Index: src/gpu/GrPathRenderer.h |
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h |
index f86eb9fe54783b502875c7dc048e2041560c64a2..88665c1d423eedd03259c5c54fd805259c843b11 100644 |
--- a/src/gpu/GrPathRenderer.h |
+++ b/src/gpu/GrPathRenderer.h |
@@ -13,6 +13,7 @@ |
#include "GrPathRendererChain.h" |
#include "GrStencil.h" |
+#include "SkDrawProcs.h" |
#include "SkStrokeRec.h" |
#include "SkTArray.h" |
@@ -137,6 +138,20 @@ public: |
this->onStencilPath(path, stroke, target); |
} |
+ // Helper for determining if we can treat a thin stroke as a hairline w/ coverage. |
+ // If we can, we draw lots faster (raster device does this same test). |
+ static bool IsStrokeHairlineOrEquivalent(const SkStrokeRec& stroke, const SkMatrix& matrix, |
+ SkScalar* outCoverage) { |
+ if (stroke.isHairlineStyle()) { |
+ if (NULL != outCoverage) { |
+ *outCoverage = SK_Scalar1; |
+ } |
+ return true; |
+ } |
+ return stroke.getStyle() == SkStrokeRec::kStroke_Style && |
+ SkDrawTreatAAStrokeAsHairline(stroke.getWidth(), matrix, outCoverage); |
+ } |
+ |
protected: |
/** |
* Subclass overrides if it has any limitations of stenciling support. |