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

Side by Side Diff: bench/DeferredCanvasBench.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/DecodeBench.cpp ('k') | bench/DeferredSurfaceCopyBench.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 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "SkBenchmark.h" 7 #include "SkBenchmark.h"
8 #include "SkDeferredCanvas.h" 8 #include "SkDeferredCanvas.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkString.h" 10 #include "SkString.h"
11 11
12 class DeferredCanvasBench : public SkBenchmark { 12 class DeferredCanvasBench : public SkBenchmark {
13 public: 13 public:
14 DeferredCanvasBench(void* param, const char name[]) : INHERITED(param) { 14 DeferredCanvasBench(const char name[]) {
15 fName.printf("deferred_canvas_%s", name); 15 fName.printf("deferred_canvas_%s", name);
16 } 16 }
17 17
18 enum { 18 enum {
19 CANVAS_WIDTH = 200, 19 CANVAS_WIDTH = 200,
20 CANVAS_HEIGHT = 200, 20 CANVAS_HEIGHT = 200,
21 }; 21 };
22 protected: 22 protected:
23 virtual const char* onGetName() { 23 virtual const char* onGetName() {
24 return fName.c_str(); 24 return fName.c_str();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 bool fDummy; 63 bool fDummy;
64 64
65 typedef SkDeferredCanvas::NotificationClient INHERITED; 65 typedef SkDeferredCanvas::NotificationClient INHERITED;
66 }; 66 };
67 67
68 // Test that records very simple draw operations. 68 // Test that records very simple draw operations.
69 // This benchmark aims to capture performance fluctuations in the recording 69 // This benchmark aims to capture performance fluctuations in the recording
70 // overhead of SkDeferredCanvas 70 // overhead of SkDeferredCanvas
71 class DeferredRecordBench : public DeferredCanvasBench { 71 class DeferredRecordBench : public DeferredCanvasBench {
72 public: 72 public:
73 DeferredRecordBench(void* param) 73 DeferredRecordBench()
74 : INHERITED(param, "record") { 74 : INHERITED("record") {
75 } 75 }
76 76
77 protected: 77 protected:
78 78
79 virtual void initDeferredCanvas(SkDeferredCanvas* canvas) SK_OVERRIDE { 79 virtual void initDeferredCanvas(SkDeferredCanvas* canvas) SK_OVERRIDE {
80 canvas->setNotificationClient(&fNotificationClient); 80 canvas->setNotificationClient(&fNotificationClient);
81 } 81 }
82 82
83 virtual void drawInDeferredCanvas(SkDeferredCanvas* canvas) SK_OVERRIDE { 83 virtual void drawInDeferredCanvas(SkDeferredCanvas* canvas) SK_OVERRIDE {
84 SkRect rect; 84 SkRect rect;
(...skipping 13 matching lines...) Expand all
98 } 98 }
99 99
100 private: 100 private:
101 typedef DeferredCanvasBench INHERITED; 101 typedef DeferredCanvasBench INHERITED;
102 SimpleNotificationClient fNotificationClient; 102 SimpleNotificationClient fNotificationClient;
103 }; 103 };
104 104
105 105
106 /////////////////////////////////////////////////////////////////////////////// 106 ///////////////////////////////////////////////////////////////////////////////
107 107
108 static SkBenchmark* Fact0(void* p) { return new DeferredRecordBench(p); } 108 DEF_BENCH( return new DeferredRecordBench(); )
109
110 static BenchRegistry gReg0(Fact0);
OLDNEW
« no previous file with comments | « bench/DecodeBench.cpp ('k') | bench/DeferredSurfaceCopyBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698