From 46596ae50559e89a0a2462573ac9448cf309cf56 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Tue, 2 Jan 2018 15:40:29 -0500 Subject: use tool_utils to encapsulate checking for recording canvas and makeSurface Bug: skia: Change-Id: Ia93ee09dd213b8d6ad5c18e887add5ff3448c824 Reviewed-on: https://skia-review.googlesource.com/90243 Reviewed-by: Mike Reed Commit-Queue: Mike Reed --- gm/multipicturedraw.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'gm/multipicturedraw.cpp') diff --git a/gm/multipicturedraw.cpp b/gm/multipicturedraw.cpp index b18fb8a53b..4dd0139cd2 100644 --- a/gm/multipicturedraw.cpp +++ b/gm/multipicturedraw.cpp @@ -241,12 +241,7 @@ static sk_sp make_sierpinski_picture() { static sk_sp create_compat_surface(SkCanvas* canvas, int width, int height) { SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); - auto surface = canvas->makeSurface(info); - if (nullptr == surface) { - // picture canvas returns nullptr so fall back to raster - surface = SkSurface::MakeRaster(info); - } - return surface; + return sk_tool_utils::makeSurface(canvas, info); } // This class stores the information required to compose all the result -- cgit v1.2.3