hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=bd4fb8d74cd9b4c16160727f43424b03d4d1dae0

commit bd4fb8d74cd9b4c16160727f43424b03d4d1dae0
Author: Hermet Park <[email protected]>
Date:   Fri Oct 18 21:03:20 2019 +0900

    vector json: clone the root node from the one singleton json.
    
    lottie(json) data is a singleton resource that is shareable among the 
instances,
    if they are using a same file, each instances can play different frames,
    they must clone the vector tree data from the lottie data.
    
    Previously, they all indicated one same vector root, multiple animation was 
corrupted.
---
 src/lib/evas/vg/evas_vg_cache.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c
index 391d3cb2a9..52b3a7eb55 100644
--- a/src/lib/evas/vg/evas_vg_cache.c
+++ b/src/lib/evas/vg/evas_vg_cache.c
@@ -251,10 +251,10 @@ _caching_root_update(Vg_Cache_Entry *vg_entry)
            to this root pointer. */
         vg_entry->root[0] = efl_duplicate(vfd->root);
      }
-   else if (vg_entry->root[0] != vfd->root)
+   else
      {
         if (vg_entry->root[0]) efl_unref(vg_entry->root[0]);
-        vg_entry->root[0] = efl_ref(vfd->root);
+        vg_entry->root[0] = efl_duplicate(vfd->root);
      }
 
    //Animatable?
@@ -263,20 +263,14 @@ _caching_root_update(Vg_Cache_Entry *vg_entry)
    //Start frame
    if (vfd->anim_data->frame_num == 0)
      {
-        if (vg_entry->root[1] != vfd->root)
-          {
-             if (vg_entry->root[1]) efl_unref(vg_entry->root[1]);
-             vg_entry->root[1] = efl_ref(vfd->root);
-          }
+        if (vg_entry->root[1]) efl_unref(vg_entry->root[1]);
+        vg_entry->root[1] = efl_duplicate(vfd->root);
      }
    //End frame
    else if (vfd->anim_data->frame_num == (vfd->anim_data->frame_cnt - 1))
      {
-        if (vg_entry->root[2] != vfd->root)
-          {
-             if (vg_entry->root[2]) efl_unref(vg_entry->root[2]);
-             vg_entry->root[2] = efl_ref(vfd->root);
-          }
+        if (vg_entry->root[2]) efl_unref(vg_entry->root[2]);
+        vg_entry->root[2] = efl_duplicate(vfd->root);
      }
 }
 

-- 


Reply via email to