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

Side by Side Diff: bench/SkLinearBitmapPipelineBench.cpp

Issue 1705203002: Add bilerp filtering. (Closed) Base URL: https://skia.googlesource.com/skia.git@fp-simple-linear-20160217
Patch Set: Redo bilerp. Created 4 years, 10 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 | gm/SkLinearBitmapPipelineGM.cpp » ('j') | src/core/SkLinearBitmapPipeline.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 <memory> 8 #include <memory>
9 #include "SkColor.h" 9 #include "SkColor.h"
10 #include "SkLinearBitmapPipeline.h" 10 #include "SkLinearBitmapPipeline.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 127 }
128 return name; 128 return name;
129 } 129 }
130 130
131 void onDraw(int loops, SkCanvas*) override { 131 void onDraw(int loops, SkCanvas*) override {
132 int width = fSrcSize.fWidth; 132 int width = fSrcSize.fWidth;
133 int height = fSrcSize.fHeight; 133 int height = fSrcSize.fHeight;
134 134
135 SkAutoTMalloc<SkPM4f> FPbuffer(width*height); 135 SkAutoTMalloc<SkPM4f> FPbuffer(width*height);
136 136
137 SkLinearBitmapPipeline pipeline{fInvert, fXTile, fYTile, fInfo, fBitmap. get(), }; 137 SkFilterQuality filterQuality;
138 if (fUseBilerp) {
139 filterQuality = SkFilterQuality::kLow_SkFilterQuality;
140 } else {
141 filterQuality = SkFilterQuality::kNone_SkFilterQuality;
142 }
143
144 SkLinearBitmapPipeline pipeline{
145 fInvert, filterQuality, fXTile, fYTile, fInfo, fBitmap.get() };
138 146
139 int count = 100; 147 int count = 100;
140 148
141 for (int n = 0; n < 1000*loops; n++) { 149 for (int n = 0; n < 1000*loops; n++) {
142 pipeline.shadeSpan4f(3, 6, FPbuffer, count); 150 pipeline.shadeSpan4f(3, 6, FPbuffer, count);
143 } 151 }
144 } 152 }
145 }; 153 };
146 154
147 struct SkBitmapFPOrigShader : public CommonBitmapFPBenchmark { 155 struct SkBitmapFPOrigShader : public CommonBitmapFPBenchmark {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) 285 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);)
278 286
279 DEF_BENCH(return new SkBitmapFPGeneral( 287 DEF_BENCH(return new SkBitmapFPGeneral(
280 srcSize, kLinear_SkColorProfileType, mR, true, 288 srcSize, kLinear_SkColorProfileType, mR, true,
281 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) 289 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);)
282 290
283 DEF_BENCH(return new SkBitmapFPOrigShader( 291 DEF_BENCH(return new SkBitmapFPOrigShader(
284 srcSize, kLinear_SkColorProfileType, mR, true, 292 srcSize, kLinear_SkColorProfileType, mR, true,
285 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) 293 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);)
286 294
OLDNEW
« no previous file with comments | « no previous file | gm/SkLinearBitmapPipelineGM.cpp » ('j') | src/core/SkLinearBitmapPipeline.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698