Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Unified Diff: bench/CodecBench.cpp

Issue 1344993003: Add nanobench tests for BitmapRegionDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/BitmapRegionDecoderBench.cpp ('k') | bench/CodecBenchPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/CodecBench.cpp
diff --git a/bench/CodecBench.cpp b/bench/CodecBench.cpp
index 1e6b5207bfcb1318fd38667aab6763dc4bdc225a..a21aae1f0b909b73d6ab148290fc99895ad6e44d 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));
« no previous file with comments | « bench/BitmapRegionDecoderBench.cpp ('k') | bench/CodecBenchPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698