From: <md...@us...> - 2008-01-23 14:36:21
|
Revision: 4888 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4888&view=rev Author: mdboom Date: 2008-01-23 06:35:21 -0800 (Wed, 23 Jan 2008) Log Message: ----------- Minor speed improvements in Agg backend. Modified Paths: -------------- trunk/matplotlib/src/_backend_agg.cpp trunk/matplotlib/src/agg_py_path_iterator.h Modified: trunk/matplotlib/src/_backend_agg.cpp =================================================================== --- trunk/matplotlib/src/_backend_agg.cpp 2008-01-23 13:33:01 UTC (rev 4887) +++ trunk/matplotlib/src/_backend_agg.cpp 2008-01-23 14:35:21 UTC (rev 4888) @@ -343,6 +343,10 @@ return false; code = path.vertex(&x0, &y0); + if (code == agg::path_cmd_stop) { + path.rewind(0); + return false; + } trans.transform(&x0, &y0); while ((code = path.vertex(&x1, &y1)) != agg::path_cmd_stop) { @@ -1602,7 +1606,6 @@ double g = Py::Float(rgb[1]); double b = Py::Float(rgb[2]); return agg::rgba(r, g, b, alpha); - } @@ -1615,8 +1618,6 @@ double p = Py::Float( points ) ; //return (int)(p*PIXELS_PER_INCH/72.0*dpi/72.0)+0.5; return (int)(p*dpi/72.0)+0.5; - - } double Modified: trunk/matplotlib/src/agg_py_path_iterator.h =================================================================== --- trunk/matplotlib/src/agg_py_path_iterator.h 2008-01-23 13:33:01 UTC (rev 4887) +++ trunk/matplotlib/src/agg_py_path_iterator.h 2008-01-23 14:35:21 UTC (rev 4888) @@ -118,7 +118,7 @@ SimplifyPath(VertexSource& source, bool quantize, bool simplify, double width = 0.0, double height = 0.0) : m_source(&source), m_quantize(quantize), m_simplify(simplify), - m_width(width), m_height(height), m_queue_read(0), m_queue_write(0), + m_width(width + 1.0), m_height(height + 1.0), m_queue_read(0), m_queue_write(0), m_moveto(true), m_lastx(0.0), m_lasty(0.0), m_clipped(false), m_do_clipping(width > 0.0 && height > 0.0), m_origdx(0.0), m_origdy(0.0), @@ -246,9 +246,9 @@ //could be clipped, but a more involved calculation would be needed if (m_do_clipping && ((*x < -1.0 && m_lastx < -1.0) || - (*x > m_width + 1.0 && m_lastx > m_width + 1.0) || + (*x > m_width && m_lastx > m_width) || (*y < -1.0 && m_lasty < -1.0) || - (*y > m_height + 1.0 && m_lasty > m_height + 1.0))) + (*y > m_height && m_lasty > m_height))) { m_lastx = *x; m_lasty = *y; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |