gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r10719: Initial work on a test for b


From: Sandro Santilli
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10719: Initial work on a test for bitmap smoothing (unfinished)
Date: Wed, 18 Mar 2009 18:47:08 +0100
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10719
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Wed 2009-03-18 18:47:08 +0100
message:
  Initial work on a test for bitmap smoothing (unfinished)
added:
  testsuite/media/vstroke.png
  testsuite/misc-ming.all/BitmapSmoothingTest.c
modified:
  testsuite/misc-ming.all/Makefile.am
=== added file 'testsuite/media/vstroke.png'
Binary files a/testsuite/media/vstroke.png      1970-01-01 00:00:00 +0000 and 
b/testsuite/media/vstroke.png     2009-03-18 17:47:08 +0000 differ
=== added file 'testsuite/misc-ming.all/BitmapSmoothingTest.c'
--- a/testsuite/misc-ming.all/BitmapSmoothingTest.c     1970-01-01 00:00:00 
+0000
+++ b/testsuite/misc-ming.all/BitmapSmoothingTest.c     2009-03-18 17:47:08 
+0000
@@ -0,0 +1,117 @@
+/***********************************************************************
+ *
+ *   Copyright (C) 2005, 2006, 2009 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
+ *
+ *
+ ***********************************************************************
+ *
+ * Test case for the Bitmap smoothing
+ * Requires: MING-0.4.3 (00040300)
+ *
+ ***********************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ming.h>
+
+int
+main(int argc, char **argv)
+{
+       SWFMovie mo;
+       SWFInput in;
+       SWFBitmap bitmap;
+       SWFFillStyle smtFill;
+       SWFFillStyle hrdFill;
+       SWFShape shpSmt;
+       SWFShape shpHrd;
+       SWFMovieClip mc;
+       SWFDisplayItem it;
+       int swfversion;
+       char outputFilename[256];
+
+       if ( argc < 2 ) {
+               fprintf(stderr, "Usage: %s <swf_version>\n", argv[0]);
+               exit(EXIT_FAILURE);
+       }
+
+       swfversion = atoi(argv[1]);
+       sprintf(outputFilename, "BitmapSmoothingTest-v%d.swf", swfversion);
+
+       /*********************************************
+        *
+        * Initialization
+        *
+        *********************************************/
+
+
+       puts("Setting things up");
+
+       Ming_init();
+        Ming_useSWFVersion (swfversion);
+ 
+       mo = newSWFMovieWithVersion(swfversion);
+
+       /****************************************************
+       * Create filled shapes mc
+       ****************************************************/
+       in = newSWFInput_filename(MEDIADIR"/vstroke.png");
+       if ( ! in ) {
+               return EXIT_FAILURE;
+       }
+
+       bitmap = newSWFBitmap_fromInput(in);
+       if ( ! bitmap ) {
+               return EXIT_FAILURE;
+       }
+
+       shpSmt = newSWFShapeFromBitmap(bitmap,
+               SWFFILL_CLIPPED_BITMAP);
+
+       shpHrd = newSWFShapeFromBitmap(bitmap,
+               SWFFILL_NONSMOOTHED_CLIPPED_BITMAP);
+
+       mc = newSWFMovieClip();
+       SWFMovieClip_add(mc, (SWFBlock)shpSmt);
+       it = SWFMovieClip_add(mc, (SWFBlock)shpHrd);
+       SWFDisplayItem_moveTo(it, 0, 5);
+       SWFMovieClip_nextFrame(mc); 
+
+       /****************************************************
+       * Create filled shapes mc, and scale it
+       ****************************************************/
+
+       it = SWFMovie_add(mo, (SWFBlock)mc);
+       SWFDisplayItem_scaleTo(it, 24, 10);
+
+       /****************************************************
+       * TODO: Add actions
+       ****************************************************/
+
+       /****************************************************
+       * Save things up
+       ****************************************************/
+
+       printf("Saving %s\n", outputFilename);
+
+       SWFMovie_nextFrame(mo); /* showFrame */
+
+       SWFMovie_save(mo, outputFilename);
+
+       return EXIT_SUCCESS;
+}
+

=== modified file 'testsuite/misc-ming.all/Makefile.am'
--- a/testsuite/misc-ming.all/Makefile.am       2009-03-05 15:47:09 +0000
+++ b/testsuite/misc-ming.all/Makefile.am       2009-03-18 17:47:08 +0000
@@ -184,6 +184,7 @@
        new_child_in_unload_test \
        instanceNameTest \
        BitmapDataTest \
+       BitmapSmoothingTest \
        $(NULL)
 
 if MING_VERSION_0_4_3
@@ -1500,6 +1501,22 @@
        EmbeddedSoundTest.swf   \
        $(NULL)
 
+BitmapSmoothingTest_SOURCES = \
+       BitmapSmoothingTest.c \
+       $(NULL)
+
+BitmapSmoothingTest_CFLAGS = \
+       -DMEDIADIR='"$(abs_mediadir)"' \
+       $(NULL)
+
+BitmapSmoothingTest_LDADD = libgnashmingutils.la
+
+BitmapSmoothingTest-v7.swf: BitmapSmoothingTest
+       ./BitmapSmoothingTest 7
+
+BitmapSmoothingTest-v8.swf: BitmapSmoothingTest
+       ./BitmapSmoothingTest 8
+
 registerClassTest_SOURCES =    \
        registerClassTest.c     \
        $(NULL)


reply via email to

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