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


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/DynamicShape.cpp
Date: Fri, 14 Sep 2007 17:15:59 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/09/14 17:15:59

Modified files:
        .              : ChangeLog 
        server         : DynamicShape.cpp 

Log message:
                * server/DynamicShape.cpp: optimized bounds computation by the
                  drawing API.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4321&r2=1.4322
http://cvs.savannah.gnu.org/viewcvs/gnash/server/DynamicShape.cpp?cvsroot=gnash&r1=1.9&r2=1.10

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4321
retrieving revision 1.4322
diff -u -b -r1.4321 -r1.4322
--- ChangeLog   14 Sep 2007 16:32:38 -0000      1.4321
+++ ChangeLog   14 Sep 2007 17:15:57 -0000      1.4322
@@ -1,5 +1,7 @@
 2007-09-14 Sandro Santilli <address@hidden>
 
+       * server/DynamicShape.cpp: optimized bounds computation by the
+         drawing API.
        * testsuite/misc-ming.all/DrawingApiTest.as: add bounds tests.
        * server/shape.{cpp,h}: add path::expandBounds to compute bounds
          of a path locally.

Index: server/DynamicShape.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/DynamicShape.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/DynamicShape.cpp     6 Aug 2007 03:30:18 -0000       1.9
+++ server/DynamicShape.cpp     14 Sep 2007 17:15:58 -0000      1.10
@@ -17,7 +17,7 @@
 
 
 
-/* $Id: DynamicShape.cpp,v 1.9 2007/08/06 03:30:18 strk Exp $ */
+/* $Id: DynamicShape.cpp,v 1.10 2007/09/14 17:15:58 strk Exp $ */
 
 #include "DynamicShape.h"
 
@@ -45,6 +45,7 @@
     m_paths.clear();
     m_fill_styles.clear();
     m_line_styles.clear();
+       m_bound.set_null();
 }
 
 void
@@ -52,7 +53,7 @@
 {
        m_paths.push_back(pth);
        _currpath = &(m_paths.back());
-       compute_bound(&m_bound);
+       //compute_bound(&m_bound);
 }
 
 void
@@ -145,8 +146,14 @@
        assert(_currpath);
 
        _currpath->drawLineTo(x, y);
-       // recompute bounds
-       compute_bound(&m_bound);
+
+       // Update bounds 
+       unsigned thickness = _currline ? m_line_styles[_currline-1].get_width() 
: 0;
+       if ( _currpath->size() == 1 ) {
+               _currpath->expandBounds(m_bound, thickness);
+       } else {
+               m_bound.expand_to_circle(x, y, thickness);
+       }
 
        // Update current pen position
        _x = x;
@@ -163,8 +170,15 @@
        assert(_currpath);
 
        _currpath->drawCurveTo(cx, cy, ax, ay);
-       // recompute bounds
-       compute_bound(&m_bound);
+
+       // Update bounds 
+       unsigned thickness = _currline ? m_line_styles[_currline-1].get_width() 
: 0;
+       if ( _currpath->size() == 1 ) {
+               _currpath->expandBounds(m_bound, thickness);
+       } else {
+               m_bound.expand_to_circle(ax, ay, thickness);
+               m_bound.expand_to_circle(cx, cy, thickness);
+       }
 
        // Update current pen position
        _x = ax;




reply via email to

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