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

Side by Side Diff: bench/AlternatingColorPatternBench.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/AAClipBench.cpp ('k') | bench/Benchmark.h » ('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 2014 Google Inc. 2 * Copyright 2014 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 "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 fShaders[count] = fPattern1.fIsBitmap ? fBmShader : nullptr; 140 fShaders[count] = fPattern1.fIsBitmap ? fBmShader : nullptr;
141 } else { 141 } else {
142 fColors[count] = fPattern2.fColor; 142 fColors[count] = fPattern2.fColor;
143 fShaders[count] = fPattern2.fIsBitmap ? fBmShader : nullptr; 143 fShaders[count] = fPattern2.fIsBitmap ? fBmShader : nullptr;
144 } 144 }
145 ++count; 145 ++count;
146 } 146 }
147 } 147 }
148 } 148 }
149 149
150 void onDraw(const int loops, SkCanvas* canvas) override { 150 void onDraw(int loops, SkCanvas* canvas) override {
151 SkPaint paint; 151 SkPaint paint;
152 paint.setAntiAlias(false); 152 paint.setAntiAlias(false);
153 paint.setFilterQuality(kLow_SkFilterQuality); 153 paint.setFilterQuality(kLow_SkFilterQuality);
154 154
155 for (int i = 0; i < loops; ++i) { 155 for (int i = 0; i < loops; ++i) {
156 for (int j = 0; j < NUM_DRAWS; ++j) { 156 for (int j = 0; j < NUM_DRAWS; ++j) {
157 paint.setColor(fColors[j]); 157 paint.setColor(fColors[j]);
158 paint.setShader(fShaders[j]); 158 paint.setShader(fShaders[j]);
159 if (kRect_DrawType == fDrawType) { 159 if (kRect_DrawType == fDrawType) {
160 canvas->drawRect(fRects[j], paint); 160 canvas->drawRect(fRects[j], paint);
(...skipping 30 matching lines...) Expand all
191 191
192 DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern, 192 DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern,
193 kOpaqueBitmap_ColorPattern, 193 kOpaqueBitmap_ColorPattern,
194 kRect_DrawType);) 194 kRect_DrawType);)
195 DEF_BENCH(return new AlternatingColorPatternBench(kAlphaBitmap_ColorPattern, 195 DEF_BENCH(return new AlternatingColorPatternBench(kAlphaBitmap_ColorPattern,
196 kAlphaBitmap_ColorPattern, 196 kAlphaBitmap_ColorPattern,
197 kRect_DrawType);) 197 kRect_DrawType);)
198 DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern, 198 DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern,
199 kAlphaBitmap_ColorPattern, 199 kAlphaBitmap_ColorPattern,
200 kRect_DrawType);) 200 kRect_DrawType);)
OLDNEW
« no previous file with comments | « bench/AAClipBench.cpp ('k') | bench/Benchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698