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

Unified Diff: gm/bigrrectaaeffect.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 | « no previous file | gm/constcolorprocessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bigrrectaaeffect.cpp
diff --git a/gm/bigrrectaaeffect.cpp b/gm/bigrrectaaeffect.cpp
index c3f47f932d1ca06c85c50d58d635fb090b50805b..fde636071b21b115e7215e0ec20d1f406a07e723 100644
--- a/gm/bigrrectaaeffect.cpp
+++ b/gm/bigrrectaaeffect.cpp
@@ -7,10 +7,14 @@
#include "gm.h"
#if SK_SUPPORT_GPU
-#include "GrTest.h"
-#include "effects/GrRRectEffect.h"
+#include "GrContext.h"
+#include "GrDrawContext.h"
+#include "GrPipelineBuilder.h"
#include "SkDevice.h"
#include "SkRRect.h"
+#include "batches/GrDrawBatch.h"
+#include "batches/GrRectBatchFactory.h"
+#include "effects/GrRRectEffect.h"
namespace skiagm {
@@ -53,6 +57,11 @@ protected:
return;
}
+ SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt));
+ if (!drawContext) {
+ return;
+ }
+
SkPaint paint;
int y = kPad;
@@ -72,12 +81,6 @@ protected:
paint.setColor(SK_ColorWHITE);
canvas->drawRect(testBounds, paint);
- GrTestTarget tt;
- context->getTestTarget(&tt, rt);
- if (!tt.target()) {
- SkDEBUGFAIL("Couldn't get Gr test target.");
- return;
- }
GrPipelineBuilder pipelineBuilder;
pipelineBuilder.setXPFactory(
GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref();
@@ -93,10 +96,10 @@ protected:
SkRect bounds = testBounds;
bounds.offset(SkIntToScalar(x), SkIntToScalar(y));
- tt.target()->drawNonAARect(pipelineBuilder,
- 0xff000000,
- SkMatrix::I(),
- bounds);
+ SkAutoTUnref<GrDrawBatch> batch(
+ GrRectBatchFactory::CreateNonAAFill(0xff000000, SkMatrix::I(), bounds,
+ nullptr, nullptr));
+ drawContext->internal_drawBatch(pipelineBuilder, batch);
}
canvas->restore();
x = x + fTestOffsetX;
« no previous file with comments | « no previous file | gm/constcolorprocessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698