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

Side by Side Diff: bench/HairlinePathBench.cpp

Issue 23478013: Major bench refactoring. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: merge with head agani 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/GradientBench.cpp ('k') | bench/ImageCacheBench.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 #include "SkBenchmark.h" 7 #include "SkBenchmark.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 paint.setAntiAlias(fFlags & kAA_Flag ? true : false); 56 paint.setAntiAlias(fFlags & kAA_Flag ? true : false);
57 57
58 SkPath path; 58 SkPath path;
59 this->makePath(&path); 59 this->makePath(&path);
60 if (fFlags & kBig_Flag) { 60 if (fFlags & kBig_Flag) {
61 SkMatrix m; 61 SkMatrix m;
62 m.setScale(SkIntToScalar(3), SkIntToScalar(3)); 62 m.setScale(SkIntToScalar(3), SkIntToScalar(3));
63 path.transform(m); 63 path.transform(m);
64 } 64 }
65 65
66 int count = N; 66 for (int i = 0; i < this->getLoops(); i++) {
67 for (int i = 0; i < count; i++) {
68 canvas->drawPath(path, paint); 67 canvas->drawPath(path, paint);
69 } 68 }
70 } 69 }
71 70
72 private: 71 private:
73 SkPaint fPaint; 72 SkPaint fPaint;
74 SkString fName; 73 SkString fName;
75 Flags fFlags; 74 Flags fFlags;
76 enum { N = SkBENCHLOOP(200) };
77 typedef SkBenchmark INHERITED; 75 typedef SkBenchmark INHERITED;
78 }; 76 };
79 77
80 class LinePathBench : public HairlinePathBench { 78 class LinePathBench : public HairlinePathBench {
81 public: 79 public:
82 LinePathBench(void* param, Flags flags) : INHERITED(param, flags) {} 80 LinePathBench(void* param, Flags flags) : INHERITED(param, flags) {}
83 81
84 virtual void appendName(SkString* name) SK_OVERRIDE { 82 virtual void appendName(SkString* name) SK_OVERRIDE {
85 name->append("line"); 83 name->append("line");
86 } 84 }
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // Don't have default path renderer for conics yet on GPU, so must use AA 227 // Don't have default path renderer for conics yet on GPU, so must use AA
230 // DEF_BENCH( return new ConicPathBench(p, FLAGS00); ) 228 // DEF_BENCH( return new ConicPathBench(p, FLAGS00); )
231 // DEF_BENCH( return new ConicPathBench(p, FLAGS01); ) 229 // DEF_BENCH( return new ConicPathBench(p, FLAGS01); )
232 DEF_BENCH( return new ConicPathBench(p, FLAGS10); ) 230 DEF_BENCH( return new ConicPathBench(p, FLAGS10); )
233 DEF_BENCH( return new ConicPathBench(p, FLAGS11); ) 231 DEF_BENCH( return new ConicPathBench(p, FLAGS11); )
234 232
235 DEF_BENCH( return new CubicPathBench(p, FLAGS00); ) 233 DEF_BENCH( return new CubicPathBench(p, FLAGS00); )
236 DEF_BENCH( return new CubicPathBench(p, FLAGS01); ) 234 DEF_BENCH( return new CubicPathBench(p, FLAGS01); )
237 DEF_BENCH( return new CubicPathBench(p, FLAGS10); ) 235 DEF_BENCH( return new CubicPathBench(p, FLAGS10); )
238 DEF_BENCH( return new CubicPathBench(p, FLAGS11); ) 236 DEF_BENCH( return new CubicPathBench(p, FLAGS11); )
OLDNEW
« no previous file with comments | « bench/GradientBench.cpp ('k') | bench/ImageCacheBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698