aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/multipicturedraw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gm/multipicturedraw.cpp')
-rw-r--r--gm/multipicturedraw.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/gm/multipicturedraw.cpp b/gm/multipicturedraw.cpp
index a4b09b2c2f..03934a601d 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;