Index: gm/convexpolyeffect.cpp |
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp |
index 0c4c94b3aaa760c502606a1e84de18dc8272baef..5b278020f647404ea089c2f0ccf79d6fd819c0e8 100644 |
--- a/gm/convexpolyeffect.cpp |
+++ b/gm/convexpolyeffect.cpp |
@@ -153,18 +153,9 @@ protected: |
} |
void onDraw(SkCanvas* canvas) override { |
- GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); |
- if (nullptr == rt) { |
- skiagm::GM::DrawGpuOnlyMessage(canvas); |
- return; |
- } |
- GrContext* context = rt->getContext(); |
- if (nullptr == context) { |
- return; |
- } |
- |
- sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(rt))); |
+ GrDrawContext* drawContext = canvas->internal_private_accessTopLayerDrawContext(); |
if (!drawContext) { |
+ skiagm::GM::DrawGpuOnlyMessage(canvas); |
return; |
} |
@@ -191,7 +182,7 @@ protected: |
pipelineBuilder.setXPFactory( |
GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref(); |
pipelineBuilder.addCoverageFragmentProcessor(fp); |
- pipelineBuilder.setRenderTarget(rt); |
+ pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget()); |
SkAutoTUnref<GrDrawBatch> batch(new PolyBoundsBatch(p.getBounds(), 0xff000000)); |
@@ -232,7 +223,7 @@ protected: |
pipelineBuilder.setXPFactory( |
GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref(); |
pipelineBuilder.addCoverageFragmentProcessor(fp); |
- pipelineBuilder.setRenderTarget(rt); |
+ pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget()); |
SkAutoTUnref<GrDrawBatch> batch(new PolyBoundsBatch(rect, 0xff000000)); |