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

Unified Diff: gm/texturedomaineffect.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/rrects.cpp ('k') | gm/yuvtorgbeffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/texturedomaineffect.cpp
diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp
index 3eaba9080628fa6cba1490b57fdb66f681e285a6..53316f7234bc1060fbdacddc9cf49bd7b7bd4ffb 100644
--- a/gm/texturedomaineffect.cpp
+++ b/gm/texturedomaineffect.cpp
@@ -12,12 +12,14 @@
#if SK_SUPPORT_GPU
+#include "GrDrawContext.h"
#include "GrContext.h"
-#include "GrTest.h"
-#include "effects/GrTextureDomain.h"
#include "SkBitmap.h"
#include "SkGr.h"
#include "SkGradientShader.h"
+#include "batches/GrDrawBatch.h"
+#include "batches/GrRectBatchFactory.h"
+#include "effects/GrTextureDomain.h"
namespace skiagm {
/**
@@ -79,10 +81,8 @@ protected:
return;
}
- GrTestTarget tt;
- context->getTestTarget(&tt, rt);
- if (nullptr == tt.target()) {
- SkDEBUGFAIL("Couldn't get Gr test target.");
+ SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt));
+ if (!drawContext) {
return;
}
@@ -132,10 +132,10 @@ protected:
pipelineBuilder.setRenderTarget(rt);
pipelineBuilder.addColorFragmentProcessor(fp);
- tt.target()->drawNonAARect(pipelineBuilder,
- GrColor_WHITE,
- viewMatrix,
- renderRect);
+ SkAutoTUnref<GrDrawBatch> batch(
+ GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, viewMatrix,
+ renderRect, nullptr, nullptr));
+ drawContext->internal_drawBatch(pipelineBuilder, batch);
x += renderRect.width() + kTestPad;
}
y += renderRect.height() + kTestPad;
« no previous file with comments | « gm/rrects.cpp ('k') | gm/yuvtorgbeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698