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

Side by Side Diff: bench/StrokeBench.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/SortBench.cpp ('k') | bench/TableBench.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 2013 Google Inc. 2 * Copyright 2013 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 7
8 #include "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 SkRect r = { 20, 20, 40, 40 }; 71 SkRect r = { 20, 20, 40, 40 };
72 SkScalar rad = 4; 72 SkScalar rad = 4;
73 fRec.fRRect.setRectXY(r, rad, rad); 73 fRec.fRRect.setRectXY(r, rad, rad);
74 } 74 }
75 75
76 protected: 76 protected:
77 virtual const char* onGetName() { 77 virtual const char* onGetName() {
78 return fName.c_str(); 78 return fName.c_str();
79 } 79 }
80 80
81 virtual void onDraw(SkCanvas* canvas) { 81 virtual void onDraw(const int loops, SkCanvas* canvas) {
82 fRec.fCanvas = canvas; 82 fRec.fCanvas = canvas;
83 this->setupPaint(&fRec.fPaint); 83 this->setupPaint(&fRec.fPaint);
84 fRec.fPaint.setStyle(SkPaint::kStroke_Style); 84 fRec.fPaint.setStyle(SkPaint::kStroke_Style);
85 fRec.fPaint.setStrokeJoin(fJoin); 85 fRec.fPaint.setStrokeJoin(fJoin);
86 fRec.fPaint.setStrokeWidth(5); 86 fRec.fPaint.setStrokeWidth(5);
87 fProc(&fRec, this->getLoops()); 87 fProc(&fRec, loops);
88 } 88 }
89 89
90 private: 90 private:
91 typedef SkBenchmark INHERITED; 91 typedef SkBenchmark INHERITED;
92 }; 92 };
93 93
94 DEF_BENCH( return new StrokeRRectBench(SkPaint::kRound_Join, draw_rect); ) 94 DEF_BENCH( return new StrokeRRectBench(SkPaint::kRound_Join, draw_rect); )
95 DEF_BENCH( return new StrokeRRectBench(SkPaint::kBevel_Join, draw_rect); ) 95 DEF_BENCH( return new StrokeRRectBench(SkPaint::kBevel_Join, draw_rect); )
96 DEF_BENCH( return new StrokeRRectBench(SkPaint::kMiter_Join, draw_rect); ) 96 DEF_BENCH( return new StrokeRRectBench(SkPaint::kMiter_Join, draw_rect); )
97 97
98 DEF_BENCH( return new StrokeRRectBench(SkPaint::kRound_Join, draw_rrect); ) 98 DEF_BENCH( return new StrokeRRectBench(SkPaint::kRound_Join, draw_rrect); )
99 DEF_BENCH( return new StrokeRRectBench(SkPaint::kBevel_Join, draw_rrect); ) 99 DEF_BENCH( return new StrokeRRectBench(SkPaint::kBevel_Join, draw_rrect); )
100 DEF_BENCH( return new StrokeRRectBench(SkPaint::kMiter_Join, draw_rrect); ) 100 DEF_BENCH( return new StrokeRRectBench(SkPaint::kMiter_Join, draw_rrect); )
101 101
102 DEF_BENCH( return new StrokeRRectBench(SkPaint::kRound_Join, draw_oval); ) 102 DEF_BENCH( return new StrokeRRectBench(SkPaint::kRound_Join, draw_oval); )
103 DEF_BENCH( return new StrokeRRectBench(SkPaint::kBevel_Join, draw_oval); ) 103 DEF_BENCH( return new StrokeRRectBench(SkPaint::kBevel_Join, draw_oval); )
104 DEF_BENCH( return new StrokeRRectBench(SkPaint::kMiter_Join, draw_oval); ) 104 DEF_BENCH( return new StrokeRRectBench(SkPaint::kMiter_Join, draw_oval); )
OLDNEW
« no previous file with comments | « bench/SortBench.cpp ('k') | bench/TableBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698