Index: gm/imagefiltersscaled.cpp |
diff --git a/gm/imagefiltersscaled.cpp b/gm/imagefiltersscaled.cpp |
index da4467882bccc773b2a2820051ca642c6231367b..391f4e5c1cd86aa37d16f22cfc95b0adb9197adc 100644 |
--- a/gm/imagefiltersscaled.cpp |
+++ b/gm/imagefiltersscaled.cpp |
@@ -44,16 +44,16 @@ protected: |
} |
void onOnceBeforeDraw() override { |
- fCheckerboard.reset(SkImage::NewFromBitmap( |
- sk_tool_utils::create_checkerboard_bitmap(64, 64, 0xFFA0A0A0, 0xFF404040, 8))); |
- fGradientCircle.reset(MakeGradientCircle(64, 64)); |
+ fCheckerboard = SkImage::MakeFromBitmap( |
+ sk_tool_utils::create_checkerboard_bitmap(64, 64, 0xFFA0A0A0, 0xFF404040, 8)); |
+ fGradientCircle = MakeGradientCircle(64, 64); |
} |
void onDraw(SkCanvas* canvas) override { |
canvas->clear(SK_ColorBLACK); |
- SkAutoTUnref<SkImageFilter> gradient(SkImageSource::Create(fGradientCircle)); |
- SkAutoTUnref<SkImageFilter> checkerboard(SkImageSource::Create(fCheckerboard)); |
+ SkAutoTUnref<SkImageFilter> gradient(SkImageSource::Create(fGradientCircle.get())); |
+ SkAutoTUnref<SkImageFilter> checkerboard(SkImageSource::Create(fCheckerboard.get())); |
SkAutoTUnref<SkShader> noise(SkPerlinNoiseShader::CreateFractalNoise( |
SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0)); |
SkPaint noisePaint; |
@@ -135,7 +135,7 @@ protected: |
} |
private: |
- static SkImage* MakeGradientCircle(int width, int height) { |
+ static sk_sp<SkImage> MakeGradientCircle(int width, int height) { |
SkScalar x = SkIntToScalar(width / 2); |
SkScalar y = SkIntToScalar(height / 2); |
SkScalar radius = SkScalarMul(SkMinScalar(x, y), SkIntToScalar(4) / SkIntToScalar(5)); |
@@ -150,10 +150,10 @@ private: |
2, SkShader::kClamp_TileMode)); |
canvas->drawCircle(x, y, radius, paint); |
- return surface->newImageSnapshot(); |
+ return surface->makeImageSnapshot(); |
} |
- SkAutoTUnref<SkImage> fCheckerboard, fGradientCircle; |
+ sk_sp<SkImage> fCheckerboard, fGradientCircle; |
typedef GM INHERITED; |
}; |