Add bounding rect for paths
Review URL: http://codereview.appspot.com/4442094/
git-svn-id: http://skia.googlecode.com/svn/trunk@1205 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrPath.h b/gpu/include/GrPath.h
index 80bbeb3..f958329 100644
--- a/gpu/include/GrPath.h
+++ b/gpu/include/GrPath.h
@@ -22,6 +22,7 @@
#include "GrPathIter.h"
#include "GrTDArray.h"
#include "GrPoint.h"
+#include "GrRect.h"
class GrPath : public GrPathSink {
public:
@@ -33,6 +34,8 @@
GrConvexHint getConvexHint() const { return fConvexHint; }
void setConvexHint(GrConvexHint hint) { fConvexHint = hint; }
+ const GrRect& getConservativeBounds() const { return fConservativeBounds; }
+
void resetFromIter(GrPathIter*);
bool operator ==(const GrPath& path) const;
@@ -66,6 +69,7 @@
virtual GrConvexHint convexHint() const;
virtual GrPathCmd next();
virtual void rewind();
+ virtual bool getConservativeBounds(GrRect* rect) const;
/**
* Sets iterator to begining of path
@@ -84,7 +88,8 @@
GrTDArray<GrPathCmd> fCmds;
GrTDArray<GrPoint> fPts;
- GrConvexHint fConvexHint;
+ GrConvexHint fConvexHint;
+ GrRect fConservativeBounds;
// this ensures we have a moveTo at the start of each contour
inline void ensureMoveTo();