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

Side by Side Diff: src/core/SkRecordDraw.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/SkPictureRecord.cpp ('k') | src/core/SkRecorder.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 "SkLayerInfo.h" 8 #include "SkLayerInfo.h"
9 #include "SkRecordDraw.h" 9 #include "SkRecordDraw.h"
10 #include "SkPatchUtils.h" 10 #include "SkPatchUtils.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 DRAW(Save, save()); 80 DRAW(Save, save());
81 DRAW(SaveLayer, saveLayer(SkCanvas::SaveLayerRec(r.bounds, r.paint, r.backdrop, r.saveLayerFlags))); 81 DRAW(SaveLayer, saveLayer(SkCanvas::SaveLayerRec(r.bounds, r.paint, r.backdrop, r.saveLayerFlags)));
82 DRAW(SetMatrix, setMatrix(SkMatrix::Concat(fInitialCTM, r.matrix))); 82 DRAW(SetMatrix, setMatrix(SkMatrix::Concat(fInitialCTM, r.matrix)));
83 DRAW(Concat, concat(r.matrix)); 83 DRAW(Concat, concat(r.matrix));
84 84
85 DRAW(ClipPath, clipPath(r.path, r.opAA.op, r.opAA.aa)); 85 DRAW(ClipPath, clipPath(r.path, r.opAA.op, r.opAA.aa));
86 DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa)); 86 DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa));
87 DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa)); 87 DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa));
88 DRAW(ClipRegion, clipRegion(r.region, r.op)); 88 DRAW(ClipRegion, clipRegion(r.region, r.op));
89 89
90 DRAW(TranslateZ, SkCanvas::translateZ(r.z));
91
90 DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); 92 DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint));
91 DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.p aint)); 93 DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.p aint));
92 DRAW(DrawBitmapRect, 94 DRAW(DrawBitmapRect,
93 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, 95 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint,
94 SkCanvas::kStrict_SrcRectConstraint)); 96 SkCanvas::kStrict_SrcRectConstraint));
95 DRAW(DrawBitmapRectFast, 97 DRAW(DrawBitmapRectFast,
96 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, 98 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint,
97 SkCanvas::kFast_SrcRectConstraint)); 99 SkCanvas::kFast_SrcRectConstraint));
98 DRAW(DrawBitmapRectFixedSize, 100 DRAW(DrawBitmapRectFixedSize,
99 legacy_drawBitmapRect(r.bitmap.shallowCopy(), &r.src, r.dst, &r.paint, r .constraint)); 101 legacy_drawBitmapRect(r.bitmap.shallowCopy(), &r.src, r.dst, &r.paint, r .constraint));
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 void trackBounds(const SaveLayer& op) { this->pushSaveBlock(op.paint); } 282 void trackBounds(const SaveLayer& op) { this->pushSaveBlock(op.paint); }
281 void trackBounds(const Restore&) { fBounds[fCurrentOp] = this->popSaveBlock( ); } 283 void trackBounds(const Restore&) { fBounds[fCurrentOp] = this->popSaveBlock( ); }
282 284
283 void trackBounds(const SetMatrix&) { this->pushControl(); } 285 void trackBounds(const SetMatrix&) { this->pushControl(); }
284 void trackBounds(const Concat&) { this->pushControl(); } 286 void trackBounds(const Concat&) { this->pushControl(); }
285 void trackBounds(const ClipRect&) { this->pushControl(); } 287 void trackBounds(const ClipRect&) { this->pushControl(); }
286 void trackBounds(const ClipRRect&) { this->pushControl(); } 288 void trackBounds(const ClipRRect&) { this->pushControl(); }
287 void trackBounds(const ClipPath&) { this->pushControl(); } 289 void trackBounds(const ClipPath&) { this->pushControl(); }
288 void trackBounds(const ClipRegion&) { this->pushControl(); } 290 void trackBounds(const ClipRegion&) { this->pushControl(); }
289 291
292 void trackBounds(const TranslateZ&) { this->pushControl(); }
293
290 // For all other ops, we can calculate and store the bounds directly now. 294 // For all other ops, we can calculate and store the bounds directly now.
291 template <typename T> void trackBounds(const T& op) { 295 template <typename T> void trackBounds(const T& op) {
292 fBounds[fCurrentOp] = this->bounds(op); 296 fBounds[fCurrentOp] = this->bounds(op);
293 this->updateSaveBounds(fBounds[fCurrentOp]); 297 this->updateSaveBounds(fBounds[fCurrentOp]);
294 } 298 }
295 299
296 void pushSaveBlock(const SkPaint* paint) { 300 void pushSaveBlock(const SkPaint* paint) {
297 // Starting a new Save block. Push a new entry to represent that. 301 // Starting a new Save block. Push a new entry to represent that.
298 SaveBounds sb; 302 SaveBounds sb;
299 sb.controlOps = 0; 303 sb.controlOps = 0;
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 808
805 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, SkRec t bounds[], 809 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, SkRec t bounds[],
806 const SkBigPicture::SnapshotArray* pictList, SkLayerI nfo* data) { 810 const SkBigPicture::SnapshotArray* pictList, SkLayerI nfo* data) {
807 SkRecords::CollectLayers visitor(cullRect, record, bounds, pictList, data); 811 SkRecords::CollectLayers visitor(cullRect, record, bounds, pictList, data);
808 for (int curOp = 0; curOp < record.count(); curOp++) { 812 for (int curOp = 0; curOp < record.count(); curOp++) {
809 visitor.setCurrentOp(curOp); 813 visitor.setCurrentOp(curOp);
810 record.visit(curOp, visitor); 814 record.visit(curOp, visitor);
811 } 815 }
812 visitor.cleanUp(); 816 visitor.cleanUp();
813 } 817 }
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | src/core/SkRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698