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

Side by Side Diff: bench/SkLinearBitmapPipelineBench.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage Created 4 years, 9 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/SKPBench.cpp ('k') | dm/DMSrcSink.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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 : CommonBitmapFPBenchmark(srcSize, colorProfile, m, useBilerp, xTile , yTile) { } 166 : CommonBitmapFPBenchmark(srcSize, colorProfile, m, useBilerp, xTile , yTile) { }
167 167
168 SkString BaseName() override { 168 SkString BaseName() override {
169 SkString name{"Orig"}; 169 SkString name{"Orig"};
170 return name; 170 return name;
171 } 171 }
172 172
173 void onPreDraw(SkCanvas* c) override { 173 void onPreDraw(SkCanvas* c) override {
174 CommonBitmapFPBenchmark::onPreDraw(c); 174 CommonBitmapFPBenchmark::onPreDraw(c);
175 175
176 SkImage* image = SkImage::NewRasterCopy( 176 fImage = SkImage::MakeRasterCopy(
177 fInfo, fBitmap.get(), sizeof(SkPMColor) * fSrcSize.fWidth); 177 SkPixmap(fInfo, fBitmap.get(), sizeof(SkPMColor) * fSrcSize.fWidth)) ;
178 fImage.reset(image);
179 fPaint.setShader(fImage->makeShader(fXTile, fYTile)); 178 fPaint.setShader(fImage->makeShader(fXTile, fYTile));
180 if (fUseBilerp) { 179 if (fUseBilerp) {
181 fPaint.setFilterQuality(SkFilterQuality::kLow_SkFilterQuality); 180 fPaint.setFilterQuality(SkFilterQuality::kLow_SkFilterQuality);
182 } else { 181 } else {
183 fPaint.setFilterQuality(SkFilterQuality::kNone_SkFilterQuality); 182 fPaint.setFilterQuality(SkFilterQuality::kNone_SkFilterQuality);
184 } 183 }
185 } 184 }
186 185
187 void onPostDraw(SkCanvas*) override { 186 void onPostDraw(SkCanvas*) override {
188 187
(...skipping 13 matching lines...) Expand all
202 201
203 int count = 100; 202 int count = 100;
204 203
205 for (int n = 0; n < 1000*loops; n++) { 204 for (int n = 0; n < 1000*loops; n++) {
206 ctx->shadeSpan(3, 6, buffer4b, count); 205 ctx->shadeSpan(3, 6, buffer4b, count);
207 } 206 }
208 207
209 ctx->~Context(); 208 ctx->~Context();
210 } 209 }
211 SkPaint fPaint; 210 SkPaint fPaint;
212 SkAutoTUnref<SkImage> fImage; 211 sk_sp<SkImage> fImage;
213 }; 212 };
214 213
215 static SkISize srcSize = SkISize::Make(120, 100); 214 static SkISize srcSize = SkISize::Make(120, 100);
216 static SkMatrix mI = SkMatrix::I(); 215 static SkMatrix mI = SkMatrix::I();
217 DEF_BENCH(return new SkBitmapFPGeneral( 216 DEF_BENCH(return new SkBitmapFPGeneral(
218 srcSize, kSRGB_SkColorProfileType, mI, false, 217 srcSize, kSRGB_SkColorProfileType, mI, false,
219 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) 218 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);)
220 219
221 DEF_BENCH(return new SkBitmapFPGeneral( 220 DEF_BENCH(return new SkBitmapFPGeneral(
222 srcSize, kLinear_SkColorProfileType, mI, false, 221 srcSize, kLinear_SkColorProfileType, mI, false,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) 286 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);)
288 287
289 DEF_BENCH(return new SkBitmapFPGeneral( 288 DEF_BENCH(return new SkBitmapFPGeneral(
290 srcSize, kLinear_SkColorProfileType, mR, true, 289 srcSize, kLinear_SkColorProfileType, mR, true,
291 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) 290 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);)
292 291
293 DEF_BENCH(return new SkBitmapFPOrigShader( 292 DEF_BENCH(return new SkBitmapFPOrigShader(
294 srcSize, kLinear_SkColorProfileType, mR, true, 293 srcSize, kLinear_SkColorProfileType, mR, true,
295 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) 294 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);)
296 295
OLDNEW
« no previous file with comments | « bench/SKPBench.cpp ('k') | dm/DMSrcSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698