diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkPicture.cpp | 1 | ||||
-rw-r--r-- | src/core/SkPictureRecord.cpp | 8 | ||||
-rw-r--r-- | src/core/SkPictureRecord.h | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp index 350784577a..58098e7bfc 100644 --- a/src/core/SkPicture.cpp +++ b/src/core/SkPicture.cpp @@ -180,6 +180,7 @@ SkCanvas* SkPicture::getRecordingCanvas() const { void SkPicture::endRecording() { if (NULL == fPlayback) { if (NULL != fRecord) { + fRecord->endRecording(); fPlayback = SkNEW_ARGS(SkPicturePlayback, (*fRecord)); fRecord->unref(); fRecord = NULL; diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp index f961bc4c62..630a1bb649 100644 --- a/src/core/SkPictureRecord.cpp +++ b/src/core/SkPictureRecord.cpp @@ -170,6 +170,14 @@ void SkPictureRecord::fillRestoreOffsetPlaceholdersForCurrentStackLevel( } } +void SkPictureRecord::endRecording() { + // clear any remaining unhandled restore offset placeholders + while (fRestoreOffsetStack.count()) { + this->fillRestoreOffsetPlaceholdersForCurrentStackLevel(0); + fRestoreOffsetStack.pop(); + } +} + void SkPictureRecord::recordRestoreOffsetPlaceholder(SkRegion::Op op) { if (regionOpExpands(op)) { // Run back through any previous clip ops, and mark their offset to diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h index 7e5f086c7b..c970696f18 100644 --- a/src/core/SkPictureRecord.h +++ b/src/core/SkPictureRecord.h @@ -95,6 +95,8 @@ public: } bool shouldFlattenPixels(const SkBitmap&) const; + + void endRecording(); private: struct PixelRefDictionaryEntry { uint32_t fKey; // SkPixelRef GenerationID. |