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

Unified Diff: gm/constcolorprocessor.cpp

Issue 1584703003: Remove two varieties of drawNonAARect from GrDrawTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@hidedrawtargetabit
Patch Set: deprecation message on GrTest Created 4 years, 11 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/rrects.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 3b2605e7a36db5cbbfdb590f94a79daffc3479eb..a9cd4b5dc5d1d4dc85221babe82a2bc2c477ec69 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.
« no previous file with comments | « gm/bigrrectaaeffect.cpp ('k') | gm/rrects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698