cedric pushed a commit to branch master.

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

commit 9c3c402fd634d4c4b5fcc61ef48122ea8c2d2f99
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Mon Nov 16 00:56:28 2015 +0100

    ector: don't use eo parent relationship for accessing the surface.
---
 src/lib/ector/cairo/ector_cairo_private.h          | 14 ++---
 src/lib/ector/cairo/ector_cairo_surface.c          | 10 +++-
 src/lib/ector/cairo/ector_renderer_cairo_base.c    | 47 ++++++++-------
 src/lib/ector/cairo/ector_renderer_cairo_base.eo   |  1 +
 .../cairo/ector_renderer_cairo_gradient_linear.c   | 47 ++++++++-------
 .../cairo/ector_renderer_cairo_gradient_linear.eo  |  2 +-
 .../cairo/ector_renderer_cairo_gradient_radial.c   | 46 ++++++++-------
 .../cairo/ector_renderer_cairo_gradient_radial.eo  |  2 +-
 src/lib/ector/cairo/ector_renderer_cairo_shape.c   | 66 ++++++++++++----------
 src/lib/ector/cairo/ector_renderer_cairo_shape.eo  |  1 +
 10 files changed, 128 insertions(+), 108 deletions(-)

diff --git a/src/lib/ector/cairo/ector_cairo_private.h 
b/src/lib/ector/cairo/ector_cairo_private.h
index 2b5735a..ea302a8 100644
--- a/src/lib/ector/cairo/ector_cairo_private.h
+++ b/src/lib/ector/cairo/ector_cairo_private.h
@@ -58,15 +58,12 @@ _ector_cairo_extent_get(Efl_Gfx_Gradient_Spread s)
   if (!Sym) return Error;
 
 static inline void *
-_ector_cairo_symbol_get(Eo *obj, const char *name)
+_ector_cairo_symbol_get(Ector_Renderer_Generic_Base_Data *base,
+                        const char *name)
 {
-   Eo *parent;
    void *sym;
 
-   eo_do(obj, parent = eo_parent_get());
-   if (!parent) return NULL;
-
-   eo_do(parent, sym = ector_cairo_surface_symbol_get(name));
+   eo_do(base->surface, sym = ector_cairo_surface_symbol_get(name));
    return sym;
 }
 
@@ -74,15 +71,12 @@ extern void 
(*cairo_pattern_add_color_stop_rgba)(cairo_pattern_t *pattern, doubl
                                                  double red, double green, 
double blue, double alpha);
 
 static inline void
-_ector_renderer_cairo_gradient_prepare(Eo *obj,
-                                       cairo_pattern_t *pat,
+_ector_renderer_cairo_gradient_prepare(cairo_pattern_t *pat,
                                        Ector_Renderer_Generic_Gradient_Data 
*src,
                                        unsigned int mul_col)
 {
    unsigned int i;
 
-   USE(obj, cairo_pattern_add_color_stop_rgba, );
-
    for (i = 0; i < src->colors_count; i++)
      {
         int r,g,b,a;
diff --git a/src/lib/ector/cairo/ector_cairo_surface.c 
b/src/lib/ector/cairo/ector_cairo_surface.c
index c073adb..12538e7 100644
--- a/src/lib/ector/cairo/ector_cairo_surface.c
+++ b/src/lib/ector/cairo/ector_cairo_surface.c
@@ -62,11 +62,15 @@ 
_ector_cairo_surface_ector_generic_surface_renderer_factory_new(Eo *obj,
                                                                 const Eo_Class 
*type)
 {
    if (type == ECTOR_RENDERER_GENERIC_SHAPE_MIXIN)
-     return eo_add(ECTOR_RENDERER_CAIRO_SHAPE_CLASS, obj);
+     return eo_add(ECTOR_RENDERER_CAIRO_SHAPE_CLASS, NULL,
+                   ector_renderer_surface_set(obj));
    else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN)
-     return eo_add(ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, obj);
+     return eo_add(ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, NULL,
+                   ector_renderer_surface_set(obj));
    else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN)
-     return eo_add(ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, obj);
+     return eo_add(ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, NULL,
+                   ector_renderer_surface_set(obj));
+
    ERR("Couldn't find class for type: %s\n", eo_class_name_get(type));
    return NULL;
 }
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_base.c 
b/src/lib/ector/cairo/ector_renderer_cairo_base.c
index 973648b..fe738ea 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_base.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_base.c
@@ -99,11 +99,7 @@ 
_ector_renderer_cairo_base_ector_renderer_generic_base_prepare(Eo *obj, Ector_Re
 {
    if (!pd->parent)
      {
-        Eo *parent;
-
-        eo_do(obj, parent = eo_parent_get());
-        if (!parent) return EINA_FALSE;
-        pd->parent = eo_data_xref(parent, ECTOR_CAIRO_SURFACE_CLASS, obj);
+        pd->parent = eo_data_xref(pd->generic->surface, 
ECTOR_CAIRO_SURFACE_CLASS, obj);
      }
    if (pd->generic->m)
      {
@@ -186,22 +182,31 @@ 
_ector_renderer_cairo_base_ector_renderer_generic_base_draw(Eo *obj EINA_UNUSED,
 static Eo *
 _ector_renderer_cairo_base_eo_base_constructor(Eo *obj, 
Ector_Renderer_Cairo_Base_Data *pd EINA_UNUSED)
 {
-   USE(obj, cairo_matrix_init, NULL);
-   USE(obj, cairo_translate, NULL);
-   USE(obj, cairo_set_source_rgba, NULL);
-   USE(obj, cairo_transform, NULL);
-   USE(obj, cairo_set_operator, NULL);
-   USE(obj, cairo_new_path, NULL);
-   USE(obj, cairo_rectangle, NULL);
-   USE(obj, cairo_clip, NULL);
-   USE(obj, cairo_device_to_user, NULL);
-   USE(obj, cairo_matrix_init_identity, NULL);
-
    eo_do_super(obj, ECTOR_RENDERER_CAIRO_BASE_CLASS, obj = eo_constructor());
    if (!obj) return NULL;
 
    pd->generic = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS, obj);
 
+   return obj;
+}
+
+static Eo_Base *
+_ector_renderer_cairo_base_eo_base_finalize(Eo *obj, 
Ector_Renderer_Cairo_Base_Data *pd)
+{
+   eo_do_super(obj, ECTOR_RENDERER_CAIRO_BASE_CLASS, obj = eo_finalize());
+   if (!obj) return NULL;
+
+   USE(pd->generic, cairo_matrix_init, NULL);
+   USE(pd->generic, cairo_translate, NULL);
+   USE(pd->generic, cairo_set_source_rgba, NULL);
+   USE(pd->generic, cairo_transform, NULL);
+   USE(pd->generic, cairo_set_operator, NULL);
+   USE(pd->generic, cairo_new_path, NULL);
+   USE(pd->generic, cairo_rectangle, NULL);
+   USE(pd->generic, cairo_clip, NULL);
+   USE(pd->generic, cairo_device_to_user, NULL);
+   USE(pd->generic, cairo_matrix_init_identity, NULL);
+
    cairo_matrix_init_identity(&identity);
 
    return obj;
@@ -210,14 +215,14 @@ _ector_renderer_cairo_base_eo_base_constructor(Eo *obj, 
Ector_Renderer_Cairo_Bas
 static void
 _ector_renderer_cairo_base_eo_base_destructor(Eo *obj, 
Ector_Renderer_Cairo_Base_Data *pd)
 {
-   Eo *parent;
-
-   free(pd->m);
+   Ector_Renderer_Generic_Base_Data *base;
 
-   eo_do(obj, parent = eo_parent_get());
-   eo_data_xunref(parent, pd->parent, obj);
+   base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+   eo_data_xunref(base->surface, pd->parent, obj);
    eo_data_xunref(obj, pd->generic, obj);
 
+   free(pd->m);
+
    eo_do_super(obj, ECTOR_RENDERER_CAIRO_BASE_CLASS, eo_destructor());
 }
 
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_base.eo 
b/src/lib/ector/cairo/ector_renderer_cairo_base.eo
index 43efa72..0132c2e 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_base.eo
+++ b/src/lib/ector/cairo/ector_renderer_cairo_base.eo
@@ -16,6 +16,7 @@ abstract Ector.Renderer.Cairo.Base 
(Ector.Renderer.Generic.Base)
       Ector.Renderer.Generic.Base.color.set;
       Ector.Renderer.Generic.Base.color.get;
       Eo.Base.constructor;
+      Eo.Base.finalize;
       Eo.Base.destructor;
    }
 }
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.c 
b/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.c
index a105d2c..7d0954c 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.c
@@ -27,7 +27,7 @@ struct _Ector_Renderer_Cairo_Gradient_Linear_Data
 };
 
 static cairo_pattern_t *
-_ector_renderer_cairo_gradient_linear_prepare(Eo *obj,
+_ector_renderer_cairo_gradient_linear_prepare(Eo *obj EINA_UNUSED,
                                               
Ector_Renderer_Generic_Gradient_Linear_Data *gld,
                                               
Ector_Renderer_Generic_Gradient_Data *gd,
                                               unsigned int mul_col)
@@ -37,7 +37,7 @@ _ector_renderer_cairo_gradient_linear_prepare(Eo *obj,
    pat = cairo_pattern_create_linear(gld->start.x, gld->start.y,
                                      gld->end.x, gld->end.y);
    if (!pat) return NULL;
-   _ector_renderer_cairo_gradient_prepare(obj, pat, gd, mul_col);
+   _ector_renderer_cairo_gradient_prepare(pat, gd, mul_col);
 
    cairo_pattern_set_extend(pat, _ector_cairo_extent_get(gd->s));
 
@@ -52,11 +52,10 @@ 
_ector_renderer_cairo_gradient_linear_ector_renderer_generic_base_prepare(Eo *ob
 
    if (!pd->parent)
      {
-        Eo *parent;
+        Ector_Renderer_Generic_Base_Data *base;
 
-        eo_do(obj, parent = eo_parent_get());
-        if (!parent) return EINA_FALSE;
-        pd->parent = eo_data_xref(parent, ECTOR_CAIRO_SURFACE_CLASS, obj);
+        base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+        pd->parent = eo_data_xref(base->surface, ECTOR_CAIRO_SURFACE_CLASS, 
obj);
      }
 
    return EINA_FALSE;
@@ -131,19 +130,25 @@ 
_ector_renderer_cairo_gradient_linear_ector_renderer_generic_base_bounds_get(Eo
 }
 
 static Eo_Base *
-_ector_renderer_cairo_gradient_linear_eo_base_constructor(Eo *obj,
-                                                          
Ector_Renderer_Cairo_Gradient_Linear_Data *pd EINA_UNUSED)
+_ector_renderer_cairo_gradient_linear_eo_base_finalize(Eo *obj, 
Ector_Renderer_Cairo_Gradient_Linear_Data *pd EINA_UNUSED)
 {
-   USE(obj, cairo_set_source, NULL);
-   USE(obj, cairo_pattern_destroy, NULL);
-   USE(obj, cairo_rectangle, NULL);
-   USE(obj, cairo_fill, NULL);
-   USE(obj, cairo_pattern_destroy, NULL);
-   USE(obj, cairo_set_source, NULL);
-   USE(obj, cairo_pattern_set_extend, NULL);
-   USE(obj, cairo_pattern_create_linear, NULL);
-
-   eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, obj = 
eo_constructor());
+   Ector_Renderer_Generic_Base_Data *base;
+
+   eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, obj = 
eo_finalize());
+   if (!obj) return NULL;
+
+   base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+
+   USE(base, cairo_set_source, NULL);
+   USE(base, cairo_pattern_destroy, NULL);
+   USE(base, cairo_rectangle, NULL);
+   USE(base, cairo_fill, NULL);
+   USE(base, cairo_pattern_destroy, NULL);
+   USE(base, cairo_set_source, NULL);
+   USE(base, cairo_pattern_set_extend, NULL);
+   USE(base, cairo_pattern_create_linear, NULL);
+   USE(base, cairo_pattern_add_color_stop_rgba, NULL);
+
    return obj;
 }
 
@@ -151,10 +156,10 @@ static void
 _ector_renderer_cairo_gradient_linear_eo_base_destructor(Eo *obj,
                                                          
Ector_Renderer_Cairo_Gradient_Linear_Data *pd)
 {
-   Eo *parent;
+   Ector_Renderer_Generic_Base_Data *base;
 
-   eo_do(obj, parent = eo_parent_get());
-   eo_data_xunref(parent, pd->parent, obj);
+   base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+   eo_data_xunref(base->surface, pd->parent, obj);
 
    eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, 
eo_destructor());
 }
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo 
b/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo
index 308cc29..b8d1414 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo
+++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo
@@ -8,7 +8,7 @@ class Ector.Renderer.Cairo.Gradient_Linear 
(Ector.Renderer.Cairo.Base, Ector.Ren
       Ector.Renderer.Generic.Base.bounds_get;
       Ector.Renderer.Generic.Base.crc.get;
       Ector.Renderer.Cairo.Base.fill;
-      Eo.Base.constructor;
+      Eo.Base.finalize;
       Eo.Base.destructor;
       Efl.Gfx.Gradient.Base.stop.set;
    }
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c 
b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
index bd89e15..b3550d5 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
@@ -38,18 +38,17 @@ 
_ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_prepare(Eo *ob
 
    if (!pd->parent)
      {
-        Eo *parent;
+        Ector_Renderer_Generic_Base_Data *base;
 
-        eo_do(obj, parent = eo_parent_get());
-        if (!parent) return EINA_FALSE;
-        pd->parent = eo_data_xref(parent, ECTOR_CAIRO_SURFACE_CLASS, obj);
+        base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+        pd->parent = eo_data_xref(base->surface, ECTOR_CAIRO_SURFACE_CLASS, 
obj);
      }
 
    return EINA_FALSE;
 }
 
 static cairo_pattern_t *
-_ector_renderer_cairo_gradient_radial_prepare(Eo *obj,
+_ector_renderer_cairo_gradient_radial_prepare(Eo *obj EINA_UNUSED,
                                               
Ector_Renderer_Generic_Gradient_Radial_Data *grd,
                                               
Ector_Renderer_Generic_Gradient_Data *gd,
                                               unsigned int mul_col)
@@ -60,7 +59,7 @@ _ector_renderer_cairo_gradient_radial_prepare(Eo *obj,
                                      grd->radial.x, grd->radial.y, 
grd->radius);
    if (!pat) return NULL;
 
-   _ector_renderer_cairo_gradient_prepare(obj, pat, gd, mul_col);
+   _ector_renderer_cairo_gradient_prepare(pat, gd, mul_col);
 
    cairo_pattern_set_extend(pat, _ector_cairo_extent_get(gd->s));
 
@@ -136,19 +135,24 @@ 
_ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_bounds_get(Eo
 }
 
 static Eo_Base *
-_ector_renderer_cairo_gradient_radial_eo_base_constructor(Eo *obj,
-                                                          
Ector_Renderer_Cairo_Gradient_Radial_Data *pd EINA_UNUSED)
+_ector_renderer_cairo_gradient_radial_eo_base_finalize(Eo *obj, 
Ector_Renderer_Cairo_Gradient_Radial_Data *pd EINA_UNUSED)
 {
-   USE(obj, cairo_set_source, NULL);
-   USE(obj, cairo_pattern_destroy, NULL);
-   USE(obj, cairo_arc, NULL);
-   USE(obj, cairo_fill, NULL);
-   USE(obj, cairo_set_source, NULL);
-   USE(obj, cairo_pattern_destroy, NULL);
-   USE(obj, cairo_pattern_set_extend, NULL);
-   USE(obj, cairo_pattern_create_radial, NULL);
-
-   eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, obj = 
eo_constructor());
+   Ector_Renderer_Generic_Base_Data *base;
+
+   eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, obj = 
eo_finalize());
+   if (!obj) return NULL;
+
+   base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+
+   USE(base, cairo_set_source, NULL);
+   USE(base, cairo_pattern_destroy, NULL);
+   USE(base, cairo_arc, NULL);
+   USE(base, cairo_fill, NULL);
+   USE(base, cairo_set_source, NULL);
+   USE(base, cairo_pattern_destroy, NULL);
+   USE(base, cairo_pattern_set_extend, NULL);
+   USE(base, cairo_pattern_create_radial, NULL);
+
    return obj;
 }
 
@@ -156,10 +160,10 @@ static void
 _ector_renderer_cairo_gradient_radial_eo_base_destructor(Eo *obj,
                                                          
Ector_Renderer_Cairo_Gradient_Radial_Data *pd)
 {
-   Eo *parent;
+   Ector_Renderer_Generic_Base_Data *base;
 
-   eo_do(obj, parent = eo_parent_get());
-   eo_data_xunref(parent, pd->parent, obj);
+   base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+   eo_data_xunref(base->surface, pd->parent, obj);
 
    eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, 
eo_destructor());
 }
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo 
b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo
index b38ed03..2057478 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo
+++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo
@@ -9,7 +9,7 @@ class Ector.Renderer.Cairo.Gradient_Radial 
(Ector.Renderer.Cairo.Base, Ector.Ren
       Ector.Renderer.Generic.Base.crc.get;
       Ector.Renderer.Cairo.Base.fill;
       Eo.Base.destructor;
-      Eo.Base.constructor;
+      Eo.Base.finalize;
       Efl.Gfx.Gradient.Base.stop.set;
    }
 }
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_shape.c 
b/src/lib/ector/cairo/ector_renderer_cairo_shape.c
index 2672be5..a78ddaf 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_shape.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_shape.c
@@ -95,12 +95,10 @@ 
_ector_renderer_cairo_shape_ector_renderer_generic_base_prepare(Eo *obj, Ector_R
    // shouldn't that be moved to the cairo base object
    if (!pd->parent)
      {
-        Eo *parent;
+        Ector_Renderer_Generic_Base_Data *base;
 
-        eo_do(obj, parent = eo_parent_get());
-        if (!parent) return EINA_FALSE;
-        pd->parent = eo_data_xref(parent, ECTOR_CAIRO_SURFACE_CLASS, obj);
-        if (!pd->parent) return EINA_FALSE;
+        base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+        pd->parent = eo_data_xref(base->surface, ECTOR_CAIRO_SURFACE_CLASS, 
obj);
      }
 
    eo_do(obj, efl_gfx_shape_path_get(&cmds, &pts));
@@ -238,28 +236,7 @@ 
_ector_renderer_cairo_shape_ector_renderer_generic_base_bounds_get(Eo *obj,
 Eo *
 _ector_renderer_cairo_shape_eo_base_constructor(Eo *obj, 
Ector_Renderer_Cairo_Shape_Data *pd)
 {
-   USE(obj, cairo_path_destroy, NULL);
-   USE(obj, cairo_restore, NULL);
-   USE(obj, cairo_fill, NULL);
-   USE(obj, cairo_set_dash, NULL);
-   USE(obj, cairo_fill_preserve, NULL);
-   USE(obj, cairo_set_source_rgba, NULL);
-   USE(obj, cairo_stroke, NULL);
-   USE(obj, cairo_set_line_width, NULL);
-   USE(obj, cairo_set_line_cap, NULL);
-   USE(obj, cairo_set_line_join, NULL);
-   USE(obj, cairo_new_path, NULL);
-   USE(obj, cairo_append_path, NULL);
-   USE(obj, cairo_save, NULL);
-   USE(obj, cairo_copy_path, NULL);
-   USE(obj, cairo_close_path, NULL);
-   USE(obj, cairo_curve_to, NULL);
-   USE(obj, cairo_line_to, NULL);
-   USE(obj, cairo_new_path, NULL);
-   USE(obj, cairo_path_destroy, NULL);
-   USE(obj, cairo_move_to, NULL);
-
-   obj = eo_do_super_ret(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, obj, 
eo_constructor());
+   eo_do_super(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, obj = eo_constructor());
    if (!obj) return NULL;
 
    pd->shape = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_SHAPE_MIXIN, obj);
@@ -268,19 +245,48 @@ _ector_renderer_cairo_shape_eo_base_constructor(Eo *obj, 
Ector_Renderer_Cairo_Sh
    eo_do(obj,
          eo_event_callback_add(EFL_GFX_PATH_CHANGED, 
_ector_renderer_cairo_shape_path_changed, pd));
 
+    return obj;
+}
+
+static Eo_Base *
+_ector_renderer_cairo_shape_eo_base_finalize(Eo *obj, 
Ector_Renderer_Cairo_Shape_Data *pd)
+{
+   eo_do_super(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, obj = eo_finalize());
+   if (!obj) return NULL;
+
+   USE(pd->base, cairo_path_destroy, NULL);
+   USE(pd->base, cairo_restore, NULL);
+   USE(pd->base, cairo_fill, NULL);
+   USE(pd->base, cairo_set_dash, NULL);
+   USE(pd->base, cairo_fill_preserve, NULL);
+   USE(pd->base, cairo_set_source_rgba, NULL);
+   USE(pd->base, cairo_stroke, NULL);
+   USE(pd->base, cairo_set_line_width, NULL);
+   USE(pd->base, cairo_set_line_cap, NULL);
+   USE(pd->base, cairo_set_line_join, NULL);
+   USE(pd->base, cairo_new_path, NULL);
+   USE(pd->base, cairo_append_path, NULL);
+   USE(pd->base, cairo_save, NULL);
+   USE(pd->base, cairo_copy_path, NULL);
+   USE(pd->base, cairo_close_path, NULL);
+   USE(pd->base, cairo_curve_to, NULL);
+   USE(pd->base, cairo_line_to, NULL);
+   USE(pd->base, cairo_move_to, NULL);
+
    return obj;
 }
 
 void
 _ector_renderer_cairo_shape_eo_base_destructor(Eo *obj, 
Ector_Renderer_Cairo_Shape_Data *pd)
 {
-   Eo *parent;
+   Ector_Renderer_Generic_Base_Data *base;
+
    //FIXME, As base class  destructor can't call destructor of mixin class.
    // call explicit API to free shape data.
    eo_do(obj, efl_gfx_shape_reset());
 
-   eo_do(obj, parent = eo_parent_get());
-   eo_data_xunref(parent, pd->parent, obj);
+   base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+   eo_data_xunref(base->surface, pd->parent, obj);
 
    eo_data_xunref(obj, pd->shape, obj);
    eo_data_xunref(obj, pd->base, obj);
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_shape.eo 
b/src/lib/ector/cairo/ector_renderer_cairo_shape.eo
index 298935b..8b16260 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_shape.eo
+++ b/src/lib/ector/cairo/ector_renderer_cairo_shape.eo
@@ -9,6 +9,7 @@ class Ector.Renderer.Cairo.Shape (Ector.Renderer.Cairo.Base, 
Ector.Renderer.Gene
       Ector.Renderer.Generic.Base.crc.get;
       Ector.Renderer.Cairo.Base.fill;
       Eo.Base.constructor;
+      Eo.Base.finalize;
       Eo.Base.destructor;
    }
 }

-- 


Reply via email to