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/ninepatchstretch.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'gm/ninepatchstretch.cpp') diff --git a/gm/ninepatchstretch.cpp b/gm/ninepatchstretch.cpp index 90a02161ef..c905cee803 100644 --- a/gm/ninepatchstretch.cpp +++ b/gm/ninepatchstretch.cpp @@ -7,14 +7,11 @@ #include "gm.h" #include "SkSurface.h" +#include "sk_tool_utils.h" static sk_sp make_surface(SkCanvas* root, int N) { SkImageInfo info = SkImageInfo::MakeN32Premul(N, N); - auto surface = root->makeSurface(info); - if (!surface) { - surface = SkSurface::MakeRaster(info); - } - return surface; + return sk_tool_utils::makeSurface(root, info); } static sk_sp make_image(SkCanvas* root, SkIRect* center) { -- cgit v1.2.3