aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-01-13 11:23:26 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-13 11:23:27 -0800
commitc2eff2ac7750a967a9fb96803dcd3844fd356d3e (patch)
tree15bd960398ffc66e5dc224aeb4fde35e15da0a18 /gm
parentf44631b133909bbf98c13e53ec11bf8cd87a2dc4 (diff)
micro fix for rrects bug using GrDrawContext
Diffstat (limited to 'gm')
-rw-r--r--gm/rrects.cpp14
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) {