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

Unified Diff: gm/yuvtorgbeffect.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/texturedomaineffect.cpp ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/yuvtorgbeffect.cpp
diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp
index 09c61765fbc0bacaceb6ca1c58cefa5ecc2d4584..40a2f03f27e223f50ed04541b6e9e9f9d9165311 100644
--- a/gm/yuvtorgbeffect.cpp
+++ b/gm/yuvtorgbeffect.cpp
@@ -69,18 +69,14 @@ protected:
}
void onDraw(SkCanvas* canvas) override {
- GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget();
- if (nullptr == rt) {
- return;
- }
- GrContext* context = rt->getContext();
- if (nullptr == context) {
+ GrDrawContext* drawContext = canvas->internal_private_accessTopLayerDrawContext();
+ if (!drawContext) {
skiagm::GM::DrawGpuOnlyMessage(canvas);
- return;
+ return;
}
- sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(rt)));
- if (!drawContext) {
+ GrContext* context = canvas->getGrContext();
+ if (!context) {
return;
}
@@ -126,7 +122,7 @@ protected:
if (fp) {
SkMatrix viewMatrix;
viewMatrix.setTranslate(x, y);
- pipelineBuilder.setRenderTarget(rt);
+ pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget());
pipelineBuilder.addColorFragmentProcessor(fp);
SkAutoTUnref<GrDrawBatch> batch(
GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, viewMatrix,
« no previous file with comments | « gm/texturedomaineffect.cpp ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698