diff options
Diffstat (limited to 'gm/srcmode.cpp')
-rw-r--r-- | gm/srcmode.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gm/srcmode.cpp b/gm/srcmode.cpp index 28bb04bd4e..93a9bc7f05 100644 --- a/gm/srcmode.cpp +++ b/gm/srcmode.cpp @@ -115,7 +115,7 @@ protected: } } - static SkSurface* compat_surface(SkCanvas* canvas, const SkISize& size, bool skipGPU) { + static sk_sp<SkSurface> compat_surface(SkCanvas* canvas, const SkISize& size, bool skipGPU) { SkImageInfo info = SkImageInfo::MakeN32Premul(size); bool callNewSurface = true; @@ -124,17 +124,16 @@ protected: callNewSurface = false; } #endif - SkSurface* surface = callNewSurface ? canvas->newSurface(info) : nullptr; + sk_sp<SkSurface> surface = callNewSurface ? canvas->makeSurface(info) : nullptr; if (nullptr == surface) { // picture canvas will return null, so fall-back to raster - surface = SkSurface::NewRaster(info); + surface = SkSurface::MakeRaster(info); } return surface; } virtual void onDraw(SkCanvas* canvas) { - SkAutoTUnref<SkSurface> surf(compat_surface(canvas, this->getISize(), - this->isCanvasDeferred())); + auto surf(compat_surface(canvas, this->getISize(), this->isCanvasDeferred())); surf->getCanvas()->drawColor(SK_ColorWHITE); this->drawContent(surf->getCanvas()); surf->draw(canvas, 0, 0, nullptr); |