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

Unified Diff: gm/imagefiltersclipped.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/imagefiltersbase.cpp ('k') | gm/imagefilterscropped.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersclipped.cpp
diff --git a/gm/imagefiltersclipped.cpp b/gm/imagefiltersclipped.cpp
index bb6cd0471f72600cc67bf563a909366ca89b83fc..84e63b8f0d5b5931304ef0d70520646d6dfbf61b 100644
--- a/gm/imagefiltersclipped.cpp
+++ b/gm/imagefiltersclipped.cpp
@@ -87,24 +87,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(12), SkIntToScalar(12)),
- new SkDropShadowImageFilter(SkIntToScalar(10), SkIntToScalar(10), SkIntToScalar(3),
- SK_ColorGREEN),
- new SkDisplacementMapEffect(SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkIntToScalar(12),
- gradient.get(),
- checkerboard.get()),
- new SkDilateImageFilter(2, 2, checkerboard.get()),
- new SkErodeImageFilter(2, 2, checkerboard.get()),
- new SkOffsetImageFilter(SkIntToScalar(-16), SkIntToScalar(32)),
- new SkResizeImageFilter(RESIZE_FACTOR_X, RESIZE_FACTOR_Y, SkPaint::kNone_FilterLevel),
+ SkBlurImageFilter::Create(SkIntToScalar(12), SkIntToScalar(12)),
+ SkDropShadowImageFilter::Create(SkIntToScalar(10), SkIntToScalar(10), SkIntToScalar(3),
+ SK_ColorGREEN),
+ SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkIntToScalar(12),
+ gradient.get(),
+ checkerboard.get()),
+ SkDilateImageFilter::Create(2, 2, checkerboard.get()),
+ SkErodeImageFilter::Create(2, 2, checkerboard.get()),
+ SkOffsetImageFilter::Create(SkIntToScalar(-16), SkIntToScalar(32)),
+ SkResizeImageFilter::Create(RESIZE_FACTOR_X, RESIZE_FACTOR_Y, SkPaint::kNone_FilterLevel),
SkRectShaderImageFilter::Create(noise),
};
« no previous file with comments | « gm/imagefiltersbase.cpp ('k') | gm/imagefilterscropped.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698