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

Unified Diff: src/core/SkPicturePlayback.cpp

Issue 15746003: Remove offsetcanvas from debugger (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review issues Created 7 years, 7 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/SkPicturePlayback.h ('k') | no next file » | 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 9244)
+++ src/core/SkPicturePlayback.cpp (working copy)
@@ -625,11 +625,11 @@
#endif
#ifdef SK_DEVELOPER
-size_t SkPicturePlayback::preDraw(size_t offset, int type) {
- return 0;
+bool SkPicturePlayback::preDraw(int opIndex, int type) {
+ return false;
}
-void SkPicturePlayback::postDraw(size_t offset) {
+void SkPicturePlayback::postDraw(int opIndex) {
}
#endif
@@ -712,6 +712,10 @@
fAbortCurrentPlayback = false;
#endif
+#ifdef SK_DEVELOPER
+ int opIndex = -1;
+#endif
+
while (!reader.eof()) {
if (callback && callback->abortDrawing()) {
canvas.restoreToCount(originalSaveCount);
@@ -727,14 +731,16 @@
uint32_t size;
DrawType op = read_op_and_size(&reader, &size);
size_t skipTo = 0;
+ if (NOOP == op) {
+ // NOOPs are to be ignored - do not propagate them any further
+ skipTo = curOffset + size;
#ifdef SK_DEVELOPER
- // TODO: once chunk sizes are in all .skps just use
- // "curOffset + size"
- skipTo = this->preDraw(curOffset, op);
+ } else {
+ opIndex++;
+ if (this->preDraw(opIndex, op)) {
+ skipTo = curOffset + size;
+ }
#endif
- if (0 == skipTo && NOOP == op) {
- // NOOPs are to be ignored - do not propagate them any further
- skipTo = curOffset + size;
}
if (0 != skipTo) {
@@ -1023,7 +1029,7 @@
}
#ifdef SK_DEVELOPER
- this->postDraw(curOffset);
+ this->postDraw(opIndex);
#endif
if (it.isValid()) {
« no previous file with comments | « src/core/SkPicturePlayback.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698