cedric pushed a commit to branch master.

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

commit 74cee52900fa31d01fc68b4735ccd3185cd89859
Author: Subhransu Mohanty <sub.moha...@samsung.com>
Date:   Thu May 19 01:36:33 2016 -0700

    evas: fix the ref issue of newly created object in shape_dup() function
    
    Summary:
    There are couple of issue.
    
        By adding the gradient to both parent container as well as to the 
shape. when we dupe the container it copies twice.
        Usually we create one gradient and set it to multiple shape , in that 
case when we call dupe() function it is going to make a separate copy for each 
of the shape.
    
    The patch fixes 1st issue. for 2nd one we need to maybe change the way we 
implemented dupe function
    
    Reviewers: Hermet, cedric
    
    Reviewed By: cedric
    
    Subscribers: cedric, jpeg
    
    Differential Revision: https://phab.enlightenment.org/D3961
    
    Signed-off-by: Cedric Bail <ced...@osg.samsung.com>
---
 src/lib/evas/canvas/evas_vg_shape.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/lib/evas/canvas/evas_vg_shape.c 
b/src/lib/evas/canvas/evas_vg_shape.c
index 80e4e03..b356b07 100644
--- a/src/lib/evas/canvas/evas_vg_shape.c
+++ b/src/lib/evas/canvas/evas_vg_shape.c
@@ -232,22 +232,25 @@ _efl_vg_shape_efl_vg_dup(Eo *obj, Efl_VG_Shape_Data *pd 
EINA_UNUSED, const Efl_V
 
    if (fromd->fill)
      {
-        fill = eo_add(eo_class_get(fromd->fill), parent, efl_vg_dup(eo_self, 
fromd->fill));
+        fill = eo_add(eo_class_get(fromd->fill), NULL, efl_vg_dup(eo_self, 
fromd->fill));
+        efl_vg_shape_fill_set(obj, fill);
+        eo_unref(fill);
      }
 
    if (fromd->stroke.fill)
      {
-        stroke_fill = eo_add(eo_class_get(fromd->stroke.fill), parent, 
efl_vg_dup(eo_self, fromd->stroke.fill));
+        stroke_fill = eo_add(eo_class_get(fromd->stroke.fill), NULL, 
efl_vg_dup(eo_self, fromd->stroke.fill));
+        efl_vg_shape_stroke_fill_set(obj, stroke_fill);
+        eo_unref(stroke_fill);
      }
 
    if (fromd->stroke.marker)
      {
-        stroke_marker = eo_add(eo_class_get(fromd->stroke.marker), parent, 
efl_vg_dup(eo_self, fromd->stroke.marker));
+        stroke_marker = eo_add(eo_class_get(fromd->stroke.marker), NULL, 
efl_vg_dup(eo_self, fromd->stroke.marker));
+        efl_vg_shape_stroke_marker_set(obj, stroke_marker);
+        eo_unref(stroke_marker);
      }
 
-   efl_vg_shape_fill_set(obj, fill);
-   efl_vg_shape_stroke_fill_set(obj, stroke_fill);
-   efl_vg_shape_stroke_marker_set(obj, stroke_marker);
    efl_gfx_shape_dup(obj, from);
 }
 

-- 


Reply via email to