aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/constcolorprocessor.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-01-13 10:08:27 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-13 10:08:27 -0800
commit04194f32f4f5ec9029357a18c0f1f9dc3404fc0c (patch)
tree9dccf58152272d4b36c4279e2566ed526f98eb9b /gm/constcolorprocessor.cpp
parentbb25b5324965d53253fc3ad9f43b7d6faa2f9100 (diff)
Remove two varieties of drawNonAARect from GrDrawTarget
Diffstat (limited to 'gm/constcolorprocessor.cpp')
-rw-r--r--gm/constcolorprocessor.cpp27
1 files changed, 14 insertions, 13 deletions
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<GrDrawContext> 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<GrDrawBatch> 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.