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

Unified Diff: include/gpu/GrClip.h

Issue 2132073002: Pre-crop filled rects to avoid scissor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 5 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 e58528114e873f2caa78f807337cdbb30d46b7e1..f070950e6594293cf862a394a3d11d7ebe998a8b 100644
--- a/include/gpu/GrClip.h
+++ b/include/gpu/GrClip.h
@@ -102,6 +102,12 @@ private:
*/
class GrClip {
public:
+ // This is the maximum distance that a draw may extend beyond a clip's scissor and still count
+ // as inside. We use a sloppy compare because the draw may have chosen its bounds in a different
+ // coord system. The rationale for 1e-3 is that in the coverage case (and barring unexpected
+ // rounding), as long as coverage stays below 0.5 * 1/256 we ought to be OK.
+ constexpr static SkScalar kScissorIgnoreFuzz = 1e-3f;
+
virtual bool quickContains(const SkRect&) const = 0;
virtual void getConservativeBounds(int width, int height, SkIRect* devResult,
bool* isIntersectionOfRects = nullptr) const = 0;

Powered by Google App Engine
This is Rietveld 408576698