Fixups for clipstack, convexity test for paths.
Review URL http://codereview.appspot.com/4250056/
git-svn-id: http://skia.googlecode.com/svn/trunk@891 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrPathIter.h b/gpu/include/GrPathIter.h
index 140cbcb..f310184 100644
--- a/gpu/include/GrPathIter.h
+++ b/gpu/include/GrPathIter.h
@@ -29,76 +29,36 @@
*/
class GrPathIter {
public:
- /**
- Returned by next(). Indicates the next piece of the path.
- */
- enum Command {
- kMove_Command, //!< next() returns 1 pt
- // Starts a new subpath at
- // at the returned point
- kLine_Command, //!< next() returns 2 pts
- // Adds a line segment
- kQuadratic_Command, //!< next() returns 3 pts
- // Adds a quadratic segment
- kCubic_Command, //!< next() returns 4 pts
- // Adds a cubic segment
- kClose_Command, //!< next() returns 0 pts
- kEnd_Command //!< next() returns 0 pts
- // Implictly closes the last
- // point
- };
-
- enum ConvexHint {
- kNone_ConvexHint, //<! No hint about convexity
- // of the path
- kConvex_ConvexHint, //<! Path is one convex piece
- kNonOverlappingConvexPieces_ConvexHint, //<! Multiple convex pieces,
- // pieces are known to be
- // disjoint
- kSameWindingConvexPieces_ConvexHint, //<! Multiple convex pieces,
- // may or may not intersect,
- // either all wind cw or all
- // wind ccw.
- kConcave_ConvexHint //<! Path is known to be
- // concave
- };
-
- static int NumCommandPoints(Command cmd) {
- static const int numPoints[] = {
- 1, 2, 3, 4, 0, 0
- };
- return numPoints[cmd];
- }
virtual ~GrPathIter() {};
/**
- Iterates through the path. Should not be called after
- kEnd_Command has been returned once. This version retrieves the
- points for the command.
- @param points The points relevant to returned commend. See Command
- enum for number of points valid for each command.
- @return The next command of the path.
+ * Iterates through the path. Should not be called after
+ * kEnd_Command has been returned once. This version retrieves the
+ * points for the command.
+ * @param points The points relevant to returned commend. See Command
+ * enum for number of points valid for each command.
+ * @return The next command of the path.
*/
- virtual Command next(GrPoint points[4]) = 0;
+ virtual GrPathCmd next(GrPoint points[4]) = 0;
/**
* If the host API has knowledge of the convexity of the path
- * it can be communicated by this hint. Ganesh can make these
- * determinations itself. So it is not necessary to compute
- * convexity status if it isn't already determined.
+ * it can be communicated by this hint. Gr can analyze the path
+ * as it is iterated. So it is not necessary to do additional work to
+ * compute convexity status if it isn't already determined.
*
* @return a hint about the convexity of the path.
*/
- virtual ConvexHint convexHint() const { return kNone_ConvexHint; }
+ virtual GrConvexHint convexHint() const { return kNone_ConvexHint; }
/**
- Iterates through the path. Should not be called after
- kEnd_Command has been returned once. This version does not retrieve the
- points for the command.
- @return The next command of the path.
- */
- virtual Command next() = 0;
+ * Iterates through the path. Should not be called after
+ * kEnd_Command has been returned once. This version does not retrieve the
+ * points for the command.
+ * @return The next command of the path.
+ */
+ virtual GrPathCmd next() = 0;
/**
Restarts iteration from the beginning.