Index: src/core/SkPicture.cpp |
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp |
index ab00000de411a3efc663e0cd34c8e16ed381a641..aad4725634211f563945a1bf1b7043645ca9d7e3 100644 |
--- a/src/core/SkPicture.cpp |
+++ b/src/core/SkPicture.cpp |
@@ -197,12 +197,18 @@ void SkPicture::draw(SkCanvas* canvas, SkDrawPictureCallback* callback) const { |
SkASSERT(NULL != canvas); |
SkASSERT(NULL != fData.get() || NULL != fRecord.get()); |
+ // If the query contains the whole picture, don't bother with the BBH. |
+ SkRect clipBounds = { 0, 0, 0, 0 }; |
+ (void)canvas->getClipBounds(&clipBounds); |
+ const bool useBBH = !clipBounds.contains(SkRect::MakeWH(this->width(), this->height())); |
+ |
if (NULL != fData.get()) { |
SkPicturePlayback playback(this); |
+ playback.setUseBBH(useBBH); |
playback.draw(canvas, callback); |
} |
if (NULL != fRecord.get()) { |
- SkRecordDraw(*fRecord, canvas, fBBH.get(), callback); |
+ SkRecordDraw(*fRecord, canvas, useBBH ? fBBH.get() : NULL, callback); |
} |
} |