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

Side by Side Diff: bench/DeferredSurfaceCopyBench.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/DeferredCanvasBench.cpp ('k') | bench/DisplacementBench.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 2013 Google Inc. 3 * Copyright 2013 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 8
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 #include "GrRenderTarget.h" 10 #include "GrRenderTarget.h"
11 #endif 11 #endif
12 #include "SkBenchmark.h" 12 #include "SkBenchmark.h"
13 #include "SkDeferredCanvas.h" 13 #include "SkDeferredCanvas.h"
14 #include "SkDevice.h" 14 #include "SkDevice.h"
15 #include "SkImage.h" 15 #include "SkImage.h"
16 #include "SkSurface.h" 16 #include "SkSurface.h"
17 17
18 class DeferredSurfaceCopyBench : public SkBenchmark { 18 class DeferredSurfaceCopyBench : public SkBenchmark {
19 enum { 19 enum {
20 kSurfaceWidth = 1000, 20 kSurfaceWidth = 1000,
21 kSurfaceHeight = 1000, 21 kSurfaceHeight = 1000,
22 }; 22 };
23 public: 23 public:
24 DeferredSurfaceCopyBench(void* param, bool discardableContents) : SkBenchmar k(param) { 24 DeferredSurfaceCopyBench(bool discardableContents) {
25 fDiscardableContents = discardableContents; 25 fDiscardableContents = discardableContents;
26 } 26 }
27 27
28 protected: 28 protected:
29 virtual const char* onGetName() SK_OVERRIDE { 29 virtual const char* onGetName() SK_OVERRIDE {
30 return fDiscardableContents ? "DeferredSurfaceCopy_discardable" : 30 return fDiscardableContents ? "DeferredSurfaceCopy_discardable" :
31 "DeferredSurfaceCopy_nonDiscardable"; 31 "DeferredSurfaceCopy_nonDiscardable";
32 } 32 }
33 33
34 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 34 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 private: 73 private:
74 bool fDiscardableContents; 74 bool fDiscardableContents;
75 75
76 typedef SkBenchmark INHERITED; 76 typedef SkBenchmark INHERITED;
77 }; 77 };
78 78
79 ////////////////////////////////////////////////////////////////////////////// 79 //////////////////////////////////////////////////////////////////////////////
80 80
81 static SkBenchmark* Fact0(void* p) { return new DeferredSurfaceCopyBench(p, fals e); } 81 DEF_BENCH( return new DeferredSurfaceCopyBench(false); )
82 static SkBenchmark* Fact1(void* p) { return new DeferredSurfaceCopyBench(p, true ); } 82 DEF_BENCH( return new DeferredSurfaceCopyBench(true); )
83
84 static BenchRegistry gReg0(Fact0);
85 static BenchRegistry gReg1(Fact1);
OLDNEW
« no previous file with comments | « bench/DeferredCanvasBench.cpp ('k') | bench/DisplacementBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698