Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: include/gpu/GrClip.h

Issue 2271053004: Convert drawPaint to drawRRect in simple cases (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: cleanup Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698