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

Unified Diff: gm/rrects.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/constcolorprocessor.cpp ('k') | gm/texturedomaineffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rrects.cpp
diff --git a/gm/rrects.cpp b/gm/rrects.cpp
index 938d4706dc26e4c3c291e6ed30233a07a9b1965f..8cb737b21cd83eafc3add526c5d179118ecd6274 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;
}
« no previous file with comments | « gm/constcolorprocessor.cpp ('k') | gm/texturedomaineffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698