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

Side by Side Diff: gm/coloremoji.cpp

Issue 1858813002: Update SkColorFilterImageFilter 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/ImageFilterCollapse.cpp ('k') | gm/colorfilterimagefilter.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 "gm.h" 8 #include "gm.h"
9 9
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 29
30 static sk_sp<SkImageFilter> make_grayscale(sk_sp<SkImageFilter> input) { 30 static sk_sp<SkImageFilter> make_grayscale(sk_sp<SkImageFilter> input) {
31 SkScalar matrix[20]; 31 SkScalar matrix[20];
32 memset(matrix, 0, 20 * sizeof(SkScalar)); 32 memset(matrix, 0, 20 * sizeof(SkScalar));
33 matrix[0] = matrix[5] = matrix[10] = 0.2126f; 33 matrix[0] = matrix[5] = matrix[10] = 0.2126f;
34 matrix[1] = matrix[6] = matrix[11] = 0.7152f; 34 matrix[1] = matrix[6] = matrix[11] = 0.7152f;
35 matrix[2] = matrix[7] = matrix[12] = 0.0722f; 35 matrix[2] = matrix[7] = matrix[12] = 0.0722f;
36 matrix[18] = 1.0f; 36 matrix[18] = 1.0f;
37 sk_sp<SkColorFilter> filter(SkColorFilter::MakeMatrixFilterRowMajor255(matri x)); 37 sk_sp<SkColorFilter> filter(SkColorFilter::MakeMatrixFilterRowMajor255(matri x));
38 return sk_sp<SkImageFilter>(SkColorFilterImageFilter::Create(filter.get(), i nput.get())); 38 return SkColorFilterImageFilter::Make(std::move(filter), std::move(input));
39 } 39 }
40 40
41 static sk_sp<SkImageFilter> make_blur(float amount, sk_sp<SkImageFilter> input) { 41 static sk_sp<SkImageFilter> make_blur(float amount, sk_sp<SkImageFilter> input) {
42 return SkBlurImageFilter::Make(amount, amount, std::move(input)); 42 return SkBlurImageFilter::Make(amount, amount, std::move(input));
43 } 43 }
44 44
45 namespace skiagm { 45 namespace skiagm {
46 46
47 class ColorEmojiGM : public GM { 47 class ColorEmojiGM : public GM {
48 public: 48 public:
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 155
156 typedef GM INHERITED; 156 typedef GM INHERITED;
157 }; 157 };
158 158
159 ////////////////////////////////////////////////////////////////////////////// 159 //////////////////////////////////////////////////////////////////////////////
160 160
161 DEF_GM(return new ColorEmojiGM;) 161 DEF_GM(return new ColorEmojiGM;)
162 162
163 } 163 }
OLDNEW
« no previous file with comments | « bench/ImageFilterCollapse.cpp ('k') | gm/colorfilterimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698