Chromium Code Reviews| Index: bench/CodecBench.cpp |
| diff --git a/bench/CodecBench.cpp b/bench/CodecBench.cpp |
| index 1384480f43e96ae6bda1e49a0777e2e1e1825dd4..66831fb24c6bc16b9696c5951a291f92e09f87e6 100644 |
| --- a/bench/CodecBench.cpp |
| +++ b/bench/CodecBench.cpp |
| @@ -11,12 +11,15 @@ |
| #include "SkCodec.h" |
| #include "SkOSFile.h" |
| -CodecBench::CodecBench(SkString baseName, SkData* encoded, SkColorType colorType) |
| +CodecBench::CodecBench(SkString baseName, SkData* encoded, SkColorType colorType, |
| + SkAlphaType alphaType) |
| : fColorType(colorType) |
| + , fAlphaType(alphaType) |
| , fData(SkRef(encoded)) |
| { |
| // Parse filename and the color type to give the benchmark a useful name |
| - fName.printf("Codec_%s_%s", baseName.c_str(), color_type_to_str(colorType)); |
| + fName.printf("Codec_%s_%s%s", baseName.c_str(), color_type_to_str(colorType), |
|
scroggo
2016/01/07 20:41:18
So for a premul, the name will be something like
msarett
2016/01/07 21:00:55
Yeah it's actually:
N32Premul
N32Unpremul
Index8Pr
|
| + alpha_type_to_str(alphaType)); |
| #ifdef SK_DEBUG |
| // Ensure that we can create an SkCodec from this data. |
| SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fData)); |
| @@ -35,15 +38,7 @@ bool CodecBench::isSuitableFor(Backend backend) { |
| void CodecBench::onDelayedSetup() { |
| SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fData)); |
| - fInfo = codec->getInfo().makeColorType(fColorType); |
| - SkAlphaType alphaType; |
| - // Caller should not have created this CodecBench if the alpha type was |
| - // invalid. |
| - SkAssertResult(SkColorTypeValidateAlphaType(fColorType, fInfo.alphaType(), |
| - &alphaType)); |
| - if (alphaType != fInfo.alphaType()) { |
| - fInfo = fInfo.makeAlphaType(alphaType); |
| - } |
| + fInfo = codec->getInfo().makeColorType(fColorType).makeAlphaType(fAlphaType); |
| fPixelStorage.reset(fInfo.getSafeSize(fInfo.minRowBytes())); |
| } |