aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-11-06 10:36:41 -0500
committerChris Michael <cp.michael@samsung.com>2015-11-06 10:48:28 -0500
commitda6eecb38cc7a6bc6f120da48cfbfb8b1249f08c (patch)
tree9f49ed3557a25fd456c728ba361eda8cb74e959f
parentecore-drm: Don't always send drmModePageFlip (diff)
downloadefl-devs/devilhorns/evas_gl_drm.tar.gz
ecore: Modify ecore_animator example to work better in testing gl_drm enginedevs/devilhorns/evas_gl_drm
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/examples/ecore/ecore_animator_example.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/examples/ecore/ecore_animator_example.c b/src/examples/ecore/ecore_animator_example.c
index db77dc7cad..ebe6262b93 100644
--- a/src/examples/ecore/ecore_animator_example.c
+++ b/src/examples/ecore/ecore_animator_example.c
@@ -11,22 +11,28 @@ static Eina_Bool _start_second_anim(void *data);
static Eina_Bool _freeze_third_anim(void *data);
static Eina_Bool _thaw_third_anim(void *data);
+static Evas_Object *bg;
+
int
main(void)
{
- Evas_Object *rect, *bg, *rect2;
+ Evas_Object *rect, *rect2;
Ecore_Evas *ee;
Evas *evas;
Ecore_Animator *anim;
+ int w, h;
ecore_evas_init();
- ee = ecore_evas_new(NULL, 0, 0, 300, 400, NULL);
+ ee = ecore_evas_new(NULL, 0, 0, 1, 1, NULL);
+ ecore_evas_screen_geometry_get(ee, NULL, NULL, &w, &h);
+ ecore_evas_resize(ee, w, h);
ecore_evas_show(ee);
+
evas = ecore_evas_get(ee);
bg = evas_object_rectangle_add(evas);
- evas_object_resize(bg, 300, 400);
+ evas_object_resize(bg, w, h);
evas_object_show(bg);
rect = evas_object_rectangle_add(evas);
@@ -39,7 +45,7 @@ main(void)
evas_object_resize(rect2, 50, 50);
evas_object_show(rect2);
- ecore_animator_frametime_set(1. / 50);
+ ecore_animator_frametime_set(1. / 60);
ecore_animator_timeline_add(5, _advance_frame, rect);
anim = ecore_animator_add(_advance_frame3, rect2);
@@ -63,6 +69,8 @@ _advance_frame(void *data, double pos)
double frame = pos;
frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_SPRING, 1.2, 15);
+ evas_object_color_set(bg, 0, 255 * (1 - frame), 255 * frame, 255);
+
evas_object_resize(data, 50 * (1 + frame), 50 * (1 + frame));
evas_object_move(data, 100 * frame, 100 * frame);
evas_object_color_set(data, 255 * frame, 0, 255 * (1 - frame), 255);
@@ -72,7 +80,7 @@ _advance_frame(void *data, double pos)
static Eina_Bool
_start_second_anim(void *data)
{
- ecore_animator_frametime_set(1. / 10);
+ /* ecore_animator_frametime_set(1. / 60); */
ecore_animator_timeline_add(20, _advance_frame2, data);
return ECORE_CALLBACK_CANCEL;
}
@@ -83,6 +91,8 @@ _advance_frame2(void *data, double pos)
double frame = pos;
frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 1.2, 50);
+ evas_object_color_set(bg, 255 * frame, 255 * (1 - frame), 0, 255);
+
evas_object_resize(data, 100 - (50 * frame), 100 - (50 * frame));
evas_object_move(data, 100 * (1 - frame), 100 * (1 - frame));
evas_object_color_set(data, 255 * (1 - frame), 0, 255 * frame, 255);