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

Unified Diff: src/core/SkCanvas.cpp

Issue 189883010: hide getTotalClip, so we can eventually remove it (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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/SkCanvas.h ('k') | src/utils/SkCanvasStateUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 58ec8fd4c5bd0bc2c2db4dc10e2e6863379af128..9dcbfdbc38891c65deb30feb8bf047dfc42022c4 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1526,7 +1526,7 @@ void SkCanvas::validateClip() const {
// construct clipRgn from the clipstack
const SkBaseDevice* device = this->getDevice();
if (!device) {
- SkASSERT(this->getTotalClip().isEmpty());
+ SkASSERT(this->isClipEmpty());
return;
}
@@ -1553,12 +1553,6 @@ void SkCanvas::validateClip() const {
}
}
}
-
-#if 0 // enable this locally for testing
- // now compare against the current rgn
- const SkRegion& rgn = this->getTotalClip();
- SkASSERT(rgn == tmpClip);
-#endif
}
#endif
@@ -1591,6 +1585,10 @@ bool SkCanvas::isClipEmpty() const {
return fMCRec->fRasterClip->isEmpty();
}
+bool SkCanvas::isClipRect() const {
+ return fMCRec->fRasterClip->isRect();
+}
+
bool SkCanvas::quickReject(const SkRect& rect) const {
if (!rect.isFinite())
@@ -1671,6 +1669,7 @@ const SkMatrix& SkCanvas::getTotalMatrix() const {
return *fMCRec->fMatrix;
}
+#ifdef SK_SUPPORT_LEGACY_GETCLIPTYPE
SkCanvas::ClipType SkCanvas::getClipType() const {
if (fMCRec->fRasterClip->isEmpty()) {
return kEmpty_ClipType;
@@ -1680,10 +1679,27 @@ SkCanvas::ClipType SkCanvas::getClipType() const {
}
return kComplex_ClipType;
}
+#endif
+#ifdef SK_SUPPORT_LEGACY_GETTOTALCLIP
const SkRegion& SkCanvas::getTotalClip() const {
return fMCRec->fRasterClip->forceGetBW();
}
+#endif
+
+const SkRegion& SkCanvas::internal_private_getTotalClip() const {
+ return fMCRec->fRasterClip->forceGetBW();
+}
+
+void SkCanvas::internal_private_getTotalClipAsPath(SkPath* path) const {
+ path->reset();
+
+ const SkRegion& rgn = fMCRec->fRasterClip->forceGetBW();
+ if (rgn.isEmpty()) {
+ return;
+ }
+ (void)rgn.getBoundaryPath(path);
+}
SkBaseDevice* SkCanvas::createLayerDevice(const SkImageInfo& info) {
SkBaseDevice* device = this->getTopDevice();
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/utils/SkCanvasStateUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698