Index: gm/displacement.cpp |
diff --git a/gm/displacement.cpp b/gm/displacement.cpp |
index c5f1837c91133bede3fcf4f01ba98cca24253173..a3fb9e5e5b9d1757dcdca04499caa9d63abd92b2 100644 |
--- a/gm/displacement.cpp |
+++ b/gm/displacement.cpp |
@@ -30,16 +30,16 @@ protected: |
SkColor c1 = sk_tool_utils::color_to_565(0xFF244484); |
SkColor c2 = sk_tool_utils::color_to_565(0xFF804020); |
- fCheckerboard.reset(SkImage::NewFromBitmap( |
- sk_tool_utils::create_checkerboard_bitmap(80, 80, c1, c2, 8))); |
- fSmall.reset(SkImage::NewFromBitmap( |
- sk_tool_utils::create_checkerboard_bitmap(64, 64, c1, c2, 8))); |
- fLarge.reset(SkImage::NewFromBitmap( |
- sk_tool_utils::create_checkerboard_bitmap(96, 96, c1, c2, 8))); |
- fLargeW.reset( |
- SkImage::NewFromBitmap(sk_tool_utils::create_checkerboard_bitmap(96, 64, c1, c2, 8))); |
- fLargeH.reset(SkImage::NewFromBitmap( |
- sk_tool_utils::create_checkerboard_bitmap(64, 96, c1, c2, 8))); |
+ fCheckerboard = SkImage::MakeFromBitmap( |
+ sk_tool_utils::create_checkerboard_bitmap(80, 80, c1, c2, 8)); |
+ fSmall = SkImage::MakeFromBitmap( |
+ sk_tool_utils::create_checkerboard_bitmap(64, 64, c1, c2, 8)); |
+ fLarge = SkImage::MakeFromBitmap( |
+ sk_tool_utils::create_checkerboard_bitmap(96, 96, c1, c2, 8)); |
+ fLargeW = |
+ SkImage::MakeFromBitmap(sk_tool_utils::create_checkerboard_bitmap(96, 64, c1, c2, 8)); |
+ fLargeH = SkImage::MakeFromBitmap( |
+ sk_tool_utils::create_checkerboard_bitmap(64, 96, c1, c2, 8)); |
} |
SkISize onISize() override { |
@@ -57,7 +57,7 @@ protected: |
void onDraw(SkCanvas* canvas) override { |
canvas->clear(SK_ColorBLACK); |
SkPaint paint; |
- SkAutoTUnref<SkImageFilter> displ(SkImageSource::Create(fCheckerboard)); |
+ SkAutoTUnref<SkImageFilter> displ(SkImageSource::Create(fCheckerboard.get())); |
paint.setImageFilter(SkDisplacementMapEffect::Create( |
SkDisplacementMapEffect::kR_ChannelSelectorType, |
SkDisplacementMapEffect::kG_ChannelSelectorType, 0.0f, displ))->unref(); |
@@ -161,25 +161,25 @@ protected: |
this->drawClippedBitmap(canvas, 500, 0, paint); |
// Tests for images of different sizes |
- displ.reset(SkImageSource::Create(fSmall)); |
+ displ.reset(SkImageSource::Create(fSmall.get())); |
paint.setImageFilter(SkDisplacementMapEffect::Create( |
SkDisplacementMapEffect::kR_ChannelSelectorType, |
SkDisplacementMapEffect::kG_ChannelSelectorType, |
40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 0, 400, paint); |
- displ.reset(SkImageSource::Create(fLarge)); |
+ displ.reset(SkImageSource::Create(fLarge.get())); |
paint.setImageFilter(SkDisplacementMapEffect::Create( |
SkDisplacementMapEffect::kB_ChannelSelectorType, |
SkDisplacementMapEffect::kA_ChannelSelectorType, |
40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 100, 400, paint); |
- displ.reset(SkImageSource::Create(fLargeW)); |
+ displ.reset(SkImageSource::Create(fLargeW.get())); |
paint.setImageFilter(SkDisplacementMapEffect::Create( |
SkDisplacementMapEffect::kR_ChannelSelectorType, |
SkDisplacementMapEffect::kB_ChannelSelectorType, |
40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 200, 400, paint); |
- displ.reset(SkImageSource::Create(fLargeH)); |
+ displ.reset(SkImageSource::Create(fLargeH.get())); |
paint.setImageFilter(SkDisplacementMapEffect::Create( |
SkDisplacementMapEffect::kG_ChannelSelectorType, |
SkDisplacementMapEffect::kA_ChannelSelectorType, |
@@ -198,7 +198,7 @@ protected: |
private: |
SkBitmap fBitmap; |
- SkAutoTUnref<SkImage> fCheckerboard, fSmall, fLarge, fLargeW, fLargeH; |
+ sk_sp<SkImage> fCheckerboard, fSmall, fLarge, fLargeW, fLargeH; |
typedef GM INHERITED; |
}; |