OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkDropShadowImageFilter.h" | 10 #include "SkDropShadowImageFilter.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 SkRect dst = SkRect::MakeXYWH(30, 30, 30, 30); | 115 SkRect dst = SkRect::MakeXYWH(30, 30, 30, 30); |
116 sk_sp<SkImageFilter> tileIF(SkTileImageFilter::Create(src, dst, nullptr)
); | 116 sk_sp<SkImageFilter> tileIF(SkTileImageFilter::Create(src, dst, nullptr)
); |
117 | 117 |
118 add_paint(paints, std::move(tileIF)); | 118 add_paint(paints, std::move(tileIF)); |
119 } | 119 } |
120 | 120 |
121 { | 121 { |
122 static const SkDropShadowImageFilter::ShadowMode kBoth = | 122 static const SkDropShadowImageFilter::ShadowMode kBoth = |
123 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode
; | 123 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode
; |
124 | 124 |
125 sk_sp<SkImageFilter> dsif( | 125 sk_sp<SkImageFilter> dsif(SkDropShadowImageFilter::Make(10.0f, 10.0f, |
126 SkDropShadowImageFilter::Create(10.0f, 10.0f, | 126 3.0f, 3.0f, |
127 3.0f, 3.0f, | 127 SK_ColorRED, kBo
th, |
128 SK_ColorRED, kBoth, | 128 source)); |
129 source.get(), nullptr)); | |
130 | 129 |
131 add_paint(paints, std::move(dsif)); | 130 add_paint(paints, std::move(dsif)); |
132 } | 131 } |
133 | 132 |
134 { | 133 { |
135 sk_sp<SkImageFilter> dsif( | 134 sk_sp<SkImageFilter> dsif( |
136 SkDropShadowImageFilter::Create(27.0f, 27.0f, | 135 SkDropShadowImageFilter::Make(27.0f, 27.0f, |
137 3.0f, 3.0f, | 136 3.0f, 3.0f, |
138 SK_ColorRED, | 137 SK_ColorRED, |
139 SkDropShadowImageFilter::kDrawShadow
Only_ShadowMode, | 138 SkDropShadowImageFilter::kDrawShadow
Only_ShadowMode, |
140 source.get(), nullptr)); | 139 source)); |
141 | 140 |
142 add_paint(paints, std::move(dsif)); | 141 add_paint(paints, std::move(dsif)); |
143 } | 142 } |
144 | 143 |
145 add_paint(paints, SkBlurImageFilter::Make(3, 3, source)); | 144 add_paint(paints, SkBlurImageFilter::Make(3, 3, source)); |
146 add_paint(paints, SkOffsetImageFilter::Make(15, 15, source)); | 145 add_paint(paints, SkOffsetImageFilter::Make(15, 15, source)); |
147 } | 146 } |
148 | 147 |
149 // This GM visualizes the fast bounds for various combinations of geometry | 148 // This GM visualizes the fast bounds for various combinations of geometry |
150 // and image filter | 149 // and image filter |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } | 313 } |
315 | 314 |
316 private: | 315 private: |
317 typedef GM INHERITED; | 316 typedef GM INHERITED; |
318 }; | 317 }; |
319 | 318 |
320 ////////////////////////////////////////////////////////////////////////////// | 319 ////////////////////////////////////////////////////////////////////////////// |
321 | 320 |
322 DEF_GM(return new ImageFilterFastBoundGM;) | 321 DEF_GM(return new ImageFilterFastBoundGM;) |
323 } | 322 } |
OLD | NEW |