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

Unified Diff: tests/ImageFilterTest.cpp

Issue 182983003: Factory methods for heap-allocated SkImageFilter objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/GLProgramsTest.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageFilterTest.cpp
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 96dc9599503e2da440f2272e7cec83ba03dfd7ff..36c9a87c39b5efee4cfca427c3eee094b2ebdcb0 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -168,7 +168,7 @@ DEF_TEST(ImageFilter, reporter) {
// 3 ) large negative specular exponent value
SkScalar specularExponent = -1000;
- SkAutoTUnref<SkImageFilter> bmSrc(new SkBitmapSource(bitmap));
+ SkAutoTUnref<SkImageFilter> bmSrc(SkBitmapSource::Create(bitmap));
SkPaint paint;
paint.setImageFilter(SkLightingImageFilter::CreateSpotLitSpecular(
location, target, specularExponent, 180,
@@ -183,7 +183,7 @@ DEF_TEST(ImageFilter, reporter) {
{
// This tests for scale bringing width to 0
SkSize scale = SkSize::Make(-0.001f, SK_Scalar1);
- SkAutoTUnref<SkImageFilter> bmSrc(new SkBitmapSource(bitmap));
+ SkAutoTUnref<SkImageFilter> bmSrc(SkBitmapSource::Create(bitmap));
SkAutoTUnref<SkBicubicImageFilter> bicubic(
SkBicubicImageFilter::CreateMitchell(scale, bmSrc));
SkBitmapDevice device(bitmap);
@@ -222,21 +222,21 @@ static void test_crop_rects(SkBaseDevice* device, skiatest::Reporter* reporter)
SkImageFilter* filters[] = {
SkColorFilterImageFilter::Create(cf.get(), input.get(), &cropRect),
- new SkDisplacementMapEffect(SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kB_ChannelSelectorType,
- 40.0f, input.get(), input.get(), &cropRect),
- new SkBlurImageFilter(SK_Scalar1, SK_Scalar1, input.get(), &cropRect),
- new SkDropShadowImageFilter(SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_ColorGREEN, input.get(), &cropRect),
+ SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kB_ChannelSelectorType,
+ 40.0f, input.get(), input.get(), &cropRect),
+ SkBlurImageFilter::Create(SK_Scalar1, SK_Scalar1, input.get(), &cropRect),
+ SkDropShadowImageFilter::Create(SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_ColorGREEN, input.get(), &cropRect),
SkLightingImageFilter::CreatePointLitDiffuse(location, SK_ColorGREEN, 0, 0, input.get(), &cropRect),
SkLightingImageFilter::CreatePointLitSpecular(location, SK_ColorGREEN, 0, 0, 0, input.get(), &cropRect),
- new SkMatrixConvolutionImageFilter(kernelSize, kernel, gain, bias, SkIPoint::Make(1, 1), SkMatrixConvolutionImageFilter::kRepeat_TileMode, false, input.get(), &cropRect),
- new SkMergeImageFilter(input.get(), input.get(), SkXfermode::kSrcOver_Mode, &cropRect),
- new SkOffsetImageFilter(SK_Scalar1, SK_Scalar1, input.get(), &cropRect),
- new SkOffsetImageFilter(SK_Scalar1, SK_Scalar1, input.get(), &cropRect),
- new SkDilateImageFilter(3, 2, input.get(), &cropRect),
- new SkErodeImageFilter(2, 3, input.get(), &cropRect),
- new SkTileImageFilter(inputCropRect.rect(), cropRect.rect(), input.get()),
- new SkXfermodeImageFilter(SkXfermode::Create(SkXfermode::kSrcOver_Mode), input.get(), input.get(), &cropRect),
+ SkMatrixConvolutionImageFilter::Create(kernelSize, kernel, gain, bias, SkIPoint::Make(1, 1), SkMatrixConvolutionImageFilter::kRepeat_TileMode, false, input.get(), &cropRect),
+ SkMergeImageFilter::Create(input.get(), input.get(), SkXfermode::kSrcOver_Mode, &cropRect),
+ SkOffsetImageFilter::Create(SK_Scalar1, SK_Scalar1, input.get(), &cropRect),
+ SkOffsetImageFilter::Create(SK_Scalar1, SK_Scalar1, input.get(), &cropRect),
+ SkDilateImageFilter::Create(3, 2, input.get(), &cropRect),
+ SkErodeImageFilter::Create(2, 3, input.get(), &cropRect),
+ SkTileImageFilter::Create(inputCropRect.rect(), cropRect.rect(), input.get()),
+ SkXfermodeImageFilter::Create(SkXfermode::Create(SkXfermode::kSrcOver_Mode), input.get(), input.get(), &cropRect),
};
for (size_t i = 0; i < SK_ARRAY_COUNT(filters); ++i) {
« no previous file with comments | « tests/GLProgramsTest.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698