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

Side by Side Diff: bench/FSRectBench.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/ETCBitmapBench.cpp ('k') | bench/FontCacheBench.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 2013 Google Inc. 3 * Copyright 2013 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 8
9 #include "Benchmark.h" 9 #include "Benchmark.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 21 matching lines...) Expand all
32 fRects[i].fLeft = -kMinOffset - SkScalarMul(rand.nextUScalar1(), kOffsetRange); 32 fRects[i].fLeft = -kMinOffset - SkScalarMul(rand.nextUScalar1(), kOffsetRange);
33 fRects[i].fTop = -kMinOffset - SkScalarMul(rand.nextUScalar1(), kOffsetRange); 33 fRects[i].fTop = -kMinOffset - SkScalarMul(rand.nextUScalar1(), kOffsetRange);
34 fRects[i].fRight = W + kMinOffset + SkScalarMul(rand.nextUScalar 1(), kOffsetRange); 34 fRects[i].fRight = W + kMinOffset + SkScalarMul(rand.nextUScalar 1(), kOffsetRange);
35 fRects[i].fBottom = H + kMinOffset + SkScalarMul(rand.nextUScala r1(), kOffsetRange); 35 fRects[i].fBottom = H + kMinOffset + SkScalarMul(rand.nextUScala r1(), kOffsetRange);
36 fColors[i] = rand.nextU() | 0xFF000000; 36 fColors[i] = rand.nextU() | 0xFF000000;
37 } 37 }
38 fInit = true; 38 fInit = true;
39 } 39 }
40 } 40 }
41 41
42 void onDraw(const int loops, SkCanvas* canvas) override { 42 void onDraw(int loops, SkCanvas* canvas) override {
43 SkPaint paint; 43 SkPaint paint;
44 for (int i = 0; i < loops; ++i) { 44 for (int i = 0; i < loops; ++i) {
45 paint.setColor(fColors[i % N]); 45 paint.setColor(fColors[i % N]);
46 canvas->drawRect(fRects[i % N], paint); 46 canvas->drawRect(fRects[i % N], paint);
47 } 47 }
48 } 48 }
49 49
50 private: 50 private:
51 enum { 51 enum {
52 W = 640, 52 W = 640,
53 H = 480, 53 H = 480,
54 N = 300, 54 N = 300,
55 }; 55 };
56 SkRect fRects[N]; 56 SkRect fRects[N];
57 SkColor fColors[N]; 57 SkColor fColors[N];
58 bool fInit; 58 bool fInit;
59 59
60 typedef Benchmark INHERITED; 60 typedef Benchmark INHERITED;
61 }; 61 };
62 62
63 DEF_BENCH(return new FSRectBench();) 63 DEF_BENCH(return new FSRectBench();)
OLDNEW
« no previous file with comments | « bench/ETCBitmapBench.cpp ('k') | bench/FontCacheBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698