[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/sprite_instance.cpp test...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/sprite_instance.cpp test... |
Date: |
Wed, 23 Jan 2008 09:35:22 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/01/23 09:35:21
Modified files:
. : ChangeLog
server : sprite_instance.cpp
testsuite/misc-ming.all: masks_test2.c masks_test2runner.cpp
Log message:
* server/sprite_instance.cpp (pointInVisibleShape): static masks
don't depend on having mouse handlers in checking hitTest.
* testsuite/misc-ming.all/masks_test2.c: add some self-contained
tests, make a statically-masked instance mouse-sensitive.
* testsuite/misc-ming.all/masks_test2runner.cpp: check that
the mouse-sensitive character shouldn't grab mouse pointer
if hit out of it's static mask.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5474&r2=1.5475
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.456&r2=1.457
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/masks_test2.c?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/masks_test2runner.cpp?cvsroot=gnash&r1=1.5&r2=1.6
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5474
retrieving revision 1.5475
diff -u -b -r1.5474 -r1.5475
--- ChangeLog 23 Jan 2008 08:37:01 -0000 1.5474
+++ ChangeLog 23 Jan 2008 09:35:20 -0000 1.5475
@@ -1,5 +1,15 @@
2008-01-23 Sandro Santilli <address@hidden>
+ * server/sprite_instance.cpp (pointInVisibleShape): static masks
+ don't depend on having mouse handlers in checking hitTest.
+ * testsuite/misc-ming.all/masks_test2.c: add some self-contained
+ tests, make a statically-masked instance mouse-sensitive.
+ * testsuite/misc-ming.all/masks_test2runner.cpp: check that
+ the mouse-sensitive character shouldn't grab mouse pointer
+ if hit out of it's static mask.
+
+2008-01-23 Sandro Santilli <address@hidden>
+
* server/asobj/LoadVars.cpp: use named strings when available.
2008-01-22 Sandro Santilli <address@hidden>
Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.456
retrieving revision 1.457
diff -u -b -r1.456 -r1.457
--- server/sprite_instance.cpp 22 Jan 2008 12:53:54 -0000 1.456
+++ server/sprite_instance.cpp 23 Jan 2008 09:35:21 -0000 1.457
@@ -3354,19 +3354,16 @@
sprite_instance::pointInVisibleShape(float x, float y) const
{
if ( ! get_visible() ) return false;
- if ( isMask() )
- {
- if ( ! can_handle_mouse_event() )
+ if ( isDynamicMask() && ! can_handle_mouse_event() )
{
// see testsuite/misc-ming.all/masks_test.swf
- log_debug("%s is a mask and can't handle mouse events, no point will hit
it", getTarget().c_str());
+ log_debug("%s is a dynamic mask and can't handle mouse events, no point
will hit it", getTarget().c_str());
return false;
}
- }
- character* mask = getMask();
+ character* mask = getMask(); // dynamic one
if ( mask && mask->get_visible() && ! mask->pointInShape(x, y) )
{
- log_debug("%s is masked by %s, which doesn't hit point %g,%g",
getTarget().c_str(), mask->getTarget().c_str(), x, y);
+ log_debug("%s is dynamically masked by %s, which doesn't hit point %g,%g",
getTarget().c_str(), mask->getTarget().c_str(), x, y);
return false;
}
VisibleShapeContainerFinder finder(x, y);
Index: testsuite/misc-ming.all/masks_test2.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/masks_test2.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- testsuite/misc-ming.all/masks_test2.c 22 Aug 2007 06:01:08 -0000
1.2
+++ testsuite/misc-ming.all/masks_test2.c 23 Jan 2008 09:35:21 -0000
1.3
@@ -19,7 +19,7 @@
/*
* Zou Lunkai, address@hidden
*
- * Test for nested masks
+ * Test for nested layer (static) masks
*/
#include <stdlib.h>
@@ -51,6 +51,9 @@
SWFMovieClip mc1, mc2, mc3, mc4, mc5, mc6, mc7, dejagnuclip;
SWFDisplayItem it;
+ const char *srcdir=".";
+ if ( argc>1 ) srcdir=argv[1];
+
Ming_init();
mo = newSWFMovieWithVersion(OUTPUT_VERSION);
SWFMovie_setDimension(mo, 800, 600);
@@ -59,40 +62,69 @@
* Don't add dejagnu clip to this file.
* Or place it in a safe depth.
*/
+ dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0,
800, 600);
+ it = SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+ SWFDisplayItem_setDepth(it, 1000);
+ SWFDisplayItem_moveTo(it, 0, 220);
+
+ SWFMovie_nextFrame(mo);
- mc1 = defineMovieclip(0, 0, 30, 30);
- mc2 = defineMovieclip(0, 0, 60, 60);
- mc3 = defineMovieclip(0, 0, 90, 90);
- mc4 = defineMovieclip(0, 0, 120, 120);
- mc5 = defineMovieclip(0, 0, 150, 150);
- mc6 = defineMovieclip(0, 0, 180, 180);
- mc7 = defineMovieclip(0, 0, 210, 210);
+ mc1 = defineMovieclip(0, 0, 30, 30); // placed at depth 1, masking up to
level 4
+ mc2 = defineMovieclip(0, 0, 60, 60); // placed at depth 2, masking up to
level 5
+ mc3 = defineMovieclip(0, 0, 90, 90); // placed at depth 3
+ mc4 = defineMovieclip(0, 0, 120, 120); // placed at depth 4
+ mc5 = defineMovieclip(0, 0, 150, 150); // placed at depth 5
+ mc6 = defineMovieclip(0, 0, 180, 180); // placed at depth 6
+ mc7 = defineMovieclip(0, 0, 210, 210); // placed at depth 7
it = SWFMovie_add(mo, (SWFBlock)mc1);
SWFDisplayItem_setDepth(it, 1);
SWFDisplayItem_setMaskLevel(it, 4);
+ SWFDisplayItem_setName(it, "mc1");
it = SWFMovie_add(mo, (SWFBlock)mc2);
SWFDisplayItem_setDepth(it, 2);
SWFDisplayItem_setMaskLevel(it, 5);
+ SWFDisplayItem_setName(it, "mc2");
it = SWFMovie_add(mo, (SWFBlock)mc3);
SWFDisplayItem_setDepth(it, 3);
SWFDisplayItem_setMaskLevel(it, 6);
+ SWFDisplayItem_setName(it, "mc3");
it = SWFMovie_add(mo, (SWFBlock)mc4);
SWFDisplayItem_setDepth(it, 4);
+ SWFDisplayItem_setName(it, "mc4");
it = SWFMovie_add(mo, (SWFBlock)mc5);
SWFDisplayItem_setDepth(it, 5);
+ SWFDisplayItem_setName(it, "mc5");
it = SWFMovie_add(mo, (SWFBlock)mc6);
SWFDisplayItem_setDepth(it, 6);
+ SWFDisplayItem_setName(it, "mc6");
+
+ check(mo, "mc1.hitTest(28, 28, true)");
+ check(mo, "mc2.hitTest(58, 58, true)");
+ check(mo, "mc3.hitTest(88, 88, true)");
+ check(mo, "mc4.hitTest(118, 118, true)");
+ check(mo, "mc5.hitTest(148, 148, true)");
+ check(mo, "mc6.hitTest(178, 178, true)");
+
+ add_actions(mo,
+ "mc4.onRollOver = function() { this._alpha = 50; };"
+ "mc4.onRollOut = function() { this._alpha = 100; };"
+ );
SWFMovie_nextFrame(mo);
it = SWFMovie_add(mo, (SWFBlock)mc7);
SWFDisplayItem_setDepth(it, 7);
+ SWFDisplayItem_setName(it, "mc7");
+
+ check(mo, "mc7.hitTest(208, 208, true)");
+
+ add_actions(mo, "_root.totals(7); stop();");
SWFMovie_nextFrame(mo);
Index: testsuite/misc-ming.all/masks_test2runner.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/masks_test2runner.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- testsuite/misc-ming.all/masks_test2runner.cpp 21 Jan 2008 23:26:51
-0000 1.5
+++ testsuite/misc-ming.all/masks_test2runner.cpp 23 Jan 2008 09:35:21
-0000 1.6
@@ -49,15 +49,23 @@
sprite_instance* root = tester.getRootMovie();
assert(root);
- check_equals(root->get_frame_count(), 2);
- // FRAME 1
+ check_equals(root->get_frame_count(), 3);
+
+ // FRAME 2
+ tester.advance();
+
check_pixel(15, 15, 30, red, 2);
// visual check succeeds with AGG pixel format RGB24
// don't know why this check fails with AGG pixel format AGG_RGB555
// it works with cairo.
xcheck_pixel(40, 40, 10, white, 3);
- // FRAME 2
+ tester.movePointerTo(118, 118);
+ xcheck( ! tester.isMouseOverMouseEntity() ); // not visible in its mask
+ tester.movePointerTo(10, 10);
+ check( tester.isMouseOverMouseEntity() ); // visible in its mask
+
+ // FRAME 3
tester.advance();
check_pixel(105, 105, 210, red, 2);
check_pixel(220, 220, 10, white, 2);