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" |
11 #include "SkRecords.h" | 11 #include "SkRecords.h" |
12 #include "SkTDArray.h" | 12 #include "SkTDArray.h" |
13 | 13 |
14 using namespace SkRecords; | 14 using namespace SkRecords; |
15 | 15 |
16 void SkRecordOptimize(SkRecord* record) { | 16 void SkRecordOptimize(SkRecord* record) { |
17 // TODO(mtklein): fuse independent optimizations to reduce number of passes? | 17 // TODO(mtklein): fuse independent optimizations to reduce number of passes? |
18 SkRecordNoopCulls(record); | 18 SkRecordNoopCulls(record); |
19 SkRecordNoopSaveRestores(record); | 19 SkRecordNoopSaveRestores(record); |
20 SkRecordNoopSaveLayerDrawRestores(record); | 20 // TODO(mtklein): figure out why we draw differently and reenable |
| 21 //SkRecordNoopSaveLayerDrawRestores(record); |
21 | 22 |
22 SkRecordAnnotateCullingPairs(record); | 23 SkRecordAnnotateCullingPairs(record); |
23 SkRecordReduceDrawPosTextStrength(record); // Helpful to run this before Bo
undDrawPosTextH. | 24 SkRecordReduceDrawPosTextStrength(record); // Helpful to run this before Bo
undDrawPosTextH. |
24 SkRecordBoundDrawPosTextH(record); | 25 SkRecordBoundDrawPosTextH(record); |
25 } | 26 } |
26 | 27 |
27 // Most of the optimizations in this file are pattern-based. These are all defi
ned as structs with: | 28 // Most of the optimizations in this file are pattern-based. These are all defi
ned as structs with: |
28 // - a Pattern typedef | 29 // - a Pattern typedef |
29 // - a bool onMatch(SkRceord*, Pattern*, unsigned begin, unsigned end) method, | 30 // - a bool onMatch(SkRceord*, Pattern*, unsigned begin, unsigned end) method, |
30 // which returns true if it made changes and false if not. | 31 // which returns true if it made changes and false if not. |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 }; | 293 }; |
293 | 294 |
294 SkTDArray<Pair> fPushStack; | 295 SkTDArray<Pair> fPushStack; |
295 SkRecord* fRecord; | 296 SkRecord* fRecord; |
296 unsigned fIndex; | 297 unsigned fIndex; |
297 }; | 298 }; |
298 void SkRecordAnnotateCullingPairs(SkRecord* record) { | 299 void SkRecordAnnotateCullingPairs(SkRecord* record) { |
299 CullAnnotator pass; | 300 CullAnnotator pass; |
300 pass.apply(record); | 301 pass.apply(record); |
301 } | 302 } |
OLD | NEW |