OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkColor.h" | 10 #include "SkColor.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void onOnceBeforeDraw() override { | 59 void onOnceBeforeDraw() override { |
60 fCheckerboard = SkImage::MakeFromBitmap( | 60 fCheckerboard = SkImage::MakeFromBitmap( |
61 sk_tool_utils::create_checkerboard_bitmap(64, 64, 0xFFA0A0A0, 0xFF40
4040, 8)); | 61 sk_tool_utils::create_checkerboard_bitmap(64, 64, 0xFFA0A0A0, 0xFF40
4040, 8)); |
62 fGradientCircle = make_gradient_circle(64, 64); | 62 fGradientCircle = make_gradient_circle(64, 64); |
63 } | 63 } |
64 | 64 |
65 void onDraw(SkCanvas* canvas) override { | 65 void onDraw(SkCanvas* canvas) override { |
66 sk_sp<SkImageFilter> gradient(SkImageSource::Make(fGradientCircle)); | 66 sk_sp<SkImageFilter> gradient(SkImageSource::Make(fGradientCircle)); |
67 sk_sp<SkImageFilter> checkerboard(SkImageSource::Make(fCheckerboard)); | 67 sk_sp<SkImageFilter> checkerboard(SkImageSource::Make(fCheckerboard)); |
68 SkImageFilter* filters[] = { | 68 SkImageFilter* filters[] = { |
69 SkBlurImageFilter::Create(12, 0), | 69 SkBlurImageFilter::Make(12, 0, nullptr).release(), |
70 SkDropShadowImageFilter::Create(0, 15, 8, 0, SK_ColorGREEN, | 70 SkDropShadowImageFilter::Create(0, 15, 8, 0, SK_ColorGREEN, |
71 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), | 71 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), |
72 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, | 72 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, |
73 SkDisplacementMapEffect::kR_ChannelS
electorType, | 73 SkDisplacementMapEffect::kR_ChannelS
electorType, |
74 12, | 74 12, |
75 gradient.get(), | 75 gradient.get(), |
76 checkerboard.get()), | 76 checkerboard.get()), |
77 SkDilateImageFilter::Create(2, 2, checkerboard.get()), | 77 SkDilateImageFilter::Create(2, 2, checkerboard.get()), |
78 SkErodeImageFilter::Create(2, 2, checkerboard.get()), | 78 SkErodeImageFilter::Create(2, 2, checkerboard.get()), |
79 }; | 79 }; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 sk_sp<SkImage> fCheckerboard; | 116 sk_sp<SkImage> fCheckerboard; |
117 sk_sp<SkImage> fGradientCircle; | 117 sk_sp<SkImage> fGradientCircle; |
118 typedef GM INHERITED; | 118 typedef GM INHERITED; |
119 }; | 119 }; |
120 | 120 |
121 ////////////////////////////////////////////////////////////////////////////// | 121 ////////////////////////////////////////////////////////////////////////////// |
122 | 122 |
123 DEF_GM( return new ImageFiltersTransformedGM; ) | 123 DEF_GM( return new ImageFiltersTransformedGM; ) |
124 | 124 |
125 } | 125 } |
OLD | NEW |