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

Side by Side Diff: src/core/SkPictureRangePlayback.cpp

Issue 375943002: Fixed up SkTimedPicturePlayback (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPictureData.h" 9 #include "SkPictureData.h"
10 #include "SkPictureRangePlayback.h" 10 #include "SkPictureRangePlayback.h"
(...skipping 11 matching lines...) Expand all
22 SkASSERT(SAVE_LAYER == op); 22 SkASSERT(SAVE_LAYER == op);
23 reader.setOffset(fStart + size); 23 reader.setOffset(fStart + size);
24 } 24 }
25 25
26 // Record this, so we can concat w/ it if we encounter a setMatrix() 26 // Record this, so we can concat w/ it if we encounter a setMatrix()
27 SkMatrix initialMatrix = canvas->getTotalMatrix(); 27 SkMatrix initialMatrix = canvas->getTotalMatrix();
28 28
29 SkAutoCanvasRestore acr(canvas, false); 29 SkAutoCanvasRestore acr(canvas, false);
30 30
31 while (!reader.eof()) { 31 while (!reader.eof()) {
32 if (callback && callback->abortDrawing()) { 32 if (NULL != callback && callback->abortDrawing()) {
33 return; 33 return;
34 } 34 }
35 35
36 if (0 != fStart || 0 != fStop) { 36 if (0 != fStart || 0 != fStop) {
37 size_t offset = reader.offset(); 37 size_t offset = reader.offset();
38 if (offset >= fStop) { 38 if (offset >= fStop) {
39 SkDEBUGCODE(uint32_t size;) 39 SkDEBUGCODE(uint32_t size;)
40 SkDEBUGCODE(DrawType op = ReadOpAndSize(&reader, &size);) 40 SkDEBUGCODE(DrawType op = ReadOpAndSize(&reader, &size);)
41 SkASSERT(RESTORE == op); 41 SkASSERT(RESTORE == op);
42 return; 42 return;
43 } 43 }
44 } 44 }
45 45
46 fCurOffset = reader.offset(); 46 fCurOffset = reader.offset();
47 uint32_t size; 47 uint32_t size;
48 DrawType op = ReadOpAndSize(&reader, &size); 48 DrawType op = ReadOpAndSize(&reader, &size);
49 if (NOOP == op) { 49 if (NOOP == op) {
50 // NOOPs are to be ignored - do not propagate them any further 50 // NOOPs are to be ignored - do not propagate them any further
51 reader.setOffset(fCurOffset + size); 51 reader.setOffset(fCurOffset + size);
52 continue; 52 continue;
53 } 53 }
54 54
55 this->handleOp(&reader, op, size, canvas, initialMatrix); 55 this->handleOp(&reader, op, size, canvas, initialMatrix);
56 } 56 }
57 } 57 }
OLDNEW
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698