containing ui setup steps in the profiling again.
[platform/upstream/expedite.git] / src / bin / image_blend_many_smooth_same_scaled.c
1 #undef FNAME
2 #undef NAME
3 #undef ICON
4
5 /* metadata */
6 #define FNAME image_blend_many_smooth_down_scaled_start
7 #define NAME "Image Blend Many Smooth Down Scaled"
8 #define ICON "blend.png"
9
10 #ifndef PROTO
11 # ifndef UI
12 #  include "main.h"
13
14 #define MANYNUM 8192
15
16 /* standard var */
17 static int done = 0;
18 /* private data */
19 static Evas_Object *o_images[MANYNUM];
20
21 /* setup */
22 static void _setup(void)
23 {
24    int i, w, h, n;
25    Evas_Object *o;
26    for (i = 0; i < MANYNUM; i++)
27      {
28         o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
29         o_images[i] = o;
30         n = rnd() % 100;
31         w = 3 + ((n * (60 - 3)) / 100);
32         h = 4 + ((n * (80 - 4)) / 100);
33         efl_file_simple_load(o, build_path("logo.png"), NULL);
34         efl_gfx_image_smooth_scale_set(o, 1);
35         efl_gfx_entity_size_set(o, EINA_SIZE2D(w, h));
36         efl_gfx_fill_set(o, EINA_RECT(0, 0, w, h));
37         efl_gfx_entity_visible_set(o, EINA_TRUE);
38      }
39    done = 0;
40 }
41
42 /* cleanup */
43 static void _cleanup(void)
44 {
45    int i;
46    for (i = 0; i < MANYNUM; i++) efl_del(o_images[i]);
47 }
48
49 /* loop - do things */
50 static void _loop(double t, int f)
51 {
52    int i;
53    Evas_Coord x, y, w, h;
54    for (i = 0; i < MANYNUM; i++)
55      {
56         exp_size_get(o_images[i], &w, &h);
57         x = (win_w / 2) - (w / 2);
58         x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (win_w / 2);
59         y = (win_h / 2) - (h / 2);
60         y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (win_h / 2);
61         efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
62      }
63    FPS_STD(NAME);
64 }
65
66 /* prepend special key handlers if interactive (before STD) */
67 static void _key(const char *key)
68 {
69    KEY_STD;
70 }
71
72
73
74
75
76
77
78
79
80
81
82
83 /* template stuff - ignore */
84 # endif
85 #endif
86
87 #ifdef UI
88 _ui_menu_item_add(ICON, NAME, FNAME);
89 #endif
90
91 #ifdef PROTO
92 void FNAME(void);
93 #endif
94
95 #ifndef PROTO
96 # ifndef UI
97 void FNAME(void)
98 {
99    ui_func_set(_key, _loop, _setup);
100 }
101 # endif
102 #endif
103 #undef FNAME
104 #undef NAME
105 #undef ICON