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

Side by Side Diff: bench/MergeBench.cpp

Issue 1842243002: Update SkImageSource to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 8 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/DisplacementBench.cpp ('k') | gm/bigtileimagefilter.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 2013 Google Inc. 2 * Copyright 2013 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 "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkImageSource.h" 10 #include "SkImageSource.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 SkRect::MakeWH(FILTER_WIDTH_LARGE, FILTER_HEIGHT_L ARGE); 73 SkRect::MakeWH(FILTER_WIDTH_LARGE, FILTER_HEIGHT_L ARGE);
74 SkPaint paint; 74 SkPaint paint;
75 paint.setImageFilter(this->mergeBitmaps()); 75 paint.setImageFilter(this->mergeBitmaps());
76 for (int i = 0; i < loops; i++) { 76 for (int i = 0; i < loops; i++) {
77 canvas->drawRect(r, paint); 77 canvas->drawRect(r, paint);
78 } 78 }
79 } 79 }
80 80
81 private: 81 private:
82 sk_sp<SkImageFilter> mergeBitmaps() { 82 sk_sp<SkImageFilter> mergeBitmaps() {
83 sk_sp<SkImageFilter> first(SkImageSource::Create(fCheckerboard.get())); 83 return SkMergeImageFilter::Make(SkImageSource::Make(fCheckerboard),
84 sk_sp<SkImageFilter> second(SkImageSource::Create(fImage.get())); 84 SkImageSource::Make(fImage));
85 return SkMergeImageFilter::Make(std::move(first), std::move(second));
86 } 85 }
87 86
88 bool fIsSmall; 87 bool fIsSmall;
89 bool fInitialized; 88 bool fInitialized;
90 sk_sp<SkImage> fImage, fCheckerboard; 89 sk_sp<SkImage> fImage, fCheckerboard;
91 90
92 typedef Benchmark INHERITED; 91 typedef Benchmark INHERITED;
93 }; 92 };
94 93
95 /////////////////////////////////////////////////////////////////////////////// 94 ///////////////////////////////////////////////////////////////////////////////
96 95
97 DEF_BENCH( return new MergeBench(true); ) 96 DEF_BENCH( return new MergeBench(true); )
98 DEF_BENCH( return new MergeBench(false); ) 97 DEF_BENCH( return new MergeBench(false); )
OLDNEW
« no previous file with comments | « bench/DisplacementBench.cpp ('k') | gm/bigtileimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698