summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_vg_gradient_linear.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_linear.c
parent621d3b566024c357ce523857db211ab02a08af72 (diff)
evas: start properly implementing render_pre for Evas_VG_Node.
Diffstat (limited to 'src/lib/evas/canvas/evas_vg_gradient_linear.c')
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_linear.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_vg_gradient_linear.c b/src/lib/evas/canvas/evas_vg_gradient_linear.c
index 035f6b1e29..156a5851ed 100644
--- a/src/lib/evas/canvas/evas_vg_gradient_linear.c
+++ b/src/lib/evas/canvas/evas_vg_gradient_linear.c
@@ -1,8 +1,12 @@
1#include "evas_common_private.h" 1#include "evas_common_private.h"
2#include "evas_private.h" 2#include "evas_private.h"
3 3
4#include "evas_vg_private.h"
5
4#include <strings.h> 6#include <strings.h>
5 7
8#define MY_CLASS EVAS_VG_GRADIENT_LINEAR_CLASS
9
6typedef struct _Evas_VG_Gradient_Linear_Data Evas_VG_Gradient_Linear_Data; 10typedef struct _Evas_VG_Gradient_Linear_Data Evas_VG_Gradient_Linear_Data;
7struct _Evas_VG_Gradient_Linear_Data 11struct _Evas_VG_Gradient_Linear_Data
8{ 12{
@@ -47,4 +51,49 @@ _evas_vg_gradient_linear_efl_graphics_gradient_linear_end_get(Eo *obj EINA_UNUSE
47 if (y) *y = pd->end.y; 51 if (y) *y = pd->end.y;
48} 52}
49 53
54static void
55_evas_vg_gradient_linear_render_pre(Eo *obj,
56 Ector_Surface *s,
57 void *data,
58 Evas_VG_Node_Data *nd)
59{
60 Evas_VG_Gradient_Linear_Data *pd = data;
61 Evas_VG_Gradient_Data *gd = eo_data_scope_get(obj, EVAS_VG_GRADIENT_CLASS);
62
63 if (!nd->renderer)
64 {
65 eo_do(s, nd->renderer = ector_surface_renderer_factory_new(ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_CLASS));
66 }
67
68 eo_do(nd->renderer,
69 ector_renderer_transformation_set(nd->m),
70 ector_renderer_origin_set(nd->x, nd->y),
71 ector_renderer_color_set(nd->r, nd->g, nd->b, nd->a),
72 ector_renderer_visibility_set(nd->visibility),
73 efl_graphics_gradient_stop_set(gd->colors, gd->colors_count),
74 efl_graphics_gradient_spread_set(gd->s),
75 efl_graphics_gradient_linear_start_set(pd->start.x, pd->start.y),
76 efl_graphics_gradient_linear_end_set(pd->end.x, pd->end.y),
77 ector_renderer_prepare());
78}
79
80static void
81_evas_vg_gradient_linear_eo_base_constructor(Eo *obj,
82 Evas_VG_Gradient_Linear_Data *pd)
83{
84 Evas_VG_Node_Data *nd;
85
86 eo_do_super(obj, MY_CLASS, eo_constructor());
87
88 nd = eo_data_scope_get(obj, EVAS_VG_NODE_CLASS);
89 nd->render_pre = _evas_vg_gradient_linear_render_pre;
90 nd->data = pd;
91}
92
93void
94_evas_vg_gradient_linear_eo_base_destructor(Eo *obj, Evas_VG_Gradient_Linear_Data *pd EINA_UNUSED)
95{
96 eo_do_super(obj, MY_CLASS, eo_destructor());
97}
98
50#include "evas_vg_gradient_linear.eo.c" 99#include "evas_vg_gradient_linear.eo.c"