summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-04-27 22:31:47 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-06-30 17:28:34 +0900
commit60aca5713e523aaec47dfaa2333757447cb08e0c (patch)
tree9834711b9e4cb0253a021f2487c9675026dda44e
parentb361f082991ed0bb141f5c0c48c40a347c47a1e8 (diff)
downloadefl-60aca5713e523aaec47dfaa2333757447cb08e0c.tar.gz
efl_animation: Implement alpha animation
This is temporary test code.
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/efl_animation_alpha.c b/src/lib/evas/canvas/efl_animation_alpha.c
index a490c35648..f6c8914322 100644
--- a/src/lib/evas/canvas/efl_animation_alpha.c
+++ b/src/lib/evas/canvas/efl_animation_alpha.c
@@ -18,6 +18,9 @@
} \
} while (0)
+#define EFL_ANIMATION_ALPHA_DATA_GET(o, pd) \
+ Evas_Object_Animation_Alpha_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_ALPHA_CLASS)
+
typedef struct _Evas_Object_Animation_Alpha_Property
{
double alpha;
@@ -50,9 +53,20 @@ _efl_animation_alpha_alpha_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Animation_Alp
}
static void
-_animate_cb(void *data, const Efl_Event *event)
+_animate_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
+ EFL_ANIMATION_ALPHA_DATA_GET(event->object, pd);
Efl_Animation_Animate_Event_Info *event_info = event->info;
+
+ double progress = event_info->progress;
+
+ double alpha
+ = (pd->from.alpha * (1.0 - progress)) + (pd->to.alpha * progress);
+
+ //FIXME: The below code is temporary test code
+ int color = (int)(alpha * 255);
+ Evas_Object *target = efl_animation_target_get(event->object);
+ evas_object_color_set(target, color, color, color, color);
}
EOLIAN static Efl_Object *