Index: gm/multipicturedraw.cpp |
diff --git a/gm/multipicturedraw.cpp b/gm/multipicturedraw.cpp |
index a4b09b2c2fcc7bd7bd0b5b77c14d025fa98b8c9f..03934a601d5cac435fe4b3cdaabc406d641f3fc3 100644 |
--- a/gm/multipicturedraw.cpp |
+++ b/gm/multipicturedraw.cpp |
@@ -241,15 +241,14 @@ static sk_sp<SkPicture> make_sierpinski_picture() { |
return recorder.finishRecordingAsPicture(); |
} |
-static SkSurface* create_compat_surface(SkCanvas* canvas, int width, int height) { |
+static sk_sp<SkSurface> create_compat_surface(SkCanvas* canvas, int width, int height) { |
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); |
- SkSurface* surface = canvas->newSurface(info); |
+ auto surface = canvas->makeSurface(info); |
if (nullptr == surface) { |
// picture canvas returns nullptr so fall back to raster |
- surface = SkSurface::NewRaster(info); |
+ surface = SkSurface::MakeRaster(info); |
} |
- |
return surface; |
} |
@@ -257,13 +256,12 @@ static SkSurface* create_compat_surface(SkCanvas* canvas, int width, int height) |
// fragments potentially generated by the MultiPictureDraw object |
class ComposeStep { |
public: |
- ComposeStep() : fSurf(nullptr), fX(0.0f), fY(0.0f), fPaint(nullptr) { } |
+ ComposeStep() : fX(0.0f), fY(0.0f), fPaint(nullptr) { } |
~ComposeStep() { |
- SkSafeUnref(fSurf); |
delete fPaint; |
} |
- SkSurface* fSurf; |
+ sk_sp<SkSurface> fSurf; |
SkScalar fX; |
SkScalar fY; |
SkPaint* fPaint; |