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

Unified Diff: tests/TessellatingPathRendererTests.cpp

Issue 2004433002: Retract GrRenderTarget from GrTestTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bench build Created 4 years, 7 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 | « include/gpu/GrDrawContext.h ('k') | tools/gpu/GrTest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/TessellatingPathRendererTests.cpp
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index a3eb4893d39e9fcb09d66f80acb154977a4a3902..22779c2fcaddac774efb5b60d0192845820735fb 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -232,13 +232,13 @@ static SkPath create_path_15() {
return path;
}
-static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, GrResourceProvider* rp,
- const SkPath& path) {
+static void test_path(GrDrawTarget* dt, GrDrawContext* drawContext,
+ GrResourceProvider* rp, const SkPath& path) {
GrTessellatingPathRenderer tess;
GrPipelineBuilder pipelineBuilder;
pipelineBuilder.setXPFactory(
GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref();
- pipelineBuilder.setRenderTarget(rt);
+ pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget());
GrNoClip noClip;
GrStyle style(SkStrokeRec::kFill_InitStyle);
GrPathRenderer::DrawPathArgs args;
@@ -255,35 +255,35 @@ static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, GrResourceProvider*
}
DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
- GrSurfaceDesc desc;
- desc.fFlags = kRenderTarget_GrSurfaceFlag;
- desc.fWidth = 800;
- desc.fHeight = 800;
- desc.fConfig = kSkia8888_GrPixelConfig;
- desc.fOrigin = kTopLeft_GrSurfaceOrigin;
- SkAutoTUnref<GrTexture> texture(
- ctxInfo.grContext()->textureProvider()->createApproxTexture(desc));
+ sk_sp<GrDrawContext> drawContext(ctxInfo.grContext()->newDrawContext(SkBackingFit::kApprox,
+ 800, 800,
+ kSkia8888_GrPixelConfig,
+ 0,
+ kTopLeft_GrSurfaceOrigin));
+ if (!drawContext) {
+ return;
+ }
+
GrTestTarget tt;
- GrRenderTarget* rt = texture->asRenderTarget();
- ctxInfo.grContext()->getTestTarget(&tt, rt);
+ ctxInfo.grContext()->getTestTarget(&tt, drawContext);
GrDrawTarget* dt = tt.target();
GrResourceProvider* rp = tt.resourceProvider();
- test_path(dt, rt, rp, create_path_0());
- test_path(dt, rt, rp, create_path_1());
- test_path(dt, rt, rp, create_path_2());
- test_path(dt, rt, rp, create_path_3());
- test_path(dt, rt, rp, create_path_4());
- test_path(dt, rt, rp, create_path_5());
- test_path(dt, rt, rp, create_path_6());
- test_path(dt, rt, rp, create_path_7());
- test_path(dt, rt, rp, create_path_8());
- test_path(dt, rt, rp, create_path_9());
- test_path(dt, rt, rp, create_path_10());
- test_path(dt, rt, rp, create_path_11());
- test_path(dt, rt, rp, create_path_12());
- test_path(dt, rt, rp, create_path_13());
- test_path(dt, rt, rp, create_path_14());
- test_path(dt, rt, rp, create_path_15());
+ test_path(dt, drawContext.get(), rp, create_path_0());
+ test_path(dt, drawContext.get(), rp, create_path_1());
+ test_path(dt, drawContext.get(), rp, create_path_2());
+ test_path(dt, drawContext.get(), rp, create_path_3());
+ test_path(dt, drawContext.get(), rp, create_path_4());
+ test_path(dt, drawContext.get(), rp, create_path_5());
+ test_path(dt, drawContext.get(), rp, create_path_6());
+ test_path(dt, drawContext.get(), rp, create_path_7());
+ test_path(dt, drawContext.get(), rp, create_path_8());
+ test_path(dt, drawContext.get(), rp, create_path_9());
+ test_path(dt, drawContext.get(), rp, create_path_10());
+ test_path(dt, drawContext.get(), rp, create_path_11());
+ test_path(dt, drawContext.get(), rp, create_path_12());
+ test_path(dt, drawContext.get(), rp, create_path_13());
+ test_path(dt, drawContext.get(), rp, create_path_14());
+ test_path(dt, drawContext.get(), rp, create_path_15());
}
#endif
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | tools/gpu/GrTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698