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

Unified Diff: gm/rrects.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/rectangletexture.cpp ('k') | gm/texdata.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rrects.cpp
diff --git a/gm/rrects.cpp b/gm/rrects.cpp
index 57c11ada5626f7d6912f898b4fcfb5f8f21c63a2..9f1c65d7e7c33c4f447e68fd241cb9208d187f5d 100644
--- a/gm/rrects.cpp
+++ b/gm/rrects.cpp
@@ -62,24 +62,8 @@ protected:
SkISize onISize() override { return SkISize::Make(kImageWidth, kImageHeight); }
void onDraw(SkCanvas* canvas) override {
- GrContext* context = nullptr;
-#if SK_SUPPORT_GPU
- GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget();
- context = rt ? rt->getContext() : nullptr;
- sk_sp<GrDrawContext> drawContext;
- if (kEffect_Type == fType) {
- if (!context) {
- skiagm::GM::DrawGpuOnlyMessage(canvas);
- return;
- }
-
- drawContext = context->drawContext(sk_ref_sp(rt));
- if (!drawContext) {
- return;
- }
- }
-#endif
- if (kEffect_Type == fType && nullptr == context) {
+ GrDrawContext* drawContext = canvas->internal_private_accessTopLayerDrawContext();
+ if (kEffect_Type == fType && !drawContext) {
skiagm::GM::DrawGpuOnlyMessage(canvas);
return;
}
@@ -128,7 +112,7 @@ protected:
rrect));
if (fp) {
pipelineBuilder.addCoverageFragmentProcessor(fp);
- pipelineBuilder.setRenderTarget(rt);
+ pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget());
SkRect bounds = rrect.getBounds();
bounds.outset(2.f, 2.f);
« no previous file with comments | « gm/rectangletexture.cpp ('k') | gm/texdata.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698