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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 bool fDoColorEmoji; | 50 bool fDoColorEmoji; |
51 SkAutoTUnref<SkTypeface> fColorEmojiTypeface; | 51 SkAutoTUnref<SkTypeface> fColorEmojiTypeface; |
52 SkPoint* fPos; | 52 SkPoint* fPos; |
53 public: | 53 public: |
54 TextBench(const char text[], int ps, | 54 TextBench(const char text[], int ps, |
55 SkColor color, FontQuality fq, bool doColorEmoji = false, bool doP
os = false) | 55 SkColor color, FontQuality fq, bool doColorEmoji = false, bool doP
os = false) |
56 : fText(text) | 56 : fText(text) |
57 , fFQ(fq) | 57 , fFQ(fq) |
58 , fDoPos(doPos) | 58 , fDoPos(doPos) |
59 , fDoColorEmoji(doColorEmoji) | 59 , fDoColorEmoji(doColorEmoji) |
60 , fPos(NULL) { | 60 , fPos(nullptr) { |
61 fPaint.setAntiAlias(kBW != fq); | 61 fPaint.setAntiAlias(kBW != fq); |
62 fPaint.setLCDRenderText(kLCD == fq); | 62 fPaint.setLCDRenderText(kLCD == fq); |
63 fPaint.setTextSize(SkIntToScalar(ps)); | 63 fPaint.setTextSize(SkIntToScalar(ps)); |
64 fPaint.setColor(color); | 64 fPaint.setColor(color); |
65 } | 65 } |
66 | 66 |
67 virtual ~TextBench() { | 67 virtual ~TextBench() { |
68 delete[] fPos; | 68 delete[] fPos; |
69 } | 69 } |
70 | 70 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kLCD); ) | 169 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kLCD); ) |
170 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kLCD); ) | 170 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kLCD); ) |
171 | 171 |
172 DEF_BENCH( return new TextBench(STR, 16, 0xFFFFFFFF, kBW, true); ) | 172 DEF_BENCH( return new TextBench(STR, 16, 0xFFFFFFFF, kBW, true); ) |
173 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true); ) | 173 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true); ) |
174 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kBW, true); ) | 174 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kBW, true); ) |
175 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kBW, true); ) | 175 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kBW, true); ) |
176 | 176 |
177 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true, true); ) | 177 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true, true); ) |
178 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 |