From 04194f32f4f5ec9029357a18c0f1f9dc3404fc0c Mon Sep 17 00:00:00 2001 From: joshualitt Date: Wed, 13 Jan 2016 10:08:27 -0800 Subject: Remove two varieties of drawNonAARect from GrDrawTarget BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1584703003 Review URL: https://codereview.chromium.org/1584703003 --- gm/constcolorprocessor.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'gm/constcolorprocessor.cpp') diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp index 3b2605e7a3..a9cd4b5dc5 100644 --- a/gm/constcolorprocessor.cpp +++ b/gm/constcolorprocessor.cpp @@ -13,10 +13,13 @@ #if SK_SUPPORT_GPU #include "GrContext.h" -#include "GrTest.h" -#include "effects/GrConstColorProcessor.h" +#include "GrDrawContext.h" +#include "GrPipelineBuilder.h" #include "SkGrPriv.h" #include "SkGradientShader.h" +#include "batches/GrDrawBatch.h" +#include "batches/GrRectBatchFactory.h" +#include "effects/GrConstColorProcessor.h" namespace skiagm { /** @@ -55,6 +58,11 @@ protected: return; } + SkAutoTUnref drawContext(context->drawContext(rt)); + if (!drawContext) { + return; + } + static const GrColor kColors[] = { 0xFFFFFFFF, 0xFFFF00FF, @@ -90,13 +98,6 @@ protected: // rect to draw SkRect renderRect = SkRect::MakeXYWH(0, 0, kRectSize, kRectSize); - GrTestTarget tt; - context->getTestTarget(&tt, rt); - if (nullptr == tt.target()) { - SkDEBUGFAIL("Couldn't get Gr test target."); - return; - } - GrPaint grPaint; SkPaint skPaint; if (paintType >= SK_ARRAY_COUNT(kPaintColors)) { @@ -114,10 +115,10 @@ protected: GrPipelineBuilder pipelineBuilder(grPaint, rt, clip); pipelineBuilder.addColorFragmentProcessor(fp); - tt.target()->drawNonAARect(pipelineBuilder, - grPaint.getColor(), - viewMatrix, - renderRect); + SkAutoTUnref batch( + GrRectBatchFactory::CreateNonAAFill(grPaint.getColor(), viewMatrix, + renderRect, nullptr, nullptr)); + drawContext->internal_drawBatch(pipelineBuilder, batch); // Draw labels for the input to the processor and the processor to the right of // the test rect. The input label appears above the processor label. -- cgit v1.2.3