diff options
author | Carsten Haitzler <raster@rasterman.com> | 2013-02-26 09:53:51 +0000 |
---|---|---|
committer | Carsten Haitzler <raster@rasterman.com> | 2013-02-26 09:53:51 +0000 |
commit | 4689ceb0889c1dcf53768b3881d982081c8d79f1 (patch) | |
tree | 748779b9fb23592aa2ff10eaeab2235502a9223e | |
parent | 244a1da63c71ee598103fbdb8a5d123c2599f640 (diff) |
add new test to expedite.
SVN revision: 84374
-rw-r--r-- | src/bin/Makefile.am | 3 | ||||
-rw-r--r-- | src/bin/image_blend_many_smooth_same_scaled.c | 109 | ||||
-rw-r--r-- | src/bin/tests.h | 1 | ||||
-rw-r--r-- | src/bin/ui.c | 3 |
4 files changed, 115 insertions, 1 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 022bb30..78383d5 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am | |||
@@ -113,7 +113,8 @@ poly_blend.c \ | |||
113 | proxy_image.c \ | 113 | proxy_image.c \ |
114 | proxy_text_fixed.c \ | 114 | proxy_text_fixed.c \ |
115 | proxy_text_random.c \ | 115 | proxy_text_random.c \ |
116 | line_blend.c | 116 | line_blend.c \ |
117 | image_blend_many_smooth_same_scaled.c | ||
117 | # \ | 118 | # \ |
118 | # image_mask.c \ | 119 | # image_mask.c \ |
119 | # image_mask_2.c \ | 120 | # image_mask_2.c \ |
diff --git a/src/bin/image_blend_many_smooth_same_scaled.c b/src/bin/image_blend_many_smooth_same_scaled.c new file mode 100644 index 0000000..2f56d8a --- /dev/null +++ b/src/bin/image_blend_many_smooth_same_scaled.c | |||
@@ -0,0 +1,109 @@ | |||
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 = eo_add(EVAS_OBJ_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 | if (o) | ||
34 | eo_do(o, | ||
35 | evas_obj_image_file_set(build_path("logo.png"), NULL), | ||
36 | evas_obj_image_smooth_scale_set(1), | ||
37 | evas_obj_size_set(w, h), | ||
38 | evas_obj_image_fill_set(0, 0, w, h), | ||
39 | evas_obj_visibility_set(EINA_TRUE)); | ||
40 | } | ||
41 | done = 0; | ||
42 | } | ||
43 | |||
44 | /* cleanup */ | ||
45 | static void _cleanup(void) | ||
46 | { | ||
47 | int i; | ||
48 | for (i = 0; i < MANYNUM; i++) eo_del(o_images[i]); | ||
49 | } | ||
50 | |||
51 | /* loop - do things */ | ||
52 | static void _loop(double t, int f) | ||
53 | { | ||
54 | int i; | ||
55 | Evas_Coord x, y, w, h; | ||
56 | for (i = 0; i < MANYNUM; i++) | ||
57 | { | ||
58 | eo_do(o_images[i], evas_obj_size_get(&w, &h)); | ||
59 | x = (win_w / 2) - (w / 2); | ||
60 | x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (win_w / 2); | ||
61 | y = (win_h / 2) - (h / 2); | ||
62 | y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (win_h / 2); | ||
63 | if (o_images[i]) | ||
64 | eo_do(o_images[i], evas_obj_position_set(x, y)); | ||
65 | } | ||
66 | FPS_STD(NAME); | ||
67 | } | ||
68 | |||
69 | /* prepend special key handlers if interactive (before STD) */ | ||
70 | static void _key(char *key) | ||
71 | { | ||
72 | KEY_STD; | ||
73 | } | ||
74 | |||
75 | |||
76 | |||
77 | |||
78 | |||
79 | |||
80 | |||
81 | |||
82 | |||
83 | |||
84 | |||
85 | |||
86 | /* template stuff - ignore */ | ||
87 | # endif | ||
88 | #endif | ||
89 | |||
90 | #ifdef UI | ||
91 | _ui_menu_item_add(ICON, NAME, FNAME); | ||
92 | #endif | ||
93 | |||
94 | #ifdef PROTO | ||
95 | void FNAME(void); | ||
96 | #endif | ||
97 | |||
98 | #ifndef PROTO | ||
99 | # ifndef UI | ||
100 | void FNAME(void) | ||
101 | { | ||
102 | ui_func_set(_key, _loop); | ||
103 | _setup(); | ||
104 | } | ||
105 | # endif | ||
106 | #endif | ||
107 | #undef FNAME | ||
108 | #undef NAME | ||
109 | #undef ICON | ||
diff --git a/src/bin/tests.h b/src/bin/tests.h index d9a35ac..d29c9a7 100644 --- a/src/bin/tests.h +++ b/src/bin/tests.h | |||
@@ -90,6 +90,7 @@ | |||
90 | #include "proxy_text_fixed.c" | 90 | #include "proxy_text_fixed.c" |
91 | #include "proxy_text_random.c" | 91 | #include "proxy_text_random.c" |
92 | #include "line_blend.c" | 92 | #include "line_blend.c" |
93 | #include "image_blend_many_smooth_same_scaled.c" | ||
93 | #if 0 // test disabled - evas having code disabled | 94 | #if 0 // test disabled - evas having code disabled |
94 | #include "image_mask.c" | 95 | #include "image_mask.c" |
95 | #include "image_mask_2.c" | 96 | #include "image_mask_2.c" |
diff --git a/src/bin/ui.c b/src/bin/ui.c index 55c48cd..783d7e2 100644 --- a/src/bin/ui.c +++ b/src/bin/ui.c | |||
@@ -163,6 +163,9 @@ static double weights[] = | |||
163 | 10.000, | 163 | 10.000, |
164 | 164 | ||
165 | 5.000, // test 91 | 165 | 5.000, // test 91 |
166 | 1.000, // test 92 (line) | ||
167 | 10.000, // test 93 Image Blend Many Smooth Down Scaled | ||
168 | |||
166 | 20.000, // MASK | 169 | 20.000, // MASK |
167 | 20.000, // MASK 2 | 170 | 20.000, // MASK 2 |
168 | 20.000, // MASK 3 | 171 | 20.000, // MASK 3 |