Defer saves() until they're needed
patch from issue 759443006 at patchset 40001 (http://crrev.com/759443006#ps40001)
BUG=skia:
Review URL: https://codereview.chromium.org/767333002
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 778abb5..67c4229 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -324,10 +324,13 @@
}
#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
}