summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-09-30 14:45:57 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-09-30 14:45:57 +0100
commitb685ae5ea305cac53984a744244c5cff49db46fb (patch)
tree82ba5bba65606fb46ec8a973633823f18575a85e
parentbe454ea912c3cecaa2268627b207ddac61739fb5 (diff)
add lots of comments for no real reason
-rw-r--r--compbench.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/compbench.c b/compbench.c
index d407f14..5e99fd4 100644
--- a/compbench.c
+++ b/compbench.c
@@ -16,8 +16,11 @@ static void _resize1(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas
16static void 16static void
17_reset(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED) 17_reset(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED)
18{ 18{
19 /* we've completed a loop! */
19 num++; 20 num++;
21 /* quit here if we reached the max desired loops */
20 if (max && (num == max)) ecore_main_loop_quit(); 22 if (max && (num == max)) ecore_main_loop_quit();
23 /* start our first op again, then hook the initial callback */
21 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 100, 100, 10.0, _resize1, NULL); 24 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 100, 100, 10.0, _resize1, NULL);
22} 25}
23 26
@@ -26,8 +29,10 @@ _fs_toggle(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o
26{ 29{
27 Eina_Bool fs = elm_win_fullscreen_get(win); 30 Eina_Bool fs = elm_win_fullscreen_get(win);
28 31
32 /* toggle fullscreen */
29 elm_win_fullscreen_set(win, !fs); 33 elm_win_fullscreen_set(win, !fs);
30 if (!fs) return; 34 if (!fs) return;
35 /* when coming out of fullscreen, resize ourselves to starting size */
31 efx_resize(win, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(0, 0), 400, 400, 10.0, NULL, NULL); 36 efx_resize(win, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(0, 0), 400, 400, 10.0, NULL, NULL);
32 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 400, 400, 10.0, _reset, NULL); 37 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 400, 400, 10.0, _reset, NULL);
33} 38}
@@ -35,6 +40,10 @@ _fs_toggle(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o
35static void 40static void
36_queue_setup(void) 41_queue_setup(void)
37{ 42{
43 /* this executes a series of fade ops to smoothly animate color
44 * changes on the main rect. colors are not important,
45 * we just want to force redraws across large areas here
46 */
38 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR, 47 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
39 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(0, 30, 222, 255)), 48 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(0, 30, 222, 255)),
40 3.0, NULL, NULL); 49 3.0, NULL, NULL);
@@ -79,8 +88,13 @@ _queue_setup(void)
79static void 88static void
80_rect_resize3(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED) 89_rect_resize3(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED)
81{ 90{
91 /* run the rect color fades twice:
92 * - first time in windowed mode
93 * - second time fullscreen
94 */
82 _queue_setup(); 95 _queue_setup();
83 _queue_setup(); 96 _queue_setup();
97 /* start queued ops */
84 efx_queue_run(rect); 98 efx_queue_run(rect);
85} 99}
86 100
@@ -89,32 +103,42 @@ _resize1(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o E
89{ 103{
90 Efx_Queue_Data *eqd; 104 Efx_Queue_Data *eqd;
91 105
106 /* resize to 100x100 */
92 eqd = efx_queue_append(win, EFX_EFFECT_SPEED_LINEAR, 107 eqd = efx_queue_append(win, EFX_EFFECT_SPEED_LINEAR,
93 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, 100, 100)), 108 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, 100, 100)),
94 10.0, NULL, NULL); 109 10.0, NULL, NULL);
110 /* resize op: move to bottom right corner and grow to half screen size */
95 efx_queue_append(win, EFX_EFFECT_SPEED_LINEAR, 111 efx_queue_append(win, EFX_EFFECT_SPEED_LINEAR,
96 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(EFX_POINT(sw / 2, sh / 2), sw / 2, sh / 2)), 112 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(EFX_POINT(sw / 2, sh / 2), sw / 2, sh / 2)),
97 30.0, NULL, NULL); 113 30.0, NULL, NULL);
114 /* resize op: move to upper right corner and grow to screen size */
98 efx_queue_append(win, EFX_EFFECT_SPEED_LINEAR, 115 efx_queue_append(win, EFX_EFFECT_SPEED_LINEAR,
99 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(EFX_POINT(0, 0), sw, sh)), 116 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(EFX_POINT(0, 0), sw, sh)),
100 30.0, NULL, NULL); 117 30.0, NULL, NULL);
118 /* start queued ops */
101 efx_queue_run(win); 119 efx_queue_run(win);
102 120
121 /* shrink to 1x1 */
103 eqd = efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR, 122 eqd = efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
104 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, 1, 1)), 123 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, 1, 1)),
105 10.0, NULL, NULL); 124 10.0, NULL, NULL);
125 /* fade to green during resize */
106 efx_queue_effect_attach(eqd, EFX_EFFECT_SPEED_LINEAR, 126 efx_queue_effect_attach(eqd, EFX_EFFECT_SPEED_LINEAR,
107 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(0, 255, 0, 255)), 127 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(0, 255, 0, 255)),
108 10.0, NULL, NULL); 128 10.0, NULL, NULL);
129 /* grow to half screen size */
109 eqd = efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR, 130 eqd = efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
110 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, sw / 2, sh / 2)), 131 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, sw / 2, sh / 2)),
111 30.0, NULL, NULL); 132 30.0, NULL, NULL);
133 /* fade to blue during resize */
112 efx_queue_effect_attach(eqd, EFX_EFFECT_SPEED_LINEAR, 134 efx_queue_effect_attach(eqd, EFX_EFFECT_SPEED_LINEAR,
113 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(0, 0, 255, 255)), 135 EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(0, 0, 255, 255)),
114 30.0, NULL, NULL); 136 30.0, NULL, NULL);
137 /* grow to screen size */
115 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR, 138 efx_queue_append(rect, EFX_EFFECT_SPEED_LINEAR,
116 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(EFX_POINT(0, 0), sw, sh)), 139 EFX_QUEUED_EFFECT(EFX_EFFECT_RESIZE(NULL, sw, sh)),
117 30.0, _rect_resize3, NULL); 140 30.0, _rect_resize3, NULL);
141 /* start queued ops */
118 efx_queue_run(rect); 142 efx_queue_run(rect);
119} 143}
120 144
@@ -151,11 +175,12 @@ main(int argc, char *argv[])
151 rect = evas_object_rectangle_add(evas_object_evas_get(win)); 175 rect = evas_object_rectangle_add(evas_object_evas_get(win));
152 evas_object_resize(rect, 400, 400); 176 evas_object_resize(rect, 400, 400);
153 evas_object_show(rect); 177 evas_object_show(rect);
178 /* start with a red rect */
154 efx_fade(rect, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(255, 0, 0), 255, 0.0, NULL, NULL); 179 efx_fade(rect, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(255, 0, 0), 255, 0.0, NULL, NULL);
155 180
181 /* first effect is a resize! */
156 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 100, 100, 10.0, _resize1, NULL); 182 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 100, 100, 10.0, _resize1, NULL);
157 183
158 efx_queue_run(rect);
159 ecore_main_loop_begin(); 184 ecore_main_loop_begin();
160 return 0; 185 return 0;
161} 186}