aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPicturePlayback.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-23 13:21:18 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-23 13:21:18 +0000
commit6d9c92b2f6e5be64dd5dd98e44d672877e4c9fbc (patch)
tree76a76894c1663efb26fbafa5aee352d7856dc71d /src/core/SkPicturePlayback.cpp
parent2d816ad36e806e5b1cf3c447e547829bbbe74fd1 (diff)
Remove offsetcanvas from debugger
Diffstat (limited to 'src/core/SkPicturePlayback.cpp')
-rw-r--r--src/core/SkPicturePlayback.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index e1c9a3a65f..e4f041f3bb 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -625,11 +625,11 @@ struct SkipClipRec {
#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 @@ void SkPicturePlayback::draw(SkCanvas& canvas, SkDrawPictureCallback* callback)
fAbortCurrentPlayback = false;
#endif
+#ifdef SK_DEVELOPER
+ int opIndex = -1;
+#endif
+
while (!reader.eof()) {
if (callback && callback->abortDrawing()) {
canvas.restoreToCount(originalSaveCount);
@@ -727,14 +731,16 @@ void SkPicturePlayback::draw(SkCanvas& canvas, SkDrawPictureCallback* callback)
uint32_t size;
DrawType op = read_op_and_size(&reader, &size);
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) {
+ if (NOOP == op) {
// NOOPs are to be ignored - do not propagate them any further
skipTo = curOffset + size;
+#ifdef SK_DEVELOPER
+ } else {
+ opIndex++;
+ if (this->preDraw(opIndex, op)) {
+ skipTo = curOffset + size;
+ }
+#endif
}
if (0 != skipTo) {
@@ -1023,7 +1029,7 @@ void SkPicturePlayback::draw(SkCanvas& canvas, SkDrawPictureCallback* callback)
}
#ifdef SK_DEVELOPER
- this->postDraw(curOffset);
+ this->postDraw(opIndex);
#endif
if (it.isValid()) {