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

Unified Diff: gm/constcolorprocessor.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/bigrrectaaeffect.cpp ('k') | gm/convexpolyeffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/constcolorprocessor.cpp
diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp
index cfc03398f60af7241ccdb2e527367776eead0f07..4e0e68d2cbd89d6f380db2cb1bbd3e1192229599 100644
--- a/gm/constcolorprocessor.cpp
+++ b/gm/constcolorprocessor.cpp
@@ -47,18 +47,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;
}
- sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(rt)));
- if (!drawContext) {
+ GrContext* context = canvas->getGrContext();
+ if (!context) {
return;
}
@@ -112,7 +108,9 @@ protected:
SkAutoTUnref<GrFragmentProcessor> fp(GrConstColorProcessor::Create(color, mode));
GrClip clip;
- GrPipelineBuilder pipelineBuilder(grPaint, rt, clip);
+ GrPipelineBuilder pipelineBuilder(grPaint,
+ drawContext->accessRenderTarget(),
+ clip);
pipelineBuilder.addColorFragmentProcessor(fp);
SkAutoTUnref<GrDrawBatch> batch(
« no previous file with comments | « gm/bigrrectaaeffect.cpp ('k') | gm/convexpolyeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698