diff options
Diffstat (limited to 'gm/rrects.cpp')
-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) { |