summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-09-30 14:32:45 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-09-30 14:32:45 +0100
commitda41776e632c8ed6c02a496aa6b96d9311b59717 (patch)
treeefcd456062024278bb0670927b790b9fa6869432
parent54d8a6e50ce85514b27cd5abb10f87896ce7fd44 (diff)
use efx effect attaches, loop seamlessly and infinitely
-rw-r--r--compbench.c83
1 files changed, 54 insertions, 29 deletions
diff --git a/compbench.c b/compbench.c
index 37c0670..86fef0d 100644
--- a/compbench.c
+++ b/compbench.c
@@ -8,16 +8,27 @@ static int sw, sh;
8 8
9static Evas_Object *win, *rect; 9static Evas_Object *win, *rect;
10 10
11static void _resize1(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED);
12
13static void
14_reset(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED)
15{
16 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 100, 100, 10.0, _resize1, NULL);
17}
18
11static void 19static void
12_fs_toggle(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED) 20_fs_toggle(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED)
13{ 21{
14 elm_win_fullscreen_set(win, !elm_win_fullscreen_get(win)); 22 Eina_Bool fs = elm_win_fullscreen_get(win);
15 evas_object_move(win, -1, -1); 23
16 evas_object_move(win, 0, 0); 24 elm_win_fullscreen_set(win, !fs);
25 if (!fs) return;
26 efx_resize(win, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(0, 0), 400, 400, 10.0, NULL, NULL);
27 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 400, 400, 10.0, _reset, NULL);
17} 28}
18 29
19static void 30static void
20_rect_resize3(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED) 31_queue_setup(void)
21{ 32{
22 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR, 33 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
23 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(0, 30, 222, 255)), 34 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(0, 30, 222, 255)),
@@ -42,38 +53,40 @@ _rect_resize3(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object
42 3.0, NULL, NULL); 53 3.0, NULL, NULL);
43 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR, 54 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
44 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(120, 255, 0, 255)), 55 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(120, 255, 0, 255)),
45 3.0, _fs_toggle, NULL); 56 3.0, NULL, NULL);
57 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
58 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(150, 220, 0, 255)),
59 3.0, NULL, NULL);
60 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
61 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(180, 180, 0, 255)),
62 3.0, NULL, NULL);
63 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
64 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(210, 150, 0, 255)),
65 3.0, NULL, NULL);
66 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
67 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(230, 100, 0, 255)),
68 3.0, NULL, NULL);
46 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR, 69 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
47 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(255, 0, 0, 255)), 70 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(255, 0, 0, 255)),
48 3.0, _rect_resize3, NULL); 71 3.0, _fs_toggle, NULL);
49 efx_queue_run(rect);
50}
51
52static void
53_rect_resize2_5(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED)
54{
55 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, sw, sh, 30.0, _rect_resize2_5, NULL);
56}
57
58static void
59_rect_resize2(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED)
60{
61 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, sw / 2, sh / 2, 30.0, _rect_resize2_5, NULL);
62 efx_fade(rect, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 255), 255, 30.0, _rect_resize3, NULL);
63} 72}
64 73
65static void 74static void
66_win_resize2(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED) 75_rect_resize3(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED)
67{ 76{
68 efx_move(win, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(sw / 2, 0), 30.0, NULL, NULL); 77 _queue_setup();
78 _queue_setup();
79 efx_queue_run(rect);
69} 80}
70 81
71static void 82static void
72_resize1(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED) 83_resize1(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED)
73{ 84{
74 efx_queue_append(win, EFX_EFFECT_SPEED_LINEAR, 85 Efx_Queue_Data *eqd;
86
87 eqd = efx_queue_append(win, EFX_EFFECT_SPEED_LINEAR,
75 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, 100, 100)), 88 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, 100, 100)),
76 10.0, _win_resize2, NULL); 89 10.0, NULL, NULL);
77 efx_queue_append(win, EFX_EFFECT_SPEED_LINEAR, 90 efx_queue_append(win, EFX_EFFECT_SPEED_LINEAR,
78 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(EFX_POINT(sw / 2, sh / 2), sw / 2, sh / 2)), 91 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(EFX_POINT(sw / 2, sh / 2), sw / 2, sh / 2)),
79 30.0, NULL, NULL); 92 30.0, NULL, NULL);
@@ -82,8 +95,22 @@ _resize1(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o E
82 30.0, NULL, NULL); 95 30.0, NULL, NULL);
83 efx_queue_run(win); 96 efx_queue_run(win);
84 97
85 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 1, 1, 10.0, NULL, NULL); 98 eqd = efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
86 efx_fade(rect, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 255, 0), 255, 10.0, _rect_resize2, NULL); 99 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, 1, 1)),
100 10.0, NULL, NULL);
101 efx_queue_effect_attach(eqd, EFX_EFFECT_SPEED_LINEAR,
102 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(0, 255, 0, 255)),
103 10.0, NULL, NULL);
104 eqd = efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
105 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, sw / 2, sh / 2)),
106 30.0, NULL, NULL);
107 efx_queue_effect_attach(eqd, EFX_EFFECT_SPEED_LINEAR,
108 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(0, 0, 255, 255)),
109 30.0, NULL, NULL);
110 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
111 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(EFX_POINT(0, 0), sw, sh)),
112 30.0, _rect_resize3, NULL);
113 efx_queue_run(rect);
87} 114}
88 115
89int 116int
@@ -115,9 +142,7 @@ main(int argc, char *argv[])
115 evas_object_show(rect); 142 evas_object_show(rect);
116 efx_fade(rect, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(255, 0, 0), 255, 0.0, NULL, NULL); 143 efx_fade(rect, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(255, 0, 0), 255, 0.0, NULL, NULL);
117 144
118 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR, 145 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 100, 100, 10.0, _resize1, NULL);
119 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, 100, 100)),
120 10.0, _resize1, NULL);
121 146
122 efx_queue_run(rect); 147 efx_queue_run(rect);
123 ecore_main_loop_begin(); 148 ecore_main_loop_begin();