Revert "vg_common_json: No path information, do not create a shape" 63/268563/1 accepted/tizen/unified/20211228.140402 submit/tizen/20211227.054708
authorChun <jykeon@samsung.com>
Mon, 27 Dec 2021 02:47:16 +0000 (02:47 +0000)
committerChun <jykeon@samsung.com>
Mon, 27 Dec 2021 02:47:16 +0000 (02:47 +0000)
This reverts commit b688e1d312aa33ac3c71c7aeac783bdbefc0fb78.

Change-Id: I82a45e07b36057bfce1238fa56c80a423ff3f293

src/static_libs/vg_common/vg_common_json.c

index b28ba66..d79a737 100644 (file)
@@ -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<Tvg_Path_Command*>(alloca(sizeof(Tvg_Path_Command) * cmdCnt));
-        Tvg_Point* pts = static_cast<Tvg_Point*>(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<Tvg_Path_Command*>(alloca(sizeof(Tvg_Path_Command) * cmdCnt));
-   Tvg_Point* pts = static_cast<Tvg_Point*>(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++)