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(); |