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

Side by Side Diff: bench/ControlBench.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/ColorPrivBench.cpp ('k') | bench/CoverageBench.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 2015 Google Inc. 2 * Copyright 2015 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 9
10 // This benchmark's runtime should be fairly constant for a given machine, 10 // This benchmark's runtime should be fairly constant for a given machine,
11 // so it can be used as a baseline to control for thermal or other throttling. 11 // so it can be used as a baseline to control for thermal or other throttling.
12 12
13 struct ControlBench : public Benchmark { 13 struct ControlBench : public Benchmark {
14 const char* onGetName() override { return "control"; } 14 const char* onGetName() override { return "control"; }
15 bool isSuitableFor(Backend backend) override { return backend == kNonRenderi ng_Backend; } 15 bool isSuitableFor(Backend backend) override { return backend == kNonRenderi ng_Backend; }
16 16
17 void onDraw(const int loops, SkCanvas*) override { 17 void onDraw(int loops, SkCanvas*) override {
18 // Nothing terribly useful: force a memory read, a memory write, and som e math. 18 // Nothing terribly useful: force a memory read, a memory write, and som e math.
19 volatile uint32_t rand = 0; 19 volatile uint32_t rand = 0;
20 for (int i = 0; i < 1000*loops; i++) { 20 for (int i = 0; i < 1000*loops; i++) {
21 rand *= 1664525; 21 rand *= 1664525;
22 rand += 1013904223; 22 rand += 1013904223;
23 } 23 }
24 } 24 }
25 }; 25 };
26 DEF_BENCH(return new ControlBench;) 26 DEF_BENCH(return new ControlBench;)
OLDNEW
« no previous file with comments | « bench/ColorPrivBench.cpp ('k') | bench/CoverageBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698