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

Side by Side Diff: bench/SkLinearBitmapPipelineBench.cpp

Issue 1712653002: Switch to pixmap in API. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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') | 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 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 SkAutoTMalloc<SkPM4f> FPbuffer(width*height); 135 SkAutoTMalloc<SkPM4f> FPbuffer(width*height);
136 136
137 SkFilterQuality filterQuality; 137 SkFilterQuality filterQuality;
138 if (fUseBilerp) { 138 if (fUseBilerp) {
139 filterQuality = SkFilterQuality::kLow_SkFilterQuality; 139 filterQuality = SkFilterQuality::kLow_SkFilterQuality;
140 } else { 140 } else {
141 filterQuality = SkFilterQuality::kNone_SkFilterQuality; 141 filterQuality = SkFilterQuality::kNone_SkFilterQuality;
142 } 142 }
143 143
144 SkPixmap srcPixmap{fInfo, fBitmap.get(), static_cast<size_t>(4 * width)} ;
145
144 SkLinearBitmapPipeline pipeline{ 146 SkLinearBitmapPipeline pipeline{
145 fInvert, filterQuality, fXTile, fYTile, fInfo, fBitmap.get() }; 147 fInvert, filterQuality, fXTile, fYTile, srcPixmap};
146 148
147 int count = 100; 149 int count = 100;
148 150
149 for (int n = 0; n < 1000*loops; n++) { 151 for (int n = 0; n < 1000*loops; n++) {
150 pipeline.shadeSpan4f(3, 6, FPbuffer, count); 152 pipeline.shadeSpan4f(3, 6, FPbuffer, count);
151 } 153 }
152 } 154 }
153 }; 155 };
154 156
155 struct SkBitmapFPOrigShader : public CommonBitmapFPBenchmark { 157 struct SkBitmapFPOrigShader : public CommonBitmapFPBenchmark {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) 287 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);)
286 288
287 DEF_BENCH(return new SkBitmapFPGeneral( 289 DEF_BENCH(return new SkBitmapFPGeneral(
288 srcSize, kLinear_SkColorProfileType, mR, true, 290 srcSize, kLinear_SkColorProfileType, mR, true,
289 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) 291 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);)
290 292
291 DEF_BENCH(return new SkBitmapFPOrigShader( 293 DEF_BENCH(return new SkBitmapFPOrigShader(
292 srcSize, kLinear_SkColorProfileType, mR, true, 294 srcSize, kLinear_SkColorProfileType, mR, true,
293 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) 295 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);)
294 296
OLDNEW
« no previous file with comments | « no previous file | gm/SkLinearBitmapPipelineGM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698