From c16ae47a9949ad80bdae0aff4707778dcaa09c53 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Tue, 11 Jan 2022 16:39:21 +0100 Subject: [PATCH] implement svg from fragment for vkvg-svg --- external/vkvg-svg | 2 +- include/vkvg-svg.h | 2 +- src/vkvg_context_internal.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/external/vkvg-svg b/external/vkvg-svg index 4acb209..98dd8e1 160000 --- a/external/vkvg-svg +++ b/external/vkvg-svg @@ -1 +1 @@ -Subproject commit 4acb2090ee4f966c74298344646b3d33076e0e21 +Subproject commit 98dd8e145744f06865ec964e9cae9c9dea461668 diff --git a/include/vkvg-svg.h b/include/vkvg-svg.h index e35e168..b325c72 100644 --- a/include/vkvg-svg.h +++ b/include/vkvg-svg.h @@ -48,7 +48,7 @@ VkvgSurface vkvg_surface_create_from_svg(VkvgDevice dev, uint32_t width, uint32_ * @return The new vkvg surface with the parsed SVG fragment as content, or null if an error occured. */ vkvg_public -VkvgSurface vkvg_surface_create_from_svg_fragment(VkvgDevice dev, uint32_t width, uint32_t height, char* svgFragment); +VkvgSurface vkvg_surface_create_from_svg_fragment(VkvgDevice dev, uint32_t width, uint32_t height, const char* svgFragment); #ifndef VKVG_SVG /*! @defgroup nsvg Nano SVG diff --git a/src/vkvg_context_internal.c b/src/vkvg_context_internal.c index d5b4981..b0a32fb 100644 --- a/src/vkvg_context_internal.c +++ b/src/vkvg_context_internal.c @@ -711,8 +711,7 @@ void _update_cur_pattern (VkvgContext ctx, VkvgPattern pat) { ctx->pushConsts.source = bounds; //transform control point with current ctx matrix - vkvg_gradient_t grad = {0}; - memcpy (&grad, pat->data, sizeof(vkvg_gradient_t)); + vkvg_gradient_t grad = *(vkvg_gradient_t*)pat->data; if (grad.count < 2) { ctx->status = VKVG_STATUS_PATTERN_INVALID_GRADIENT; -- 2.47.3