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

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

Issue 1360943003: simplify code in SkRecords.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: another SaveLayer Created 5 years, 2 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/SkRecord.h ('k') | src/core/SkRecordPattern.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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); 109 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint));
110 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); 110 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint));
111 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); 111 DRAW(DrawRRect, drawRRect(r.rrect, r.paint));
112 DRAW(DrawRect, drawRect(r.rect, r.paint)); 112 DRAW(DrawRect, drawRect(r.rect, r.paint));
113 DRAW(DrawSprite, drawSprite(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); 113 DRAW(DrawSprite, drawSprite(r.bitmap.shallowCopy(), r.left, r.top, r.paint));
114 DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint)); 114 DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint));
115 DRAW(DrawTextBlob, drawTextBlob(r.blob, r.x, r.y, r.paint)); 115 DRAW(DrawTextBlob, drawTextBlob(r.blob, r.x, r.y, r.paint));
116 DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, &r.matrix, r.p aint)); 116 DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, &r.matrix, r.p aint));
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, 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(nullptr == fDrawablePicts); 126 SkASSERT(nullptr == fDrawablePicts);
127 fCanvas->drawDrawable(fDrawables[r.index], r.matrix); 127 fCanvas->drawDrawable(fDrawables[r.index], r.matrix);
128 } else { 128 } else {
129 fCanvas->drawPicture(fDrawablePicts[r.index], r.matrix, nullptr); 129 fCanvas->drawPicture(fDrawablePicts[r.index], r.matrix, nullptr);
(...skipping 679 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 (int curOp = 0; curOp < record.count(); curOp++) { 811 for (int 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/SkRecord.h ('k') | src/core/SkRecordPattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698