summaryrefslogtreecommitdiff
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
parent15f8280f27d7f2fc288f51083d410da3fdd81e5b (diff)
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);
11static Eina_Bool _freeze_third_anim(void *data); 11static Eina_Bool _freeze_third_anim(void *data);
12static Eina_Bool _thaw_third_anim(void *data); 12static Eina_Bool _thaw_third_anim(void *data);
13 13
14static Evas_Object *bg;
15
14int 16int
15main(void) 17main(void)
16{ 18{
17 Evas_Object *rect, *bg, *rect2; 19 Evas_Object *rect, *rect2;
18 Ecore_Evas *ee; 20 Ecore_Evas *ee;
19 Evas *evas; 21 Evas *evas;
20 Ecore_Animator *anim; 22 Ecore_Animator *anim;
23 int w, h;
21 24
22 ecore_evas_init(); 25 ecore_evas_init();
23 26
24 ee = ecore_evas_new(NULL, 0, 0, 300, 400, NULL); 27 ee = ecore_evas_new(NULL, 0, 0, 1, 1, NULL);
28 ecore_evas_screen_geometry_get(ee, NULL, NULL, &w, &h);
29 ecore_evas_resize(ee, w, h);
25 ecore_evas_show(ee); 30 ecore_evas_show(ee);
31
26 evas = ecore_evas_get(ee); 32 evas = ecore_evas_get(ee);
27 33
28 bg = evas_object_rectangle_add(evas); 34 bg = evas_object_rectangle_add(evas);
29 evas_object_resize(bg, 300, 400); 35 evas_object_resize(bg, w, h);
30 evas_object_show(bg); 36 evas_object_show(bg);
31 37
32 rect = evas_object_rectangle_add(evas); 38 rect = evas_object_rectangle_add(evas);
@@ -39,7 +45,7 @@ main(void)
39 evas_object_resize(rect2, 50, 50); 45 evas_object_resize(rect2, 50, 50);
40 evas_object_show(rect2); 46 evas_object_show(rect2);
41 47
42 ecore_animator_frametime_set(1. / 50); 48 ecore_animator_frametime_set(1. / 60);
43 ecore_animator_timeline_add(5, _advance_frame, rect); 49 ecore_animator_timeline_add(5, _advance_frame, rect);
44 50
45 anim = ecore_animator_add(_advance_frame3, rect2); 51 anim = ecore_animator_add(_advance_frame3, rect2);
@@ -63,6 +69,8 @@ _advance_frame(void *data, double pos)
63 double frame = pos; 69 double frame = pos;
64 frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_SPRING, 1.2, 15); 70 frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_SPRING, 1.2, 15);
65 71
72 evas_object_color_set(bg, 0, 255 * (1 - frame), 255 * frame, 255);
73
66 evas_object_resize(data, 50 * (1 + frame), 50 * (1 + frame)); 74 evas_object_resize(data, 50 * (1 + frame), 50 * (1 + frame));
67 evas_object_move(data, 100 * frame, 100 * frame); 75 evas_object_move(data, 100 * frame, 100 * frame);
68 evas_object_color_set(data, 255 * frame, 0, 255 * (1 - frame), 255); 76 evas_object_color_set(data, 255 * frame, 0, 255 * (1 - frame), 255);
@@ -72,7 +80,7 @@ _advance_frame(void *data, double pos)
72static Eina_Bool 80static Eina_Bool
73_start_second_anim(void *data) 81_start_second_anim(void *data)
74{ 82{
75 ecore_animator_frametime_set(1. / 10); 83 /* ecore_animator_frametime_set(1. / 60); */
76 ecore_animator_timeline_add(20, _advance_frame2, data); 84 ecore_animator_timeline_add(20, _advance_frame2, data);
77 return ECORE_CALLBACK_CANCEL; 85 return ECORE_CALLBACK_CANCEL;
78} 86}
@@ -83,6 +91,8 @@ _advance_frame2(void *data, double pos)
83 double frame = pos; 91 double frame = pos;
84 frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 1.2, 50); 92 frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 1.2, 50);
85 93
94 evas_object_color_set(bg, 255 * frame, 255 * (1 - frame), 0, 255);
95
86 evas_object_resize(data, 100 - (50 * frame), 100 - (50 * frame)); 96 evas_object_resize(data, 100 - (50 * frame), 100 - (50 * frame));
87 evas_object_move(data, 100 * (1 - frame), 100 * (1 - frame)); 97 evas_object_move(data, 100 * (1 - frame), 100 * (1 - frame));
88 evas_object_color_set(data, 255 * (1 - frame), 0, 255 * frame, 255); 98 evas_object_color_set(data, 255 * (1 - frame), 0, 255 * frame, 255);