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

Unified Diff: src/core/SkRasterClip.h

Issue 541593005: allow canvas to force conservative clips (for speed) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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: src/core/SkRasterClip.h
diff --git a/src/core/SkRasterClip.h b/src/core/SkRasterClip.h
index ec38990a0c78281dfed3f077fbf5508db75547e7..8a0681805cdb3f9a02052651b8d3f1b2780840a5 100644
--- a/src/core/SkRasterClip.h
+++ b/src/core/SkRasterClip.h
@@ -13,11 +13,13 @@
class SkRasterClip {
public:
- SkRasterClip();
- SkRasterClip(const SkIRect&);
+ SkRasterClip(bool forceConservativeRects = false);
+ SkRasterClip(const SkIRect&, bool forceConservativeRects = false);
SkRasterClip(const SkRasterClip&);
~SkRasterClip();
+ bool isForceConservativeRects() const { return fForceConservativeRects; }
+
bool isBW() const { return fIsBW; }
bool isAA() const { return !fIsBW; }
const SkRegion& bwRgn() const { SkASSERT(fIsBW); return fBW; }
@@ -41,7 +43,7 @@ public:
bool op(const SkIRect&, SkRegion::Op);
bool op(const SkRegion&, SkRegion::Op);
- bool op(const SkRect&, SkRegion::Op, bool doAA);
+ bool op(const SkRect&, const SkISize&, SkRegion::Op, bool doAA);
bool op(const SkPath&, const SkISize&, SkRegion::Op, bool doAA);
void translate(int dx, int dy, SkRasterClip* dst) const;
@@ -75,6 +77,7 @@ public:
private:
SkRegion fBW;
SkAAClip fAA;
+ bool fForceConservativeRects;
bool fIsBW;
// these 2 are caches based on querying the right obj based on fIsBW
bool fIsEmpty;
@@ -107,6 +110,7 @@ private:
bool setPath(const SkPath& path, const SkRegion& clip, bool doAA);
bool setPath(const SkPath& path, const SkIRect& clip, bool doAA);
bool op(const SkRasterClip&, SkRegion::Op);
+ bool setConservativeRect(const SkRect& r, const SkIRect& clipR, bool isInverse);
};
class SkAutoRasterClipValidate : SkNoncopyable {

Powered by Google App Engine
This is Rietveld 408576698