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

Side by Side Diff: bench/ChartBench.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/BlurRectBench.cpp ('k') | bench/ChecksumBench.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 #include "SkBenchmark.h" 9 #include "SkBenchmark.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 fill->lineTo(xLeft, yBase); 84 fill->lineTo(xLeft, yBase);
85 } 85 }
86 } 86 }
87 87
88 } 88 }
89 89
90 // A set of scrolling line plots with the area between each plot filled. Stresse s out GPU path 90 // A set of scrolling line plots with the area between each plot filled. Stresse s out GPU path
91 // filling 91 // filling
92 class ChartBench : public SkBenchmark { 92 class ChartBench : public SkBenchmark {
93 public: 93 public:
94 ChartBench(void* param, bool aa) : SkBenchmark(param) { 94 ChartBench(bool aa) {
95 fShift = 0; 95 fShift = 0;
96 fAA = aa; 96 fAA = aa;
97 fSize.fWidth = -1; 97 fSize.fWidth = -1;
98 fSize.fHeight = -1; 98 fSize.fHeight = -1;
99 } 99 }
100 100
101 protected: 101 protected:
102 virtual const char* onGetName() SK_OVERRIDE { 102 virtual const char* onGetName() SK_OVERRIDE {
103 if (fAA) { 103 if (fAA) {
104 return "chart_aa"; 104 return "chart_aa";
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 int fShift; 187 int fShift;
188 SkISize fSize; 188 SkISize fSize;
189 SkTDArray<SkScalar> fData[kNumGraphs]; 189 SkTDArray<SkScalar> fData[kNumGraphs];
190 bool fAA; 190 bool fAA;
191 191
192 typedef SkBenchmark INHERITED; 192 typedef SkBenchmark INHERITED;
193 }; 193 };
194 194
195 ////////////////////////////////////////////////////////////////////////////// 195 //////////////////////////////////////////////////////////////////////////////
196 196
197 static SkBenchmark* Fact0(void* p) { return new ChartBench(p, true); } 197 DEF_BENCH( return new ChartBench(true); )
198 static SkBenchmark* Fact1(void* p) { return new ChartBench(p, false); } 198 DEF_BENCH( return new ChartBench(false); )
199
200 static BenchRegistry gReg0(Fact0);
201 static BenchRegistry gReg1(Fact1);
OLDNEW
« no previous file with comments | « bench/BlurRectBench.cpp ('k') | bench/ChecksumBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698