aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/CodecBench.cpp
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2015-09-22 11:56:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-22 11:56:16 -0700
commit7f69144aaabbedf51ad2a1feddc9e0689f2c5ee9 (patch)
tree9ed42dfc6bd44387571d5d5db61bbf7c23036675 /bench/CodecBench.cpp
parentcc334b36de5c4508266c322dfa44039d8156dc70 (diff)
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
Diffstat (limited to 'bench/CodecBench.cpp')
-rw-r--r--bench/CodecBench.cpp17
1 files changed, 2 insertions, 15 deletions
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<SkCodec> codec(SkCodec::NewFromData(fData));