gnash-commit
[Top][All Lists]
Advanced

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

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


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash ChangeLog server/styles.cpp server/styles...
Date: Fri, 02 May 2008 13:54:17 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Changes by:     Udo Giacomozzi <udog>   08/05/02 13:54:16

Modified files:
        .              : ChangeLog 
        server         : styles.cpp styles.h 
        backend        : render_handler_agg.cpp 

Log message:
        server/style.{cpp,h}: added cap style, join style, no-close and miter 
limit factor properties to line_style class

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6473&r2=1.6474
http://cvs.savannah.gnu.org/viewcvs/gnash/server/styles.cpp?cvsroot=gnash&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/gnash/server/styles.h?cvsroot=gnash&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_agg.cpp?cvsroot=gnash&r1=1.137&r2=1.138

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.6473
retrieving revision 1.6474
diff -u -b -r1.6473 -r1.6474
--- ChangeLog   2 May 2008 13:50:37 -0000       1.6473
+++ ChangeLog   2 May 2008 13:54:15 -0000       1.6474
@@ -1,3 +1,8 @@
+2008-05-02 Udo Giacomozzi <address@hidden>
+
+       * server/style.{cpp,h}: added cap style, join style, no-close and
+         miter limit factor properties to line_style class
+
 2008-05-02 Sandro Santilli <address@hidden>
 
        * gui/Makefile.am: build the DUMP gui when requested.

Index: server/styles.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/styles.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- server/styles.cpp   29 Apr 2008 11:29:04 -0000      1.39
+++ server/styles.cpp   2 May 2008 13:54:16 -0000       1.40
@@ -54,28 +54,29 @@
 
        // TODO: Same as in read(...), use these.
        // 0 -- Round caps, 1 -- No caps, 2 -- square caps
-       boost::uint8_t caps = in->read_uint(2);
+       _startCapStyle = (cap_style_e) in->read_uint(2);
        // 0 -- Round join, 1 -- Bevel join, 2 -- Miter join
-       boost::uint8_t joins = in->read_uint(2);
+       _joinStyle = (join_style_e) in->read_uint(2);
        bool has_fill = in->read_bit();
        _scaleHorizontally = ! in->read_bit();
        _scaleVertically = ! in->read_bit();
        bool pixel_hinting = in->read_bit();
 
        static_cast<void> (in->read_uint(5));
-       bool no_close = in->read_bit();
-       bool end_cap_style = in->read_uint(2); // As caps above.
+       _noClose = in->read_bit();
+       _endCapStyle = (cap_style_e) in->read_uint(2); // As caps above.
 
-       if (joins == 2)
+       if (_joinStyle == JOIN_MITER)  // style 2
        {
                in->ensureBytes(2);
-               float f_miter = in->read_short_ufixed();
+               _miterLimitFactor = in->read_short_ufixed();
        }
        if (has_fill)
        {
                // TODO: Throwing this away is not the right thing.
                // What is?
                // A fill style is here.
+               // Answer (Udo): Should be passed to renderer somehow.
                fill_style f, g;
                f.read(in, tag_type, md, &g);
                m_color = f.get_color();

Index: server/styles.h
===================================================================
RCS file: /cvsroot/gnash/gnash/server/styles.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- server/styles.h     29 Apr 2008 11:29:04 -0000      1.26
+++ server/styles.h     2 May 2008 13:54:16 -0000       1.27
@@ -19,6 +19,9 @@
 class stream;
 class movie_definition;
 
+  typedef enum { CAP_ROUND=0, CAP_NONE=1, CAP_SQUARE=2 } cap_style_e;
+  typedef enum { JOIN_ROUND=0, JOIN_BEVEL=1, JOIN_MITER=2 } join_style_e;
+  
 /// For the outside of outline shapes, or just bare lines.
 class line_style 
 {
@@ -39,7 +42,12 @@
                m_width(width),
                m_color(color),
                _scaleVertically(scaleThicknessVertically),
-               _scaleHorizontally(scaleThicknessHorizontally)
+               _scaleHorizontally(scaleThicknessHorizontally),
+               _noClose(false),
+               _startCapStyle(CAP_ROUND),
+               _endCapStyle(CAP_ROUND),
+               _joinStyle(JOIN_ROUND),
+               _miterLimitFactor(1.0f)
        {
        }
 
@@ -76,6 +84,37 @@
                return _scaleHorizontally;
        }
 
+       /// Return the start cap style
+       cap_style_e startCapStyle() const
+       {
+         return _startCapStyle;
+  }
+       
+       /// Return the end cap style
+       cap_style_e endCapStyle() const
+       {
+         return _endCapStyle;
+  }
+  
+  /// Return the join style
+  join_style_e joinStyle() const
+  {
+    return _joinStyle;
+  }
+  
+  /// Return the miter limit factor
+  float miterLimitFactor() const
+  {
+    return _miterLimitFactor;
+  }
+  
+  /// Return true if stroke should not be closed if the stroke's last point
+  /// matches the first point. Caps should be applied instead of a join
+  bool noClose() const
+  {
+    return _noClose;
+  }
+
        /// Return line color and alpha
        const rgba&     get_color() const { return m_color; }
 
@@ -100,6 +139,11 @@
        rgba    m_color;
        bool _scaleVertically;
        bool _scaleHorizontally;
+       bool _noClose;
+       cap_style_e _startCapStyle;
+       cap_style_e _endCapStyle;
+       join_style_e _joinStyle;
+       float _miterLimitFactor;
 };
 
 } // namespace gnash

Index: backend/render_handler_agg.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/backend/render_handler_agg.cpp,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -b -r1.137 -r1.138
--- backend/render_handler_agg.cpp      29 Apr 2008 11:29:02 -0000      1.137
+++ backend/render_handler_agg.cpp      2 May 2008 13:54:16 -0000       1.138
@@ -42,6 +42,10 @@
     patterns          don't exist (they're converted at compile time by Flash!)
     widths            COMPLETE
     colors, alpha     COMPLETE
+    cap styles        TODO / fixed to round caps
+    join styles       TODO / fixed to round joins
+    no-close flag     TODO / currently ignored        
+  
     
   fills:
     solid fills       COMPLETE




reply via email to

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