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

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

Issue 2127233002: Added the framework for having canvas/recorder/picture record depth_set's. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: updated tests to be more rigorous about translateZ in playback Created 4 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/SkPictureFlat.h ('k') | src/core/SkPictureRecord.h » ('j') | 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 "SkPatchUtils.h" 9 #include "SkPatchUtils.h"
10 #include "SkPictureData.h" 10 #include "SkPictureData.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 DrawType op, 122 DrawType op,
123 uint32_t size, 123 uint32_t size,
124 SkCanvas* canvas, 124 SkCanvas* canvas,
125 const SkMatrix& initialMatrix) { 125 const SkMatrix& initialMatrix) {
126 switch (op) { 126 switch (op) {
127 case NOOP: { 127 case NOOP: {
128 SkASSERT(size >= 4); 128 SkASSERT(size >= 4);
129 reader->skip(size - 4); 129 reader->skip(size - 4);
130 } break; 130 } break;
131 case CLIP_PATH: { 131 case CLIP_PATH: {
132 const SkPath& path = fPictureData->getPath(reader); 132 const SkPath& path = fPictureData->getPath(reader);
133 uint32_t packed = reader->readInt(); 133 uint32_t packed = reader->readInt();
134 SkRegion::Op regionOp = ClipParams_unpackRegionOp(packed); 134 SkRegion::Op regionOp = ClipParams_unpackRegionOp(packed);
135 bool doAA = ClipParams_unpackDoAA(packed); 135 bool doAA = ClipParams_unpackDoAA(packed);
136 size_t offsetToRestore = reader->readInt(); 136 size_t offsetToRestore = reader->readInt();
137 SkASSERT(!offsetToRestore || offsetToRestore >= reader->offset()); 137 SkASSERT(!offsetToRestore || offsetToRestore >= reader->offset());
138 canvas->clipPath(path, regionOp, doAA); 138 canvas->clipPath(path, regionOp, doAA);
139 if (canvas->isClipEmpty() && offsetToRestore) { 139 if (canvas->isClipEmpty() && offsetToRestore) {
140 reader->skip(offsetToRestore - reader->offset()); 140 reader->skip(offsetToRestore - reader->offset());
141 } 141 }
142 } break; 142 } break;
143 case CLIP_REGION: { 143 case CLIP_REGION: {
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 case SKEW: { 596 case SKEW: {
597 SkScalar sx = reader->readScalar(); 597 SkScalar sx = reader->readScalar();
598 SkScalar sy = reader->readScalar(); 598 SkScalar sy = reader->readScalar();
599 canvas->skew(sx, sy); 599 canvas->skew(sx, sy);
600 } break; 600 } break;
601 case TRANSLATE: { 601 case TRANSLATE: {
602 SkScalar dx = reader->readScalar(); 602 SkScalar dx = reader->readScalar();
603 SkScalar dy = reader->readScalar(); 603 SkScalar dy = reader->readScalar();
604 canvas->translate(dx, dy); 604 canvas->translate(dx, dy);
605 } break; 605 } break;
606 case TRANSLATE_Z: {
607 SkScalar dz = reader->readScalar();
608 canvas->translateZ(dz);
609 }
606 default: 610 default:
607 SkASSERTF(false, "Unknown draw type: %d", op); 611 SkASSERTF(false, "Unknown draw type: %d", op);
608 } 612 }
609 } 613 }
OLDNEW
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698