summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubhransu Mohanty <sub.mohanty@samsung.com>2016-05-19 01:55:06 -0700
committerCedric Bail <cedric@osg.samsung.com>2016-05-19 02:23:56 -0700
commit655ed09ab4026c9994d6aa9c4e3a3c245541c262 (patch)
treeb97dfe0c3e1e4b081b364520318d54a1ff2ac99d
parentce4a9ee6c8c6e801069bd2c9aad56b785094fb3a (diff)
evas: propagate the change to child when object is a vector graphic container
Summary: let me know whats your thought Reviewers: Hermet, cedric Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3893 Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
-rw-r--r--src/lib/efl/interfaces/efl_gfx_types.eot9
-rw-r--r--src/lib/evas/canvas/evas_vg_container.c18
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_linear.c5
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_radial.c5
-rw-r--r--src/lib/evas/canvas/evas_vg_node.c5
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h1
-rw-r--r--src/lib/evas/canvas/evas_vg_shape.c5
7 files changed, 37 insertions, 11 deletions
diff --git a/src/lib/efl/interfaces/efl_gfx_types.eot b/src/lib/efl/interfaces/efl_gfx_types.eot
index d7a85d195f..0e4dd1e916 100644
--- a/src/lib/efl/interfaces/efl_gfx_types.eot
+++ b/src/lib/efl/interfaces/efl_gfx_types.eot
@@ -159,3 +159,12 @@ enum Efl.Gfx.Border_Fill_Mode
159 solid = 2 [[Image's center region is to be made solid, even if it has transparency on it]] 159 solid = 2 [[Image's center region is to be made solid, even if it has transparency on it]]
160} 160}
161 161
162enum Efl.Gfx.Change.Flag
163{
164 [[What property got changed for this object @since 1.18]]
165 none = 0x0, [[No change]]
166 matrix = 0x1, [[matrix got changed]]
167 path = 0x2, [[path got changes]]
168 all = -1 [[all property got changed]]
169}
170
diff --git a/src/lib/evas/canvas/evas_vg_container.c b/src/lib/evas/canvas/evas_vg_container.c
index b34d137fba..fc11bec7f4 100644
--- a/src/lib/evas/canvas/evas_vg_container.c
+++ b/src/lib/evas/canvas/evas_vg_container.c
@@ -15,14 +15,25 @@ _efl_vg_container_render_pre(Eo *obj EINA_UNUSED,
15 Efl_VG_Container_Data *pd = data; 15 Efl_VG_Container_Data *pd = data;
16 Eina_List *l; 16 Eina_List *l;
17 Eo *child; 17 Eo *child;
18 Efl_VG_Data *child_nd;
19 Efl_Gfx_Change_Flag flag;
18 20
19 if (!nd->changed) return ; 21 if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return ;
20 nd->changed = EINA_FALSE; 22
23 flag = nd->flags;
24 nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
21 25
22 EFL_VG_COMPUTE_MATRIX(current, parent, nd); 26 EFL_VG_COMPUTE_MATRIX(current, parent, nd);
23 27
24 EINA_LIST_FOREACH(pd->children, l, child) 28 EINA_LIST_FOREACH(pd->children, l, child)
25 _evas_vg_render_pre(child, s, current); 29 {
30 if (flag & EFL_GFX_CHANGE_FLAG_MATRIX)
31 {
32 child_nd = eo_data_scope_get(child, EFL_VG_CLASS);
33 child_nd->flags |= EFL_GFX_CHANGE_FLAG_MATRIX;
34 }
35 _evas_vg_render_pre(child, s, current);
36 }
26} 37}
27 38
28static Eo * 39static Eo *
@@ -38,6 +49,7 @@ _efl_vg_container_eo_base_constructor(Eo *obj,
38 nd = eo_data_scope_get(obj, EFL_VG_CLASS); 49 nd = eo_data_scope_get(obj, EFL_VG_CLASS);
39 nd->render_pre = _efl_vg_container_render_pre; 50 nd->render_pre = _efl_vg_container_render_pre;
40 nd->data = pd; 51 nd->data = pd;
52 nd->flags = EFL_GFX_CHANGE_FLAG_ALL;
41 53
42 return obj; 54 return obj;
43} 55}
diff --git a/src/lib/evas/canvas/evas_vg_gradient_linear.c b/src/lib/evas/canvas/evas_vg_gradient_linear.c
index 5aa2607850..11491708aa 100644
--- a/src/lib/evas/canvas/evas_vg_gradient_linear.c
+++ b/src/lib/evas/canvas/evas_vg_gradient_linear.c
@@ -65,8 +65,9 @@ _efl_vg_gradient_linear_render_pre(Eo *obj,
65 Efl_VG_Gradient_Linear_Data *pd = data; 65 Efl_VG_Gradient_Linear_Data *pd = data;
66 Efl_VG_Gradient_Data *gd; 66 Efl_VG_Gradient_Data *gd;
67 67
68 if (!nd->changed) return ; 68 if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return ;
69 nd->changed = EINA_FALSE; 69
70 nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
70 71
71 gd = eo_data_scope_get(obj, EFL_VG_GRADIENT_CLASS); 72 gd = eo_data_scope_get(obj, EFL_VG_GRADIENT_CLASS);
72 EFL_VG_COMPUTE_MATRIX(current, parent, nd); 73 EFL_VG_COMPUTE_MATRIX(current, parent, nd);
diff --git a/src/lib/evas/canvas/evas_vg_gradient_radial.c b/src/lib/evas/canvas/evas_vg_gradient_radial.c
index c36150ae90..4a46c7a8d1 100644
--- a/src/lib/evas/canvas/evas_vg_gradient_radial.c
+++ b/src/lib/evas/canvas/evas_vg_gradient_radial.c
@@ -81,8 +81,9 @@ _efl_vg_gradient_radial_render_pre(Eo *obj,
81 Efl_VG_Gradient_Radial_Data *pd = data; 81 Efl_VG_Gradient_Radial_Data *pd = data;
82 Efl_VG_Gradient_Data *gd; 82 Efl_VG_Gradient_Data *gd;
83 83
84 if (!nd->changed) return ; 84 if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return ;
85 nd->changed = EINA_FALSE; 85
86 nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
86 87
87 gd = eo_data_scope_get(obj, EFL_VG_GRADIENT_CLASS); 88 gd = eo_data_scope_get(obj, EFL_VG_GRADIENT_CLASS);
88 EFL_VG_COMPUTE_MATRIX(current, parent, nd); 89 EFL_VG_COMPUTE_MATRIX(current, parent, nd);
diff --git a/src/lib/evas/canvas/evas_vg_node.c b/src/lib/evas/canvas/evas_vg_node.c
index 7a55b204ea..3c44b914f6 100644
--- a/src/lib/evas/canvas/evas_vg_node.c
+++ b/src/lib/evas/canvas/evas_vg_node.c
@@ -23,8 +23,7 @@ _efl_vg_property_changed(void *data, const Eo_Event *event)
23 Efl_VG_Data *pd = data; 23 Efl_VG_Data *pd = data;
24 Eo *parent; 24 Eo *parent;
25 25
26 if (pd->changed) return EINA_TRUE; 26 if (!pd->flags) pd->flags = EFL_GFX_CHANGE_FLAG_ALL;
27 pd->changed = EINA_TRUE;
28 27
29 parent = eo_parent_get(event->object); 28 parent = eo_parent_get(event->object);
30 eo_event_callback_call(parent, event->desc, event->info); 29 eo_event_callback_call(parent, event->desc, event->info);
@@ -57,6 +56,7 @@ _efl_vg_transformation_set(Eo *obj,
57 pd->m = NULL; 56 pd->m = NULL;
58 } 57 }
59 58
59 pd->flags |= EFL_GFX_CHANGE_FLAG_MATRIX;
60 _efl_vg_changed(obj); 60 _efl_vg_changed(obj);
61} 61}
62 62
@@ -275,6 +275,7 @@ _efl_vg_eo_base_constructor(Eo *obj,
275 } 275 }
276 276
277 eo_event_callback_add(obj, EFL_GFX_CHANGED, _efl_vg_property_changed, pd); 277 eo_event_callback_add(obj, EFL_GFX_CHANGED, _efl_vg_property_changed, pd);
278 pd->flags = EFL_GFX_CHANGE_FLAG_ALL;
278 pd->changed = EINA_TRUE; 279 pd->changed = EINA_TRUE;
279 280
280 return obj; 281 return obj;
diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h
index fca6680505..711e2875ad 100644
--- a/src/lib/evas/canvas/evas_vg_private.h
+++ b/src/lib/evas/canvas/evas_vg_private.h
@@ -37,6 +37,7 @@ struct _Efl_VG_Data
37 37
38 double x, y; 38 double x, y;
39 int r, g, b, a; 39 int r, g, b, a;
40 Efl_Gfx_Change_Flag flags;
40 41
41 Eina_Bool visibility : 1; 42 Eina_Bool visibility : 1;
42 Eina_Bool changed : 1; 43 Eina_Bool changed : 1;
diff --git a/src/lib/evas/canvas/evas_vg_shape.c b/src/lib/evas/canvas/evas_vg_shape.c
index b356b07e52..c3599f03d1 100644
--- a/src/lib/evas/canvas/evas_vg_shape.c
+++ b/src/lib/evas/canvas/evas_vg_shape.c
@@ -131,8 +131,9 @@ _efl_vg_shape_render_pre(Eo *obj EINA_UNUSED,
131 Efl_VG_Data *fill, *stroke_fill, *stroke_marker, *mask; 131 Efl_VG_Data *fill, *stroke_fill, *stroke_marker, *mask;
132 double xn = nd->x, yn = nd->y ; 132 double xn = nd->x, yn = nd->y ;
133 133
134 if (!nd->changed) return ; 134 if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return ;
135 nd->changed = EINA_FALSE; 135
136 nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
136 137
137 if(parent) eina_matrix3_point_transform(parent, nd->x, nd->y, &xn, &yn); 138 if(parent) eina_matrix3_point_transform(parent, nd->x, nd->y, &xn, &yn);
138 139