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

Side by Side Diff: bench/BitmapBench.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/BigPathBench.cpp ('k') | bench/BitmapRectBench.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 2011 Google Inc. 2 * Copyright 2011 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 "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 if (kIndex_8_SkColorType == fColorType) { 125 if (kIndex_8_SkColorType == fColorType) {
126 convertToIndex666(bm, &fBitmap, fAlphaType); 126 convertToIndex666(bm, &fBitmap, fAlphaType);
127 } else { 127 } else {
128 fBitmap = bm; 128 fBitmap = bm;
129 } 129 }
130 130
131 fBitmap.setIsVolatile(fIsVolatile); 131 fBitmap.setIsVolatile(fIsVolatile);
132 } 132 }
133 133
134 void onDraw(const int loops, SkCanvas* canvas) override { 134 void onDraw(int loops, SkCanvas* canvas) override {
135 if (fDoScale) { 135 if (fDoScale) {
136 canvas->scale(.99f, .99f); 136 canvas->scale(.99f, .99f);
137 } 137 }
138 SkIPoint dim = this->getSize(); 138 SkIPoint dim = this->getSize();
139 SkRandom rand; 139 SkRandom rand;
140 140
141 SkPaint paint(fPaint); 141 SkPaint paint(fPaint);
142 this->setupPaint(&paint); 142 this->setupPaint(&paint);
143 143
144 const SkBitmap& bitmap = fBitmap; 144 const SkBitmap& bitmap = fBitmap;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 218 }
219 if (isBilerp(fFlags)) { 219 if (isBilerp(fFlags)) {
220 fFullName.append("_bilerp"); 220 fFullName.append("_bilerp");
221 } else if (isBicubic(fFlags)) { 221 } else if (isBicubic(fFlags)) {
222 fFullName.append("_bicubic"); 222 fFullName.append("_bicubic");
223 } 223 }
224 224
225 return fFullName.c_str(); 225 return fFullName.c_str();
226 } 226 }
227 227
228 void onDraw(const int loops, SkCanvas* canvas) override { 228 void onDraw(int loops, SkCanvas* canvas) override {
229 SkISize dim = canvas->getDeviceSize(); 229 SkISize dim = canvas->getDeviceSize();
230 if (fFlags & kScale_Flag) { 230 if (fFlags & kScale_Flag) {
231 const SkScalar x = SkIntToScalar(dim.fWidth) / 2; 231 const SkScalar x = SkIntToScalar(dim.fWidth) / 2;
232 const SkScalar y = SkIntToScalar(dim.fHeight) / 2; 232 const SkScalar y = SkIntToScalar(dim.fHeight) / 2;
233 233
234 canvas->translate(x, y); 234 canvas->translate(x, y);
235 // just enough so we can't take the sprite case 235 // just enough so we can't take the sprite case
236 canvas->scale(SK_Scalar1 * 99/100, SK_Scalar1 * 99/100); 236 canvas->scale(SK_Scalar1 * 99/100, SK_Scalar1 * 99/100);
237 canvas->translate(-x, -y); 237 canvas->translate(-x, -y);
238 } 238 }
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, t rue, false, kScale_Flag | kRotate_Flag | kBilerp_Flag); ) 381 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, t rue, false, kScale_Flag | kRotate_Flag | kBilerp_Flag); )
382 382
383 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f alse, false, kScale_Flag | kBilerp_Flag | kBicubic_Flag); ) 383 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f alse, false, kScale_Flag | kBilerp_Flag | kBicubic_Flag); )
384 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f alse, false, kScale_Flag | kRotate_Flag | kBilerp_Flag | kBicubic_Flag); ) 384 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f alse, false, kScale_Flag | kRotate_Flag | kBilerp_Flag | kBicubic_Flag); )
385 385
386 // source alpha tests -> S32A_Opaque_BlitRow32_{arm,neon} 386 // source alpha tests -> S32A_Opaque_BlitRow32_{arm,neon}
387 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kOpaque_Sou rceAlpha, kN32_SkColorType); ) 387 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kOpaque_Sou rceAlpha, kN32_SkColorType); )
388 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTransparen t_SourceAlpha, kN32_SkColorType); ) 388 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTransparen t_SourceAlpha, kN32_SkColorType); )
389 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTwoStripes _SourceAlpha, kN32_SkColorType); ) 389 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTwoStripes _SourceAlpha, kN32_SkColorType); )
390 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kThreeStrip es_SourceAlpha, kN32_SkColorType); ) 390 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kThreeStrip es_SourceAlpha, kN32_SkColorType); )
OLDNEW
« no previous file with comments | « bench/BigPathBench.cpp ('k') | bench/BitmapRectBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698