aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_vg_gradient_radial.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_radial.c
parentevas: add an unique name for each Efl.VG.Base object and make it possible to ... (diff)
downloadefl-7cb92ff35d3e49c53368b6fe4ade1d2a732018fc.tar.gz
evas: add support for interpolating Efl_VG_Node tree.
Diffstat (limited to 'src/lib/evas/canvas/evas_vg_gradient_radial.c')
-rw-r--r--src/lib/evas/canvas/evas_vg_gradient_radial.c32
1 files changed, 32 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 8af5e7d41c..52ed9570c5 100644
--- a/src/lib/evas/canvas/evas_vg_gradient_radial.c
+++ b/src/lib/evas/canvas/evas_vg_gradient_radial.c
@@ -138,6 +138,38 @@ _efl_vg_gradient_radial_efl_vg_base_bounds_get(Eo *obj, Efl_VG_Gradient_Radial_D
pd->radius * 2, pd->radius * 2);
}
+static Eina_Bool
+_efl_vg_gradient_radial_efl_vg_base_interpolate(Eo *obj,
+ Efl_VG_Gradient_Radial_Data *pd,
+ const Efl_VG_Base *from, const Efl_VG_Base *to,
+ double pos_map)
+{
+ Efl_VG_Gradient_Radial_Data *fromd, *tod;
+ double from_map;
+ Eina_Bool r;
+
+ eo_do_super(obj, EFL_VG_GRADIENT_RADIAL_CLASS, r = efl_vg_interpolate(from, to, pos_map));
+
+ if (!r) return EINA_FALSE;
+
+ fromd = eo_data_scope_get(from, EFL_VG_GRADIENT_RADIAL_CLASS);
+ tod = eo_data_scope_get(to, EFL_VG_GRADIENT_RADIAL_CLASS);
+ from_map = 1.0 - pos_map;
+
+#define INTP(Pd, From, To, Member, From_Map, Pos_Map) \
+ Pd->Member = From->Member * From_Map + To->Member * Pos_Map
+
+ INTP(pd, fromd, tod, focal.x, from_map, pos_map);
+ INTP(pd, fromd, tod, focal.y, from_map, pos_map);
+ INTP(pd, fromd, tod, center.x, from_map, pos_map);
+ INTP(pd, fromd, tod, center.y, from_map, pos_map);
+ INTP(pd, fromd, tod, radius, from_map, pos_map);
+
+#undef INTP
+
+ return EINA_TRUE;
+}
+
EAPI void
evas_vg_gradient_radial_center_set(Eo *obj, double x, double y)
{