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

Unified Diff: gm/yuvtorgbeffect.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/texturedomaineffect.cpp ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/yuvtorgbeffect.cpp
diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp
index 66ade251849364827c594ca58c88c0fc2175bbbc..18d799c3f77f8693d6741232de3d7322278a709f 100644
--- a/gm/yuvtorgbeffect.cpp
+++ b/gm/yuvtorgbeffect.cpp
@@ -13,11 +13,14 @@
#if SK_SUPPORT_GPU
#include "GrContext.h"
-#include "GrTest.h"
-#include "effects/GrYUVtoRGBEffect.h"
+#include "GrDrawContext.h"
+#include "GrPipelineBuilder.h"
#include "SkBitmap.h"
#include "SkGr.h"
#include "SkGradientShader.h"
+#include "batches/GrDrawBatch.h"
+#include "batches/GrRectBatchFactory.h"
+#include "effects/GrYUVtoRGBEffect.h"
#define YSIZE 8
#define USIZE 4
@@ -77,10 +80,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;
}
@@ -128,10 +129,10 @@ protected:
viewMatrix.setTranslate(x, y);
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;
}
« no previous file with comments | « gm/texturedomaineffect.cpp ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698