Index: include/gpu/GrClip.h |
diff --git a/include/gpu/GrClip.h b/include/gpu/GrClip.h |
index 168827b9f8aab5d9451228aa0bdee719580bf0ba..f3653eee58c42eaf6a913fd84431a8a7b9c2bcf2 100644 |
--- a/include/gpu/GrClip.h |
+++ b/include/gpu/GrClip.h |
@@ -33,6 +33,17 @@ public: |
virtual ~GrClip() {} |
/** |
+ * This method quickly and conservatively determines whether the entire clip is equivalent to |
+ * intersection with a rrect. |
+ * |
+ * @param rtBounds The bounds of the render target that the clip will be applied to. |
+ * @param rrect If return is true rrect will contain the rrect equivalent to the clip. |
+ * @param aa If return is true aa will indicate whether the rrect clip is antialiased. |
+ * @return true if the clip is equivalent to a single rrect, false otherwise. |
+ */ |
+ virtual bool isRRect(const SkRect& rtBounds, SkRRect* rrect, bool* aa) const = 0; |
+ |
+ /** |
* This is the maximum distance that a draw may extend beyond a clip's boundary and still count |
* count as "on the other side". We leave some slack because floating point rounding error is |
* likely to blame. The rationale for 1e-3 is that in the coverage case (and barring unexpected |
@@ -122,6 +133,7 @@ private: |
bool apply(GrContext*, GrDrawContext*, bool, bool, GrAppliedClip*) const final { |
return true; |
} |
+ bool isRRect(const SkRect&, SkRRect*, bool*) const override { return false; }; |
}; |
#endif |