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): rebaseline and re-enable | 17 SkRecordNoopSaveLayerDrawRestores(record); |
18 //SkRecordNoopSaveLayerDrawRestores(record); | |
19 SkRecordNoopSaveRestores(record); | 18 SkRecordNoopSaveRestores(record); |
20 SkRecordReduceDrawPosTextStrength(record); | 19 SkRecordReduceDrawPosTextStrength(record); |
21 } | 20 } |
22 | 21 |
23 // Most of the optimizations in this file are pattern-based. These are all defi
ned as structs with: | 22 // Most of the optimizations in this file are pattern-based. These are all defi
ned as structs with: |
24 // - a Pattern typedef | 23 // - a Pattern typedef |
25 // - a bool onMatch(SkRceord*, Pattern*, unsigned begin, unsigned end) method, | 24 // - a bool onMatch(SkRceord*, Pattern*, unsigned begin, unsigned end) method, |
26 // which returns true if it made changes and false if not. | 25 // which returns true if it made changes and false if not. |
27 | 26 |
28 // Run a pattern-based optimization once across the SkRecord, returning true if
it made any changes. | 27 // Run a pattern-based optimization once across the SkRecord, returning true if
it made any changes. |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 DrawPosTextH, | 182 DrawPosTextH, |
184 (draw->paint, draw->text, draw->byteLength, scalars
, firstY)); | 183 (draw->paint, draw->text, draw->byteLength, scalars
, firstY)); |
185 return true; | 184 return true; |
186 } | 185 } |
187 }; | 186 }; |
188 void SkRecordReduceDrawPosTextStrength(SkRecord* record) { | 187 void SkRecordReduceDrawPosTextStrength(SkRecord* record) { |
189 StrengthReducer pass; | 188 StrengthReducer pass; |
190 apply(&pass, record); | 189 apply(&pass, record); |
191 } | 190 } |
192 | 191 |
OLD | NEW |