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

Unified Diff: gm/imagefiltersscaled.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 | « gm/imagefiltersgraph.cpp ('k') | gm/imagemagnifier.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersscaled.cpp
diff --git a/gm/imagefiltersscaled.cpp b/gm/imagefiltersscaled.cpp
index ab24a3025f170685cbdea17b188ddb80ba511cb2..809e7ea3445937dc3526586a61f4728756a0beaf 100644
--- a/gm/imagefiltersscaled.cpp
+++ b/gm/imagefiltersscaled.cpp
@@ -86,24 +86,24 @@ protected:
}
canvas->clear(0x00000000);
- SkAutoTUnref<SkImageFilter> gradient(new SkBitmapSource(fGradientCircle));
- SkAutoTUnref<SkImageFilter> checkerboard(new SkBitmapSource(fCheckerboard));
+ SkAutoTUnref<SkImageFilter> gradient(SkBitmapSource::Create(fGradientCircle));
+ SkAutoTUnref<SkImageFilter> checkerboard(SkBitmapSource::Create(fCheckerboard));
SkAutoTUnref<SkShader> noise(SkPerlinNoiseShader::CreateFractalNoise(
SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0));
SkImageFilter* filters[] = {
- new SkBlurImageFilter(SkIntToScalar(4), SkIntToScalar(4)),
- new SkDropShadowImageFilter(SkIntToScalar(5), SkIntToScalar(10), SkIntToScalar(3),
- SK_ColorYELLOW),
- new SkDisplacementMapEffect(SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkIntToScalar(12),
- gradient.get(),
- checkerboard.get()),
- new SkDilateImageFilter(1, 1, checkerboard.get()),
- new SkErodeImageFilter(1, 1, checkerboard.get()),
- new SkOffsetImageFilter(SkIntToScalar(32), 0),
- new SkResizeImageFilter(RESIZE_FACTOR, RESIZE_FACTOR, SkPaint::kNone_FilterLevel),
+ SkBlurImageFilter::Create(SkIntToScalar(4), SkIntToScalar(4)),
+ SkDropShadowImageFilter::Create(SkIntToScalar(5), SkIntToScalar(10), SkIntToScalar(3),
+ SK_ColorYELLOW),
+ SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkIntToScalar(12),
+ gradient.get(),
+ checkerboard.get()),
+ SkDilateImageFilter::Create(1, 1, checkerboard.get()),
+ SkErodeImageFilter::Create(1, 1, checkerboard.get()),
+ SkOffsetImageFilter::Create(SkIntToScalar(32), 0),
+ SkResizeImageFilter::Create(RESIZE_FACTOR, RESIZE_FACTOR, SkPaint::kNone_FilterLevel),
SkRectShaderImageFilter::Create(noise),
};
« no previous file with comments | « gm/imagefiltersgraph.cpp ('k') | gm/imagemagnifier.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698