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

Unified Diff: src/core/SkBBoxHierarchyRecord.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.h ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBBoxHierarchyRecord.cpp
===================================================================
--- src/core/SkBBoxHierarchyRecord.cpp (revision 8135)
+++ src/core/SkBBoxHierarchyRecord.cpp (working copy)
@@ -8,7 +8,6 @@
#include "SkBBoxHierarchyRecord.h"
#include "SkPictureStateTree.h"
-#include "SkBBoxHierarchy.h"
SkBBoxHierarchyRecord::SkBBoxHierarchyRecord(uint32_t recordFlags,
SkBBoxHierarchy* h,
@@ -17,6 +16,7 @@
fStateTree = SkNEW(SkPictureStateTree);
fBoundingHierarchy = h;
fBoundingHierarchy->ref();
+ fBoundingHierarchy->setClient(this);
}
void SkBBoxHierarchyRecord::handleBBox(const SkRect& bounds) {
@@ -103,3 +103,13 @@
fStateTree->appendClip(this->writeStream().size());
return INHERITED::clipRRect(rrect, op, doAntiAlias);
}
+
+bool SkBBoxHierarchyRecord::shouldRewind(void* data) {
+ // SkBBoxHierarchy::rewindInserts is called by SkPicture after the
+ // SkPicture has rewound its command stream. To match that rewind in the
+ // BBH, we rewind all draws that reference commands that were recorded
+ // past the point to which the SkPicture has rewound, which is given by
+ // writeStream().size().
+ SkPictureStateTree::Draw* draw = static_cast<SkPictureStateTree::Draw*>(data);
+ return draw->fOffset >= writeStream().size();
+}
« no previous file with comments | « src/core/SkBBoxHierarchyRecord.h ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698