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

Side by Side Diff: bench/PatchBench.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/MutexBench.cpp ('k') | bench/PatchGridBench.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 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 #include "Benchmark.h" 7 #include "Benchmark.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkGradientShader.h" 9 #include "SkGradientShader.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 case kTexCoords_VertexMode: 116 case kTexCoords_VertexMode:
117 case kBoth_VertexMode: 117 case kBoth_VertexMode:
118 fPaint.setShader(this->createShader())->unref(); 118 fPaint.setShader(this->createShader())->unref();
119 break; 119 break;
120 default: 120 default:
121 fPaint.setShader(nullptr); 121 fPaint.setShader(nullptr);
122 break; 122 break;
123 } 123 }
124 } 124 }
125 125
126 void onDraw(const int loops, SkCanvas* canvas) override { 126 void onDraw(int loops, SkCanvas* canvas) override {
127 canvas->scale(fScale.x(), fScale.y()); 127 canvas->scale(fScale.x(), fScale.y());
128 for (int i = 0; i < loops; i++) { 128 for (int i = 0; i < loops; i++) {
129 switch (fVertexMode) { 129 switch (fVertexMode) {
130 case kNone_VertexMode: 130 case kNone_VertexMode:
131 canvas->drawPatch(fCubics, nullptr, nullptr, nullptr, fPaint ); 131 canvas->drawPatch(fCubics, nullptr, nullptr, nullptr, fPaint );
132 break; 132 break;
133 case kColors_VertexMode: 133 case kColors_VertexMode:
134 canvas->drawPatch(fCubics, fColors, nullptr, nullptr, fPaint ); 134 canvas->drawPatch(fCubics, fColors, nullptr, nullptr, fPaint );
135 break; 135 break;
136 case kTexCoords_VertexMode: 136 case kTexCoords_VertexMode:
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 DEF_BENCH( return new LoopPatchBench(SkVector::Make(1.0f, 1.0f), 316 DEF_BENCH( return new LoopPatchBench(SkVector::Make(1.0f, 1.0f),
317 PatchBench::kBoth_VertexMode); ) 317 PatchBench::kBoth_VertexMode); )
318 DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f), 318 DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f),
319 PatchBench::kNone_VertexMode); ) 319 PatchBench::kNone_VertexMode); )
320 DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f), 320 DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f),
321 PatchBench::kColors_VertexMode); ) 321 PatchBench::kColors_VertexMode); )
322 DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f), 322 DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f),
323 PatchBench::kTexCoords_VertexMode); ) 323 PatchBench::kTexCoords_VertexMode); )
324 DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f), 324 DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f),
325 PatchBench::kBoth_VertexMode); ) 325 PatchBench::kBoth_VertexMode); )
OLDNEW
« no previous file with comments | « bench/MutexBench.cpp ('k') | bench/PatchGridBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698