Index: gm/tileimagefilter.cpp |
diff --git a/gm/tileimagefilter.cpp b/gm/tileimagefilter.cpp |
index eb0ad09f4be4cbfa6015532ee67ccd78d8b38e8e..b03af4420700ac6325f798f032f106f15b80e53c 100644 |
--- a/gm/tileimagefilter.cpp |
+++ b/gm/tileimagefilter.cpp |
@@ -35,14 +35,14 @@ protected: |
} |
void onOnceBeforeDraw() override { |
- fBitmap.reset(SkImage::NewFromBitmap( |
- sk_tool_utils::create_string_bitmap(50, 50, 0xD000D000, 10, 45, 50, "e"))); |
+ fBitmap = SkImage::MakeFromBitmap( |
+ sk_tool_utils::create_string_bitmap(50, 50, 0xD000D000, 10, 45, 50, "e")); |
- fCheckerboard.reset(SkImage::NewFromBitmap( |
+ fCheckerboard = SkImage::MakeFromBitmap( |
sk_tool_utils::create_checkerboard_bitmap(80, 80, |
sk_tool_utils::color_to_565(0xFFA0A0A0), |
sk_tool_utils::color_to_565(0xFF404040), |
- 8))); |
+ 8)); |
} |
void onDraw(SkCanvas* canvas) override { |
@@ -56,7 +56,7 @@ protected: |
int x = 0, y = 0; |
for (size_t i = 0; i < 4; i++) { |
- const SkImage* image = (i & 0x01) ? fCheckerboard : fBitmap; |
+ const SkImage* image = (i & 0x01) ? fCheckerboard.get() : fBitmap.get(); |
SkRect srcRect = SkRect::MakeXYWH(SkIntToScalar(image->width()/4), |
SkIntToScalar(image->height()/4), |
SkIntToScalar(image->width()/(i+1)), |
@@ -72,7 +72,7 @@ protected: |
canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); |
SkPaint paint; |
paint.setImageFilter(filter); |
- canvas->drawImage(fBitmap, 0, 0, &paint); |
+ canvas->drawImage(fBitmap.get(), 0, 0, &paint); |
canvas->drawRect(srcRect, red); |
canvas->drawRect(dstRect, blue); |
canvas->restore(); |
@@ -102,14 +102,14 @@ protected: |
canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); |
canvas->clipRect(dstRect); |
canvas->saveLayer(&dstRect, &paint); |
- canvas->drawImage(fBitmap, 0, 0); |
+ canvas->drawImage(fBitmap.get(), 0, 0); |
canvas->restore(); |
canvas->drawRect(srcRect, red); |
canvas->drawRect(dstRect, blue); |
canvas->restore(); |
} |
private: |
- SkAutoTUnref<SkImage> fBitmap, fCheckerboard; |
+ sk_sp<SkImage> fBitmap, fCheckerboard; |
typedef GM INHERITED; |
}; |