Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: src/core/SkPictureRecord.cpp

Issue 767333002: Defer saves() until they're needed (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update tests Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | tests/PictureBBHTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureRecord.cpp
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 778abb5f978537dd1aa4bb1102c6e1af14e8e3e3..67c4229e3d43290881c7a311b36769611fb0e104 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -324,10 +324,13 @@ void SkPictureRecord::fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t
}
#ifdef SK_DEBUG
- // assert that the final offset value points to a save verb
- uint32_t opSize;
- DrawType drawOp = peek_op_and_size(&fWriter, -offset, &opSize);
- SkASSERT(SAVE == drawOp || SAVE_LAYER == drawOp);
+ // offset of 0 has been disabled, so we skip it
+ if (offset > 0) {
+ // assert that the final offset value points to a save verb
+ uint32_t opSize;
+ DrawType drawOp = peek_op_and_size(&fWriter, -offset, &opSize);
+ SkASSERT(SAVE == drawOp || SAVE_LAYER == drawOp);
+ }
#endif
}
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | tests/PictureBBHTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698