{
if (!pd->surface)
{
- Eo *parent;
+ Ector_Renderer_Generic_Base_Data *base;
- eo_do(obj, parent = eo_parent_get());
- if (!parent) return EINA_FALSE;
- pd->surface = eo_data_xref(parent, ECTOR_SOFTWARE_SURFACE_CLASS, obj);
+ base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+ pd->surface = eo_data_xref(base->surface, ECTOR_SOFTWARE_SURFACE_CLASS, obj);
}
update_color_table(pd);
return EINA_TRUE;
}
-Eo *
+static Eo *
_ector_renderer_software_gradient_linear_eo_base_constructor(Eo *obj,
Ector_Renderer_Software_Gradient_Data *pd)
{
obj = eo_do_super_ret(obj, ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS, obj, eo_constructor());
+ if (!obj) return NULL;
+
pd->gd = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_GRADIENT_MIXIN, obj);
pd->gld = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN, obj);
return obj;
}
-void
+static void
_ector_renderer_software_gradient_linear_eo_base_destructor(Eo *obj,
Ector_Renderer_Software_Gradient_Data *pd)
{
- Eo *parent;
+ Ector_Renderer_Generic_Base_Data *base;
destroy_color_table(pd);
- eo_do(obj, parent = eo_parent_get());
- eo_data_xunref(parent, pd->surface, obj);
+ base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+ eo_data_xunref(base->surface, pd->surface, obj);
eo_data_xunref(obj, pd->gd, obj);
eo_data_xunref(obj, pd->gld, obj);
{
if (!pd->surface)
{
- Eo *parent;
+ Ector_Renderer_Generic_Base_Data *base;
- eo_do(obj, parent = eo_parent_get());
- if (!parent) return EINA_FALSE;
- pd->surface = eo_data_xref(parent, ECTOR_SOFTWARE_SURFACE_CLASS, obj);
+ base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+ pd->surface = eo_data_xref(base->surface, ECTOR_SOFTWARE_SURFACE_CLASS, obj);
}
update_color_table(pd);
_ector_renderer_software_gradient_radial_eo_base_destructor(Eo *obj,
Ector_Renderer_Software_Gradient_Data *pd)
{
- Eo *parent;
+ Ector_Renderer_Generic_Base_Data *base;
destroy_color_table(pd);
- eo_do(obj, parent = eo_parent_get());
- eo_data_xunref(parent, pd->surface, obj);
+ base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+ eo_data_xunref(base->surface, pd->surface, obj);
eo_data_xunref(obj, pd->gd, obj);
eo_data_xunref(obj, pd->gld, obj);
// shouldn't that be moved to the software base object
if (!pd->surface)
{
- Eo *parent;
- eo_do(obj, parent = eo_parent_get());
- if (!parent) return EINA_FALSE;
- pd->surface = eo_data_xref(parent, ECTOR_SOFTWARE_SURFACE_CLASS, obj);
- if (!pd->surface) return EINA_FALSE;
+ Ector_Renderer_Generic_Base_Data *base;
+
+ base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+ pd->surface = eo_data_xref(base->surface, ECTOR_SOFTWARE_SURFACE_CLASS, obj);
}
+
return EINA_TRUE;
}
return EINA_TRUE;
}
-Eo *
+static Eo *
_ector_renderer_software_shape_eo_base_constructor(Eo *obj, Ector_Renderer_Software_Shape_Data *pd)
{
- obj = eo_do_super_ret(obj, ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, obj, eo_constructor());
+ eo_do_super(obj, ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, obj = eo_constructor());
+ if (!obj) return NULL;
+
pd->shape = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_SHAPE_MIXIN, obj);
pd->base = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS, obj);
eo_do(obj,
return obj;
}
-void
+static void
_ector_renderer_software_shape_eo_base_destructor(Eo *obj, Ector_Renderer_Software_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());
if (pd->shape_data) ector_software_rasterizer_destroy_rle_data(pd->shape_data);
if (pd->outline_data) ector_software_rasterizer_destroy_rle_data(pd->outline_data);
- eo_do(obj, parent = eo_parent_get());
- eo_data_xunref(parent, pd->surface, obj);
+ base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
+ eo_data_xunref(base->surface, pd->surface, obj);
eo_data_xunref(obj, pd->shape, obj);
eo_data_xunref(obj, pd->base, obj);
const Eo_Class *type)
{
if (type == ECTOR_RENDERER_GENERIC_SHAPE_MIXIN)
- return eo_add(ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, obj);
+ return eo_add(ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, NULL,
+ ector_renderer_surface_set(obj));
else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN)
- return eo_add(ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS, obj);
+ return eo_add(ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS, NULL,
+ ector_renderer_surface_set(obj));
else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN)
- return eo_add(ECTOR_RENDERER_SOFTWARE_GRADIENT_RADIAL_CLASS, obj);
+ return eo_add(ECTOR_RENDERER_SOFTWARE_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;
}