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/drawatlascolor.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'gm/drawatlascolor.cpp') diff --git a/gm/drawatlascolor.cpp b/gm/drawatlascolor.cpp index 548641b354..8d53e31425 100644 --- a/gm/drawatlascolor.cpp +++ b/gm/drawatlascolor.cpp @@ -20,10 +20,7 @@ static sk_sp make_atlas(SkCanvas* caller, int atlasSize) { const int kBlockSize = atlasSize/2; SkImageInfo info = SkImageInfo::MakeN32Premul(atlasSize, atlasSize); - auto surface(caller->makeSurface(info)); - if (nullptr == surface) { - surface = SkSurface::MakeRaster(info); - } + auto surface(sk_tool_utils::makeSurface(caller, info)); SkCanvas* canvas = surface->getCanvas(); SkPaint paint; -- cgit v1.2.3