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

Side by Side Diff: bench/ColorCubeBench.cpp

Issue 648483002: Attempt at fixing color cube bench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « no previous file | no next file » | 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 #include "Benchmark.h" 7 #include "Benchmark.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkColorCubeFilter.h" 9 #include "SkColorCubeFilter.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 for (int g = 0; g < fCubeDimension; ++g) { 87 for (int g = 0; g < fCubeDimension; ++g) {
88 for (int b = 0; b < fCubeDimension; ++b) { 88 for (int b = 0; b < fCubeDimension; ++b) {
89 pixels[(fCubeDimension * ((fCubeDimension * b) + g)) + r] = 89 pixels[(fCubeDimension * ((fCubeDimension * b) + g)) + r] =
90 SkColorSetARGB(0xFF, lut[r], lut[g], lut[b]); 90 SkColorSetARGB(0xFF, lut[r], lut[g], lut[b]);
91 } 91 }
92 } 92 }
93 } 93 }
94 } 94 }
95 95
96 void test(const int loops, SkCanvas* canvas) { 96 void test(const int loops, SkCanvas* canvas) {
97 SkAutoTUnref<SkColorFilter> colorCube(
98 SkColorCubeFilter::Create(fCubeData, fCubeDimension));
99 SkPaint paint; 97 SkPaint paint;
100 paint.setColorFilter(colorCube);
101
102 for (int i = 0; i < loops; i++) { 98 for (int i = 0; i < loops; i++) {
99 SkAutoTUnref<SkColorFilter> colorCube(
100 SkColorCubeFilter::Create(fCubeData, fCubeDimension));
101 paint.setColorFilter(colorCube);
103 canvas->drawBitmap(fBitmap, 0, 0, &paint); 102 canvas->drawBitmap(fBitmap, 0, 0, &paint);
104 } 103 }
105 } 104 }
106 105
107 typedef Benchmark INHERITED; 106 typedef Benchmark INHERITED;
108 }; 107 };
109 108
110 /////////////////////////////////////////////////////////////////////////////// 109 ///////////////////////////////////////////////////////////////////////////////
111 110
112 DEF_BENCH( return new ColorCubeBench(); ) 111 DEF_BENCH( return new ColorCubeBench(); )
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698