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

Side by Side Diff: src/record/SkRecordOpts.cpp

Issue 272673002: Move paints to the front of draw structs. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 7 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 | « no previous file | src/record/SkRecorder.cpp » ('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 "SkRecordOpts.h" 8 #include "SkRecordOpts.h"
9 9
10 #include "SkRecordPattern.h" 10 #include "SkRecordPattern.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 SK_COMPILE_ASSERT(sizeof(SkPoint) == 2 * sizeof(SkScalar), SquintingIsNo tSafe); 180 SK_COMPILE_ASSERT(sizeof(SkPoint) == 2 * sizeof(SkScalar), SquintingIsNo tSafe);
181 SkScalar* scalars = &draw->pos[0].fX; 181 SkScalar* scalars = &draw->pos[0].fX;
182 for (unsigned i = 0; i < 2*points; i += 2) { 182 for (unsigned i = 0; i < 2*points; i += 2) {
183 scalars[i/2] = scalars[i]; 183 scalars[i/2] = scalars[i];
184 } 184 }
185 185
186 // Extend lifetime of draw to the end of the loop so we can copy its pai nt. 186 // Extend lifetime of draw to the end of the loop so we can copy its pai nt.
187 Adopted<DrawPosText> adopted(draw); 187 Adopted<DrawPosText> adopted(draw);
188 SkNEW_PLACEMENT_ARGS(record->replace<DrawPosTextH>(begin, adopted), 188 SkNEW_PLACEMENT_ARGS(record->replace<DrawPosTextH>(begin, adopted),
189 DrawPosTextH, 189 DrawPosTextH,
190 (draw->text, draw->byteLength, scalars, firstY, dra w->paint)); 190 (draw->paint, draw->text, draw->byteLength, scalars , firstY));
191 return true; 191 return true;
192 } 192 }
193 }; 193 };
194 void SkRecordReduceDrawPosTextStrength(SkRecord* record) { 194 void SkRecordReduceDrawPosTextStrength(SkRecord* record) {
195 StrengthReducer pass; 195 StrengthReducer pass;
196 apply(&pass, record); 196 apply(&pass, record);
197 } 197 }
198 198
199 // Tries to replace DrawPosTextH with BoundedDrawPosTextH, which knows conservat ive upper and lower 199 // Tries to replace DrawPosTextH with BoundedDrawPosTextH, which knows conservat ive upper and lower
200 // bounds to use with SkCanvas::quickRejectY. 200 // bounds to use with SkCanvas::quickRejectY.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 }; 275 };
276 276
277 SkTDArray<Pair> fPushStack; 277 SkTDArray<Pair> fPushStack;
278 SkRecord* fRecord; 278 SkRecord* fRecord;
279 unsigned fIndex; 279 unsigned fIndex;
280 }; 280 };
281 void SkRecordAnnotateCullingPairs(SkRecord* record) { 281 void SkRecordAnnotateCullingPairs(SkRecord* record) {
282 CullAnnotator pass; 282 CullAnnotator pass;
283 pass.apply(record); 283 pass.apply(record);
284 } 284 }
OLDNEW
« no previous file with comments | « no previous file | src/record/SkRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698