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

Unified Diff: bench/DecodeBench.cpp

Issue 918673002: Adding new benchmark to test image decoding performance. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added include Created 5 years, 10 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 | « no previous file | bench/DecodingBench.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/DecodeBench.cpp
diff --git a/bench/DecodeBench.cpp b/bench/DecodeBench.cpp
deleted file mode 100644
index 507a7d8e9274e6d86ad2d3ae55a39b6af7bb184e..0000000000000000000000000000000000000000
--- a/bench/DecodeBench.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#include "Benchmark.h"
-#include "SkBitmap.h"
-#include "SkCommandLineFlags.h"
-#include "SkImageDecoder.h"
-#include "SkOSFile.h"
-#include "SkString.h"
-#include "sk_tool_utils.h"
-
-DEFINE_string(decodeBenchFilename, "resources/CMYK.jpeg", "Path to image for DecodeBench.");
-
-class DecodeBench : public Benchmark {
- const SkColorType fPrefColorType;
- SkString fName;
-public:
- DecodeBench(SkColorType ct) : fPrefColorType(ct) {
- SkString fname = SkOSPath::Basename(FLAGS_decodeBenchFilename[0]);
- fName.printf("decode_%s_%s", sk_tool_utils::colortype_name(ct), fname.c_str());
- }
-
- bool isSuitableFor(Backend backend) SK_OVERRIDE {
- return backend == kNonRendering_Backend;
- }
-
-protected:
- virtual const char* onGetName() {
- return fName.c_str();
- }
-
- virtual void onDraw(const int loops, SkCanvas*) {
- for (int i = 0; i < loops; i++) {
- SkBitmap bm;
- SkImageDecoder::DecodeFile(FLAGS_decodeBenchFilename[0], &bm, fPrefColorType,
- SkImageDecoder::kDecodePixels_Mode);
- }
- }
-
-private:
- typedef Benchmark INHERITED;
-};
-
-DEF_BENCH( return new DecodeBench(kN32_SkColorType); )
-DEF_BENCH( return new DecodeBench(kRGB_565_SkColorType); )
-DEF_BENCH( return new DecodeBench(kARGB_4444_SkColorType); )
« no previous file with comments | « no previous file | bench/DecodingBench.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698