aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/multipicturedraw.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-02 15:40:29 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-02 21:06:41 +0000
commit46596ae50559e89a0a2462573ac9448cf309cf56 (patch)
treebc515e91123b6d0d14f7873c4ab7ce2d22b41bcc /gm/multipicturedraw.cpp
parent99b504018b31d63566995b3fc114c940ed4749c4 (diff)
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 <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'gm/multipicturedraw.cpp')
-rw-r--r--gm/multipicturedraw.cpp7
1 files changed, 1 insertions, 6 deletions
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<SkPicture> make_sierpinski_picture() {
static sk_sp<SkSurface> 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