[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11220: More drawing API tests.
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11220: More drawing API tests. |
Date: |
Wed, 08 Jul 2009 09:01:19 +0200 |
User-agent: |
Bazaar (1.13.1) |
------------------------------------------------------------
revno: 11220
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2009-07-08 09:01:19 +0200
message:
More drawing API tests.
modified:
testsuite/misc-ming.all/DrawingApiTest.as
testsuite/misc-ming.all/DrawingApiTestRunner.cpp
------------------------------------------------------------
revno: 11208.1.3
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Wed 2009-07-08 08:41:41 +0200
message:
Add more tests to DrawingApiTest.as
modified:
testsuite/misc-ming.all/DrawingApiTest.as
------------------------------------------------------------
revno: 11208.1.4
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Wed 2009-07-08 08:54:17 +0200
message:
xcheck.
modified:
testsuite/misc-ming.all/DrawingApiTest.as
------------------------------------------------------------
revno: 11208.1.5
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Wed 2009-07-08 08:57:51 +0200
message:
Add pixel checking.
modified:
testsuite/misc-ming.all/DrawingApiTestRunner.cpp
=== modified file 'testsuite/misc-ming.all/DrawingApiTest.as'
--- a/testsuite/misc-ming.all/DrawingApiTest.as 2009-07-07 20:40:59 +0000
+++ b/testsuite/misc-ming.all/DrawingApiTest.as 2009-07-08 07:01:19 +0000
@@ -631,6 +631,96 @@
endFill();
+ // =======================
+ // Shape 3
+ // =======================
+
+ x += 200;
+
+ createEmptyMovieClip("d", 500);
+ with (d)
+ {
+ lineStyle(10, 10, 100);
+ moveTo(x, y);
+ lineTo(x, y + yr);
+ lineTo(x + xr, y + yr);
+ endFill(); // does NOT force closeup
+ }
+
+ // =======================
+ // Shape 4
+ // =======================
+
+ x = 20;
+ y += 150;
+
+ createEmptyMovieClip("e", 501);
+ with (e)
+ {
+ lineStyle(10, 10, 100);
+ beginFill(); // does NOT start a fill
+ moveTo(x, y);
+ lineTo(x, y + yr);
+ lineTo(x + xr, y + yr);
+ endFill(); // does NOT force closeup
+ }
+
+ // The shape is not closed to form a triangle,
+ // so the only way to hit it is to hit the line.
+ xcheck(!e.hitTest(x + 30, y + 30, true));
+
+ // Top right 'corner'
+ check(e.hitTest(x, y, true));
+
+ // =======================
+ // Shape 5
+ // =======================
+
+ x += 200;
+
+ createEmptyMovieClip("f", 502);
+ with (f)
+ {
+ lineStyle(10, 10, 100);
+ beginFill(0); // does start a fill
+ moveTo(x, y);
+ lineTo(x, y + yr);
+ lineTo(x + xr, y + yr);
+ endFill(); // DOES force closeup
+ }
+
+ // Somewhere within the closed triangle.
+ check(f.hitTest(x + 30, y + 30, true));
+
+ // =======================
+ // Shape 6
+ // =======================
+
+ x += 200;
+
+ createEmptyMovieClip("g", 503);
+ with (g)
+ {
+ lineStyle(10, 0xFFFF00, 100);
+ beginFill(0x00ff00); // does start a fill
+ moveTo(x, y);
+ lineTo(x, y + yr);
+ lineTo(x + xr, y + yr);
+ beginFill(0x0000ff); // closes previous fill, opens a new one
+ lineTo(x + xr, y);
+ lineTo(x + xr, y + yr);
+ endFill(); // DOES force closeup
+ }
+
+ // Bottom left
+ check(g.hitTest(x + 20, y + 80, true));
+
+ // Top right
+ // This is not a hit with 9,0,115,0, even though it is
+ // clearly within a fill. It's a bug, so we should
+ // probably not worry about behaviour in this case.
+ check(!g.hitTest(x + 80, y + 20, true));
+
_visible = false;
}
line.onRollOver = function() {};
=== modified file 'testsuite/misc-ming.all/DrawingApiTestRunner.cpp'
--- a/testsuite/misc-ming.all/DrawingApiTestRunner.cpp 2009-07-07 11:10:51
+0000
+++ b/testsuite/misc-ming.all/DrawingApiTestRunner.cpp 2009-07-08 06:57:51
+0000
@@ -761,35 +761,112 @@
// Test picture 3
tester.pressKey(gnash::key::_3); tester.advance();
+ const int w = 100, h = 100;
+
+ int x = 20, y = 20;
+
// Shape 1
// Bottom left corner (green line).
- check_pixel(20, 120, 2, green, 2);
+ check_pixel(x, y + h, 2, green, 2);
// Bottom left fill (red)
- check_pixel(40, 80, 2, red, 2);
+ check_pixel(x + 20, y + 60, 2, red, 2);
// Top right fill (red)
- check_pixel(100, 40, 2, red, 2);
+ check_pixel(x + 80, y + 20, 2, red, 2);
// Dead centre fill (red)
- xcheck_pixel(70, 70, 2, red, 2);
+ xcheck_pixel(x + w / 2, y + h / 2, 2, red, 2);
// Top right corner (blue line)
- check_pixel(120, 20, 2, blue, 2);
+ check_pixel(x + w, y, 2, blue, 2);
// Shape 2
+ x += 200;
+
// Bottom left corner (green line).
- check_pixel(220, 120, 2, green, 2);
+ check_pixel(x, y + h, 2, green, 2);
// Bottom left fill (red)
- check_pixel(240, 80, 2, red, 2);
+ check_pixel(x + 20, y + 60, 2, red, 2);
// Top right fill (red)
- xcheck_pixel(300, 40, 2, red, 2);
+ xcheck_pixel(x + 80, y + 20, 2, red, 2);
// Dead centre fill (red)
- xcheck_pixel(270, 70, 2, red, 2);
+ xcheck_pixel(x + w / 2, y + h / 2, 2, red, 2);
// Top right corner (blue line, is correct to be over black line ending)
- check_pixel(320, 20, 2, blue, 2);
+ check_pixel(x + w, y, 2, blue, 2);
// Top centre (black line)
- check_pixel(270, 20, 2, black, 2);
-
- //----------------------------------------------------------
+ check_pixel(x + w / 2, y, 2, black, 2);
+
+ // Shape 3
+
+ x += 200;
+
+ // Bottom left corner (black line).
+ check_pixel(x, y + h, 2, black, 2);
+ // Bottom left fill (none)
+ check_pixel(x + 20, y + 60, 2, white, 2);
+ // Top right fill (none)
+ check_pixel(x + 80, y + 20, 2, white, 2);
+ // Dead centre fill (none)
+ xcheck_pixel(x + w / 2, y + h / 2, 2, white, 2);
+ // Top right corner (nothing)
+ check_pixel(x + w, y, 2, white, 2);
+
+ // Shape 4
+
+ x = 20;
+ y += 150;
+
+ // Should look the same as Shape 3
+
+ // Bottom left corner (black line).
+ check_pixel(x, y + h, 2, black, 2);
+ // Bottom left fill (none)
+ xcheck_pixel(x + 20, y + 60, 2, white, 2);
+ // Top right fill (none)
+ check_pixel(x + 80, y + 20, 2, white, 2);
+ // Dead centre fill (none)
+ xcheck_pixel(x + w / 2, y + h / 2, 2, white, 2);
+ // Top right corner (nothing)
+ check_pixel(x + w, y, 2, white, 2);
+
+ // Shape 5
+
+ x += 200;
+
+ // Bottom left corner (black line).
+ check_pixel(x, y + h, 2, black, 2);
+ // Bottom left fill (black)
+ check_pixel(x + 20, y + 60, 2, black, 2);
+ // Top right fill (none)
+ check_pixel(x + 80, y + 20, 2, white, 2);
+ // Dead centre (black line)
+ check_pixel(x + w / 2, y + h / 2, 2, black, 2);
+ // Top right corner (nothing)
+ check_pixel(x + w, y, 2, white, 2);
+
+ // Shape 6
+
+ x += 200;
+
+ // NB: the rendering of this shape is not consistent
+ // across different versions of the pp. It doesn't seem
+ // like a sane case, so there is probably no need
+ // to worry about compatibility.
+
+ // Bottom left corner (yellow line).
+ check_pixel(x, y + h, 2, yellow, 2);
+ // Bottom left fill (green)
+ check_pixel(x + 20, y + 60, 2, green, 2);
+
+ // The following tests are possibly meaningless:
+
+ // Top right fill (blue)
+ xcheck_pixel(x + 80, y + 20, 2, blue, 2);
+ // Dead centre (yellow line)
+ check_pixel(x + w / 2, y + h / 2, 2, yellow, 2);
+ // Top right corner (yellow line)
+ check_pixel(x + w, y, 2, yellow, 2);
+
+ //----------------------------------------------------------
// TODO: check startDrag/stopDrag on the hit detector
// (hit 'd' key to toggle)
//----------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11220: More drawing API tests.,
Benjamin Wolsey <=