aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/rrects.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/rrects.cpp
parentbb25b5324965d53253fc3ad9f43b7d6faa2f9100 (diff)
Remove two varieties of drawNonAARect from GrDrawTarget
Diffstat (limited to 'gm/rrects.cpp')
-rw-r--r--gm/rrects.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/gm/rrects.cpp b/gm/rrects.cpp
index 938d4706dc..8cb737b21c 100644
--- a/gm/rrects.cpp
+++ b/gm/rrects.cpp
@@ -7,7 +7,10 @@
#include "gm.h"
#if SK_SUPPORT_GPU
-#include "GrTest.h"
+#include "GrContext.h"
+#include "GrDrawContext.h"
+#include "batches/GrDrawBatch.h"
+#include "batches/GrRectBatchFactory.h"
#include "effects/GrRRectEffect.h"
#endif
#include "SkDevice.h"
@@ -64,6 +67,10 @@ protected:
#if SK_SUPPORT_GPU
GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget();
context = rt ? rt->getContext() : nullptr;
+ SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt));
+ if (!drawContext) {
+ return;
+ }
#endif
if (kEffect_Type == fType && nullptr == context) {
skiagm::GM::DrawGpuOnlyMessage(canvas);
@@ -103,12 +110,6 @@ protected:
canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
if (kEffect_Type == fType) {
#if SK_SUPPORT_GPU
- GrTestTarget tt;
- context->getTestTarget(&tt, rt);
- if (nullptr == tt.target()) {
- SkDEBUGFAIL("Couldn't get Gr test target.");
- return;
- }
GrPipelineBuilder pipelineBuilder;
pipelineBuilder.setXPFactory(
GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref();
@@ -125,10 +126,10 @@ protected:
SkRect bounds = rrect.getBounds();
bounds.outset(2.f, 2.f);
- tt.target()->drawNonAARect(pipelineBuilder,
- 0xff000000,
- SkMatrix::I(),
- bounds);
+ SkAutoTUnref<GrDrawBatch> batch(
+ GrRectBatchFactory::CreateNonAAFill(0xff000000, SkMatrix::I(),
+ bounds, nullptr, nullptr));
+ drawContext->internal_drawBatch(pipelineBuilder, batch);
} else {
drew = false;
}