| 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 "SkRecordCulling.h" | 8 #include "SkRecordOpts.h" |
| 9 | 9 |
| 10 #include "SkRecords.h" | 10 #include "SkRecords.h" |
| 11 #include "SkTDArray.h" | 11 #include "SkTDArray.h" |
| 12 | 12 |
| 13 void SkRecordOptimize(SkRecord* record) { |
| 14 SkRecordAnnotateCullingPairs(record); |
| 15 } |
| 16 |
| 13 namespace { | 17 namespace { |
| 14 | 18 |
| 15 struct Annotator { | 19 struct Annotator { |
| 16 unsigned index; | 20 unsigned index; |
| 17 SkTDArray<SkRecords::PushCull*> pushStack; | 21 SkTDArray<SkRecords::PushCull*> pushStack; |
| 18 | 22 |
| 19 // Do nothing to most record types. | 23 // Do nothing to most record types. |
| 20 template <typename T> void operator()(T*) {} | 24 template <typename T> void operator()(T*) {} |
| 21 }; | 25 }; |
| 22 | 26 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 36 | 40 |
| 37 } // namespace | 41 } // namespace |
| 38 | 42 |
| 39 void SkRecordAnnotateCullingPairs(SkRecord* record) { | 43 void SkRecordAnnotateCullingPairs(SkRecord* record) { |
| 40 Annotator annotator; | 44 Annotator annotator; |
| 41 | 45 |
| 42 for (annotator.index = 0; annotator.index < record->count(); annotator.index
++) { | 46 for (annotator.index = 0; annotator.index < record->count(); annotator.index
++) { |
| 43 record->mutate(annotator.index, annotator); | 47 record->mutate(annotator.index, annotator); |
| 44 } | 48 } |
| 45 } | 49 } |
| OLD | NEW |