diff options
author | joshualitt <joshualitt@chromium.org> | 2016-01-13 11:23:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-13 11:23:27 -0800 |
commit | c2eff2ac7750a967a9fb96803dcd3844fd356d3e (patch) | |
tree | 15bd960398ffc66e5dc224aeb4fde35e15da0a18 /gm | |
parent | f44631b133909bbf98c13e53ec11bf8cd87a2dc4 (diff) |
micro fix for rrects bug using GrDrawContext
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1582933002
Review URL: https://codereview.chromium.org/1582933002
Diffstat (limited to 'gm')
-rw-r--r-- | gm/rrects.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gm/rrects.cpp b/gm/rrects.cpp index 8cb737b21c..63d6c9e6db 100644 --- a/gm/rrects.cpp +++ b/gm/rrects.cpp @@ -67,9 +67,17 @@ protected: #if SK_SUPPORT_GPU GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); context = rt ? rt->getContext() : nullptr; - SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); - if (!drawContext) { - return; + SkAutoTUnref<GrDrawContext> drawContext; + if (kEffect_Type == fType) { + if (!context) { + skiagm::GM::DrawGpuOnlyMessage(canvas); + return; + } + + drawContext.reset(context->drawContext(rt)); + if (!drawContext) { + return; + } } #endif if (kEffect_Type == fType && nullptr == context) { |