Revision: 6795
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6795&view=rev
Author: mdboom
Date: 2009-01-16 18:47:51 +0000 (Fri, 16 Jan 2009)
Log Message:
-----------
Remove need for m_done flag in simlifier -- we can just put a path_stop onto
the queue instead. Saves one boolean test on every iteration.
Modified Paths:
--------------
trunk/matplotlib/src/agg_py_path_iterator.h
Modified: trunk/matplotlib/src/agg_py_path_iterator.h
===================================================================
--- trunk/matplotlib/src/agg_py_path_iterator.h 2009-01-16 18:45:39 UTC (rev
6794)
+++ trunk/matplotlib/src/agg_py_path_iterator.h 2009-01-16 18:47:51 UTC (rev
6795)
@@ -143,8 +143,7 @@
m_origdx(0.0), m_origdy(0.0),
m_origdNorm2(0.0), m_dnorm2Max(0.0), m_dnorm2Min(0.0),
m_haveMin(false), m_lastMax(false), m_maxX(0.0), m_maxY(0.0),
- m_minX(0.0), m_minY(0.0), m_lastWrittenX(0.0), m_lastWrittenY(0.0),
- m_done(false)
+ m_minX(0.0), m_minY(0.0), m_lastWrittenX(0.0), m_lastWrittenY(0.0)
#if DEBUG_SIMPLIFY
, m_pushed(0), m_skipped(0)
#endif
@@ -202,17 +201,6 @@
return cmd;
}
- // If the queue is now empty, and the path was fully consumed
- // in the last call to the main loop, return agg::path_cmd_stop to
- // signal that there are no more points to emit.
- if (m_done)
- {
- #if DEBUG_SIMPLIFY
- printf(".\n");
- #endif
- return agg::path_cmd_stop;
- }
-
// The main simplification loop. The point is to consume only as many
// points as necessary until something has been added to the outbound
// queue, not to run through the entire path in one go. This
@@ -418,7 +406,7 @@
}
queue_push(agg::path_cmd_line_to, m_maxX, m_maxY);
}
- m_done = true;
+ queue_push(agg::path_cmd_stop, 0.0, 0.0);
}
// Return the first item in the queue, if any, otherwise
@@ -455,7 +443,7 @@
bool m_simplify;
double m_width, m_height;
- static const int m_queue_size = 7;
+ static const int m_queue_size = 8;
int m_queue_read;
int m_queue_write;
item m_queue[m_queue_size];
@@ -479,7 +467,6 @@
double m_minY;
double m_lastWrittenX;
double m_lastWrittenY;
- bool m_done;
#if DEBUG_SIMPLIFY
unsigned m_pushed;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins