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

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

Issue 273643007: Convert all SkRecordPattern matchers into SkRecord mutators. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: dumper too 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 | « src/record/SkRecordDraw.cpp ('k') | src/record/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 "SkRecordOpts.h" 8 #include "SkRecordOpts.h"
9 9
10 #include "SkRecordPattern.h" 10 #include "SkRecordPattern.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 SkASSERT(fIndex > push.index); 257 SkASSERT(fIndex > push.index);
258 unsigned skip = fIndex - push.index; 258 unsigned skip = fIndex - push.index;
259 259
260 Adopted<PushCull> adopted(push.command); 260 Adopted<PushCull> adopted(push.command);
261 SkNEW_PLACEMENT_ARGS(fRecord->replace<PairedPushCull>(push.index, adopte d), 261 SkNEW_PLACEMENT_ARGS(fRecord->replace<PairedPushCull>(push.index, adopte d),
262 PairedPushCull, (&adopted, skip)); 262 PairedPushCull, (&adopted, skip));
263 } 263 }
264 264
265 void apply(SkRecord* record) { 265 void apply(SkRecord* record) {
266 for (fRecord = record, fIndex = 0; fIndex < record->count(); fIndex++) { 266 for (fRecord = record, fIndex = 0; fIndex < record->count(); fIndex++) {
267 fRecord->mutate(fIndex, *this); 267 fRecord->mutate<void>(fIndex, *this);
268 } 268 }
269 } 269 }
270 270
271 private: 271 private:
272 struct Pair { 272 struct Pair {
273 unsigned index; 273 unsigned index;
274 PushCull* command; 274 PushCull* command;
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 | « src/record/SkRecordDraw.cpp ('k') | src/record/SkRecordPattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698