gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/parser/shape_character_d...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/parser/shape_character_d...
Date: Thu, 23 Aug 2007 15:10:51 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/08/23 15:10:51

Modified files:
        .              : ChangeLog 
        server/parser  : shape_character_def.cpp shape_character_def.h 

Log message:
                * server/parser/shape_character_def.{cpp,h}: document
                  the read function; compute bound when not available
                  in the SWF (glyphs in DEFINEFONT*).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4083&r2=1.4084
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.cpp?cvsroot=gnash&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.h?cvsroot=gnash&r1=1.14&r2=1.15

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4083
retrieving revision 1.4084
diff -u -b -r1.4083 -r1.4084
--- ChangeLog   23 Aug 2007 14:10:53 -0000      1.4083
+++ ChangeLog   23 Aug 2007 15:10:50 -0000      1.4084
@@ -1,5 +1,11 @@
 2007-08-23 Sandro Santilli <address@hidden>
 
+       * server/parser/shape_character_def.{cpp,h}: document
+         the read function; compute bound when not available
+         in the SWF (glyphs in DEFINEFONT*).
+
+2007-08-23 Sandro Santilli <address@hidden>
+
        * libamf/amf.{cpp,h}: fixed a bunch of memory errors, added
          some dox, first pass to interface clean ups.
        * testsuite/libamf.all/Makefile.am: add testsuite/ to the 

Index: server/parser/shape_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/shape_character_def.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- server/parser/shape_character_def.cpp       7 Aug 2007 20:53:10 -0000       
1.32
+++ server/parser/shape_character_def.cpp       23 Aug 2007 15:10:51 -0000      
1.33
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: shape_character_def.cpp,v 1.32 2007/08/07 20:53:10 strk Exp $ */
+/* $Id: shape_character_def.cpp,v 1.33 2007/08/23 15:10:51 strk Exp $ */
 
 // Based on the public domain shape.cpp of Thatcher Ulrich <address@hidden> 
2003
 
@@ -36,6 +36,9 @@
 #include <cfloat>
 #include <algorithm>
 
+// Define the macro below to always compute bounds for shape characters
+// and compare them with the bounds encoded in the SWF
+//#define GNASH_DEBUG_SHAPE_BOUNDS 1
 
 //#define DEBUG_DISPLAY_SHAPE_PATHS    // won't probably work anymore (Udo)
 #ifdef DEBUG_DISPLAY_SHAPE_PATHS
@@ -481,6 +484,25 @@
            }
        }
     }
+
+    if ( ! with_style )
+    {
+        // TODO: performance would be improved by computing 
+        //       the bounds as edges are parsed.
+        compute_bound(&m_bound);
+    }
+#ifdef GNASH_DEBUG_SHAPE_BOUNDS
+    else
+    {
+        rect computedBounds;
+        compute_bound(&computedBounds);
+        if ( computedBounds != m_bounds )
+        {
+            log_debug("Shape character read for tag %d contained embedded 
bounds %s, while we computed bounds %s",
+                tag_type, m_bound.toString().c_str(), 
computedBounds.toString().c_str());
+        }
+    }
+#endif // GNASH_DEBUG_SHAPE_BOUNDS
 }
 
 

Index: server/parser/shape_character_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/shape_character_def.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- server/parser/shape_character_def.h 6 Aug 2007 03:30:19 -0000       1.14
+++ server/parser/shape_character_def.h 23 Aug 2007 15:10:51 -0000      1.15
@@ -5,7 +5,7 @@
 
 // Quadratic bezier outline shapes, the basis for most SWF rendering.
 
-/* $Id: shape_character_def.h,v 1.14 2007/08/06 03:30:19 strk Exp $ */
+/* $Id: shape_character_def.h,v 1.15 2007/08/23 15:10:51 strk Exp $ */
 
 #ifndef GNASH_SHAPE_CHARACTER_DEF_H
 #define GNASH_SHAPE_CHARACTER_DEF_H
@@ -48,7 +48,31 @@
                float   get_height_local() const;
                float   get_width_local() const;
 
+               /// \brief
+               /// Read a shape definition as included in DEFINEFONT*,
+               /// DEFINESHAPE* or DEFINEMORPH* tag
+               //
+               /// @param in
+               ///     The stream to read the shape from
+               ///
+               /// @param tag_type
+               ///     The SWF::tag_type this shape definition is read for.
+               ///     TODO: change to an actual SWF::tag_type type
+               ///
+               /// @param with_style
+               ///     If true, this definition includes bounds, fill styles 
and line styles.
+               ///     Tipically, this is only false for DEFINEFONT* tags.
+               ///     NOTE: if with_style is false, bounds of the shape will 
be computed
+               ///           rather then read.
+               ///     TODO: drop this function, set based on tag_type ?
+               ///
+               /// @param m
+               ///     The movie definition corresponding to the SWF we/re 
parsing.
+               ///     This is used to resolve bitmap characters for fill 
styles, never
+               ///     used if with_style is false.
+               ///
                void    read(stream* in, int tag_type, bool with_style, 
movie_definition* m);
+
                void    display(
                        const matrix& mat,
                        const cxform& cx,




reply via email to

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