| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 apply(&pass, record); | 269 apply(&pass, record); |
| 270 } | 270 } |
| 271 | 271 |
| 272 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 272 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 273 | 273 |
| 274 void SkRecordOptimize(SkRecord* record) { | 274 void SkRecordOptimize(SkRecord* record) { |
| 275 // This might be useful as a first pass in the future if we want to weed | 275 // This might be useful as a first pass in the future if we want to weed |
| 276 // out junk for other optimization passes. Right now, nothing needs it, | 276 // out junk for other optimization passes. Right now, nothing needs it, |
| 277 // and the bounding box hierarchy will do the work of skipping no-op | 277 // and the bounding box hierarchy will do the work of skipping no-op |
| 278 // Save-NoDraw-Restore sequences better than we can here. | 278 // Save-NoDraw-Restore sequences better than we can here. |
| 279 SkRecordNoopSaveRestores(record); | 279 // As there is a known problem with this peephole and drawAnnotation, disabl
e this. |
| 280 // If we want to enable this we must first fix this bug: |
| 281 // https://bugs.chromium.org/p/skia/issues/detail?id=5548 |
| 282 // SkRecordNoopSaveRestores(record); |
| 280 | 283 |
| 281 SkRecordNoopSaveLayerDrawRestores(record); | 284 SkRecordNoopSaveLayerDrawRestores(record); |
| 282 SkRecordMergeSvgOpacityAndFilterLayers(record); | 285 SkRecordMergeSvgOpacityAndFilterLayers(record); |
| 283 | 286 |
| 284 record->defrag(); | 287 record->defrag(); |
| 285 } | 288 } |
| 286 | 289 |
| 287 void SkRecordOptimize2(SkRecord* record) { | 290 void SkRecordOptimize2(SkRecord* record) { |
| 288 multiple_set_matrices(record); | 291 multiple_set_matrices(record); |
| 289 SkRecordNoopSaveRestores(record); | 292 SkRecordNoopSaveRestores(record); |
| 290 SkRecordNoopSaveLayerDrawRestores(record); | 293 SkRecordNoopSaveLayerDrawRestores(record); |
| 291 SkRecordMergeSvgOpacityAndFilterLayers(record); | 294 SkRecordMergeSvgOpacityAndFilterLayers(record); |
| 292 | 295 |
| 293 record->defrag(); | 296 record->defrag(); |
| 294 } | 297 } |
| OLD | NEW |