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

Unified Diff: src/core/SkRasterClip.cpp

Issue 1925693002: remove 'deprecated' region from SkDraw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update dox Created 4 years, 8 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 | « src/core/SkRasterClip.h ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRasterClip.cpp
diff --git a/src/core/SkRasterClip.cpp b/src/core/SkRasterClip.cpp
index 89467677f3ec95904ff4ae540a82b031f2310bae..88bfbafc365da153e2ffb88898f1eb8abd22c9ab 100644
--- a/src/core/SkRasterClip.cpp
+++ b/src/core/SkRasterClip.cpp
@@ -24,6 +24,14 @@ SkRasterClip::SkRasterClip(const SkRasterClip& src) {
SkDEBUGCODE(this->validate();)
}
+SkRasterClip::SkRasterClip(const SkRegion& rgn) : fBW(rgn) {
+ fForceConservativeRects = false;
+ fIsBW = true;
+ fIsEmpty = this->computeIsEmpty(); // bounds might be empty, so compute
+ fIsRect = !fIsEmpty;
+ SkDEBUGCODE(this->validate();)
+}
+
SkRasterClip::SkRasterClip(const SkIRect& bounds, bool forceConservativeRects) : fBW(bounds) {
fForceConservativeRects = forceConservativeRects;
fIsBW = true;
@@ -44,6 +52,22 @@ SkRasterClip::~SkRasterClip() {
SkDEBUGCODE(this->validate();)
}
+bool SkRasterClip::operator==(const SkRasterClip& other) const {
+ // This impl doesn't care if fForceConservativeRects is the same in both, only the current state
+
+ if (fIsBW != other.fIsBW) {
+ return false;
+ }
+ bool isEqual = fIsBW ? fBW == other.fBW : fAA == other.fAA;
+#ifdef SK_DEBUG
+ if (isEqual) {
+ SkASSERT(fIsEmpty == other.fIsEmpty);
+ SkASSERT(fIsRect == other.fIsRect);
+ }
+#endif
+ return isEqual;
+}
+
bool SkRasterClip::isComplex() const {
return fIsBW ? fBW.isComplex() : !fAA.isEmpty();
}
« no previous file with comments | « src/core/SkRasterClip.h ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698