forked from enlightenment/efl
ector: make it possible to have an unique id per Ector_Renderer.
This is going to be used by an Eina_Hash to deduplicate the number of Ector_Renderer.
This commit is contained in:
parent
4d75e359ff
commit
6416997382
|
@ -163,4 +163,26 @@ _ector_renderer_cairo_gradient_linear_efl_gfx_gradient_base_stop_set(Eo *obj,
|
|||
efl_gfx_gradient_stop_set(colors, length));
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
_ector_renderer_cairo_gradient_linear_ector_renderer_generic_base_crc_get(Eo *obj, Ector_Renderer_Cairo_Gradient_Linear_Data *pd EINA_UNUSED)
|
||||
{
|
||||
Ector_Renderer_Generic_Gradient_Linear_Data *gld;
|
||||
Ector_Renderer_Generic_Gradient_Data *gd;
|
||||
unsigned int crc;
|
||||
|
||||
eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS,
|
||||
crc = ector_renderer_crc_get());
|
||||
|
||||
gld = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN);
|
||||
gd = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_MIXIN);
|
||||
if (!gd || !gld) return crc;
|
||||
|
||||
crc = eina_crc((void*) gd->s, sizeof (Efl_Gfx_Gradient_Spread), crc, EINA_FALSE);
|
||||
if (gd->colors_count)
|
||||
crc = eina_crc((void*) gd->colors, sizeof (Efl_Gfx_Gradient_Stop) * gd->colors_count, crc, EINA_FALSE);
|
||||
crc = eina_crc((void*) gld, sizeof (Ector_Renderer_Generic_Gradient_Linear_Data), crc, EINA_FALSE);
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
#include "ector_renderer_cairo_gradient_linear.eo.c"
|
||||
|
|
|
@ -6,6 +6,7 @@ class Ector.Renderer.Cairo.Gradient_Linear (Ector.Renderer.Cairo.Base, Ector.Ren
|
|||
Ector.Renderer.Generic.Base.prepare;
|
||||
Ector.Renderer.Generic.Base.draw;
|
||||
Ector.Renderer.Generic.Base.bounds_get;
|
||||
Ector.Renderer.Generic.Base.crc.get;
|
||||
Ector.Renderer.Cairo.Base.fill;
|
||||
Eo.Base.destructor;
|
||||
Efl.Gfx.Gradient.Base.stop.set;
|
||||
|
|
|
@ -168,4 +168,26 @@ _ector_renderer_cairo_gradient_radial_efl_gfx_gradient_base_stop_set(Eo *obj,
|
|||
efl_gfx_gradient_stop_set(colors, length));
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
_ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_crc_get(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd EINA_UNUSED)
|
||||
{
|
||||
Ector_Renderer_Generic_Gradient_Radial_Data *grd;
|
||||
Ector_Renderer_Generic_Gradient_Data *gd;
|
||||
unsigned int crc;
|
||||
|
||||
eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS,
|
||||
crc = ector_renderer_crc_get());
|
||||
|
||||
grd = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN);
|
||||
gd = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_MIXIN);
|
||||
if (!grd || !gd) return crc;
|
||||
|
||||
crc = eina_crc((void*) gd->s, sizeof (Efl_Gfx_Gradient_Spread), crc, EINA_FALSE);
|
||||
if (gd->colors_count)
|
||||
crc = eina_crc((void*) gd->colors, sizeof (Efl_Gfx_Gradient_Stop) * gd->colors_count, crc, EINA_FALSE);
|
||||
crc = eina_crc((void*) grd, sizeof (Ector_Renderer_Generic_Gradient_Radial_Data), crc, EINA_FALSE);
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
#include "ector_renderer_cairo_gradient_radial.eo.c"
|
||||
|
|
|
@ -6,6 +6,7 @@ class Ector.Renderer.Cairo.Gradient_Radial (Ector.Renderer.Cairo.Base, Ector.Ren
|
|||
Ector.Renderer.Generic.Base.prepare;
|
||||
Ector.Renderer.Generic.Base.draw;
|
||||
Ector.Renderer.Generic.Base.bounds_get;
|
||||
Ector.Renderer.Generic.Base.crc.get;
|
||||
Ector.Renderer.Cairo.Base.fill;
|
||||
Eo.Base.destructor;
|
||||
Efl.Gfx.Gradient.Base.stop.set;
|
||||
|
|
|
@ -293,5 +293,30 @@ _ector_renderer_cairo_shape_eo_base_destructor(Eo *obj, Ector_Renderer_Cairo_Sha
|
|||
if (pd->path) cairo_path_destroy(pd->path);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
_ector_renderer_cairo_shape_ector_renderer_generic_base_crc_get(Eo *obj,
|
||||
Ector_Renderer_Cairo_Shape_Data *pd)
|
||||
{
|
||||
unsigned int crc;
|
||||
|
||||
eo_do_super(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS,
|
||||
crc = ector_renderer_crc_get());
|
||||
|
||||
crc = eina_crc((void*) &pd->shape->stroke.marker, sizeof (pd->shape->stroke.marker), crc, EINA_FALSE);
|
||||
crc = eina_crc((void*) &pd->shape->stroke.scale, sizeof (pd->shape->stroke.scale) * 3, crc, EINA_FALSE); // scale, width, centered
|
||||
crc = eina_crc((void*) &pd->shape->stroke.color, sizeof (pd->shape->stroke.color), crc, EINA_FALSE);
|
||||
crc = eina_crc((void*) &pd->shape->stroke.cap, sizeof (pd->shape->stroke.cap), crc, EINA_FALSE);
|
||||
crc = eina_crc((void*) &pd->shape->stroke.join, sizeof (pd->shape->stroke.join), crc, EINA_FALSE);
|
||||
|
||||
if (pd->shape->fill) crc = _renderer_crc_get(pd->shape->fill, crc);
|
||||
if (pd->shape->stroke.fill) crc = _renderer_crc_get(pd->shape->stroke.fill, crc);
|
||||
if (pd->shape->stroke.marker) crc = _renderer_crc_get(pd->shape->stroke.marker, crc);
|
||||
if (pd->shape->stroke.dash_length)
|
||||
{
|
||||
crc = eina_crc((void*) pd->shape->stroke.dash, sizeof (Efl_Gfx_Dash) * pd->shape->stroke.dash_length, crc, EINA_FALSE);
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
#include "ector_renderer_cairo_shape.eo.c"
|
||||
|
|
|
@ -6,6 +6,7 @@ class Ector.Renderer.Cairo.Shape (Ector.Renderer.Cairo.Base, Ector.Renderer.Gene
|
|||
Ector.Renderer.Generic.Base.prepare;
|
||||
Ector.Renderer.Generic.Base.draw;
|
||||
Ector.Renderer.Generic.Base.bounds_get;
|
||||
Ector.Renderer.Generic.Base.crc.get;
|
||||
Ector.Renderer.Cairo.Base.fill;
|
||||
Eo.Base.constructor;
|
||||
Eo.Base.destructor;
|
||||
|
|
|
@ -145,4 +145,14 @@ struct _Ector_Renderer_Generic_Shape_Data
|
|||
} stroke;
|
||||
};
|
||||
|
||||
static inline unsigned int
|
||||
_renderer_crc_get(Eo *obj, unsigned int crc)
|
||||
{
|
||||
unsigned int id;
|
||||
|
||||
eo_do(obj, id = ector_renderer_crc_get());
|
||||
crc = eina_crc((void*) &id, sizeof (id), crc, EINA_FALSE);
|
||||
return crc;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -135,4 +135,20 @@ _ector_renderer_generic_base_prepare(Eo *obj EINA_UNUSED,
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
_ector_renderer_generic_base_crc_get(Eo *obj EINA_UNUSED,
|
||||
Ector_Renderer_Generic_Base_Data *pd)
|
||||
{
|
||||
unsigned int crc;
|
||||
|
||||
crc = eina_crc((void*) &pd->color, sizeof(pd->color), 0xffffffff, EINA_TRUE);
|
||||
crc = eina_crc((void*) &pd->q, sizeof(pd->q), crc, EINA_FALSE);
|
||||
crc = eina_crc((void*) &pd->origin, sizeof(pd->origin), crc, EINA_FALSE);
|
||||
|
||||
if (pd->m) crc = eina_crc((void*) pd->m, sizeof(Eina_Matrix3), crc, EINA_FALSE);
|
||||
if (pd->mask) crc = _renderer_crc_get(pd->mask, crc);
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
#include "ector_renderer_generic_base.eo.c"
|
||||
|
|
|
@ -81,6 +81,11 @@ abstract Ector.Renderer.Generic.Base (Eo.Base)
|
|||
q: Ector_Quality;
|
||||
}
|
||||
}
|
||||
@property crc {
|
||||
get {
|
||||
return: uint;
|
||||
}
|
||||
}
|
||||
bounds_get {
|
||||
params {
|
||||
@out r: Eina.Rectangle;
|
||||
|
|
|
@ -108,4 +108,20 @@ _ector_renderer_software_gradient_linear_efl_gfx_gradient_base_stop_set(Eo *obj,
|
|||
destroy_color_table(pd);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
_ector_renderer_software_gradient_linear_ector_renderer_generic_base_crc_get(Eo *obj, Ector_Renderer_Software_Gradient_Data *pd)
|
||||
{
|
||||
unsigned int crc;
|
||||
|
||||
eo_do_super(obj, ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS,
|
||||
crc = ector_renderer_crc_get());
|
||||
|
||||
crc = eina_crc((void*) pd->gd->s, sizeof (Efl_Gfx_Gradient_Spread), crc, EINA_FALSE);
|
||||
if (pd->gd->colors_count)
|
||||
crc = eina_crc((void*) pd->gd->colors, sizeof (Efl_Gfx_Gradient_Stop) * pd->gd->colors_count, crc, EINA_FALSE);
|
||||
crc = eina_crc((void*) pd->gld, sizeof (Ector_Renderer_Generic_Gradient_Linear_Data), crc, EINA_FALSE);
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
#include "ector_renderer_software_gradient_linear.eo.c"
|
||||
|
|
|
@ -6,6 +6,7 @@ class Ector.Renderer.Software.Gradient_Linear (Ector.Renderer.Software.Base, Ect
|
|||
implements {
|
||||
Ector.Renderer.Generic.Base.prepare;
|
||||
Ector.Renderer.Generic.Base.draw;
|
||||
Ector.Renderer.Generic.Base.crc.get;
|
||||
Ector.Renderer.Software.Base.fill;
|
||||
Eo.Base.constructor;
|
||||
Eo.Base.destructor;
|
||||
|
|
|
@ -116,4 +116,20 @@ _ector_renderer_software_gradient_radial_efl_gfx_gradient_base_stop_set(Eo *obj,
|
|||
destroy_color_table(pd);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
_ector_renderer_software_gradient_radial_ector_renderer_generic_base_crc_get(Eo *obj, Ector_Renderer_Software_Gradient_Data *pd)
|
||||
{
|
||||
unsigned int crc;
|
||||
|
||||
eo_do_super(obj, ECTOR_RENDERER_SOFTWARE_GRADIENT_RADIAL_CLASS,
|
||||
crc = ector_renderer_crc_get());
|
||||
|
||||
crc = eina_crc((void*) pd->gd->s, sizeof (Efl_Gfx_Gradient_Spread), crc, EINA_FALSE);
|
||||
if (pd->gd->colors_count)
|
||||
crc = eina_crc((void*) pd->gd->colors, sizeof (Efl_Gfx_Gradient_Stop) * pd->gd->colors_count, crc, EINA_FALSE);
|
||||
crc = eina_crc((void*) pd->gld, sizeof (Ector_Renderer_Generic_Gradient_Radial_Data), crc, EINA_FALSE);
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
#include "ector_renderer_software_gradient_radial.eo.c"
|
||||
|
|
|
@ -6,6 +6,7 @@ class Ector.Renderer.Software.Gradient_Radial (Ector.Renderer.Software.Base, Ect
|
|||
implements {
|
||||
Ector.Renderer.Generic.Base.prepare;
|
||||
Ector.Renderer.Generic.Base.draw;
|
||||
Ector.Renderer.Generic.Base.crc.get;
|
||||
Ector.Renderer.Software.Base.fill;
|
||||
Eo.Base.constructor;
|
||||
Eo.Base.destructor;
|
||||
|
|
|
@ -726,4 +726,29 @@ _ector_renderer_software_shape_eo_base_destructor(Eo *obj, Ector_Renderer_Softwa
|
|||
}
|
||||
|
||||
|
||||
unsigned int
|
||||
_ector_renderer_software_shape_ector_renderer_generic_base_crc_get(Eo *obj,
|
||||
Ector_Renderer_Software_Shape_Data *pd)
|
||||
{
|
||||
unsigned int crc;
|
||||
|
||||
eo_do_super(obj, ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, crc = ector_renderer_crc_get());
|
||||
|
||||
crc = eina_crc((void*) &pd->shape->stroke.marker, sizeof (pd->shape->stroke.marker), crc, EINA_FALSE);
|
||||
crc = eina_crc((void*) &pd->shape->stroke.scale, sizeof (pd->shape->stroke.scale) * 3, crc, EINA_FALSE); // scale, width, centered
|
||||
crc = eina_crc((void*) &pd->shape->stroke.color, sizeof (pd->shape->stroke.color), crc, EINA_FALSE);
|
||||
crc = eina_crc((void*) &pd->shape->stroke.cap, sizeof (pd->shape->stroke.cap), crc, EINA_FALSE);
|
||||
crc = eina_crc((void*) &pd->shape->stroke.join, sizeof (pd->shape->stroke.join), crc, EINA_FALSE);
|
||||
|
||||
if (pd->shape->fill) crc = _renderer_crc_get(pd->shape->fill, crc);
|
||||
if (pd->shape->stroke.fill) crc = _renderer_crc_get(pd->shape->stroke.fill, crc);
|
||||
if (pd->shape->stroke.marker) crc = _renderer_crc_get(pd->shape->stroke.marker, crc);
|
||||
if (pd->shape->stroke.dash_length)
|
||||
{
|
||||
crc = eina_crc((void*) pd->shape->stroke.dash, sizeof (Efl_Gfx_Dash) * pd->shape->stroke.dash_length, crc, EINA_FALSE);
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
#include "ector_renderer_software_shape.eo.c"
|
||||
|
|
|
@ -6,6 +6,7 @@ class Ector.Renderer.Software.Shape (Ector.Renderer.Software.Base, Ector.Rendere
|
|||
Ector.Renderer.Generic.Base.prepare;
|
||||
Ector.Renderer.Generic.Base.draw;
|
||||
Ector.Renderer.Software.Base.fill;
|
||||
Ector.Renderer.Generic.Base.crc.get;
|
||||
Efl.Gfx.Shape.path.set;
|
||||
Eo.Base.constructor;
|
||||
Eo.Base.destructor;
|
||||
|
|
Loading…
Reference in New Issue