Index: gm/rrects.cpp |
diff --git a/gm/rrects.cpp b/gm/rrects.cpp |
index 8cb737b21cd83eafc3add526c5d179118ecd6274..63d6c9e6dbbf2adb56e8528d291ed53bee96c0b0 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) { |