aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_vg_gradient_radial.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-04-03 16:22:58 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-04-03 16:22:58 +0200
commit6097178ec32f56edf2a737a701ed55b673c29879 (patch)
treea994152d4397f3f889d4fd6133addc730fb88363 /src/lib/evas/canvas/evas_vg_gradient_radial.c
parentevas: those function should have been static. (diff)
downloadefl-6097178ec32f56edf2a737a701ed55b673c29879.tar.gz
evas: start properly implementing render_pre for Evas_VG_Node.
Diffstat (limited to 'src/lib/evas/canvas/evas_vg_gradient_radial.c')
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_radial.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_vg_gradient_radial.c b/src/lib/evas/canvas/evas_vg_gradient_radial.c
index 0e21565c6d..c27430a340 100644
--- a/src/lib/evas/canvas/evas_vg_gradient_radial.c
+++ b/src/lib/evas/canvas/evas_vg_gradient_radial.c
@@ -1,6 +1,10 @@
#include "evas_common_private.h"
#include "evas_private.h"
+#include "evas_vg_private.h"
+
+#define MY_CLASS EVAS_VG_GRADIENT_RADIAL_CLASS
+
typedef struct _Evas_VG_Gradient_Radial_Data Evas_VG_Gradient_Radial_Data;
struct _Evas_VG_Gradient_Radial_Data
{
@@ -61,4 +65,50 @@ _evas_vg_gradient_radial_efl_graphics_gradient_radial_focal_get(Eo *obj EINA_UNU
if (y) *y = pd->focal.y;
}
+static void
+_evas_vg_gradient_radial_render_pre(Eo *obj,
+ Ector_Surface *s,
+ void *data,
+ Evas_VG_Node_Data *nd)
+{
+ Evas_VG_Gradient_Radial_Data *pd = data;
+ Evas_VG_Gradient_Data *gd = eo_data_scope_get(obj, EVAS_VG_GRADIENT_CLASS);
+
+ if (!nd->renderer)
+ {
+ eo_do(s, nd->renderer = ector_surface_renderer_factory_new(ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_CLASS));
+ }
+
+ eo_do(nd->renderer,
+ ector_renderer_transformation_set(nd->m),
+ ector_renderer_origin_set(nd->x, nd->y),
+ ector_renderer_color_set(nd->r, nd->g, nd->b, nd->a),
+ ector_renderer_visibility_set(nd->visibility),
+ efl_graphics_gradient_stop_set(gd->colors, gd->colors_count),
+ efl_graphics_gradient_spread_set(gd->s),
+ efl_graphics_gradient_radial_center_set(pd->center.x, pd->center.y),
+ efl_graphics_gradient_radial_focal_set(pd->focal.x, pd->focal.y),
+ efl_graphics_gradient_radial_radius_set(pd->radius),
+ ector_renderer_prepare());
+}
+
+static void
+_evas_vg_gradient_radial_eo_base_constructor(Eo *obj, Evas_VG_Gradient_Radial_Data *pd)
+{
+ Evas_VG_Node_Data *nd;
+
+ eo_do_super(obj, MY_CLASS, eo_constructor());
+
+ nd = eo_data_scope_get(obj, EVAS_VG_NODE_CLASS);
+ nd->render_pre = _evas_vg_gradient_radial_render_pre;
+ nd->data = pd;
+}
+
+static void
+_evas_vg_gradient_radial_eo_base_destructor(Eo *obj,
+ Evas_VG_Gradient_Radial_Data *pd EINA_UNUSED)
+{
+ eo_do_super(obj, MY_CLASS, eo_destructor());
+}
+
#include "evas_vg_gradient_radial.eo.c"