OLD | NEW |
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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkBitmapDevice.h" | 9 #include "SkBitmapDevice.h" |
10 #include "SkBlurImageFilter.h" | 10 #include "SkBlurImageFilter.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 this->addFilter("color filter", | 154 this->addFilter("color filter", |
155 SkColorFilterImageFilter::Make(std::move(cf), input, cropRect)); | 155 SkColorFilterImageFilter::Make(std::move(cf), input, cropRect)); |
156 } | 156 } |
157 | 157 |
158 { | 158 { |
159 sk_sp<SkImage> gradientImage(SkImage::MakeFromBitmap(make_gradient_c
ircle(64, 64))); | 159 sk_sp<SkImage> gradientImage(SkImage::MakeFromBitmap(make_gradient_c
ircle(64, 64))); |
160 sk_sp<SkImageFilter> gradientSource(SkImageSource::Make(std::move(gr
adientImage))); | 160 sk_sp<SkImageFilter> gradientSource(SkImageSource::Make(std::move(gr
adientImage))); |
161 | 161 |
162 this->addFilter("displacement map", | 162 this->addFilter("displacement map", |
163 sk_sp<SkImageFilter>(SkDisplacementMapEffect::Create( | 163 SkDisplacementMapEffect::Make(SkDisplacementMapEffect::kR_Channe
lSelectorType, |
164 SkDisplacementMapEffect::kR_ChannelSelec
torType, | 164 SkDisplacementMapEffect::kB_Channe
lSelectorType, |
165 SkDisplacementMapEffect::kB_ChannelSelec
torType, | 165 20.0f, |
166 20.0f, gradientSource.get(), input.get()
, cropRect))); | 166 std::move(gradientSource), input,
cropRect)); |
167 } | 167 } |
168 | 168 |
169 this->addFilter("blur", SkBlurImageFilter::Make(SK_Scalar1, | 169 this->addFilter("blur", SkBlurImageFilter::Make(SK_Scalar1, |
170 SK_Scalar1, | 170 SK_Scalar1, |
171 input, | 171 input, |
172 cropRect)); | 172 cropRect)); |
173 this->addFilter("drop shadow", SkDropShadowImageFilter::Make( | 173 this->addFilter("drop shadow", SkDropShadowImageFilter::Make( |
174 SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_ColorGREEN, | 174 SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_ColorGREEN, |
175 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, | 175 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, |
176 input, cropRect)); | 176 input, cropRect)); |
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1767 | 1767 |
1768 test_xfermode_cropped_input(&canvas, reporter); | 1768 test_xfermode_cropped_input(&canvas, reporter); |
1769 } | 1769 } |
1770 | 1770 |
1771 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(ImageFilterBlurLargeImage_Gpu, reporter, ctxInfo
) { | 1771 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(ImageFilterBlurLargeImage_Gpu, reporter, ctxInfo
) { |
1772 auto surface(SkSurface::MakeRenderTarget(ctxInfo.fGrContext, SkBudgeted::kYe
s, | 1772 auto surface(SkSurface::MakeRenderTarget(ctxInfo.fGrContext, SkBudgeted::kYe
s, |
1773 SkImageInfo::MakeN32Premul(100, 100
))); | 1773 SkImageInfo::MakeN32Premul(100, 100
))); |
1774 test_large_blur_input(reporter, surface->getCanvas()); | 1774 test_large_blur_input(reporter, surface->getCanvas()); |
1775 } | 1775 } |
1776 #endif | 1776 #endif |
OLD | NEW |