Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: src/core/SkRecordOpts.cpp

Issue 551853002: Turn on the save-layer optimization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkPicture.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/core/SkPicture.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698