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

Side by Side Diff: bench/ImageBench.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/HairlinePathBench.cpp ('k') | bench/ImageCacheBench.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 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkImage.h" 10 #include "SkImage.h"
(...skipping 21 matching lines...) Expand all
32 // create an Image reflecting the canvas (gpu or cpu) 32 // create an Image reflecting the canvas (gpu or cpu)
33 SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100); 33 SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100);
34 SkAutoTUnref<SkSurface> surface(canvas->newSurface(info)); 34 SkAutoTUnref<SkSurface> surface(canvas->newSurface(info));
35 canvas->drawColor(SK_ColorRED); 35 canvas->drawColor(SK_ColorRED);
36 fImage.reset(surface->newImageSnapshot()); 36 fImage.reset(surface->newImageSnapshot());
37 37
38 // create a cpu-backed Surface 38 // create a cpu-backed Surface
39 fRasterSurface.reset(SkSurface::NewRaster(info)); 39 fRasterSurface.reset(SkSurface::NewRaster(info));
40 } 40 }
41 41
42 void onDraw(const int loops, SkCanvas*) override { 42 void onDraw(int loops, SkCanvas*) override {
43 for (int i = 0; i < loops; i++) { 43 for (int i = 0; i < loops; i++) {
44 for (int inner = 0; inner < 10; ++inner) { 44 for (int inner = 0; inner < 10; ++inner) {
45 fRasterSurface->getCanvas()->drawImage(fImage, 0, 0); 45 fRasterSurface->getCanvas()->drawImage(fImage, 0, 0);
46 } 46 }
47 } 47 }
48 } 48 }
49 49
50 private: 50 private:
51 SkString fName; 51 SkString fName;
52 SkAutoTUnref<SkImage> fImage; 52 SkAutoTUnref<SkImage> fImage;
53 SkAutoTUnref<SkSurface> fRasterSurface; 53 SkAutoTUnref<SkSurface> fRasterSurface;
54 54
55 typedef Benchmark INHERITED; 55 typedef Benchmark INHERITED;
56 }; 56 };
57 57
58 58
59 DEF_BENCH( return new Image2RasterBench; ) 59 DEF_BENCH( return new Image2RasterBench; )
OLDNEW
« no previous file with comments | « bench/HairlinePathBench.cpp ('k') | bench/ImageCacheBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698