OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "Benchmark.h" | 9 #include "Benchmark.h" |
10 #include "Resources.h" | 10 #include "Resources.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 | 92 |
93 const char* onGetName() override { | 93 const char* onGetName() override { |
94 fName.printf("text_%g", SkScalarToFloat(fPaint.getTextSize())); | 94 fName.printf("text_%g", SkScalarToFloat(fPaint.getTextSize())); |
95 if (fDoPos) { | 95 if (fDoPos) { |
96 fName.append("_pos"); | 96 fName.append("_pos"); |
97 } | 97 } |
98 fName.appendf("_%s", fontQualityName(fPaint)); | 98 fName.appendf("_%s", fontQualityName(fPaint)); |
99 if (SK_ColorBLACK != fPaint.getColor()) { | 99 if (SK_ColorBLACK == fPaint.getColor()) { |
| 100 fName.append("_BK"); |
| 101 } else if (SK_ColorWHITE == fPaint.getColor()) { |
| 102 fName.append("_WT"); |
| 103 } else { |
100 fName.appendf("_%02X", fPaint.getAlpha()); | 104 fName.appendf("_%02X", fPaint.getAlpha()); |
101 } else { | |
102 fName.append("_BK"); | |
103 } | 105 } |
104 | 106 |
105 if (fDoColorEmoji) { | 107 if (fDoColorEmoji) { |
106 fName.append("_ColorEmoji"); | 108 fName.append("_ColorEmoji"); |
107 } | 109 } |
108 | 110 |
109 return fName.c_str(); | 111 return fName.c_str(); |
110 } | 112 } |
111 | 113 |
112 void onDraw(const int loops, SkCanvas* canvas) override { | 114 void onDraw(const int loops, SkCanvas* canvas) override { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 147 } |
146 | 148 |
147 private: | 149 private: |
148 typedef Benchmark INHERITED; | 150 typedef Benchmark INHERITED; |
149 }; | 151 }; |
150 | 152 |
151 /////////////////////////////////////////////////////////////////////////////// | 153 /////////////////////////////////////////////////////////////////////////////// |
152 | 154 |
153 #define STR "Hamburgefons" | 155 #define STR "Hamburgefons" |
154 | 156 |
| 157 DEF_BENCH( return new TextBench(STR, 16, 0xFFFFFFFF, kBW); ) |
155 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW); ) | 158 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW); ) |
156 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kBW); ) | 159 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kBW); ) |
157 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kBW); ) | 160 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kBW); ) |
158 | 161 |
| 162 DEF_BENCH( return new TextBench(STR, 16, 0xFFFFFFFF, kAA); ) |
159 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kAA); ) | 163 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kAA); ) |
160 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kAA); ) | 164 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kAA); ) |
161 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kAA); ) | 165 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kAA); ) |
162 | 166 |
| 167 DEF_BENCH( return new TextBench(STR, 16, 0xFFFFFFFF, kLCD); ) |
163 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kLCD); ) | 168 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kLCD); ) |
164 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kLCD); ) | 169 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kLCD); ) |
165 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kLCD); ) | 170 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kLCD); ) |
166 | 171 |
| 172 DEF_BENCH( return new TextBench(STR, 16, 0xFFFFFFFF, kBW, true); ) |
167 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true); ) | 173 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true); ) |
168 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kBW, true); ) | 174 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kBW, true); ) |
169 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kBW, true); ) | 175 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kBW, true); ) |
170 | 176 |
171 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true, true); ) | 177 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true, true); ) |
172 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kAA, false, true); ) | 178 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kAA, false, true); ) |
OLD | NEW |