{
if (!op || !points) return;
#ifdef HAVE_THORVG
+ unsigned int i = 0, j = 0;
Evas_Vg_Path_Command *evas_cmds = NULL;
double *evas_pts = NULL;
Tvg_Paint *shape = _get_tvg_shape(obj);
+ if (!shape) return;
const Tvg_Path_Command *tvg_cmds = NULL;
uint32_t cmds_len = 0;
tvg_shape_get_path_commands(shape, &tvg_cmds, &cmds_len);
- const Tvg_Point *tvg_pts = NULL;
- uint32_t pts_len = 0;
- tvg_shape_get_path_coords(shape, &tvg_pts, &pts_len);
-
- if (!tvg_cmds || (cmds_len <= 0) || !tvg_pts || (pts_len <= 0))
+ if (cmds_len > 0)
{
- *op = NULL;
- *points = NULL;
- return;
- }
-
- unsigned int i = 0, j = 0;
+ evas_cmds = (Evas_Vg_Path_Command*)malloc(sizeof(Evas_Vg_Path_Command) * (cmds_len + 1));
+ if (!evas_cmds) return;
- evas_cmds = (Evas_Vg_Path_Command*)malloc(sizeof(Evas_Vg_Path_Command) * (cmds_len + 1));
- if (!evas_cmds) return;
+ for (i = 0; i < cmds_len; ++i)
+ evas_cmds[i] = _get_evas_command(tvg_cmds[i]);
- for (i = 0; i < cmds_len; ++i)
- evas_cmds[i] = _get_evas_command(tvg_cmds[i]);
-
- evas_cmds[cmds_len] = EVAS_VG_PATH_COMMAND_END;
- *op = evas_cmds;
+ evas_cmds[cmds_len] = EVAS_VG_PATH_COMMAND_END;
+ *op = evas_cmds;
+ }
+ else *op = NULL;
- evas_pts = (double*)malloc(sizeof(double) * pts_len * 2);
- if (!evas_pts) return;
+ const Tvg_Point *tvg_pts = NULL;
+ uint32_t pts_len = 0;
+ tvg_shape_get_path_coords(shape, &tvg_pts, &pts_len);
- for (i = 0; i < pts_len; ++i)
+ if (pts_len > 0)
{
- evas_pts[j] = tvg_pts[i].x;
- evas_pts[j+1] = tvg_pts[i].y;
- j += 2;
+ evas_pts = (double*)malloc(sizeof(double) * pts_len * 2);
+ if (!evas_pts) return;
+
+ for (i = 0; i < pts_len; ++i)
+ {
+ evas_pts[j] = tvg_pts[i].x;
+ evas_pts[j+1] = tvg_pts[i].y;
+ j += 2;
+ }
+ *points = evas_pts;
}
- *points = evas_pts;
+ else *points = NULL;
+
#else
efl_gfx_path_get(obj, (const Efl_Gfx_Path_Command **)op, points);
#endif