gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/swf/SetBackgroundColorTa...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/swf/SetBackgroundColorTa...
Date: Wed, 30 Apr 2008 13:34:30 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/04/30 13:34:30

Modified files:
        .              : ChangeLog 
        server/swf     : SetBackgroundColorTag.h 
        testsuite/misc-swfmill.all: Makefile.am 
Added files:
        testsuite/misc-swfmill.all: background.xml 
                                    backgroundTestRunner.cpp 

Log message:
        * server/swf/SetBackgroundColorTag.h: update to match
          change in ::execute signature
        * testsuite/misc-swfmill.all/: Makefile.am, background.xml,
          backgroundTestRunner.cpp: add test for multiple SetBackgroundColor
          tags in an SWF. Expected behaviour is we only use the first one,
          gnash fails.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6462&r2=1.6463
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/SetBackgroundColorTag.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-swfmill.all/Makefile.am?cvsroot=gnash&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-swfmill.all/background.xml?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-swfmill.all/backgroundTestRunner.cpp?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6462
retrieving revision 1.6463
diff -u -b -r1.6462 -r1.6463
--- ChangeLog   30 Apr 2008 12:21:32 -0000      1.6462
+++ ChangeLog   30 Apr 2008 13:34:29 -0000      1.6463
@@ -1,5 +1,14 @@
 2008-04-30 Sandro Santilli <address@hidden>
 
+       * server/swf/SetBackgroundColorTag.h: update to match 
+         change in ::execute signature
+       * testsuite/misc-swfmill.all/: Makefile.am, background.xml,
+         backgroundTestRunner.cpp: add test for multiple SetBackgroundColor
+         tags in an SWF. Expected behaviour is we only use the first one,
+         gnash fails.
+
+2008-04-30 Sandro Santilli <address@hidden>
+
        * server/Makefile.am, server/impl.cpp,
          server/parser/sound_definition.{cpp,h},
          server/swf/StreamSoundBlockTag.{cpp,h},

Index: server/swf/SetBackgroundColorTag.h
===================================================================
RCS file: /sources/gnash/gnash/server/swf/SetBackgroundColorTag.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/swf/SetBackgroundColorTag.h  21 Jan 2008 20:56:02 -0000      1.2
+++ server/swf/SetBackgroundColorTag.h  30 Apr 2008 13:34:29 -0000      1.3
@@ -24,7 +24,6 @@
 
 #include "ControlTag.h" // for inheritance
 #include "swf.h" // for tag_type definition
-#include "action_buffer.h" // for composition
 #include "sprite_instance.h" // for inlines (execute)
 #include "movie_definition.h" // for inlines (loader)
 #include "log.h" // for log_parse
@@ -83,7 +82,7 @@
                read(in);
        }
 
-       void execute(sprite_instance* m) const
+       void execute(sprite_instance* m, DisplayList& /*dlist*/) const
        {
                float   current_alpha = m->get_background_alpha();
                rgba newcolor = m_color; // to avoid making m_color mutable
@@ -91,9 +90,9 @@
                m->set_background_color(newcolor);
        }
 
-       void execute_state(sprite_instance* m) const
+       void execute_state(sprite_instance* m, DisplayList& dlist) const
        {
-               execute(m);
+               execute(m, dlist);
        }
 
        /// Set background color tag loader (SWF::SETBACKGROUNDCOLOR)

Index: testsuite/misc-swfmill.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-swfmill.all/Makefile.am,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- testsuite/misc-swfmill.all/Makefile.am      25 Apr 2008 09:00:21 -0000      
1.16
+++ testsuite/misc-swfmill.all/Makefile.am      30 Apr 2008 13:34:29 -0000      
1.17
@@ -19,6 +19,7 @@
 AUTOMAKE_OPTIONS = dejagnu -Wno-portability
 
 abs_topbuilddir=$(shell cd $(top_builddir); pwd)
+abs_builddir=$(shell cd $(top_builddir)/testsuite/misc-ming.all; pwd)
 
 ## Self-contained XML tests
 SC_XMLTESTS =                  \
@@ -29,10 +30,23 @@
        zeroframe_definesprite.xml \
        $(NULL)
 
-EXTRA_DIST = $(SC_XMLTESTS)
+EXTRA_DIST = $(SC_XMLTESTS) background.xml
 
 if ENABLE_SWFMILL
 
+AM_CPPFLAGS = -I.. \
+       -I$(top_srcdir)         \
+       -I$(top_srcdir)/libbase \
+       -I$(top_srcdir)/libmedia \
+       -I$(top_srcdir)/backend \
+       -I$(top_srcdir)/server  \
+       -I$(top_srcdir)/server/parser  \
+       -I$(top_srcdir)/server/vm \
+       -I$(top_srcdir)/server/asobj \
+       -I$(top_srcdir)/libgeometry \
+       -I$(top_srcdir)/testsuite \
+       $(NULL)
+
 SC_XMLTESTS_OUT = $(SC_XMLTESTS:.xml=.swf)
 
 # Dependencies for all self-contained SWF tests
@@ -45,6 +59,9 @@
        zeroframe_definesprite-runner   \
        $(NULL)
 
+check_PROGRAMS = \
+       backgroundTestRunner
+
 jump_after_end-runner: $(srcdir)/../generic-testrunner.sh jump_after_end.swf 
Makefile
        sh $< -r 50 -c "END OF TEST" $(top_builddir) jump_after_end.swf > $@
        chmod 755 $@
@@ -61,6 +78,21 @@
        sh $< -r 50 -c "END OF TEST" $(top_builddir) zeroframe_definesprite.swf 
> $@
        chmod 755 $@
 
+backgroundTestRunner_SOURCES = \
+       backgroundTestRunner.cpp \
+       $(NULL)
+backgroundTestRunner_CXXFLAGS = \
+       -DSRCDIR='"$(srcdir)"' \
+       -DTGTDIR='"$(abs_builddir)"' \
+       $(NULL)
+backgroundTestRunner_LDADD = \
+       $(top_builddir)/testsuite/libtestsuite.la \
+       $(NULL)
+backgroundTestRunner_DEPENDENCIES = \
+       $(top_builddir)/testsuite/libtestsuite.la \
+       background.swf      \
+       $(NULL)
+
 .xml.swf: 
        $(SWFMILL) -v simple $(@:%.swf=$(srcdir)/%.xml) $@
 
@@ -72,7 +104,7 @@
 
 
 TEST_DRIVERS = ../simple.exp
-TEST_CASES = ${check_SCRIPTS}
+TEST_CASES = ${check_SCRIPTS} ${check_PROGRAMS}
 
 check-DEJAGNU: site-update $(check_PROGRAMS)
        @runtest=$(RUNTEST); \

Index: testsuite/misc-swfmill.all/background.xml
===================================================================
RCS file: testsuite/misc-swfmill.all/background.xml
diff -N testsuite/misc-swfmill.all/background.xml
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-swfmill.all/background.xml   30 Apr 2008 13:34:30 -0000      
1.1
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+
+<swf version="6" compressed="1">
+
+<!--
+Test for background color
+-->
+
+  <Header width="12800" height="9600" framerate="2" frames="2">
+
+    <size>
+      <Rectangle left="0" right="12800" top="0" bottom="9600"/>
+    </size>
+
+    <tags>
+
+      <SetBackgroundColor>
+        <color>
+          <Color red="244" green="0" blue="0"/>
+        </color>
+      </SetBackgroundColor>
+
+      <SetBackgroundColor>
+        <color>
+          <Color red="0" green="255" blue="0"/>
+        </color>
+      </SetBackgroundColor>
+
+      <ShowFrame/>
+
+      <SetBackgroundColor>
+        <color>
+          <Color red="0" green="0" blue="255"/>
+        </color>
+      </SetBackgroundColor>
+
+      <ShowFrame/>
+
+      <End/>
+
+    </tags>
+
+  </Header>
+</swf>

Index: testsuite/misc-swfmill.all/backgroundTestRunner.cpp
===================================================================
RCS file: testsuite/misc-swfmill.all/backgroundTestRunner.cpp
diff -N testsuite/misc-swfmill.all/backgroundTestRunner.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-swfmill.all/backgroundTestRunner.cpp 30 Apr 2008 13:34:30 
-0000      1.1
@@ -0,0 +1,83 @@
+/* 
+ *   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ *
+ */ 
+
+#define INPUT_FILENAME "background.swf"
+
+#include "MovieTester.h"
+#include "GnashException.h"
+#include "sprite_instance.h"
+#include "character.h"
+#include "dlist.h"
+#include "log.h"
+
+#include "check.h"
+#include <string>
+#include <cassert>
+
+using namespace gnash;
+using namespace std;
+
+int
+main(int /*argc*/, char** /*argv*/)
+{
+       string filename = string(SRCDIR) + string("/") + string(INPUT_FILENAME);
+       auto_ptr<MovieTester> t;
+
+       gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
+       dbglogfile.setVerbosity(1);
+
+       try
+       {
+               t.reset(new MovieTester(filename));
+       }
+       catch (const GnashException& e)
+       {
+               std::cerr << "Error initializing MovieTester: " << e.what() << 
std::endl;
+               exit(EXIT_FAILURE);
+       }
+       
+       MovieTester& tester = *t;
+
+       // Colors used for pixel checking
+       rgba red(255,0,0,255);
+
+       sprite_instance* root = tester.getRootMovie();
+       assert(root);
+
+       check_equals(root->get_frame_count(), 2);
+       check_equals(root->get_current_frame(), 0);
+
+       xcheck_pixel(60, 60, 50, red, 1);
+       xcheck_pixel(60, 400, 50, red, 1);
+       xcheck_pixel(600, 400, 50, red, 1);
+       xcheck_pixel(600, 60, 50, red, 1);
+       xcheck_pixel(320, 240, 50, red, 1);
+
+       tester.advance();
+
+       check_equals(root->get_current_frame(), 1);
+
+       xcheck_pixel(60, 60, 50, red, 1);
+       xcheck_pixel(60, 400, 50, red, 1);
+       xcheck_pixel(600, 400, 50, red, 1);
+       xcheck_pixel(600, 60, 50, red, 1);
+       xcheck_pixel(320, 240, 50, red, 1);
+}
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]