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

Side by Side Diff: bench/ReadPixBench.cpp

Issue 23876006: Refactoring: get rid of the SkBenchmark void* parameter. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: sync to head Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bench/RTreeBench.cpp ('k') | bench/RectBench.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 2012 The Android Open Source Project 3 * Copyright 2012 The Android Open Source Project
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 8
9 #include "SkBenchmark.h" 9 #include "SkBenchmark.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 11
12 12
13 /** 13 /**
14 * This bench mark tests the use case where the user writes the a canvas 14 * This bench mark tests the use case where the user writes the a canvas
15 * and then reads small chunks from it repeatedly. This can cause trouble 15 * and then reads small chunks from it repeatedly. This can cause trouble
16 * for the GPU as readbacks are very expensive. 16 * for the GPU as readbacks are very expensive.
17 */ 17 */
18 class ReadPixBench : public SkBenchmark { 18 class ReadPixBench : public SkBenchmark {
19 public: 19 public:
20 ReadPixBench(void* param) : INHERITED(param) {} 20 ReadPixBench() {}
21 21
22 protected: 22 protected:
23 virtual const char* onGetName() SK_OVERRIDE { 23 virtual const char* onGetName() SK_OVERRIDE {
24 return "readpix"; 24 return "readpix";
25 } 25 }
26 26
27 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 27 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
28 canvas->clear(SK_ColorBLACK); 28 canvas->clear(SK_ColorBLACK);
29 29
30 SkISize size = canvas->getDeviceSize(); 30 SkISize size = canvas->getDeviceSize();
(...skipping 26 matching lines...) Expand all
57 private: 57 private:
58 static const int kNumStepsX = 30; 58 static const int kNumStepsX = 30;
59 static const int kNumStepsY = 30; 59 static const int kNumStepsY = 30;
60 static const int kWindowSize = 5; 60 static const int kWindowSize = 5;
61 61
62 typedef SkBenchmark INHERITED; 62 typedef SkBenchmark INHERITED;
63 }; 63 };
64 64
65 //////////////////////////////////////////////////////////////////////////////// 65 ////////////////////////////////////////////////////////////////////////////////
66 66
67 static SkBenchmark* fact(void* p) { return new ReadPixBench(p); } 67 DEF_BENCH( return new ReadPixBench(); )
68 static BenchRegistry gReg(fact);
OLDNEW
« no previous file with comments | « bench/RTreeBench.cpp ('k') | bench/RectBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698