summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_vg_gradient_linear.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-06-16 16:28:19 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-08-21 16:40:31 +0200
commit7cb92ff35d3e49c53368b6fe4ade1d2a732018fc (patch)
tree90628a6c6b4e62f507a78ad7a4d8b1e754a453b8 /src/lib/evas/canvas/evas_vg_gradient_linear.c
parentd595324a8dbccabf80d13d8f22e59c6166b4c2b6 (diff)
evas: add support for interpolating Efl_VG_Node tree.
Diffstat (limited to 'src/lib/evas/canvas/evas_vg_gradient_linear.c')
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_linear.c31
1 files changed, 31 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 9a54f7ac39..609dc7a73a 100644
--- a/src/lib/evas/canvas/evas_vg_gradient_linear.c
+++ b/src/lib/evas/canvas/evas_vg_gradient_linear.c
@@ -120,6 +120,37 @@ _efl_vg_gradient_linear_efl_vg_base_bounds_get(Eo *obj, Efl_VG_Gradient_Linear_D
120 pd->end.x - pd->start.x, pd->end.y - pd->start.x); 120 pd->end.x - pd->start.x, pd->end.y - pd->start.x);
121} 121}
122 122
123static Eina_Bool
124_efl_vg_gradient_linear_efl_vg_base_interpolate(Eo *obj,
125 Efl_VG_Gradient_Linear_Data *pd,
126 const Efl_VG_Base *from, const Efl_VG_Base *to,
127 double pos_map)
128{
129 Efl_VG_Gradient_Linear_Data *fromd, *tod;
130 double from_map;
131 Eina_Bool r;
132
133 eo_do_super(obj, EFL_VG_GRADIENT_LINEAR_CLASS, r = efl_vg_interpolate(from, to, pos_map));
134
135 if (!r) return EINA_FALSE;
136
137 fromd = eo_data_scope_get(from, EFL_VG_GRADIENT_LINEAR_CLASS);
138 tod = eo_data_scope_get(to, EFL_VG_GRADIENT_LINEAR_CLASS);
139 from_map = 1.0 - pos_map;
140
141#define INTP(Pd, From, To, Member, From_Map, Pos_Map) \
142 Pd->Member = From->Member * From_Map + To->Member * Pos_Map
143
144 INTP(pd, fromd, tod, start.x, from_map, pos_map);
145 INTP(pd, fromd, tod, start.y, from_map, pos_map);
146 INTP(pd, fromd, tod, end.x, from_map, pos_map);
147 INTP(pd, fromd, tod, end.y, from_map, pos_map);
148
149#undef INTP
150
151 return EINA_TRUE;
152}
153
123EAPI void 154EAPI void
124evas_vg_gradient_linear_start_set(Eo *obj, double x, double y) 155evas_vg_gradient_linear_start_set(Eo *obj, double x, double y)
125{ 156{