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

Unified Diff: src/core/SkPicturePlayback.cpp

Issue 12817011: Fixing SkPicture command pattern optimizations to make them work correctly with bounding box hierar… (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months 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/SkBBoxHierarchyRecord.cpp ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicturePlayback.cpp
===================================================================
--- src/core/SkPicturePlayback.cpp (revision 8135)
+++ src/core/SkPicturePlayback.cpp (working copy)
@@ -715,23 +715,34 @@
size_t curOffset = reader.offset();
uint32_t size;
DrawType op = read_op_and_size(&reader, &size);
- if (NOOP == op) {
+ size_t skipTo = 0;
+#ifdef SK_DEVELOPER
+ // TODO: once chunk sizes are in all .skps just use
+ // "curOffset + size"
+ skipTo = this->preDraw(curOffset, op);
+#endif
+ if (0 == skipTo && NOOP == op) {
// NOOPs are to be ignored - do not propagate them any further
- reader.setOffset(curOffset+size);
- continue;
+ skipTo = curOffset + size;
}
-#ifdef SK_DEVELOPER
- // TODO: once chunk sizes are in all .skps just use "curOffset + size"
- size_t skipTo = this->preDraw(curOffset, op);
if (0 != skipTo) {
+ if (it.isValid()) {
+ // If using a bounding box hierarchy, advance the state tree
+ // iterator until at or after skipTo
+ uint32_t adjustedSkipTo;
+ do {
+ adjustedSkipTo = it.draw();
+ } while (adjustedSkipTo < skipTo);
+ skipTo = adjustedSkipTo;
+ }
if (kDrawComplete == skipTo) {
break;
}
reader.setOffset(skipTo);
continue;
}
-#endif
+
switch (op) {
case CLIP_PATH: {
const SkPath& path = getPath(reader);
« no previous file with comments | « src/core/SkBBoxHierarchyRecord.cpp ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698