| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 SkScalar x = 0; | 83 SkScalar x = 0; |
| 84 for (size_t i = 0; i < len; ++i) { | 84 for (size_t i = 0; i < len; ++i) { |
| 85 fPos[i].set(x, SkIntToScalar(50)); | 85 fPos[i].set(x, SkIntToScalar(50)); |
| 86 x += adv[i]; | 86 x += adv[i]; |
| 87 } | 87 } |
| 88 delete[] adv; | 88 delete[] adv; |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 | 92 |
| 93 virtual const char* onGetName() { | 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.appendf("_%02X", fPaint.getAlpha()); | 100 fName.appendf("_%02X", fPaint.getAlpha()); |
| 101 } else { | 101 } else { |
| 102 fName.append("_BK"); | 102 fName.append("_BK"); |
| 103 } | 103 } |
| 104 | 104 |
| 105 if (fDoColorEmoji) { | 105 if (fDoColorEmoji) { |
| 106 fName.append("_ColorEmoji"); | 106 fName.append("_ColorEmoji"); |
| 107 } | 107 } |
| 108 | 108 |
| 109 return fName.c_str(); | 109 return fName.c_str(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 virtual void onDraw(const int loops, SkCanvas* canvas) { | 112 void onDraw(const int loops, SkCanvas* canvas) override { |
| 113 const SkIPoint dim = this->getSize(); | 113 const SkIPoint dim = this->getSize(); |
| 114 SkRandom rand; | 114 SkRandom rand; |
| 115 | 115 |
| 116 SkPaint paint(fPaint); | 116 SkPaint paint(fPaint); |
| 117 this->setupPaint(&paint); | 117 this->setupPaint(&paint); |
| 118 // explicitly need these | 118 // explicitly need these |
| 119 paint.setColor(fPaint.getColor()); | 119 paint.setColor(fPaint.getColor()); |
| 120 paint.setAntiAlias(kBW != fFQ); | 120 paint.setAntiAlias(kBW != fFQ); |
| 121 paint.setLCDRenderText(kLCD == fFQ); | 121 paint.setLCDRenderText(kLCD == fFQ); |
| 122 | 122 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kLCD); ) | 163 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kLCD); ) |
| 164 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kLCD); ) | 164 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kLCD); ) |
| 165 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kLCD); ) | 165 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kLCD); ) |
| 166 | 166 |
| 167 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true); ) | 167 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true); ) |
| 168 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kBW, true); ) | 168 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kBW, true); ) |
| 169 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kBW, true); ) | 169 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kBW, true); ) |
| 170 | 170 |
| 171 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true, true); ) | 171 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true, true); ) |
| 172 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kAA, false, true); ) | 172 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kAA, false, true); ) |
| OLD | NEW |