From: Chun Date: Mon, 27 Dec 2021 02:47:16 +0000 (+0000) Subject: Revert "vg_common_json: No path information, do not create a shape" X-Git-Tag: accepted/tizen/unified/20211228.140402^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F268563%2F1;p=platform%2Fupstream%2Fefl.git Revert "vg_common_json: No path information, do not create a shape" This reverts commit b688e1d312aa33ac3c71c7aeac783bdbefc0fb78. Change-Id: I82a45e07b36057bfce1238fa56c80a423ff3f293 --- 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++)