From: Michal Szczecinski Date: Wed, 4 Nov 2020 15:15:48 +0000 (+0100) Subject: evas vector: Added path lenght get implementation for thorvg X-Git-Tag: accepted/tizen/unified/20201116.220352~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b71e2042500aaa6eb96bd5575a181f673ffef641;p=platform%2Fupstream%2Fefl.git evas vector: Added path lenght get implementation for thorvg This commit is needed to use thorvg to render edje vector parts. Change-Id: I55f551e4f8865fd8af7f2487dd5897e6f2a1ea7a --- diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.c b/src/lib/evas/canvas/efl_canvas_vg_shape.c index 398c563..68d17e0 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_shape.c +++ b/src/lib/evas/canvas/efl_canvas_vg_shape.c @@ -1036,8 +1036,26 @@ evas_vg_shape_path_get(Evas_Vg_Shape *obj, const Evas_Vg_Path_Command **op, cons EAPI void evas_vg_shape_path_length_get(Evas_Vg_Shape *obj, unsigned int *commands, unsigned int *points) { - //TODO: implement +#ifdef HAVE_THORVG + Tvg_Paint *tvg_shape = _get_tvg_shape(obj); + if (!tvg_shape) return; + + const Tvg_Path_Command *cmds = NULL; + const Tvg_Point *coords = NULL; + + tvg_shape_get_path_commands(tvg_shape, &cmds, commands); + tvg_shape_get_path_coords(tvg_shape, &coords, points); + + //in evas commands we have always EVAS_VG_PATH_COMMAND_END to indicate commands + //array end. + *commands += 1; + + //evas array stores x, y coordinates in one array, tvg use array of points + *points = *points * 2; + +#else efl_gfx_path_length_get(obj, commands, points); +#endif } EAPI void