OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |