Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: gm/convexpolyeffect.cpp

Issue 1930623003: Clean up test drawContext usage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix typo Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/constcolorprocessor.cpp ('k') | gm/imagefromyuvtextures.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « gm/constcolorprocessor.cpp ('k') | gm/imagefromyuvtextures.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698