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

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: fix another msvs warning 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
« no previous file with comments | « include/core/SkClipStack.h ('k') | src/core/SkClipStack.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrClip.h
diff --git a/include/gpu/GrClip.h b/include/gpu/GrClip.h
index 168827b9f8aab5d9451228aa0bdee719580bf0ba..a7505f99b2c7e3ec79c5b9a02438cfa8badf5abf 100644
--- a/include/gpu/GrClip.h
+++ b/include/gpu/GrClip.h
@@ -33,6 +33,21 @@ public:
virtual ~GrClip() {}
/**
+ * This method quickly and conservatively determines whether the entire clip is equivalent to
+ * intersection with a rrect. This will only return true if the rrect does not fully contain
+ * the render target bounds. Moreover, the returned rrect need not be contained by the render
+ * target bounds. We assume all draws will be implicitly clipped by the render target bounds.
+ *
+ * @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 within
+ * rtBounds.
+ * @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 +137,7 @@ private:
bool apply(GrContext*, GrDrawContext*, bool, bool, GrAppliedClip*) const final {
return true;
}
+ bool isRRect(const SkRect&, SkRRect*, bool*) const override { return false; };
};
#endif
« no previous file with comments | « include/core/SkClipStack.h ('k') | src/core/SkClipStack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698