Chromium Code Reviews| Index: src/core/SkPicture.cpp |
| diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp |
| index ab00000de411a3efc663e0cd34c8e16ed381a641..631f7b0dc98561ad4125eb757fe51a7783cb949e 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; |
| + canvas->getClipBounds(&clipBounds); |
|
reed1
2014/08/18 18:48:44
If this returns false, clipBounds is undefined.
mtklein
2014/08/18 19:02:49
Done.
|
| + const bool useBBH = !clipBounds.contains(SkRect::MakeWH(this->width(), this->height())); |
|
reed1
2014/08/18 18:48:44
This will generate int->float warnings
mtklein
2014/08/18 19:02:49
Let's see?
|
| + |
| 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); |
| } |
| } |