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

Side by Side Diff: bench/DecodeBench.cpp

Issue 99893003: Simplify benchmark internal API. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bench/DashBench.cpp ('k') | bench/DeferredCanvasBench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
(...skipping 22 matching lines...) Expand all
33 33
34 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE { 34 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE {
35 return backend == kNonRendering_Backend; 35 return backend == kNonRendering_Backend;
36 } 36 }
37 37
38 protected: 38 protected:
39 virtual const char* onGetName() { 39 virtual const char* onGetName() {
40 return fName.c_str(); 40 return fName.c_str();
41 } 41 }
42 42
43 virtual void onDraw(SkCanvas*) { 43 virtual void onDraw(const int loops, SkCanvas*) {
44 for (int i = 0; i < this->getLoops(); i++) { 44 for (int i = 0; i < loops; i++) {
45 SkBitmap bm; 45 SkBitmap bm;
46 SkImageDecoder::DecodeFile(FLAGS_decodeBenchFilename[0], 46 SkImageDecoder::DecodeFile(FLAGS_decodeBenchFilename[0],
47 &bm, 47 &bm,
48 fPrefConfig, 48 fPrefConfig,
49 SkImageDecoder::kDecodePixels_Mode); 49 SkImageDecoder::kDecodePixels_Mode);
50 } 50 }
51 } 51 }
52 52
53 private: 53 private:
54 typedef SkBenchmark INHERITED; 54 typedef SkBenchmark INHERITED;
55 }; 55 };
56 56
57 DEF_BENCH( return new DecodeBench(SkBitmap::kARGB_8888_Config); ) 57 DEF_BENCH( return new DecodeBench(SkBitmap::kARGB_8888_Config); )
58 DEF_BENCH( return new DecodeBench(SkBitmap::kRGB_565_Config); ) 58 DEF_BENCH( return new DecodeBench(SkBitmap::kRGB_565_Config); )
59 DEF_BENCH( return new DecodeBench(SkBitmap::kARGB_4444_Config); ) 59 DEF_BENCH( return new DecodeBench(SkBitmap::kARGB_4444_Config); )
OLDNEW
« no previous file with comments | « bench/DashBench.cpp ('k') | bench/DeferredCanvasBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698