From 7f69144aaabbedf51ad2a1feddc9e0689f2c5ee9 Mon Sep 17 00:00:00 2001 From: msarett Date: Tue, 22 Sep 2015 11:56:16 -0700 Subject: Add nanobench tests for BitmapRegionDecoder SkBitmapRegionDecoderInterface provides an interface for multiple implementations of Android's BitmapRegionDecoder. We already have correctness tests in DM that will enable us to compare the quality of our various BRD implementations. We also need these performance tests to compare the speed of our various implementations. BUG=skia:4357 Review URL: https://codereview.chromium.org/1344993003 --- bench/CodecBench.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'bench/CodecBench.cpp') diff --git a/bench/CodecBench.cpp b/bench/CodecBench.cpp index 1e6b5207bf..a21aae1f0b 100644 --- a/bench/CodecBench.cpp +++ b/bench/CodecBench.cpp @@ -6,6 +6,7 @@ */ #include "CodecBench.h" +#include "CodecBenchPriv.h" #include "SkBitmap.h" #include "SkCodec.h" #include "SkOSFile.h" @@ -15,21 +16,7 @@ CodecBench::CodecBench(SkString baseName, SkData* encoded, SkColorType colorType , fData(SkRef(encoded)) { // Parse filename and the color type to give the benchmark a useful name - const char* colorName; - switch(colorType) { - case kN32_SkColorType: - colorName = "N32"; - break; - case kRGB_565_SkColorType: - colorName = "565"; - break; - case kAlpha_8_SkColorType: - colorName = "Alpha8"; - break; - default: - colorName = "Unknown"; - } - fName.printf("Codec_%s_%s", baseName.c_str(), colorName); + fName.printf("Codec_%s_%s", baseName.c_str(), color_type_to_str(colorType)); #ifdef SK_DEBUG // Ensure that we can create an SkCodec from this data. SkAutoTDelete codec(SkCodec::NewFromData(fData)); -- cgit v1.2.3