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

Side by Side Diff: bench/GMBench.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/GMBench.h ('k') | bench/GameBench.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 7
8 #include "GMBench.h" 8 #include "GMBench.h"
9 9
10 GMBench::GMBench(skiagm::GM* gm) : fGM(gm) { 10 GMBench::GMBench(skiagm::GM* gm) : fGM(gm) {
11 fName.printf("GM_%s", gm->getName()); 11 fName.printf("GM_%s", gm->getName());
12 } 12 }
13 13
14 GMBench::~GMBench() { delete fGM; } 14 GMBench::~GMBench() { delete fGM; }
15 15
16 const char* GMBench::onGetName() { 16 const char* GMBench::onGetName() {
17 return fName.c_str(); 17 return fName.c_str();
18 } 18 }
19 19
20 bool GMBench::isSuitableFor(Backend backend) { 20 bool GMBench::isSuitableFor(Backend backend) {
21 return kNonRendering_Backend != backend; 21 return kNonRendering_Backend != backend;
22 } 22 }
23 23
24 void GMBench::onDraw(const int loops, SkCanvas* canvas) { 24 void GMBench::onDraw(int loops, SkCanvas* canvas) {
25 // Do we care about timing the draw of the background (once)? 25 // Do we care about timing the draw of the background (once)?
26 // Does the GM ever rely on drawBackground to lazily compute something? 26 // Does the GM ever rely on drawBackground to lazily compute something?
27 fGM->drawBackground(canvas); 27 fGM->drawBackground(canvas);
28 for (int i = 0; i < loops; ++i) { 28 for (int i = 0; i < loops; ++i) {
29 fGM->drawContent(canvas); 29 fGM->drawContent(canvas);
30 } 30 }
31 } 31 }
32 32
33 SkIPoint GMBench::onGetSize() { 33 SkIPoint GMBench::onGetSize() {
34 SkISize size = fGM->getISize(); 34 SkISize size = fGM->getISize();
35 return SkIPoint::Make(size.fWidth, size.fHeight); 35 return SkIPoint::Make(size.fWidth, size.fHeight);
36 } 36 }
37 37
OLDNEW
« no previous file with comments | « bench/GMBench.h ('k') | bench/GameBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698