DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, context) { GrSurfaceDesc desc; desc.fFlags = kRenderTarget_GrSurfaceFlag; desc.fWidth = 800; desc.fHeight = 800; desc.fConfig = kSkia8888_GrPixelConfig; desc.fOrigin = kTopLeft_GrSurfaceOrigin; SkAutoTUnref<GrTexture> texture(context->textureProvider()->createApproxTexture(desc)); GrTestTarget tt; GrRenderTarget* rt = texture->asRenderTarget(); context->getTestTarget(&tt, rt); 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()); }
DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { sk_sp<GrDrawContext> drawContext(ctxInfo.grContext()->newDrawContext(SkBackingFit::kApprox, 800, 800, kSkia8888_GrPixelConfig, 0, kTopLeft_GrSurfaceOrigin)); if (!drawContext) { return; } GrTestTarget tt; ctxInfo.grContext()->getTestTarget(&tt, drawContext); GrDrawTarget* dt = tt.target(); GrResourceProvider* rp = tt.resourceProvider(); 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()); }
DEF_GPUTEST(TessellatingPathRendererTests, reporter, factory) { GrContext* context = factory->get(static_cast<GrContextFactory::GLContextType>(0)); if (nullptr == context) { return; } GrSurfaceDesc desc; desc.fFlags = kRenderTarget_GrSurfaceFlag; desc.fWidth = 800; desc.fHeight = 800; desc.fConfig = kSkia8888_GrPixelConfig; desc.fOrigin = kTopLeft_GrSurfaceOrigin; SkAutoTUnref<GrTexture> texture(context->textureProvider()->createApproxTexture(desc)); GrTestTarget tt; GrRenderTarget* rt = texture->asRenderTarget(); context->getTestTarget(&tt, rt); 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()); }
DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(AADistanceFieldPathRenderer, reporter, ctxInfo) { // The DF PR only works with contexts that support derivatives if (!ctxInfo.grContext()->caps()->shaderCaps()->shaderDerivativeSupport()) { return; } sk_sp<GrDrawContext> drawContext(ctxInfo.grContext()->newDrawContext(SkBackingFit::kApprox, 800, 800, kSkia8888_GrPixelConfig, 0, kTopLeft_GrSurfaceOrigin)); if (!drawContext) { return; } GrAADistanceFieldPathRenderer dfpr; GrTestTarget tt; ctxInfo.grContext()->getTestTarget(&tt, drawContext); GrResourceProvider* rp = tt.resourceProvider(); test_far_from_origin(drawContext.get(), &dfpr, rp); ctxInfo.grContext()->flush(); }