Index: gm/drawminibitmaprect.cpp |
diff --git a/gm/drawminibitmaprect.cpp b/gm/drawminibitmaprect.cpp |
index f0ce1a2db6d57cfbf7181c27f0552a4c08b8533a..c494605daf37ce4437711a4bb9c336c6ecf08e59 100644 |
--- a/gm/drawminibitmaprect.cpp |
+++ b/gm/drawminibitmaprect.cpp |
@@ -13,7 +13,7 @@ |
#include "SkShader.h" |
#include "SkSurface.h" |
-static SkImage* makebm(SkCanvas* caller, int w, int h) { |
+static sk_sp<SkImage> makebm(SkCanvas* caller, int w, int h) { |
SkImageInfo info = SkImageInfo::MakeN32Premul(w, h); |
SkAutoTUnref<SkSurface> surface(caller->newSurface(info)); |
if (nullptr == surface) { |
@@ -56,7 +56,7 @@ static SkImage* makebm(SkCanvas* caller, int w, int h) { |
rect.inset(wScalar / 8, hScalar / 8); |
mat.postScale(SK_Scalar1 / 4, SK_Scalar1 / 4); |
} |
- return surface->newImageSnapshot(); |
+ return surface->makeImageSnapshot(); |
} |
static const int gSize = 1024; |
@@ -80,7 +80,7 @@ protected: |
void onDraw(SkCanvas* canvas) override { |
if (nullptr == fImage) { |
- fImage.reset(makebm(canvas, gSurfaceSize, gSurfaceSize)); |
+ fImage = makebm(canvas, gSurfaceSize, gSurfaceSize); |
} |
const SkRect dstRect = { 0, 0, SkIntToScalar(64), SkIntToScalar(64)}; |
@@ -113,7 +113,7 @@ protected: |
// rect stays rect |
break; |
} |
- canvas->drawImageRect(fImage, srcRect, dstRect, &paint, |
+ canvas->drawImageRect(fImage.get(), srcRect, dstRect, &paint, |
SkCanvas::kFast_SrcRectConstraint); |
canvas->restore(); |
@@ -131,9 +131,9 @@ protected: |
} |
private: |
- bool fAA; |
- SkAutoTUnref<SkImage> fImage; |
- SkString fName; |
+ bool fAA; |
+ sk_sp<SkImage> fImage; |
+ SkString fName; |
typedef skiagm::GM INHERITED; |
}; |