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

Side by Side Diff: bench/PathIterBench.cpp

Issue 1379923005: Remove const from `const int loops`. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: n too Created 5 years, 2 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
« no previous file with comments | « bench/PathBench.cpp ('k') | bench/PerlinNoiseBench.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 2011 Google Inc. 3 * Copyright 2011 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 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 bool isSuitableFor(Backend backend) override { 60 bool isSuitableFor(Backend backend) override {
61 return backend == kNonRendering_Backend; 61 return backend == kNonRendering_Backend;
62 } 62 }
63 63
64 protected: 64 protected:
65 const char* onGetName() override { 65 const char* onGetName() override {
66 return fName.c_str(); 66 return fName.c_str();
67 } 67 }
68 68
69 void onDraw(const int loops, SkCanvas*) override { 69 void onDraw(int loops, SkCanvas*) override {
70 if (fRaw) { 70 if (fRaw) {
71 for (int i = 0; i < loops; ++i) { 71 for (int i = 0; i < loops; ++i) {
72 SkPath::RawIter iter(fPath); 72 SkPath::RawIter iter(fPath);
73 SkPath::Verb verb; 73 SkPath::Verb verb;
74 SkPoint pts[4]; 74 SkPoint pts[4];
75 75
76 while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { } 76 while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { }
77 } 77 }
78 } else { 78 } else {
79 for (int i = 0; i < loops; ++i) { 79 for (int i = 0; i < loops; ++i) {
80 SkPath::Iter iter(fPath, false); 80 SkPath::Iter iter(fPath, false);
81 SkPath::Verb verb; 81 SkPath::Verb verb;
82 SkPoint pts[4]; 82 SkPoint pts[4];
83 83
84 while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { } 84 while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { }
85 } 85 }
86 } 86 }
87 } 87 }
88 88
89 private: 89 private:
90 typedef Benchmark INHERITED; 90 typedef Benchmark INHERITED;
91 }; 91 };
92 92
93 /////////////////////////////////////////////////////////////////////////////// 93 ///////////////////////////////////////////////////////////////////////////////
94 94
95 DEF_BENCH( return new PathIterBench(false); ) 95 DEF_BENCH( return new PathIterBench(false); )
96 DEF_BENCH( return new PathIterBench(true); ) 96 DEF_BENCH( return new PathIterBench(true); )
OLDNEW
« no previous file with comments | « bench/PathBench.cpp ('k') | bench/PerlinNoiseBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698