OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 if (fForceUpdate) { | 103 if (fForceUpdate) { |
104 fName.append("_update"); | 104 fName.append("_update"); |
105 } | 105 } |
106 if (fIsVolatile) { | 106 if (fIsVolatile) { |
107 fName.append("_volatile"); | 107 fName.append("_volatile"); |
108 } | 108 } |
109 | 109 |
110 return fName.c_str(); | 110 return fName.c_str(); |
111 } | 111 } |
112 | 112 |
113 void onPreDraw() override { | 113 void onDelayedSetup() override { |
114 SkBitmap bm; | 114 SkBitmap bm; |
115 | 115 |
116 if (kIndex_8_SkColorType == fColorType) { | 116 if (kIndex_8_SkColorType == fColorType) { |
117 bm.allocPixels(SkImageInfo::MakeN32(W, H, fAlphaType)); | 117 bm.allocPixels(SkImageInfo::MakeN32(W, H, fAlphaType)); |
118 } else { | 118 } else { |
119 bm.allocPixels(SkImageInfo::Make(W, H, fColorType, fAlphaType)); | 119 bm.allocPixels(SkImageInfo::Make(W, H, fColorType, fAlphaType)); |
120 } | 120 } |
121 bm.eraseColor(kOpaque_SkAlphaType == fAlphaType ? SK_ColorBLACK : 0); | 121 bm.eraseColor(kOpaque_SkAlphaType == fAlphaType ? SK_ColorBLACK : 0); |
122 | 122 |
123 this->onDrawIntoBitmap(bm); | 123 this->onDrawIntoBitmap(bm); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, t
rue, false, kScale_Flag | kRotate_Flag | kBilerp_Flag); ) | 381 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, t
rue, false, kScale_Flag | kRotate_Flag | kBilerp_Flag); ) |
382 | 382 |
383 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f
alse, false, kScale_Flag | kBilerp_Flag | kBicubic_Flag); ) | 383 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f
alse, false, kScale_Flag | kBilerp_Flag | kBicubic_Flag); ) |
384 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f
alse, false, kScale_Flag | kRotate_Flag | kBilerp_Flag | kBicubic_Flag); ) | 384 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f
alse, false, kScale_Flag | kRotate_Flag | kBilerp_Flag | kBicubic_Flag); ) |
385 | 385 |
386 // source alpha tests -> S32A_Opaque_BlitRow32_{arm,neon} | 386 // source alpha tests -> S32A_Opaque_BlitRow32_{arm,neon} |
387 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kOpaque_Sou
rceAlpha, kN32_SkColorType); ) | 387 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kOpaque_Sou
rceAlpha, kN32_SkColorType); ) |
388 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTransparen
t_SourceAlpha, kN32_SkColorType); ) | 388 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTransparen
t_SourceAlpha, kN32_SkColorType); ) |
389 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTwoStripes
_SourceAlpha, kN32_SkColorType); ) | 389 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTwoStripes
_SourceAlpha, kN32_SkColorType); ) |
390 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kThreeStrip
es_SourceAlpha, kN32_SkColorType); ) | 390 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kThreeStrip
es_SourceAlpha, kN32_SkColorType); ) |
OLD | NEW |