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

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

Issue 1224783002: add matrix options to drawDrawable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: modify gm Created 5 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
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 DRAW(DrawAtlas, drawAtlas(r.atlas, r.xforms, r.texs, r.colors, r.count, r.mode, r.cull, r.paint)); 117 DRAW(DrawAtlas, drawAtlas(r.atlas, r.xforms, r.texs, r.colors, r.count, r.mode, r.cull, r.paint));
118 DRAW(DrawVertices, drawVertices(r.vmode, r.vertexCount, r.vertices, r.texs, r.co lors, 118 DRAW(DrawVertices, drawVertices(r.vmode, r.vertexCount, r.vertices, r.texs, r.co lors,
119 r.xmode.get(), r.indices, r.indexCount, r.paint) ); 119 r.xmode.get(), r.indices, r.indexCount, r.paint) );
120 #undef DRAW 120 #undef DRAW
121 121
122 template <> void Draw::draw(const DrawDrawable& r) { 122 template <> void Draw::draw(const DrawDrawable& r) {
123 SkASSERT(r.index >= 0); 123 SkASSERT(r.index >= 0);
124 SkASSERT(r.index < fDrawableCount); 124 SkASSERT(r.index < fDrawableCount);
125 if (fDrawables) { 125 if (fDrawables) {
126 SkASSERT(NULL == fDrawablePicts); 126 SkASSERT(NULL == fDrawablePicts);
127 fCanvas->drawDrawable(fDrawables[r.index]); 127 fCanvas->drawDrawable(fDrawables[r.index], r.matrix);
128 } else { 128 } else {
129 fCanvas->drawPicture(fDrawablePicts[r.index]); 129 fCanvas->drawPicture(fDrawablePicts[r.index], r.matrix, NULL);
130 } 130 }
131 } 131 }
132 132
133 // This is an SkRecord visitor that fills an SkBBoxHierarchy. 133 // This is an SkRecord visitor that fills an SkBBoxHierarchy.
134 // 134 //
135 // The interesting part here is how to calculate bounds for ops which don't 135 // The interesting part here is how to calculate bounds for ops which don't
136 // have intrinsic bounds. What is the bounds of a Save or a Translate? 136 // have intrinsic bounds. What is the bounds of a Save or a Translate?
137 // 137 //
138 // We answer this by thinking about a particular definition of bounds: if I 138 // We answer this by thinking about a particular definition of bounds: if I
139 // don't execute this op, pixels in this rectangle might draw incorrectly. So 139 // don't execute this op, pixels in this rectangle might draw incorrectly. So
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); 809 SkRecords::CollectLayers visitor(cullRect, record, pictList, data);
810 810
811 for (unsigned curOp = 0; curOp < record.count(); curOp++) { 811 for (unsigned curOp = 0; curOp < record.count(); curOp++) {
812 visitor.setCurrentOp(curOp); 812 visitor.setCurrentOp(curOp);
813 record.visit<void>(curOp, visitor); 813 record.visit<void>(curOp, visitor);
814 } 814 }
815 815
816 visitor.cleanUp(bbh); 816 visitor.cleanUp(bbh);
817 } 817 }
818 818
OLDNEW
« no previous file with comments | « src/core/SkDrawable.cpp ('k') | src/core/SkRecorder.h » ('j') | src/core/SkRecords.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698