From c5d085999a73a0b644bdb2387ead17745731435a Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 3 Apr 2015 16:21:49 +0200 Subject: [PATCH] ector: add stop implementation. --- src/lib/ector/ector_renderer_gradient.c | 17 +++++++++++++++++ src/lib/evas/canvas/evas_vg_gradient.c | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/lib/ector/ector_renderer_gradient.c b/src/lib/ector/ector_renderer_gradient.c index 610fb93..d54f365 100644 --- a/src/lib/ector/ector_renderer_gradient.c +++ b/src/lib/ector/ector_renderer_gradient.c @@ -10,6 +10,10 @@ typedef struct _Ector_Renderer_Generic_Gradient_Data Ector_Renderer_Generic_Gradient_Data; struct _Ector_Renderer_Generic_Gradient_Data { + Efl_Graphics_Gradient_Stop *colors; + unsigned int colors_count; + + Efl_Graphics_Gradient_Spread s; }; void @@ -18,6 +22,15 @@ _ector_renderer_gradient_efl_graphics_gradient_stop_set(Eo *obj, const Efl_Graphics_Gradient_Stop *colors, unsigned int length) { + pd->colors = realloc(pd->colors, length * sizeof(Efl_Graphics_Gradient_Stop)); + if (!pd->colors) + { + pd->colors_count = 0; + return ; + } + + memcpy(pd->colors, colors, length * sizeof(Efl_Graphics_Gradient_Stop)); + pd->colors_count = length; } void @@ -26,6 +39,8 @@ _ector_renderer_gradient_efl_graphics_gradient_stop_get(Eo *obj, const Efl_Graphics_Gradient_Stop **colors, unsigned int *length) { + if (colors) *colors = pd->colors; + if (length) *length = pd->colors_count; } void @@ -33,12 +48,14 @@ _ector_renderer_gradient_efl_graphics_gradient_spread_set(Eo *obj, Ector_Renderer_Generic_Gradient_Data *pd, Efl_Graphics_Gradient_Spread s) { + pd->s = s; } Efl_Graphics_Gradient_Spread _ector_renderer_gradient_efl_graphics_gradient_spread_get(Eo *obj, Ector_Renderer_Generic_Gradient_Data *pd) { + return pd->s; } diff --git a/src/lib/evas/canvas/evas_vg_gradient.c b/src/lib/evas/canvas/evas_vg_gradient.c index 72bddf7..28ed579 100644 --- a/src/lib/evas/canvas/evas_vg_gradient.c +++ b/src/lib/evas/canvas/evas_vg_gradient.c @@ -6,7 +6,7 @@ typedef struct _Evas_VG_Gradient_Data Evas_VG_Gradient_Data; struct _Evas_VG_Gradient_Data { - // FIXME: Later on we should deduplicate it somehow. + // FIXME: Later on we should deduplicate it somehow (Using Ector ?). Efl_Graphics_Gradient_Stop *colors; unsigned int colors_count; -- 2.7.4