From: Jean-Philippe Bruyère Date: Wed, 12 Jan 2022 21:20:09 +0000 (+0100) Subject: svg #subid rendering test X-Git-Tag: v0.3.0-beta~17 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=6faad744d43cfc69ae910b17580476cdb3519f44;p=jp%2Fvkvg.git svg #subid rendering test --- diff --git a/tests/data/checkbox.svg b/tests/data/checkbox.svg new file mode 100644 index 0000000..6b6914a --- /dev/null +++ b/tests/data/checkbox.svg @@ -0,0 +1,51 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/tests/svg.c b/tests/svg.c index 82adf4f..6522e6a 100644 --- a/tests/svg.c +++ b/tests/svg.c @@ -4,6 +4,8 @@ static float rotation = 0.f; static const char* path = "data/tiger.svg"; +static const char* svgSubPath = "data/checkbox.svg"; + void svg_surface() { VkvgSurface svgSurf = vkvg_surface_create_from_svg (device, test_width, test_height, path); @@ -31,11 +33,26 @@ void vkvg_svg () { vkvg_destroy(ctx); vkvg_svg_destroy (svg); } +void vkvg_svg_sub () { + VkvgSvg svg = vkvg_svg_load (svgSubPath); + uint32_t w, h; + vkvg_svg_get_dimensions(svg, &w, &h); + VkvgContext ctx = _initCtx(surf); + vkvg_clear(ctx); + + vkvg_svg_render (svg, ctx, "True"); + vkvg_translate(ctx, 200, 0); + vkvg_svg_render (svg, ctx, "False"); + + vkvg_destroy(ctx); + vkvg_svg_destroy (svg); +} int main(int argc, char *argv[]) { no_test_size = true; PERFORM_TEST (svg_surface, argc, argv); PERFORM_TEST (vkvg_svg, argc, argv); + PERFORM_TEST (vkvg_svg_sub, argc, argv); return 0; }