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 "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 SkBlendMode::k
SrcIn)); | 146 SkBlendMode::k
SrcIn)); |
147 | 147 |
148 this->addFilter("color filter", | 148 this->addFilter("color filter", |
149 SkColorFilterImageFilter::Make(std::move(cf), input, cropRect)); | 149 SkColorFilterImageFilter::Make(std::move(cf), input, cropRect)); |
150 } | 150 } |
151 | 151 |
152 { | 152 { |
153 sk_sp<SkImage> gradientImage(SkImage::MakeFromBitmap(make_gradient_c
ircle(64, 64))); | 153 sk_sp<SkImage> gradientImage(SkImage::MakeFromBitmap(make_gradient_c
ircle(64, 64))); |
154 sk_sp<SkImageFilter> gradientSource(SkImageSource::Make(std::move(gr
adientImage))); | 154 sk_sp<SkImageFilter> gradientSource(SkImageSource::Make(std::move(gr
adientImage))); |
155 | 155 |
156 this->addFilter("displacement map", | 156 this->addFilter("displacement map", |
157 SkDisplacementMapEffect::Make(SkDisplacementMapEffect::kR_Channe
lSelectorType, | 157 SkDisplacementMapEffect::Make(SkDisplacementMapEffect::kR_Channe
lSelectorType, |
158 SkDisplacementMapEffect::kB_Channe
lSelectorType, | 158 SkDisplacementMapEffect::kB_Channe
lSelectorType, |
159 20.0f, | 159 20.0f, |
160 std::move(gradientSource), input,
cropRect)); | 160 std::move(gradientSource), input,
cropRect)); |
161 } | 161 } |
162 | 162 |
163 this->addFilter("blur", SkBlurImageFilter::Make(SK_Scalar1, | 163 this->addFilter("blur", SkBlurImageFilter::Make(SK_Scalar1, |
164 SK_Scalar1, | 164 SK_Scalar1, |
165 input, | 165 input, |
166 cropRect)); | 166 cropRect)); |
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1858 { SkColorFilterImageFilter::Make(cf, cfif), true }, | 1858 { SkColorFilterImageFilter::Make(cf, cfif), true }, |
1859 { SkMergeImageFilter::Make(cfif, cfif, SkBlendMode::kSrcOver), true
}, | 1859 { SkMergeImageFilter::Make(cfif, cfif, SkBlendMode::kSrcOver), true
}, |
1860 { SkComposeImageFilter::Make(cfif, cfif), true }, | 1860 { SkComposeImageFilter::Make(cfif, cfif), true }, |
1861 | 1861 |
1862 { blif, false }, | 1862 { blif, false }, |
1863 { SkBlurImageFilter::Make(3, 3, cfif), false }, | 1863 { SkBlurImageFilter::Make(3, 3, cfif), false }, |
1864 { SkColorFilterImageFilter::Make(cf, blif), false }, | 1864 { SkColorFilterImageFilter::Make(cf, blif), false }, |
1865 { SkMergeImageFilter::Make(cfif, blif, SkBlendMode::kSrcOver), false
}, | 1865 { SkMergeImageFilter::Make(cfif, blif, SkBlendMode::kSrcOver), false
}, |
1866 { SkComposeImageFilter::Make(blif, cfif), false }, | 1866 { SkComposeImageFilter::Make(blif, cfif), false }, |
1867 }; | 1867 }; |
1868 | 1868 |
1869 for (const auto& rec : recs) { | 1869 for (const auto& rec : recs) { |
1870 const bool canHandle = rec.fFilter->canHandleComplexCTM(); | 1870 const bool canHandle = rec.fFilter->canHandleComplexCTM(); |
1871 REPORTER_ASSERT(reporter, canHandle == rec.fExpectCanHandle); | 1871 REPORTER_ASSERT(reporter, canHandle == rec.fExpectCanHandle); |
1872 } | 1872 } |
1873 } | 1873 } |
OLD | NEW |