[Swfdec-commits] 3 commits - swfdec/swfdec_movie_as_drawing.c test/image test/trace
Benjamin Otte
company at kemper.freedesktop.org
Mon May 12 13:01:17 PDT 2008
swfdec/swfdec_movie_as_drawing.c | 14 +-
test/image/Makefile.am | 9 +
test/image/beginFill-values-5.swf |binary
test/image/beginFill-values-5.swf.png |binary
test/image/beginFill-values-6.swf |binary
test/image/beginFill-values-6.swf.png |binary
test/image/beginFill-values-7.swf |binary
test/image/beginFill-values-7.swf.png |binary
test/image/beginFill-values-8.swf |binary
test/image/beginFill-values-8.swf.png |binary
test/image/beginFill-values.as | 85 +++++++++++++
test/trace/Makefile.am | 9 +
test/trace/beginFill-values-5.swf |binary
test/trace/beginFill-values-5.swf.trace | 170 ++++++++++++++++++++++++++
test/trace/beginFill-values-6.swf |binary
test/trace/beginFill-values-6.swf.trace | 203 ++++++++++++++++++++++++++++++++
test/trace/beginFill-values-7.swf |binary
test/trace/beginFill-values-7.swf.trace | 203 ++++++++++++++++++++++++++++++++
test/trace/beginFill-values-8.swf |binary
test/trace/beginFill-values-8.swf.trace | 203 ++++++++++++++++++++++++++++++++
test/trace/beginFill-values.as | 87 +++++++++++++
21 files changed, 977 insertions(+), 6 deletions(-)
New commits:
commit 8bacc28209019e62fce644a2af52b41d48322a5c
Author: Benjamin Otte <otte at gnome.org>
Date: Mon May 12 22:00:58 2008 +0200
add test that ensures a path is always created
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 575ef1b..122f378 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -342,6 +342,15 @@ EXTRA_DIST = \
attachmovie-object-6.swf.trace \
attachmovie-object-7.swf \
attachmovie-object-7.swf.trace \
+ beginFill-values-5.swf \
+ beginFill-values-5.swf.trace \
+ beginFill-values-6.swf \
+ beginFill-values-6.swf.trace \
+ beginFill-values-7.swf \
+ beginFill-values-7.swf.trace \
+ beginFill-values-8.swf \
+ beginFill-values-8.swf.trace \
+ beginFill-values.as \
bevel-filter-properties.as \
bevel-filter-properties-5.swf \
bevel-filter-properties-5.swf.trace \
diff --git a/test/trace/beginFill-values-5.swf b/test/trace/beginFill-values-5.swf
new file mode 100644
index 0000000..9fa914f
Binary files /dev/null and b/test/trace/beginFill-values-5.swf differ
diff --git a/test/trace/beginFill-values-5.swf.trace b/test/trace/beginFill-values-5.swf.trace
new file mode 100644
index 0000000..afc7aca
--- /dev/null
+++ b/test/trace/beginFill-values-5.swf.trace
@@ -0,0 +1,170 @@
+valueOf called
+toString called
+toString called with
+valueOf called with
+0: valueOf!
+1: valueOf!
+2: valueOf!
+3: valueOf!
+4: valueOf!
+5: valueOf!
+6: valueOf!
+7: valueOf!
+8: valueOf!
+9: valueOf!
+10: valueOf!
+11: valueOf!
+12: valueOf!
+13: valueOf!
+14: valueOf!
+15: valueOf!
+16: valueOf!
+17: valueOf!
+18: valueOf!
+19: valueOf!
+20: valueOf!
+21: valueOf!
+22: valueOf!
+22: toString!
+23: valueOf!
+23: toString!
+24: valueOf!
+24: toString!
+25: valueOf!
+26: valueOf!
+26: toString!
+27: valueOf!
+27: toString!
+28: valueOf!
+28: toString!
+29: valueOf!
+29: toString!
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+60
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
diff --git a/test/trace/beginFill-values-6.swf b/test/trace/beginFill-values-6.swf
new file mode 100644
index 0000000..fac9243
Binary files /dev/null and b/test/trace/beginFill-values-6.swf differ
diff --git a/test/trace/beginFill-values-6.swf.trace b/test/trace/beginFill-values-6.swf.trace
new file mode 100644
index 0000000..f88e764
--- /dev/null
+++ b/test/trace/beginFill-values-6.swf.trace
@@ -0,0 +1,203 @@
+valueOf called
+toString called
+toString called with
+valueOf called with
+0: valueOf!
+1: valueOf!
+2: valueOf!
+3: valueOf!
+4: valueOf!
+5: valueOf!
+6: valueOf!
+7: valueOf!
+8: valueOf!
+9: valueOf!
+10: valueOf!
+11: valueOf!
+12: valueOf!
+13: valueOf!
+14: valueOf!
+15: valueOf!
+16: valueOf!
+17: valueOf!
+18: valueOf!
+19: valueOf!
+20: valueOf!
+21: valueOf!
+22: valueOf!
+22: toString!
+23: valueOf!
+23: toString!
+24: valueOf!
+24: toString!
+25: valueOf!
+25: toString!
+26: valueOf!
+26: toString!
+27: valueOf!
+27: toString!
+28: valueOf!
+28: toString!
+29: valueOf!
+29: toString!
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+valueOf called
+10
+10
+10
+10
+valueOf called with
+10
+10
+10
+10
+0: valueOf!
+10
+10
+1: valueOf!
+10
+10
+2: valueOf!
+10
+10
+3: valueOf!
+10
+10
+4: valueOf!
+10
+10
+5: valueOf!
+10
+10
+6: valueOf!
+10
+10
+7: valueOf!
+10
+10
+8: valueOf!
+10
+10
+9: valueOf!
+10
+10
+10: valueOf!
+10
+10
+11: valueOf!
+10
+10
+12: valueOf!
+10
+10
+13: valueOf!
+10
+10
+14: valueOf!
+10
+10
+15: valueOf!
+10
+10
+16: valueOf!
+10
+10
+17: valueOf!
+10
+10
+18: valueOf!
+10
+10
+19: valueOf!
+10
+10
+20: valueOf!
+10
+10
+21: valueOf!
+10
+10
+22: valueOf!
+10
+10
+23: valueOf!
+10
+10
+24: valueOf!
+10
+10
+25: valueOf!
+10
+10
+26: valueOf!
+10
+10
+27: valueOf!
+10
+10
+28: valueOf!
+10
+10
+29: valueOf!
+10
+10
+60
+10
+10
+10
+10
+10
+10
+10
+10
diff --git a/test/trace/beginFill-values-7.swf b/test/trace/beginFill-values-7.swf
new file mode 100644
index 0000000..896eb12
Binary files /dev/null and b/test/trace/beginFill-values-7.swf differ
diff --git a/test/trace/beginFill-values-7.swf.trace b/test/trace/beginFill-values-7.swf.trace
new file mode 100644
index 0000000..f88e764
--- /dev/null
+++ b/test/trace/beginFill-values-7.swf.trace
@@ -0,0 +1,203 @@
+valueOf called
+toString called
+toString called with
+valueOf called with
+0: valueOf!
+1: valueOf!
+2: valueOf!
+3: valueOf!
+4: valueOf!
+5: valueOf!
+6: valueOf!
+7: valueOf!
+8: valueOf!
+9: valueOf!
+10: valueOf!
+11: valueOf!
+12: valueOf!
+13: valueOf!
+14: valueOf!
+15: valueOf!
+16: valueOf!
+17: valueOf!
+18: valueOf!
+19: valueOf!
+20: valueOf!
+21: valueOf!
+22: valueOf!
+22: toString!
+23: valueOf!
+23: toString!
+24: valueOf!
+24: toString!
+25: valueOf!
+25: toString!
+26: valueOf!
+26: toString!
+27: valueOf!
+27: toString!
+28: valueOf!
+28: toString!
+29: valueOf!
+29: toString!
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+valueOf called
+10
+10
+10
+10
+valueOf called with
+10
+10
+10
+10
+0: valueOf!
+10
+10
+1: valueOf!
+10
+10
+2: valueOf!
+10
+10
+3: valueOf!
+10
+10
+4: valueOf!
+10
+10
+5: valueOf!
+10
+10
+6: valueOf!
+10
+10
+7: valueOf!
+10
+10
+8: valueOf!
+10
+10
+9: valueOf!
+10
+10
+10: valueOf!
+10
+10
+11: valueOf!
+10
+10
+12: valueOf!
+10
+10
+13: valueOf!
+10
+10
+14: valueOf!
+10
+10
+15: valueOf!
+10
+10
+16: valueOf!
+10
+10
+17: valueOf!
+10
+10
+18: valueOf!
+10
+10
+19: valueOf!
+10
+10
+20: valueOf!
+10
+10
+21: valueOf!
+10
+10
+22: valueOf!
+10
+10
+23: valueOf!
+10
+10
+24: valueOf!
+10
+10
+25: valueOf!
+10
+10
+26: valueOf!
+10
+10
+27: valueOf!
+10
+10
+28: valueOf!
+10
+10
+29: valueOf!
+10
+10
+60
+10
+10
+10
+10
+10
+10
+10
+10
diff --git a/test/trace/beginFill-values-8.swf b/test/trace/beginFill-values-8.swf
new file mode 100644
index 0000000..6239272
Binary files /dev/null and b/test/trace/beginFill-values-8.swf differ
diff --git a/test/trace/beginFill-values-8.swf.trace b/test/trace/beginFill-values-8.swf.trace
new file mode 100644
index 0000000..f88e764
--- /dev/null
+++ b/test/trace/beginFill-values-8.swf.trace
@@ -0,0 +1,203 @@
+valueOf called
+toString called
+toString called with
+valueOf called with
+0: valueOf!
+1: valueOf!
+2: valueOf!
+3: valueOf!
+4: valueOf!
+5: valueOf!
+6: valueOf!
+7: valueOf!
+8: valueOf!
+9: valueOf!
+10: valueOf!
+11: valueOf!
+12: valueOf!
+13: valueOf!
+14: valueOf!
+15: valueOf!
+16: valueOf!
+17: valueOf!
+18: valueOf!
+19: valueOf!
+20: valueOf!
+21: valueOf!
+22: valueOf!
+22: toString!
+23: valueOf!
+23: toString!
+24: valueOf!
+24: toString!
+25: valueOf!
+25: toString!
+26: valueOf!
+26: toString!
+27: valueOf!
+27: toString!
+28: valueOf!
+28: toString!
+29: valueOf!
+29: toString!
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+valueOf called
+10
+10
+10
+10
+valueOf called with
+10
+10
+10
+10
+0: valueOf!
+10
+10
+1: valueOf!
+10
+10
+2: valueOf!
+10
+10
+3: valueOf!
+10
+10
+4: valueOf!
+10
+10
+5: valueOf!
+10
+10
+6: valueOf!
+10
+10
+7: valueOf!
+10
+10
+8: valueOf!
+10
+10
+9: valueOf!
+10
+10
+10: valueOf!
+10
+10
+11: valueOf!
+10
+10
+12: valueOf!
+10
+10
+13: valueOf!
+10
+10
+14: valueOf!
+10
+10
+15: valueOf!
+10
+10
+16: valueOf!
+10
+10
+17: valueOf!
+10
+10
+18: valueOf!
+10
+10
+19: valueOf!
+10
+10
+20: valueOf!
+10
+10
+21: valueOf!
+10
+10
+22: valueOf!
+10
+10
+23: valueOf!
+10
+10
+24: valueOf!
+10
+10
+25: valueOf!
+10
+10
+26: valueOf!
+10
+10
+27: valueOf!
+10
+10
+28: valueOf!
+10
+10
+29: valueOf!
+10
+10
+60
+10
+10
+10
+10
+10
+10
+10
+10
diff --git a/test/trace/beginFill-values.as b/test/trace/beginFill-values.as
new file mode 100644
index 0000000..327ff01
--- /dev/null
+++ b/test/trace/beginFill-values.as
@@ -0,0 +1,87 @@
+// makeswf -v 7 -s 200x150 -r 1 -o movie23.swf movie23.as
+
+#include "values.as"
+
+rectangle = function (mc, color, x, y, w, h)
+{
+ mc.beginFill (color);
+ mc.moveTo (x, y);
+ mc.lineTo (x + w, y);
+ mc.lineTo (x + w, y + h);
+ mc.lineTo (x, y + h);
+ mc.lineTo (x, y);
+ mc.endFill ();
+};
+
+rectangle (this, 0xFFFF00, 0, 0, 200, 150);
+createEmptyMovieClip ("a", 0);
+
+for (i = 0; i < values.length; i++) {
+ var x = createEmptyMovieClip ("a" + i, i);
+ rectangle (x, values[i], (i % 10) * 20, int (i / 10) * 20, 10, 10);
+ trace (x._width);
+ trace (x._height);
+};
+
+trace (i);
+mc = createEmptyMovieClip ("a" + i, i);
+x = (i % 10) * 20;
+y = int (i / 10) * 20;
+w = h = 10;
+mc.beginFill ();
+mc.moveTo (x, y);
+mc.lineTo (x + w, y);
+mc.lineTo (x + w, y + h);
+mc.lineTo (x, y + h);
+mc.lineTo (x, y);
+mc.endFill ();
+trace (mc._width);
+trace (mc._height);
+i++;
+
+mc = createEmptyMovieClip ("a" + i, i);
+x = (i % 10) * 20;
+y = int (i / 10) * 20;
+w = h = 10;
+mc.beginFill (undefined, 128);
+mc.moveTo (x, y);
+mc.lineTo (x + w, y);
+mc.lineTo (x + w, y + h);
+mc.lineTo (x, y + h);
+mc.lineTo (x, y);
+mc.endFill ();
+trace (mc._width);
+trace (mc._height);
+i++;
+
+mc = createEmptyMovieClip ("a" + i, i);
+x = (i % 10) * 20;
+y = int (i / 10) * 20;
+w = h = 10;
+mc.beginFill (0xFF);
+mc.moveTo (x, y);
+mc.lineTo (x + w, y);
+mc.lineTo (x + w, y + h);
+mc.lineTo (x, y + h);
+mc.lineTo (x, y);
+mc.endFill ();
+trace (mc._width);
+trace (mc._height);
+i++;
+
+mc = createEmptyMovieClip ("a" + i, i);
+x = (i % 10) * 20;
+y = int (i / 10) * 20;
+w = h = 10;
+mc.beginFill (0xFF, undefined);
+mc.moveTo (x, y);
+mc.lineTo (x + w, y);
+mc.lineTo (x + w, y + h);
+mc.lineTo (x, y + h);
+mc.lineTo (x, y);
+mc.endFill ();
+trace (mc._width);
+trace (mc._height);
+i++;
+
+getURL ("fscommand:quit", "");
commit d8cb11306d97910ab52576aa2d330976fd70e8d1
Author: Benjamin Otte <otte at gnome.org>
Date: Mon May 12 21:57:24 2008 +0200
add render test for recent fix
diff --git a/test/image/Makefile.am b/test/image/Makefile.am
index 5667a68..7d3901e 100644
--- a/test/image/Makefile.am
+++ b/test/image/Makefile.am
@@ -30,6 +30,15 @@ EXTRA_DIST = \
background-set-and-load-8.swf \
background-set-and-load-8.swf.png \
background-set-and-load.xml \
+ beginFill-values-5.swf \
+ beginFill-values-5.swf.png \
+ beginFill-values-6.swf \
+ beginFill-values-6.swf.png \
+ beginFill-values-7.swf \
+ beginFill-values-7.swf.png \
+ beginFill-values-8.swf \
+ beginFill-values-8.swf.png \
+ beginFill-values.as \
bw.jpg \
clip-change.c \
clip-change-backward-5.swf \
diff --git a/test/image/beginFill-values-5.swf b/test/image/beginFill-values-5.swf
new file mode 100644
index 0000000..cb71bda
Binary files /dev/null and b/test/image/beginFill-values-5.swf differ
diff --git a/test/image/beginFill-values-5.swf.png b/test/image/beginFill-values-5.swf.png
new file mode 100644
index 0000000..2564fc2
Binary files /dev/null and b/test/image/beginFill-values-5.swf.png differ
diff --git a/test/image/beginFill-values-6.swf b/test/image/beginFill-values-6.swf
new file mode 100644
index 0000000..6ee8853
Binary files /dev/null and b/test/image/beginFill-values-6.swf differ
diff --git a/test/image/beginFill-values-6.swf.png b/test/image/beginFill-values-6.swf.png
new file mode 100644
index 0000000..daf3869
Binary files /dev/null and b/test/image/beginFill-values-6.swf.png differ
diff --git a/test/image/beginFill-values-7.swf b/test/image/beginFill-values-7.swf
new file mode 100644
index 0000000..06e5be7
Binary files /dev/null and b/test/image/beginFill-values-7.swf differ
diff --git a/test/image/beginFill-values-7.swf.png b/test/image/beginFill-values-7.swf.png
new file mode 100644
index 0000000..daf3869
Binary files /dev/null and b/test/image/beginFill-values-7.swf.png differ
diff --git a/test/image/beginFill-values-8.swf b/test/image/beginFill-values-8.swf
new file mode 100644
index 0000000..d0f4e4e
Binary files /dev/null and b/test/image/beginFill-values-8.swf differ
diff --git a/test/image/beginFill-values-8.swf.png b/test/image/beginFill-values-8.swf.png
new file mode 100644
index 0000000..daf3869
Binary files /dev/null and b/test/image/beginFill-values-8.swf.png differ
diff --git a/test/image/beginFill-values.as b/test/image/beginFill-values.as
new file mode 100644
index 0000000..ac26bd7
--- /dev/null
+++ b/test/image/beginFill-values.as
@@ -0,0 +1,85 @@
+// makeswf -v 7 -s 200x150 -r 1 -o movie23.swf movie23.as
+
+#include "values.as"
+
+rectangle = function (mc, color, x, y, w, h)
+{
+ mc.beginFill (color);
+ mc.moveTo (x, y);
+ mc.lineTo (x + w, y);
+ mc.lineTo (x + w, y + h);
+ mc.lineTo (x, y + h);
+ mc.lineTo (x, y);
+ mc.endFill ();
+};
+
+rectangle (this, 0xFFFF00, 0, 0, 200, 150);
+createEmptyMovieClip ("a", 0);
+
+for (i = 0; i < values.length; i++) {
+ var x = createEmptyMovieClip ("a" + i, i);
+ rectangle (x, values[i], (i % 10) * 20, int (i / 10) * 20, 10, 10);
+ trace (x._width);
+ trace (x._height);
+};
+
+trace (i);
+mc = createEmptyMovieClip ("a" + i, i);
+x = (i % 10) * 20;
+y = int (i / 10) * 20;
+w = h = 10;
+mc.beginFill ();
+mc.moveTo (x, y);
+mc.lineTo (x + w, y);
+mc.lineTo (x + w, y + h);
+mc.lineTo (x, y + h);
+mc.lineTo (x, y);
+mc.endFill ();
+trace (mc._width);
+trace (mc._height);
+i++;
+
+mc = createEmptyMovieClip ("a" + i, i);
+x = (i % 10) * 20;
+y = int (i / 10) * 20;
+w = h = 10;
+mc.beginFill (undefined, 128);
+mc.moveTo (x, y);
+mc.lineTo (x + w, y);
+mc.lineTo (x + w, y + h);
+mc.lineTo (x, y + h);
+mc.lineTo (x, y);
+mc.endFill ();
+trace (mc._width);
+trace (mc._height);
+i++;
+
+mc = createEmptyMovieClip ("a" + i, i);
+x = (i % 10) * 20;
+y = int (i / 10) * 20;
+w = h = 10;
+mc.beginFill (0xFF);
+mc.moveTo (x, y);
+mc.lineTo (x + w, y);
+mc.lineTo (x + w, y + h);
+mc.lineTo (x, y + h);
+mc.lineTo (x, y);
+mc.endFill ();
+trace (mc._width);
+trace (mc._height);
+i++;
+
+mc = createEmptyMovieClip ("a" + i, i);
+x = (i % 10) * 20;
+y = int (i / 10) * 20;
+w = h = 10;
+mc.beginFill (0xFF, undefined);
+mc.moveTo (x, y);
+mc.lineTo (x + w, y);
+mc.lineTo (x + w, y + h);
+mc.lineTo (x, y + h);
+mc.lineTo (x, y);
+mc.endFill ();
+trace (mc._width);
+trace (mc._height);
+i++;
commit 1ca905a9e4db850d92a0ed78dc5de33d4456baa6
Author: Benjamin Otte <otte at gnome.org>
Date: Mon May 12 21:56:08 2008 +0200
beginFill uses alpha=0 when the color is undefined
also, it always starts a fill
diff --git a/swfdec/swfdec_movie_as_drawing.c b/swfdec/swfdec_movie_as_drawing.c
index 4312e63..24d0953 100644
--- a/swfdec/swfdec_movie_as_drawing.c
+++ b/swfdec/swfdec_movie_as_drawing.c
@@ -86,13 +86,15 @@ swfdec_sprite_movie_beginFill (SwfdecAsContext *cx, SwfdecAsObject *object,
SWFDEC_AS_CHECK (SWFDEC_TYPE_MOVIE, &movie, "|ii", &color, &alpha);
movie->draw_fill = NULL;
- if (argc == 0)
- return;
- color = color & 0xFFFFFF;
- if (argc <= 1) {
- alpha = 255;
+ if (argc == 0 || SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[0])) {
+ color = 0;
+ } else {
+ color = color & 0xFFFFFF;
+ if (argc <= 1) {
+ alpha = 255;
+ }
+ color = SWFDEC_COLOR_FROM_COLOR_ALPHA (color, alpha);
}
- color = SWFDEC_COLOR_FROM_COLOR_ALPHA (color, alpha);
draw = SWFDEC_DRAW (swfdec_pattern_new_color (color));
swfdec_path_move_to (&draw->path, movie->draw_x, movie->draw_y);
swfdec_sprite_movie_end_fill (movie, draw);
More information about the Swfdec-commits
mailing list