From db0d2d6bfdc776b2e30f5fdcbd9fbe4d3f5945ab Mon Sep 17 00:00:00 2001 From: Chun Date: Mon, 27 Dec 2021 02:47:16 +0000 Subject: [PATCH] Revert "vg_common_json: No path information, do not create a shape" This reverts commit b688e1d312aa33ac3c71c7aeac783bdbefc0fb78. Change-Id: I82a45e07b36057bfce1238fa56c80a423ff3f293 --- src/static_libs/vg_common/vg_common_json.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c index b28ba66..d79a737 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -53,16 +53,13 @@ _construct_drawable_nodes(Tvg_Paint *parent, const LOTLayerNode *layer, int dept const float *data = node->mPath.ptPtr; if (!data) continue; + Tvg_Paint* shape = tvg_shape_new(); //0: Path uint32_t cmdCnt = node->mPath.elmCount; uint32_t ptsCnt = node->mPath.ptCount * sizeof(float) / sizeof(Tvg_Point); - if (cmdCnt == 0 || ptsCnt == 0) continue; - - Tvg_Paint* shape = tvg_shape_new(); - - Tvg_Path_Command* cmds = static_cast(alloca(sizeof(Tvg_Path_Command) * cmdCnt)); - Tvg_Point* pts = static_cast(alloca(sizeof(Tvg_Point) * ptsCnt)); + Tvg_Path_Command cmds[cmdCnt]; + Tvg_Point pts[ptsCnt]; uint32_t cmd_i = 0, pts_i = 0; for (uint32_t i = 0; i < cmdCnt; i++) @@ -214,16 +211,13 @@ _construct_mask_nodes(Tvg_Paint *parent, LOTMask *mask, int depth EINA_UNUSED) const float *data = mask->mPath.ptPtr; if (!data) return; + Tvg_Paint* shape = tvg_shape_new(); //Path uint32_t cmdCnt = mask->mPath.elmCount; uint32_t ptsCnt = mask->mPath.ptCount * sizeof(float) / sizeof(Tvg_Point); - if (cmdCnt == 0 || ptsCnt == 0) return; - - Tvg_Paint* shape = tvg_shape_new(); - - Tvg_Path_Command* cmds = static_cast(alloca(sizeof(Tvg_Path_Command) * cmdCnt)); - Tvg_Point* pts = static_cast(alloca(sizeof(Tvg_Point) * ptsCnt)); + Tvg_Path_Command cmds[cmdCnt]; + Tvg_Point pts[ptsCnt]; uint32_t cmd_i = 0, pts_i = 0; for (uint32_t i = 0; i < cmdCnt; i++) -- 2.7.4