Remove global curve subdivision tolerance from GrPathUtils.
Put in framework for changing curve subdivision tolerance when rendering
offscreen AA tiles; however, comment out actual tolerance changes because
of possible quality issues with simple circles (q.v. Arcs slide of SampleApp).
git-svn-id: http://skia.googlecode.com/svn/trunk@1702 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrContext.h b/gpu/include/GrContext.h
index 8d482e9..0528267 100644
--- a/gpu/include/GrContext.h
+++ b/gpu/include/GrContext.h
@@ -594,6 +594,7 @@
bool prepareForOffscreenAA(GrDrawTarget* target,
bool requireStencil,
const GrIRect& boundRect,
+ GrPathRenderer* pr,
OffscreenRecord* record);
// sets up target to draw coverage to the supersampled render target
@@ -611,7 +612,9 @@
OffscreenRecord* record);
// restored the draw target state and releases offscreen target to cache
- void cleanupOffscreenAA(GrDrawTarget* target, OffscreenRecord* record);
+ void cleanupOffscreenAA(GrDrawTarget* target,
+ GrPathRenderer* pr,
+ OffscreenRecord* record);
// computes vertex layout bits based on the paint. If paint expresses
// a texture for a stage, the stage coords will be bound to postitions
diff --git a/gpu/include/GrPathRenderer.h b/gpu/include/GrPathRenderer.h
index 1ebad4f..d77aad6 100644
--- a/gpu/include/GrPathRenderer.h
+++ b/gpu/include/GrPathRenderer.h
@@ -27,6 +27,8 @@
*/
class GR_API GrPathRenderer : public GrRefCnt {
public:
+ GrPathRenderer(void);
+
/**
* Returns true if this path renderer is able to render the path.
* Returning false allows the caller to fallback to another path renderer.
@@ -122,6 +124,19 @@
*/
static GrPathRenderer* CreatePathRenderer();
+ /**
+ * Multiply curve tolerance by the given value, increasing or decreasing
+ * the maximum error permitted in tesselating curves with short straight
+ * line segments.
+ */
+ void scaleCurveTolerance(GrScalar multiplier) {
+ GrAssert(multiplier > 0);
+ fCurveTolerance = SkScalarMul(fCurveTolerance, multiplier);
+ }
+
+protected:
+ GrScalar fCurveTolerance;
+
private:
typedef GrRefCnt INHERITED;