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

Side by Side Diff: bench/ImageFilterCollapse.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/ImageCacheBench.cpp ('k') | bench/ImageFilterDAGBench.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 "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 21 matching lines...) Expand all
32 // Create a chain of ImageFilters from colorFilters 32 // Create a chain of ImageFilters from colorFilters
33 fImageFilter = nullptr; 33 fImageFilter = nullptr;
34 for(int i = nFilters; i --> 0;) { 34 for(int i = nFilters; i --> 0;) {
35 SkAutoTUnref<SkImageFilter> filter( 35 SkAutoTUnref<SkImageFilter> filter(
36 SkColorFilterImageFilter::Create(colorFilters[i], fImage Filter, nullptr) 36 SkColorFilterImageFilter::Create(colorFilters[i], fImage Filter, nullptr)
37 ); 37 );
38 SkRefCnt_SafeAssign(fImageFilter, filter.get()); 38 SkRefCnt_SafeAssign(fImageFilter, filter.get());
39 } 39 }
40 } 40 }
41 41
42 void onDraw(const int loops, SkCanvas* canvas) override { 42 void onDraw(int loops, SkCanvas* canvas) override {
43 makeBitmap(); 43 makeBitmap();
44 44
45 for(int i = 0; i < loops; i++) { 45 for(int i = 0; i < loops; i++) {
46 SkPaint paint; 46 SkPaint paint;
47 paint.setImageFilter(fImageFilter); 47 paint.setImageFilter(fImageFilter);
48 canvas->drawBitmap(fBitmap, 0, 0, &paint); 48 canvas->drawBitmap(fBitmap, 0, 0, &paint);
49 } 49 }
50 } 50 }
51 51
52 private: 52 private:
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 doPreDraw(colorFilters, SK_ARRAY_COUNT(colorFilters)); 149 doPreDraw(colorFilters, SK_ARRAY_COUNT(colorFilters));
150 150
151 for(unsigned i = 0; i < SK_ARRAY_COUNT(colorFilters); i++) { 151 for(unsigned i = 0; i < SK_ARRAY_COUNT(colorFilters); i++) {
152 colorFilters[i]->unref(); 152 colorFilters[i]->unref();
153 } 153 }
154 } 154 }
155 }; 155 };
156 156
157 DEF_BENCH(return new TableCollapseBench;) 157 DEF_BENCH(return new TableCollapseBench;)
158 DEF_BENCH(return new MatrixCollapseBench;) 158 DEF_BENCH(return new MatrixCollapseBench;)
OLDNEW
« no previous file with comments | « bench/ImageCacheBench.cpp ('k') | bench/ImageFilterDAGBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698