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 <cedric@osg.samsung.com>
This commit is contained in:
Subhransu Mohanty 2016-05-19 01:36:33 -07:00 committed by Cedric Bail
parent 3046b8ac4c
commit 74cee52900
1 changed files with 9 additions and 6 deletions

View File

@ -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);
}