[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Drawing...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Drawing... |
Date: |
Tue, 30 Oct 2007 13:37:09 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/10/30 13:37:09
Modified files:
. : ChangeLog
testsuite/misc-ming.all: DrawingApiTestRunner.cpp
Log message:
* testsuite/misc-ming.all/DrawingApiTestRunner.cpp:
Check hitdetector bounds and reactions on mouse movement
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4742&r2=1.4743
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/DrawingApiTestRunner.cpp?cvsroot=gnash&r1=1.23&r2=1.24
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4742
retrieving revision 1.4743
diff -u -b -r1.4742 -r1.4743
--- ChangeLog 30 Oct 2007 11:03:46 -0000 1.4742
+++ ChangeLog 30 Oct 2007 13:37:09 -0000 1.4743
@@ -1,5 +1,7 @@
2007-10-30 Sandro Santilli <address@hidden>
+ * testsuite/misc-ming.all/DrawingApiTestRunner.cpp:
+ Check hitdetector bounds and reactions on mouse movement
* gui/gui.{cpp,h}: Add support for mouse pointer movements using the
keyboard arrow keys. Support is currently enabled but can be
switched off at compile time. If compile-time enabled support can
Index: testsuite/misc-ming.all/DrawingApiTestRunner.cpp
===================================================================
RCS file:
/sources/gnash/gnash/testsuite/misc-ming.all/DrawingApiTestRunner.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- testsuite/misc-ming.all/DrawingApiTestRunner.cpp 22 Aug 2007 15:47:48
-0000 1.23
+++ testsuite/misc-ming.all/DrawingApiTestRunner.cpp 30 Oct 2007 13:37:09
-0000 1.24
@@ -353,7 +353,96 @@
check_pixel(351, 280, 10, white, 2);
check_pixel(400, 280, 3, yellow, 2);
- // TODO: check hitdetector bounds and reactions on mouse
- // movement !
+ //--------------------------------------------------------------
+ // Check hitdetector bounds and reactions on mouse movement
+ //--------------------------------------------------------------
+
+ typedef struct IntPoint { int x; int y; IntPoint(int nx, int ny) :
x(nx), y(ny) {} };
+
+ IntPoint c1s(6, 346); // top-right of first yellow circle (in when
small)
+ IntPoint c1b(16, 329); // top-right of first yellow circle (in when
big, out when small)
+ IntPoint c2s(66, 340); // top-right of second yellow circle (in when
small)
+ IntPoint c2b(75, 332); // top-right of second yellow circle (in when
big, out when small)
+ IntPoint c3s(129, 340); // top-right of third yellow circle (in when
small)
+ IntPoint c3b(133, 330); // top-right of third yellow circle (in when
big, out when small)
+
+ // Disjoint cursor's and drawing's bounding boxes
+ tester.movePointerTo(50, 50);
+ tester.advance(); // hitTest runs onEnterFrame
+
+ check_pixel(c1s.x, c1s.y, 1, yellow, 2);
+ check_pixel(c1b.x, c1b.y, 1, white, 2);
+
+ check_pixel(c2s.x, c2s.y, 1, yellow, 2);
+ check_pixel(c2b.x, c2b.y, 1, white, 2);
+
+ check_pixel(c3s.x, c3s.y, 1, yellow, 2);
+ check_pixel(c3b.x, c3b.y, 1, white, 2);
+
+ // Cursor's and drawing's bounding box intersection
+ //
+ // NOTE: shapes don't intersect, the cursor is a circle,
+ // and only the top-left corner of it's bounding box
+ // intersects the drawing's bounding box
+ // NOTE: one pixel down or one pixel right and they would not intersect
anymore
+ //
+ tester.movePointerTo(424, 304);
+ tester.advance(); // hitTest runs onEnterFrame
+
+ check_pixel(c1s.x, c1s.y, 1, yellow, 2);
+ check(tester.getInvalidatedRanges().contains(c1b.x, c1b.y));
+ check_pixel(c1b.x, c1b.y, 1, yellow, 2);
+
+ check(!tester.getInvalidatedRanges().contains(c2s.x, c2s.y)); //
failure won't impact correctness, only performance
+ check(!tester.getInvalidatedRanges().contains(c2b.x, c2b.y)); //
failure won't impact correctness, only performance
+ check_pixel(c2s.x, c2s.y, 1, yellow, 2);
+ check_pixel(c2b.x, c2b.y, 1, white, 2);
+
+ check(!tester.getInvalidatedRanges().contains(c3s.x, c3s.y)); //
failure won't impact correctness, only performance
+ check(!tester.getInvalidatedRanges().contains(c3b.x, c3b.y)); //
failure won't impact correctness, only performance
+ check_pixel(c3s.x, c3s.y, 1, yellow, 2);
+ check_pixel(c3b.x, c3b.y, 1, white, 2);
+
+ // Pointer inside drawing's bounding box
+ // (pointer itself, not the cursor)
+ tester.movePointerTo(221, 84);
+ tester.advance(); // hitTest runs onEnterFrame
+
+ check(!tester.getInvalidatedRanges().contains(c1s.x, c1s.y)); //
failure won't impact correctness, only performance
+ check(!tester.getInvalidatedRanges().contains(c1b.x, c1b.y)); //
failure won't impact correctness, only performance
+ check_pixel(c1s.x, c1s.y, 1, yellow, 2);
+ check_pixel(c1b.x, c1b.y, 1, yellow, 2);
+
+ check_pixel(c2s.x, c2s.y, 1, yellow, 2);
+ check(tester.getInvalidatedRanges().contains(c2b.x, c2b.y));
+ check_pixel(c2b.x, c2b.y, 1, yellow, 2);
+
+ check(!tester.getInvalidatedRanges().contains(c3s.x, c3s.y)); //
failure won't impact correctness, only performance
+ check(!tester.getInvalidatedRanges().contains(c3b.x, c3b.y)); //
failure won't impact correctness, only performance
+ check_pixel(c3s.x, c3s.y, 1, yellow, 2);
+ check_pixel(c3b.x, c3b.y, 1, white, 2);
+
+ // Pointer inside drawing's shape
+ tester.movePointerTo(167, 170); // the thik red line
+ tester.advance(); // hitTest runs onEnterFrame
+
+ check(!tester.getInvalidatedRanges().contains(c1s.x, c1s.y)); //
failure won't impact correctness, only performance
+ check(!tester.getInvalidatedRanges().contains(c1b.x, c1b.y)); //
failure won't impact correctness, only performance
+ check_pixel(c1s.x, c1s.y, 1, yellow, 2);
+ check_pixel(c1b.x, c1b.y, 1, yellow, 2);
+
+ check(!tester.getInvalidatedRanges().contains(c2s.x, c2s.y)); //
failure won't impact correctness, only performance
+ check(!tester.getInvalidatedRanges().contains(c2b.x, c2b.y)); //
failure won't impact correctness, only performance
+ check_pixel(c2s.x, c2s.y, 1, yellow, 2);
+ check_pixel(c2b.x, c2b.y, 1, yellow, 2);
+
+ check_pixel(c3s.x, c3s.y, 1, yellow, 2);
+ check(tester.getInvalidatedRanges().contains(c3b.x, c3b.y));
+ check_pixel(c3b.x, c3b.y, 1, yellow, 2);
+
+ //--------------------------------------------------------------
+ // TODO: Check setMask effect (triggered onMouseDown)
+ //--------------------------------------------------------------
+
}
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Drawing...,
Sandro Santilli <=