summaryrefslogtreecommitdiff
path: root/src
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
parent621d3b566024c357ce523857db211ab02a08af72 (diff)
evas: start properly implementing render_pre for Evas_VG_Node.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_object_vg.c11
-rw-r--r--src/lib/evas/canvas/evas_vg_container.c29
-rw-r--r--src/lib/evas/canvas/evas_vg_container.eo1
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient.c12
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_linear.c49
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_linear.eo2
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_radial.c50
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_radial.eo2
-rw-r--r--src/lib/evas/canvas/evas_vg_image.c11
-rw-r--r--src/lib/evas/canvas/evas_vg_image.eo2
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h29
-rw-r--r--src/lib/evas/canvas/evas_vg_shape.c100
-rw-r--r--src/lib/evas/canvas/evas_vg_shape.eo1
13 files changed, 256 insertions, 43 deletions
diff --git a/src/lib/evas/canvas/evas_object_vg.c b/src/lib/evas/canvas/evas_object_vg.c
index 397a3f6..dba3c7a 100644
--- a/src/lib/evas/canvas/evas_object_vg.c
+++ b/src/lib/evas/canvas/evas_object_vg.c
@@ -1,6 +1,7 @@
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"
4#include "evas_vg_root_node.eo.h" 5#include "evas_vg_root_node.eo.h"
5 6
6#define MY_CLASS EVAS_VG_CLASS 7#define MY_CLASS EVAS_VG_CLASS
@@ -164,11 +165,17 @@ evas_object_vg_render(Evas_Object *eo_obj EINA_UNUSED,
164static void 165static void
165evas_object_vg_render_pre(Evas_Object *eo_obj, 166evas_object_vg_render_pre(Evas_Object *eo_obj,
166 Evas_Object_Protected_Data *obj, 167 Evas_Object_Protected_Data *obj,
167 void *type_private_data EINA_UNUSED) 168 void *type_private_data)
168{ 169{
170 Evas_VG_Data *vd = type_private_data;
171 Evas_Public_Data *e = obj->layer->evas;
169 int is_v, was_v; 172 int is_v, was_v;
173 Ector_Surface *s;
170 174
171 // FIXME: call all modified Ector_Renderer prepare fct 175 // FIXME: handle damage only on changed renderer.
176 s = e->engine.func->ector_get(e->engine.data.output);
177 if (vd->root && s)
178 _evas_vg_render_pre(vd->root, s);
172 179
173 /* dont pre-render the obj twice! */ 180 /* dont pre-render the obj twice! */
174 if (obj->pre_render_done) return; 181 if (obj->pre_render_done) return;
diff --git a/src/lib/evas/canvas/evas_vg_container.c b/src/lib/evas/canvas/evas_vg_container.c
index c4b7f38..20ac001 100644
--- a/src/lib/evas/canvas/evas_vg_container.c
+++ b/src/lib/evas/canvas/evas_vg_container.c
@@ -6,10 +6,37 @@
6#define MY_CLASS EVAS_VG_CONTAINER_CLASS 6#define MY_CLASS EVAS_VG_CONTAINER_CLASS
7 7
8static void 8static void
9_evas_vg_container_render_pre(Eo *obj EINA_UNUSED,
10 Ector_Surface *s,
11 void *data,
12 Evas_VG_Node_Data *nd EINA_UNUSED)
13{
14 Evas_VG_Container_Data *pd = data;
15 Eina_List *l;
16 Eo *child;
17
18 EINA_LIST_FOREACH(pd->children, l, child)
19 _evas_vg_render_pre(child, s);
20}
21
22static void
9_evas_vg_container_eo_base_constructor(Eo *obj, 23_evas_vg_container_eo_base_constructor(Eo *obj,
10 Evas_VG_Container_Data *pd EINA_UNUSED) 24 Evas_VG_Container_Data *pd)
11{ 25{
26 Evas_VG_Node_Data *nd;
27
12 eo_do_super(obj, MY_CLASS, eo_constructor()); 28 eo_do_super(obj, MY_CLASS, eo_constructor());
29
30 nd = eo_data_scope_get(obj, EVAS_VG_NODE_CLASS);
31 nd->render_pre = _evas_vg_container_render_pre;
32 nd->data = pd;
33}
34
35static void
36_evas_vg_container_eo_base_destructor(Eo *obj,
37 Evas_VG_Container_Data *pd EINA_UNUSED)
38{
39 eo_do_super(obj, MY_CLASS, eo_destructor());
13} 40}
14 41
15static Eina_Bool 42static Eina_Bool
diff --git a/src/lib/evas/canvas/evas_vg_container.eo b/src/lib/evas/canvas/evas_vg_container.eo
index 423a202..0af3b00 100644
--- a/src/lib/evas/canvas/evas_vg_container.eo
+++ b/src/lib/evas/canvas/evas_vg_container.eo
@@ -3,6 +3,7 @@ class Evas.VG_Container (Evas.VG_Node)
3 eo_prefix: evas_vg_container; 3 eo_prefix: evas_vg_container;
4 implements { 4 implements {
5 Eo.Base.constructor; 5 Eo.Base.constructor;
6 Eo.Base.destructor;
6 Evas.VG_Node.bound_get; 7 Evas.VG_Node.bound_get;
7 } 8 }
8} 9}
diff --git a/src/lib/evas/canvas/evas_vg_gradient.c b/src/lib/evas/canvas/evas_vg_gradient.c
index acca97f..a63b636 100644
--- a/src/lib/evas/canvas/evas_vg_gradient.c
+++ b/src/lib/evas/canvas/evas_vg_gradient.c
@@ -1,17 +1,9 @@
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 <strings.h> 4#include "evas_vg_private.h"
5
6typedef struct _Evas_VG_Gradient_Data Evas_VG_Gradient_Data;
7struct _Evas_VG_Gradient_Data
8{
9 // FIXME: Later on we should deduplicate it somehow (Using Ector ?).
10 Efl_Graphics_Gradient_Stop *colors;
11 unsigned int colors_count;
12 5
13 Efl_Graphics_Gradient_Spread s; 6#include <strings.h>
14};
15 7
16static void 8static void
17_evas_vg_gradient_efl_graphics_gradient_stop_set(Eo *obj EINA_UNUSED, 9_evas_vg_gradient_efl_graphics_gradient_stop_set(Eo *obj EINA_UNUSED,
diff --git a/src/lib/evas/canvas/evas_vg_gradient_linear.c b/src/lib/evas/canvas/evas_vg_gradient_linear.c
index 035f6b1..156a585 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"
diff --git a/src/lib/evas/canvas/evas_vg_gradient_linear.eo b/src/lib/evas/canvas/evas_vg_gradient_linear.eo
index d513f10..0ae1347 100644
--- a/src/lib/evas/canvas/evas_vg_gradient_linear.eo
+++ b/src/lib/evas/canvas/evas_vg_gradient_linear.eo
@@ -7,5 +7,7 @@ class Evas.VG_Gradient_Linear (Evas.VG_Gradient, Efl.Graphics.Gradient_Linear)
7 Efl.Graphics.Gradient_Linear.start.get; 7 Efl.Graphics.Gradient_Linear.start.get;
8 Efl.Graphics.Gradient_Linear.end.set; 8 Efl.Graphics.Gradient_Linear.end.set;
9 Efl.Graphics.Gradient_Linear.end.get; 9 Efl.Graphics.Gradient_Linear.end.get;
10 Eo.Base.constructor;
11 Eo.Base.destructor;
10 } 12 }
11} 13}
diff --git a/src/lib/evas/canvas/evas_vg_gradient_radial.c b/src/lib/evas/canvas/evas_vg_gradient_radial.c
index 0e21565..c27430a 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 @@
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
6#define MY_CLASS EVAS_VG_GRADIENT_RADIAL_CLASS
7
4typedef struct _Evas_VG_Gradient_Radial_Data Evas_VG_Gradient_Radial_Data; 8typedef struct _Evas_VG_Gradient_Radial_Data Evas_VG_Gradient_Radial_Data;
5struct _Evas_VG_Gradient_Radial_Data 9struct _Evas_VG_Gradient_Radial_Data
6{ 10{
@@ -61,4 +65,50 @@ _evas_vg_gradient_radial_efl_graphics_gradient_radial_focal_get(Eo *obj EINA_UNU
61 if (y) *y = pd->focal.y; 65 if (y) *y = pd->focal.y;
62} 66}
63 67
68static void
69_evas_vg_gradient_radial_render_pre(Eo *obj,
70 Ector_Surface *s,
71 void *data,
72 Evas_VG_Node_Data *nd)
73{
74 Evas_VG_Gradient_Radial_Data *pd = data;
75 Evas_VG_Gradient_Data *gd = eo_data_scope_get(obj, EVAS_VG_GRADIENT_CLASS);
76
77 if (!nd->renderer)
78 {
79 eo_do(s, nd->renderer = ector_surface_renderer_factory_new(ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_CLASS));
80 }
81
82 eo_do(nd->renderer,
83 ector_renderer_transformation_set(nd->m),
84 ector_renderer_origin_set(nd->x, nd->y),
85 ector_renderer_color_set(nd->r, nd->g, nd->b, nd->a),
86 ector_renderer_visibility_set(nd->visibility),
87 efl_graphics_gradient_stop_set(gd->colors, gd->colors_count),
88 efl_graphics_gradient_spread_set(gd->s),
89 efl_graphics_gradient_radial_center_set(pd->center.x, pd->center.y),
90 efl_graphics_gradient_radial_focal_set(pd->focal.x, pd->focal.y),
91 efl_graphics_gradient_radial_radius_set(pd->radius),
92 ector_renderer_prepare());
93}
94
95static void
96_evas_vg_gradient_radial_eo_base_constructor(Eo *obj, Evas_VG_Gradient_Radial_Data *pd)
97{
98 Evas_VG_Node_Data *nd;
99
100 eo_do_super(obj, MY_CLASS, eo_constructor());
101
102 nd = eo_data_scope_get(obj, EVAS_VG_NODE_CLASS);
103 nd->render_pre = _evas_vg_gradient_radial_render_pre;
104 nd->data = pd;
105}
106
107static void
108_evas_vg_gradient_radial_eo_base_destructor(Eo *obj,
109 Evas_VG_Gradient_Radial_Data *pd EINA_UNUSED)
110{
111 eo_do_super(obj, MY_CLASS, eo_destructor());
112}
113
64#include "evas_vg_gradient_radial.eo.c" 114#include "evas_vg_gradient_radial.eo.c"
diff --git a/src/lib/evas/canvas/evas_vg_gradient_radial.eo b/src/lib/evas/canvas/evas_vg_gradient_radial.eo
index a6bfe70..0a06ae9 100644
--- a/src/lib/evas/canvas/evas_vg_gradient_radial.eo
+++ b/src/lib/evas/canvas/evas_vg_gradient_radial.eo
@@ -9,5 +9,7 @@ class Evas.VG_Gradient_Radial (Evas.VG_Gradient, Efl.Graphics.Gradient_Radial)
9 Efl.Graphics.Gradient_Radial.radius.get; 9 Efl.Graphics.Gradient_Radial.radius.get;
10 Efl.Graphics.Gradient_Radial.focal.set; 10 Efl.Graphics.Gradient_Radial.focal.set;
11 Efl.Graphics.Gradient_Radial.focal.get; 11 Efl.Graphics.Gradient_Radial.focal.get;
12 Eo.Base.constructor;
13 Eo.Base.destructor;
12 } 14 }
13} 15}
diff --git a/src/lib/evas/canvas/evas_vg_image.c b/src/lib/evas/canvas/evas_vg_image.c
index 21a7bbe..d47b94e 100644
--- a/src/lib/evas/canvas/evas_vg_image.c
+++ b/src/lib/evas/canvas/evas_vg_image.c
@@ -59,5 +59,16 @@ _evas_vg_image_efl_file_file_get(Eo *obj, Evas_VG_Image_Data *pd,
59 if (key) *key = pd->key; 59 if (key) *key = pd->key;
60} 60}
61 61
62static void
63_evas_vg_image_eo_base_constructor(Eo *obj, Evas_VG_Image_Data *pd)
64{
65 eo_error_set(obj);
66}
67
68static void
69_evas_vg_image_eo_base_destructor(Eo *obj, Evas_VG_Image_Data *pd)
70{
71 eo_error_set(obj);
72}
62 73
63#include "evas_vg_image.eo.c" 74#include "evas_vg_image.eo.c"
diff --git a/src/lib/evas/canvas/evas_vg_image.eo b/src/lib/evas/canvas/evas_vg_image.eo
index 6ed670e..33fe0b0 100644
--- a/src/lib/evas/canvas/evas_vg_image.eo
+++ b/src/lib/evas/canvas/evas_vg_image.eo
@@ -28,5 +28,7 @@ class Evas.VG_Image (Evas.VG_Node, Efl.File)
28 implements { 28 implements {
29 Efl.File.file.set; 29 Efl.File.file.set;
30 Efl.File.file.get; 30 Efl.File.file.get;
31 Eo.Base.constructor;
32 Eo.Base.destructor;
31 } 33 }
32} \ No newline at end of file 34} \ No newline at end of file
diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h
index 6b83623..7d8f069 100644
--- a/src/lib/evas/canvas/evas_vg_private.h
+++ b/src/lib/evas/canvas/evas_vg_private.h
@@ -1,14 +1,19 @@
1#ifndef EVAS_VG_PRIVATE_H_ 1#ifndef EVAS_VG_PRIVATE_H_
2# define EVAS_VG_PRIVATE_H_ 2# define EVAS_VG_PRIVATE_H_
3 3
4#include <Ector.h>
5
4typedef struct _Evas_VG_Node_Data Evas_VG_Node_Data; 6typedef struct _Evas_VG_Node_Data Evas_VG_Node_Data;
7typedef struct _Evas_VG_Container_Data Evas_VG_Container_Data;
8typedef struct _Evas_VG_Gradient_Data Evas_VG_Gradient_Data;
9
5struct _Evas_VG_Node_Data 10struct _Evas_VG_Node_Data
6{ 11{
7 Eina_Matrix3 *m; 12 Eina_Matrix3 *m;
8 Evas_VG_Node *mask; 13 Evas_VG_Node *mask;
14 Ector_Renderer *renderer;
9 15
10 void (*render_pre)(void); 16 void (*render_pre)(Eo *obj, Ector_Surface *s, void *data, Evas_VG_Node_Data *nd);
11 void (*render)(void);
12 void *data; 17 void *data;
13 18
14 double x, y; 19 double x, y;
@@ -18,10 +23,28 @@ struct _Evas_VG_Node_Data
18 Eina_Bool changed : 1; 23 Eina_Bool changed : 1;
19}; 24};
20 25
21typedef struct _Evas_VG_Container_Data Evas_VG_Container_Data;
22struct _Evas_VG_Container_Data 26struct _Evas_VG_Container_Data
23{ 27{
24 Eina_List *children; 28 Eina_List *children;
25}; 29};
26 30
31struct _Evas_VG_Gradient_Data
32{
33 // FIXME: Later on we should deduplicate it somehow (Using Ector ?).
34 Efl_Graphics_Gradient_Stop *colors;
35 unsigned int colors_count;
36
37 Efl_Graphics_Gradient_Spread s;
38};
39
40static inline void
41_evas_vg_render_pre(Evas_VG_Node *child, Ector_Surface *s)
42{
43 Evas_VG_Node_Data *child_nd;
44
45 // FIXME: Prevent infinite loop
46 child_nd = eo_data_scope_get(child, EVAS_VG_NODE_CLASS);
47 child_nd->render_pre(child, s, child_nd->data, child_nd);
48}
49
27#endif 50#endif
diff --git a/src/lib/evas/canvas/evas_vg_shape.c b/src/lib/evas/canvas/evas_vg_shape.c
index b39a9ef..9e67710 100644
--- a/src/lib/evas/canvas/evas_vg_shape.c
+++ b/src/lib/evas/canvas/evas_vg_shape.c
@@ -8,7 +8,7 @@
8typedef struct _Evas_VG_Shape_Data Evas_VG_Shape_Data; 8typedef struct _Evas_VG_Shape_Data Evas_VG_Shape_Data;
9struct _Evas_VG_Shape_Data 9struct _Evas_VG_Shape_Data
10{ 10{
11 Efl_Graphics_Path_Command *op; 11 Efl_Graphics_Path_Command *ops;
12 double *points; 12 double *points;
13 13
14 Evas_VG_Node *fill; 14 Evas_VG_Node *fill;
@@ -29,50 +29,31 @@ struct _Evas_VG_Shape_Data
29 Efl_Graphics_Cap cap; 29 Efl_Graphics_Cap cap;
30 Efl_Graphics_Join join; 30 Efl_Graphics_Join join;
31 } stroke; 31 } stroke;
32
33 unsigned int op_count;
34 unsigned int pts_counts;
35}; 32};
36 33
37static Eina_Bool 34static Eina_Bool
38_evas_vg_shape_efl_graphics_shape_path_set(Eo *obj EINA_UNUSED, 35_evas_vg_shape_efl_graphics_shape_path_set(Eo *obj EINA_UNUSED,
39 Evas_VG_Shape_Data *pd, 36 Evas_VG_Shape_Data *pd,
40 const Efl_Graphics_Path_Command *op, 37 const Efl_Graphics_Path_Command *ops,
41 const double *points) 38 const double *points)
42{ 39{
43 free(pd->points); 40 free(pd->points);
44 pd->points = NULL; 41 pd->points = NULL;
45 free(pd->op); 42 free(pd->ops);
46 pd->op = NULL; 43 pd->ops = NULL;
47 44
48 return efl_graphics_path_dup(&pd->op, &pd->points, op, points); 45 return efl_graphics_path_dup(&pd->ops, &pd->points, ops, points);
49} 46}
50 47
51static Eina_Bool 48static Eina_Bool
52_evas_vg_shape_bounds_get(Eo *obj, Evas_VG_Shape_Data *pd, Eina_Rectangle *r) 49_evas_vg_shape_evas_vg_node_bound_get(Eo *obj,
50 Evas_VG_Shape_Data *pd,
51 Eina_Rectangle *r)
53{ 52{
54 (void) obj; (void) pd; (void) r;
55 return EINA_FALSE; 53 return EINA_FALSE;
56} 54}
57 55
58static void 56static void
59_evas_vg_shape_eo_base_constructor(Eo *obj, Evas_VG_Shape_Data *pd EINA_UNUSED)
60{
61 eo_do_super(obj, MY_CLASS, eo_constructor());
62 pd->stroke.cap = EFL_GRAPHICS_CAP_BUTT;
63 pd->stroke.join = EFL_GRAPHICS_JOIN_MITER;
64 pd->stroke.scale = 1;
65 pd->stroke.a = 1;
66 pd->stroke.centered = 0.5;
67}
68
69static void
70_evas_vg_shape_eo_base_destructor(Eo *obj, Evas_VG_Shape_Data *pd EINA_UNUSED)
71{
72 eo_do_super(obj, MY_CLASS, eo_destructor());
73}
74
75static void
76_evas_vg_shape_fill_set(Eo *obj EINA_UNUSED, 57_evas_vg_shape_fill_set(Eo *obj EINA_UNUSED,
77 Evas_VG_Shape_Data *pd, 58 Evas_VG_Shape_Data *pd,
78 Evas_VG_Node *f) 59 Evas_VG_Node *f)
@@ -249,4 +230,69 @@ _evas_vg_shape_efl_graphics_shape_stroke_join_get(Eo *obj EINA_UNUSED,
249 return pd->stroke.join; 230 return pd->stroke.join;
250} 231}
251 232
233static void
234_evas_vg_shape_render_pre(Eo *obj EINA_UNUSED,
235 Ector_Surface *s,
236 void *data,
237 Evas_VG_Node_Data *nd)
238{
239 Evas_VG_Shape_Data *pd = data;
240
241 _evas_vg_render_pre(pd->fill, s);
242 _evas_vg_render_pre(pd->stroke.fill, s);
243 _evas_vg_render_pre(pd->stroke.marker, s);
244 _evas_vg_render_pre(nd->mask, s);
245
246 if (!nd->renderer)
247 {
248 eo_do(s, nd->renderer = ector_surface_renderer_factory_new(ECTOR_RENDERER_GENERIC_SHAPE_CLASS));
249 }
250
251 eo_do(nd->renderer,
252 ector_renderer_transformation_set(nd->m),
253 ector_renderer_origin_set(nd->x, nd->y),
254 ector_renderer_color_set(nd->r, nd->g, nd->b, nd->a),
255 ector_renderer_visibility_set(nd->visibility),
256 ector_renderer_mask_set(nd->mask),
257 ector_renderer_shape_fill_set(pd->fill),
258 ector_renderer_shape_stroke_fill_set(pd->stroke.fill),
259 ector_renderer_shape_stroke_marker_set(pd->stroke.marker),
260 efl_graphics_shape_stroke_scale_set(pd->stroke.scale),
261 efl_graphics_shape_stroke_color_set(pd->stroke.r,
262 pd->stroke.g,
263 pd->stroke.b,
264 pd->stroke.a),
265 efl_graphics_shape_stroke_width_set(pd->stroke.width),
266 efl_graphics_shape_stroke_location_set(pd->stroke.centered),
267 efl_graphics_shape_stroke_dash_set(pd->stroke.dash, pd->stroke.dash_count),
268 efl_graphics_shape_stroke_cap_set(pd->stroke.cap),
269 efl_graphics_shape_stroke_join_set(pd->stroke.join),
270 efl_graphics_shape_path_set(pd->ops, pd->points),
271 ector_renderer_prepare());
272}
273
274static void
275_evas_vg_shape_eo_base_constructor(Eo *obj, Evas_VG_Shape_Data *pd)
276{
277 Evas_VG_Node_Data *nd;
278
279 eo_do_super(obj, MY_CLASS, eo_constructor());
280
281 pd->stroke.cap = EFL_GRAPHICS_CAP_BUTT;
282 pd->stroke.join = EFL_GRAPHICS_JOIN_MITER;
283 pd->stroke.scale = 1;
284 pd->stroke.a = 1;
285 pd->stroke.centered = 0.5;
286
287 nd = eo_data_scope_get(obj, EVAS_VG_NODE_CLASS);
288 nd->render_pre = _evas_vg_shape_render_pre;
289 nd->data = pd;
290}
291
292static void
293_evas_vg_shape_eo_base_destructor(Eo *obj, Evas_VG_Shape_Data *pd EINA_UNUSED)
294{
295 eo_do_super(obj, MY_CLASS, eo_destructor());
296}
297
252#include "evas_vg_shape.eo.c" 298#include "evas_vg_shape.eo.c"
diff --git a/src/lib/evas/canvas/evas_vg_shape.eo b/src/lib/evas/canvas/evas_vg_shape.eo
index 0574b72..41845b4 100644
--- a/src/lib/evas/canvas/evas_vg_shape.eo
+++ b/src/lib/evas/canvas/evas_vg_shape.eo
@@ -40,6 +40,7 @@ class Evas.VG_Shape (Evas.VG_Node, Efl.Graphics.Shape)
40 Efl.Graphics.Shape.stroke_cap; 40 Efl.Graphics.Shape.stroke_cap;
41 Efl.Graphics.Shape.stroke_join; 41 Efl.Graphics.Shape.stroke_join;
42 Efl.Graphics.Shape.path_set; 42 Efl.Graphics.Shape.path_set;
43 Evas.VG_Node.bound_get;
43 Eo.Base.constructor; 44 Eo.Base.constructor;
44 Eo.Base.destructor; 45 Eo.Base.destructor;
45 } 46 }