aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-10 21:24:37 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-10 21:24:37 +0000
commit5e2457ef2eba0c3f2e4c8fc89be7f36659e4f3b1 (patch)
tree3418fe75b782bb62645295c1d0b51d60a85dac1b /src
parentd1e3c5fde3f2ed309273cb08dbba2309b13e527f (diff)
add getTotalClipBounds() as a partial replacement for getTotalClip. This can be
faster than getTotalClip, since it doesn't need to compute the actual complex region for the answer. git-svn-id: http://skia.googlecode.com/svn/trunk@2452 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkCanvas.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index f563cd1211..89c6e5b79d 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1151,6 +1151,13 @@ SkCanvas::ClipType SkCanvas::getClipType() const {
return kComplex_ClipType;
}
+bool SkCanvas::getTotalClipBounds(SkIRect* bounds) const {
+ if (bounds) {
+ *bounds = fMCRec->fRegion->getBounds();
+ }
+ return !fMCRec->fRegion->isEmpty();
+}
+
const SkRegion& SkCanvas::getTotalClip() const {
return *fMCRec->fRegion;
}