gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/DynamicShape.cpp server/...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/DynamicShape.cpp server/...
Date: Wed, 07 Nov 2007 12:08:16 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/11/07 12:08:16

Modified files:
        .              : ChangeLog 
        server         : DynamicShape.cpp DynamicShape.h shape.cpp 
                         shape.h 
        testsuite/misc-ming.all: DrawingApiTestRunner.cpp 

Log message:
                * server/DynamicShape.{cpp,h}: Start new paths as new shapes
                  when beginFill is called.
                * server/shape.{cpp,h}: add interfaces for setting m_new_shape
                  both in constructors and standalone.
                * testsuite/misc-ming.all/DrawingApiTestRunner.cpp: fix the
                  two-overlapping squares case.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4792&r2=1.4793
http://cvs.savannah.gnu.org/viewcvs/gnash/server/DynamicShape.cpp?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/server/DynamicShape.h?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/server/shape.cpp?cvsroot=gnash&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/gnash/server/shape.h?cvsroot=gnash&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/DrawingApiTestRunner.cpp?cvsroot=gnash&r1=1.30&r2=1.31

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4792
retrieving revision 1.4793
diff -u -b -r1.4792 -r1.4793
--- ChangeLog   7 Nov 2007 12:00:58 -0000       1.4792
+++ ChangeLog   7 Nov 2007 12:08:15 -0000       1.4793
@@ -1,5 +1,14 @@
 2007-11-07 Sandro Santilli <address@hidden>
 
+       * server/DynamicShape.{cpp,h}: Start new paths as new shapes
+         when beginFill is called.
+       * server/shape.{cpp,h}: add interfaces for setting m_new_shape
+         both in constructors and standalone.
+       * testsuite/misc-ming.all/DrawingApiTestRunner.cpp: fix the
+         two-overlapping squares case.
+
+2007-11-07 Sandro Santilli <address@hidden>
+
        * server/movie_root.cpp (display): skip display of null-sized levels.
        * testsuite/misc-ming.all/DrawingApiTest.as: have '-' and '+'
          use a step of 25% instead of 20% (easier for pixel checking);

Index: server/DynamicShape.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/DynamicShape.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- server/DynamicShape.cpp     14 Sep 2007 17:15:58 -0000      1.10
+++ server/DynamicShape.cpp     7 Nov 2007 12:08:16 -0000       1.11
@@ -17,7 +17,7 @@
 
 
 
-/* $Id: DynamicShape.cpp,v 1.10 2007/09/14 17:15:58 strk Exp $ */
+/* $Id: DynamicShape.cpp,v 1.11 2007/11/07 12:08:16 strk Exp $ */
 
 #include "DynamicShape.h"
 
@@ -84,12 +84,12 @@
        // TODO: how to know wheter the fill should be set
        //       as *left* or *right* fill ?
        //       A quick test shows that *left* always work fine !
-       path newPath(_x, _y, _currfill, 0, _currline);
+       path newPath(_x, _y, _currfill, 0, _currline, true); // new fill start 
new subshapes
        add_path(newPath);
 }
 
 void
-DynamicShape::startNewPath()
+DynamicShape::startNewPath(bool newShape)
 {
        // Close any pending filled style
        // The DrawingApiTest.swf file shows we should NOT
@@ -98,7 +98,7 @@
 
        // A quick test shows that *left* always work fine !
        // More than that, using a *right* fill seems to break the tests !
-       path newPath(_x, _y, _currfill, 0, _currline);
+       path newPath(_x, _y, _currfill, 0, _currline, newShape);
        add_path(newPath);
 }
 
@@ -118,14 +118,14 @@
 {
        line_style style(thickness, color);
        _currline = add_line_style(style);
-       startNewPath();
+       startNewPath(false); // don't make this the start of a new subshape (to 
verify)
 }
 
 void
 DynamicShape::resetLineStyle()
 {
        _currline = 0;
-       startNewPath();
+       startNewPath(false); // don't make this the start of a new subshape (to 
verify)
 }
 
 void
@@ -135,14 +135,15 @@
        {
                _x = x;
                _y = y;
-               startNewPath();
+               // TODO: close previous path if any and filled ?
+               startNewPath(false); // don't make this the start of a new 
subshape (to verify)
        }
 }
 
 void
 DynamicShape::lineTo(float x, float y)
 {
-       if ( ! _currpath ) startNewPath();
+       if ( ! _currpath ) startNewPath(true); // first shape is always new (I 
hope this doesn't break anything)
        assert(_currpath);
 
        _currpath->drawLineTo(x, y);
@@ -166,7 +167,7 @@
 void
 DynamicShape::curveTo(float cx, float cy, float ax, float ay)
 {
-       if ( ! _currpath ) startNewPath();
+       if ( ! _currpath ) startNewPath(true); // first shape is always new (I 
hope this doesn't break anything)
        assert(_currpath);
 
        _currpath->drawCurveTo(cx, cy, ax, ay);

Index: server/DynamicShape.h
===================================================================
RCS file: /sources/gnash/gnash/server/DynamicShape.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/DynamicShape.h       1 Jul 2007 10:54:18 -0000       1.5
+++ server/DynamicShape.h       7 Nov 2007 12:08:16 -0000       1.6
@@ -16,7 +16,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 
-/* $Id: DynamicShape.h,v 1.5 2007/07/01 10:54:18 bjacques Exp $ */
+/* $Id: DynamicShape.h,v 1.6 2007/11/07 12:08:16 strk Exp $ */
 
 #ifndef GNASH_DYNAMIC_SHAPE_H
 #define GNASH_DYNAMIC_SHAPE_H
@@ -102,13 +102,16 @@
 
 private:
 
-       // Initialize a new path, used when changing
-       // style or moving the pen
+       /// Initialize a new path
        //
-       // The newly added path will use current values
-       // for origin, fill and line styles.
-       //
-       void startNewPath();
+       /// Used when changing style or moving the pen
+       ///
+       /// The newly added path will use current values
+       /// for origin, fill and line styles.
+       ///
+       /// If newShape is true the new shape will start a new subshape.
+       ///
+       void startNewPath(bool newShape);
 
        path* _currpath;
 

Index: server/shape.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/shape.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- server/shape.cpp    7 Nov 2007 08:44:42 -0000       1.42
+++ server/shape.cpp    7 Nov 2007 12:08:16 -0000       1.43
@@ -123,16 +123,16 @@
 //
 
 
-path::path()
+path::path(bool newShape)
     :
-    m_new_shape(false)
+    m_new_shape(newShape)
 {
     reset(0, 0, 0, 0, 0);
 }
 
-path::path(float ax, float ay, int fill0, int fill1, int line)
+path::path(float ax, float ay, int fill0, int fill1, int line, bool newShape)
     :
-    m_new_shape(false)
+    m_new_shape(newShape)
 {
     reset(ax, ay, fill0, fill1, line);
 }

Index: server/shape.h
===================================================================
RCS file: /sources/gnash/gnash/server/shape.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- server/shape.h      7 Nov 2007 10:13:50 -0000       1.28
+++ server/shape.h      7 Nov 2007 12:08:16 -0000       1.29
@@ -5,7 +5,7 @@
 
 // Quadratic bezier outline shapes, the basis for most SWF rendering.
 
-/* $Id: shape.h,v 1.28 2007/11/07 10:13:50 udog Exp $ */
+/* $Id: shape.h,v 1.29 2007/11/07 12:08:16 strk Exp $ */
 
 #ifndef GNASH_SHAPE_H
 #define GNASH_SHAPE_H
@@ -53,7 +53,12 @@
        class path
        {
        public:
-               path();
+               /// Default constructor
+               //
+               /// @param newShape
+               ///     True if this path starts a new subshape
+               ///
+               path(bool newShape=false);
 
                /// Initialize a path 
                //
@@ -75,10 +80,13 @@
                ///     Line style index for right fill (1-based).
                ///     Zero means NO style.
                ///
+               /// @param newShape
+               ///     True if this path starts a new subshape
+               ///
                ///
-               path(float ax, float ay, int fill0, int fill1, int line);
+               path(float ax, float ay, int fill0, int fill1, int line, bool 
newShape=false);
 
-               /// Re-initialize a path 
+               /// Re-initialize a path, maintaining the "new shape" flag 
untouched
                //
                /// @param ax
                ///     X coordinate of path origin in TWIPS
@@ -97,6 +105,12 @@
                ///
                void    reset(float ax, float ay, int fill0, int fill1, int 
line);
 
+               /// Set this path as the start of a new (sub)shape
+               void setNewShape() { m_new_shape=true; }
+
+               /// Return true if this path starts a new (sub)shape
+               bool getNewShape() const { return m_new_shape; }
+
                /// Return true if this path contains no edges
                bool    is_empty() const;
 

Index: testsuite/misc-ming.all/DrawingApiTestRunner.cpp
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/misc-ming.all/DrawingApiTestRunner.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- testsuite/misc-ming.all/DrawingApiTestRunner.cpp    7 Nov 2007 10:05:37 
-0000       1.30
+++ testsuite/misc-ming.all/DrawingApiTestRunner.cpp    7 Nov 2007 12:08:16 
-0000       1.31
@@ -650,7 +650,7 @@
        // lower-center
        check_pixel(260, 175, 2, light_green, 2);
        // center-center (two overlapping subshapes)
-       xcheck_pixel(260, 160, 2, overlapping_light_green, 2);
+       check_pixel(260, 160, 2, overlapping_light_green, 2);
 
        tester.pressKey(gnash::key::PLUS); // alpha goes up to 75
        tester.pressKey(gnash::key::PLUS); // alpha goes up to 100
@@ -687,7 +687,7 @@
        // lower-center
        check_pixel(309, 175, 2, light_green, 2);
        // center-center (two overlapping subshapes)
-       xcheck_pixel(309, 160, 2, overlapping_light_green, 2);
+       check_pixel(309, 160, 2, overlapping_light_green, 2);
 
        tester.pressKey(gnash::key::PLUS); // alpha goes up to 75
        tester.pressKey(gnash::key::PLUS); // alpha goes up to 100




reply via email to

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