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

Side by Side Diff: bench/RectBench.cpp

Issue 1798133003: Revert of Finish conversion to sk_sp<SkShader> (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/PatchGridBench.cpp ('k') | bench/RepeatTileBench.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 SkRandom rand; 231 SkRandom rand;
232 SkColor color = 0xFF000000; 232 SkColor color = 0xFF000000;
233 U8CPU alpha = 0xFF; 233 U8CPU alpha = 0xFF;
234 SkPaint paint; 234 SkPaint paint;
235 paint.setStrokeCap(SkPaint::kRound_Cap); 235 paint.setStrokeCap(SkPaint::kRound_Cap);
236 if (_type == KMaskShader) { 236 if (_type == KMaskShader) {
237 SkBitmap srcBM; 237 SkBitmap srcBM;
238 srcBM.allocN32Pixels(10, 1); 238 srcBM.allocN32Pixels(10, 1);
239 srcBM.eraseColor(0xFF00FF00); 239 srcBM.eraseColor(0xFF00FF00);
240 240
241 paint.setShader(SkShader::MakeBitmapShader(srcBM, SkShader::kClamp_T ileMode, 241 SkShader* s;
242 SkShader::kClamp_TileMode )); 242 s = SkShader::CreateBitmapShader(srcBM, SkShader::kClamp_TileMode,
243 SkShader::kClamp_TileMode);
244 paint.setShader(s)->unref();
243 } 245 }
244 for (int loop = 0; loop < loops; loop++) { 246 for (int loop = 0; loop < loops; loop++) {
245 for (size_t i = 0; i < sizes; i++) { 247 for (size_t i = 0; i < sizes; i++) {
246 switch (_type) { 248 switch (_type) {
247 case kMaskOpaque: 249 case kMaskOpaque:
248 color = fColors[i]; 250 color = fColors[i];
249 alpha = 0xFF; 251 alpha = 0xFF;
250 break; 252 break;
251 case kMaskBlack: 253 case kMaskBlack:
252 alpha = 0xFF; 254 alpha = 0xFF;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 "maskopaque");) 302 "maskopaque");)
301 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, 303 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
302 BlitMaskBench::kMaskBlack, 304 BlitMaskBench::kMaskBlack,
303 "maskblack");) 305 "maskblack");)
304 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, 306 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
305 BlitMaskBench::kMaskColor, 307 BlitMaskBench::kMaskColor,
306 "maskcolor");) 308 "maskcolor");)
307 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, 309 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
308 BlitMaskBench::KMaskShader, 310 BlitMaskBench::KMaskShader,
309 "maskshader");) 311 "maskshader");)
OLDNEW
« no previous file with comments | « bench/PatchGridBench.cpp ('k') | bench/RepeatTileBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698