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 "SkColorShader.h" | 10 #include "SkColorShader.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 protected: | 52 protected: |
53 virtual const char* onGetName() { | 53 virtual const char* onGetName() { |
54 fName.printf("shadermask"); | 54 fName.printf("shadermask"); |
55 fName.appendf("_%s", fontQualityName(fPaint)); | 55 fName.appendf("_%s", fontQualityName(fPaint)); |
56 fName.appendf("_%02X", fPaint.getAlpha()); | 56 fName.appendf("_%02X", fPaint.getAlpha()); |
57 return fName.c_str(); | 57 return fName.c_str(); |
58 } | 58 } |
59 | 59 |
60 virtual void onDraw(SkCanvas* canvas) { | 60 virtual void onDraw(SkCanvas* canvas) { |
61 const SkIPoint dim = this->getSize(); | 61 const SkIPoint dim = this->getSize(); |
62 SkMWCRandom rand; | 62 SkRandom rand; |
63 | 63 |
64 SkPaint paint(fPaint); | 64 SkPaint paint(fPaint); |
65 this->setupPaint(&paint); | 65 this->setupPaint(&paint); |
66 // explicitly need these | 66 // explicitly need these |
67 paint.setAlpha(fPaint.getAlpha()); | 67 paint.setAlpha(fPaint.getAlpha()); |
68 paint.setAntiAlias(kBW != fFQ); | 68 paint.setAntiAlias(kBW != fFQ); |
69 paint.setLCDRenderText(kLCD == fFQ); | 69 paint.setLCDRenderText(kLCD == fFQ); |
70 | 70 |
71 const SkScalar x0 = SkIntToScalar(-10); | 71 const SkScalar x0 = SkIntToScalar(-10); |
72 const SkScalar y0 = SkIntToScalar(-10); | 72 const SkScalar y0 = SkIntToScalar(-10); |
(...skipping 25 matching lines...) Expand all Loading... |
98 static SkBenchmark* Fact11(void* p) { return new ShaderMaskBench(p, false, kAA);
} | 98 static SkBenchmark* Fact11(void* p) { return new ShaderMaskBench(p, false, kAA);
} |
99 static SkBenchmark* Fact20(void* p) { return new ShaderMaskBench(p, true, kLCD)
; } | 99 static SkBenchmark* Fact20(void* p) { return new ShaderMaskBench(p, true, kLCD)
; } |
100 static SkBenchmark* Fact21(void* p) { return new ShaderMaskBench(p, false, kLCD)
; } | 100 static SkBenchmark* Fact21(void* p) { return new ShaderMaskBench(p, false, kLCD)
; } |
101 | 101 |
102 static BenchRegistry gReg00(Fact00); | 102 static BenchRegistry gReg00(Fact00); |
103 static BenchRegistry gReg01(Fact01); | 103 static BenchRegistry gReg01(Fact01); |
104 static BenchRegistry gReg10(Fact10); | 104 static BenchRegistry gReg10(Fact10); |
105 static BenchRegistry gReg11(Fact11); | 105 static BenchRegistry gReg11(Fact11); |
106 static BenchRegistry gReg20(Fact20); | 106 static BenchRegistry gReg20(Fact20); |
107 static BenchRegistry gReg21(Fact21); | 107 static BenchRegistry gReg21(Fact21); |
OLD | NEW |