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 #include "SkBenchmark.h" | 8 #include "SkBenchmark.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkFontHost.h" | 10 #include "SkFontHost.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 if (SK_ColorBLACK != fPaint.getColor()) { | 87 if (SK_ColorBLACK != fPaint.getColor()) { |
88 fName.appendf("_%02X", fPaint.getAlpha()); | 88 fName.appendf("_%02X", fPaint.getAlpha()); |
89 } else { | 89 } else { |
90 fName.append("_BK"); | 90 fName.append("_BK"); |
91 } | 91 } |
92 return fName.c_str(); | 92 return fName.c_str(); |
93 } | 93 } |
94 | 94 |
95 virtual void onDraw(SkCanvas* canvas) { | 95 virtual void onDraw(SkCanvas* canvas) { |
96 const SkIPoint dim = this->getSize(); | 96 const SkIPoint dim = this->getSize(); |
97 SkMWCRandom rand; | 97 SkRandom rand; |
98 | 98 |
99 SkPaint paint(fPaint); | 99 SkPaint paint(fPaint); |
100 this->setupPaint(&paint); | 100 this->setupPaint(&paint); |
101 // explicitly need these | 101 // explicitly need these |
102 paint.setColor(fPaint.getColor()); | 102 paint.setColor(fPaint.getColor()); |
103 paint.setAntiAlias(kBW != fFQ); | 103 paint.setAntiAlias(kBW != fFQ); |
104 paint.setLCDRenderText(kLCD == fFQ); | 104 paint.setLCDRenderText(kLCD == fFQ); |
105 | 105 |
106 const SkScalar x0 = SkIntToScalar(-10); | 106 const SkScalar x0 = SkIntToScalar(-10); |
107 const SkScalar y0 = SkIntToScalar(-10); | 107 const SkScalar y0 = SkIntToScalar(-10); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 static BenchRegistry gReg11(Fact11); | 152 static BenchRegistry gReg11(Fact11); |
153 static BenchRegistry gReg12(Fact12); | 153 static BenchRegistry gReg12(Fact12); |
154 static BenchRegistry gReg13(Fact13); | 154 static BenchRegistry gReg13(Fact13); |
155 | 155 |
156 static BenchRegistry gReg21(Fact21); | 156 static BenchRegistry gReg21(Fact21); |
157 static BenchRegistry gReg22(Fact22); | 157 static BenchRegistry gReg22(Fact22); |
158 static BenchRegistry gReg23(Fact23); | 158 static BenchRegistry gReg23(Fact23); |
159 | 159 |
160 static BenchRegistry gReg111(Fact111); | 160 static BenchRegistry gReg111(Fact111); |
OLD | NEW |