summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Nash <nash@nash.id.au>2011-02-13 00:27:08 +0000
committerBrett Nash <nash@nash.id.au>2011-02-13 00:27:08 +0000
commitebe7b0745e3ba2fe60cb0f1d1975a321bbce23dc (patch)
treeebcd984d1274a5b17b31ee6fc3b0a6d604f890c6
parent0eb947b47b934b7e24d58030eecf740a39e95822 (diff)
Expedite: Proxy tests: Add some proxy tests.
So this covers a basic image, and some text tests. SVN revision: 56976
-rw-r--r--src/bin/Makefile.am5
-rw-r--r--src/bin/proxy_image.c111
-rw-r--r--src/bin/proxy_text_fixed.c123
-rw-r--r--src/bin/proxy_text_random.c143
-rw-r--r--src/bin/tests.h3
-rw-r--r--src/bin/ui.c3
6 files changed, 387 insertions, 1 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 3814735..bad365c 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -109,7 +109,10 @@ image_blend_occlude3_many.c \
109image_blend_occlude1_very_many.c \ 109image_blend_occlude1_very_many.c \
110image_blend_occlude2_very_many.c \ 110image_blend_occlude2_very_many.c \
111image_blend_occlude3_very_many.c \ 111image_blend_occlude3_very_many.c \
112poly_blend.c 112poly_blend.c \
113proxy_image.c \
114proxy_text_fixed.c \
115proxy_text_random.c
113 116
114expedite_CFLAGS = @WIN32_CFLAGS@ 117expedite_CFLAGS = @WIN32_CFLAGS@
115expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@ 118expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@
diff --git a/src/bin/proxy_image.c b/src/bin/proxy_image.c
new file mode 100644
index 0000000..f1debcd
--- /dev/null
+++ b/src/bin/proxy_image.c
@@ -0,0 +1,111 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME image_blend_unscaled_proxy_start
7#define NAME "Image Blend Unscaled Proxy"
8#define ICON "blend.png"
9
10#ifndef PROTO
11# ifndef UI
12# include "main.h"
13
14/* standard var */
15static int done = 0;
16/* private data */
17static Evas_Object *o_images[OBNUM];
18
19/* setup */
20static void _setup(void)
21{
22 int i;
23 Evas_Object *o,*src;
24
25 o = evas_object_image_add(evas);
26 evas_object_image_file_set(o, build_path("logo.png"), NULL);
27 evas_object_image_fill_set(o, 0, 0, 120, 160);
28 evas_object_resize(o, 120, 160);
29 evas_object_show(o);
30 src = o;
31 o_images[0] = src;
32
33 for (i = 1; i < OBNUM; i++)
34 {
35 o = evas_object_image_add(evas);
36 o_images[i] = o;
37 evas_object_image_source_set(o, src);
38 evas_object_resize(o, 120, 160);
39 evas_object_image_fill_set(o, 0,0,120,160);
40 evas_object_show(o);
41 }
42 done = 0;
43}
44
45/* cleanup */
46static void _cleanup(void)
47{
48 int i;
49 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
50}
51
52/* loop - do things */
53static void _loop(double t, int f)
54{
55 int i;
56 Evas_Coord x, y, w, h;
57 for (i = 0; i < OBNUM; i++)
58 {
59 w = 120;
60 h = 160;
61 x = (win_w / 2) - (w / 2);
62 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
63 y = (win_h / 2) - (h / 2);
64 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
65 evas_object_move(o_images[i], x, y);
66 }
67 FPS_STD(NAME);
68}
69
70/* prepend special key handlers if interactive (before STD) */
71static void _key(char *key)
72{
73 KEY_STD;
74}
75
76
77
78
79
80
81
82
83
84
85
86
87/* template stuff - ignore */
88# endif
89#endif
90
91#ifdef UI
92_ui_menu_item_add(ICON, NAME, FNAME);
93#endif
94
95#ifdef PROTO
96void FNAME(void);
97#endif
98
99#ifndef PROTO
100# ifndef UI
101void FNAME(void)
102{
103 ui_func_set(_key, _loop);
104 _setup();
105}
106# endif
107#endif
108#undef FNAME
109#undef NAME
110#undef ICON
111
diff --git a/src/bin/proxy_text_fixed.c b/src/bin/proxy_text_fixed.c
new file mode 100644
index 0000000..c589a57
--- /dev/null
+++ b/src/bin/proxy_text_fixed.c
@@ -0,0 +1,123 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME proxy_text_fixed
7#define NAME "Proxy Text Fixed"
8#define ICON "text.png"
9
10#ifndef PROTO
11# ifndef UI
12# include "main.h"
13
14/* standard var */
15static int done = 0;
16
17/* private data */
18static Evas_Object *o_texts[OBNUM];
19
20/* setup */
21static void _setup(void)
22{
23 int i,w,h;
24 Evas_Object *o,*s;
25 Evas_Text_Style_Type st;
26
27 st = EVAS_TEXT_STYLE_SHADOW;
28 for (i = 0; st <= EVAS_TEXT_STYLE_FAR_SOFT_SHADOW; i++)
29 {
30 o = evas_object_text_add(evas);
31 o_texts[i] = o;
32 evas_object_text_font_set(o, "Vera-Bold", 20);
33 evas_object_text_text_set(o, "This is a test string");
34 evas_object_text_style_set(o, st);
35 evas_object_color_set(o, 255, 255, 255, 255);
36 evas_object_text_shadow_color_set(o, 0, 0, 0, 24);
37 evas_object_text_glow_color_set(o, 100, 80, 40, 100);
38 evas_object_text_glow2_color_set(o, 50, 10, 5, 50);
39 evas_object_text_outline_color_set(o, 0, 0, 0, 255);
40 evas_object_show(o);
41 st++;
42 }
43
44 for ( ; i < OBNUM ; i ++)
45 {
46 s = o_texts[i % st];
47 o = evas_object_image_add(evas);
48 o_texts[i] = o;
49 evas_object_image_source_set(o, s);
50 evas_object_geometry_get(s, NULL, NULL, &w, &h);
51 evas_object_resize(o, w, h);
52 evas_object_image_fill_set(o, 0, 0, w, h);
53 evas_object_show(o);
54 }
55
56 done = 0;
57}
58
59/* cleanup */
60static void _cleanup(void)
61{
62 int i;
63 for (i = 0; i < OBNUM; i++) evas_object_del(o_texts[i]);
64}
65
66/* loop - do things */
67static void _loop(double t, int f)
68{
69 int i;
70 Evas_Coord x, y, w, h;
71 for (i = 0; i < OBNUM; i++)
72 {
73 evas_object_geometry_get(o_texts[i], NULL, NULL, &w, &h);
74 x = (win_w / 2) - (w / 2);
75 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
76 y = (win_h / 2) - (h / 2);
77 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2);
78 evas_object_move(o_texts[i], x, y);
79 }
80 FPS_STD(NAME);
81}
82
83/* prepend special key handlers if interactive (before STD) */
84static void _key(char *key)
85{
86 KEY_STD;
87}
88
89
90
91
92
93
94
95
96
97
98
99
100/* template stuff - ignore */
101# endif
102#endif
103
104#ifdef UI
105_ui_menu_item_add(ICON, NAME, FNAME);
106#endif
107
108#ifdef PROTO
109void FNAME(void);
110#endif
111
112#ifndef PROTO
113# ifndef UI
114void FNAME(void)
115{
116 ui_func_set(_key, _loop);
117 _setup();
118}
119# endif
120#endif
121#undef FNAME
122#undef NAME
123#undef ICON
diff --git a/src/bin/proxy_text_random.c b/src/bin/proxy_text_random.c
new file mode 100644
index 0000000..32fbfba
--- /dev/null
+++ b/src/bin/proxy_text_random.c
@@ -0,0 +1,143 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME proxy_text_random
7#define NAME "Proxy Text Random"
8#define ICON "text.png"
9
10#ifndef PROTO
11# ifndef UI
12# include "main.h"
13
14/* standard var */
15static int done = 0;
16
17/* private data */
18static Evas_Object *o_texts[OBNUM];
19
20/* setup */
21static void _setup(void)
22{
23 int i = 0;
24 Evas_Object *o;
25 Evas_Coord x, y, w, h;
26 char buf[1024];
27 const char *strs[] = {
28 "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
29 "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
30 "Fiddly", "Family", "Lair", "Monkeys", "Magazine"
31 };
32 srnd();
33 o = evas_object_text_add(evas);
34 o_texts[0] = o;
35 evas_object_text_font_set(o, "Vera-Bold", 20);
36 snprintf(buf, sizeof(buf), "%s %s %s %s.",
37 strs[rnd() % (sizeof(strs) / sizeof(char *))],
38 strs[rnd() % (sizeof(strs) / sizeof(char *))],
39 strs[rnd() % (sizeof(strs) / sizeof(char *))],
40 strs[rnd() % (sizeof(strs) / sizeof(char *))]);
41 evas_object_text_text_set(o, buf);
42 evas_object_color_set(o, 0, 0, 0, 255);
43 evas_object_geometry_get(o, NULL, NULL, &w, &h);
44 x = (win_w / 2) - (w / 2);
45 x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
46 y = (win_h / 2) - (h / 2);
47 y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
48 evas_object_move(o, x, y);
49 evas_object_show(o);
50 for (i = 1 ; i < OBNUM ; i ++)
51 {
52 o = evas_object_image_add(evas);
53 o_texts[i] = o;
54 evas_object_image_source_set(o, o_texts[0]);
55 evas_object_geometry_get(o_texts[0], NULL, NULL, &w, &h);
56 evas_object_resize(o, w, h);
57 evas_object_image_fill_set(o, 0, 0, w, h);
58 x = (win_w / 2) - (w / 2);
59 x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
60 y = (win_h / 2) - (h / 2);
61 y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
62 evas_object_move(o, x, y);
63
64 evas_object_show(o);
65 }
66
67
68 done = 0;
69}
70
71/* cleanup */
72static void _cleanup(void)
73{
74 int i;
75 for (i = 0; i < OBNUM; i++) evas_object_del(o_texts[i]);
76}
77
78/* loop - do things */
79static void _loop(double t, int f)
80{
81 int i,w,h;
82 char buf[1024];
83 const char *strs[] = {
84 "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
85 "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
86 "Fiddly", "Family", "Lair", "Monkeys", "Magazine"
87 };
88 snprintf(buf, sizeof(buf), "%s %s %s %s.",
89 strs[rnd() % (sizeof(strs) / sizeof(char *))],
90 strs[rnd() % (sizeof(strs) / sizeof(char *))],
91 strs[rnd() % (sizeof(strs) / sizeof(char *))],
92 strs[rnd() % (sizeof(strs) / sizeof(char *))]);
93 evas_object_text_text_set(o_texts[0], buf);
94 evas_object_geometry_get(o_texts[0], NULL, NULL, &w, &h);
95 for (i = 1; i < OBNUM; i++)
96 {
97 evas_object_resize(o_texts[i],w,h);
98 evas_object_image_fill_set(o_texts[i],0,0,w,h);
99 }
100 FPS_STD(NAME);
101}
102
103/* prepend special key handlers if interactive (before STD) */
104static void _key(char *key)
105{
106 KEY_STD;
107}
108
109
110
111
112
113
114
115
116
117
118
119
120/* template stuff - ignore */
121# endif
122#endif
123
124#ifdef UI
125_ui_menu_item_add(ICON, NAME, FNAME);
126#endif
127
128#ifdef PROTO
129void FNAME(void);
130#endif
131
132#ifndef PROTO
133# ifndef UI
134void FNAME(void)
135{
136 ui_func_set(_key, _loop);
137 _setup();
138}
139# endif
140#endif
141#undef FNAME
142#undef NAME
143#undef ICON
diff --git a/src/bin/tests.h b/src/bin/tests.h
index 9182130..202db87 100644
--- a/src/bin/tests.h
+++ b/src/bin/tests.h
@@ -86,3 +86,6 @@
86#include "image_blend_occlude2_very_many.c" 86#include "image_blend_occlude2_very_many.c"
87#include "image_blend_occlude3_very_many.c" 87#include "image_blend_occlude3_very_many.c"
88#include "poly_blend.c" 88#include "poly_blend.c"
89#include "proxy_image.c"
90#include "proxy_text_fixed.c"
91#include "proxy_text_random.c"
diff --git a/src/bin/ui.c b/src/bin/ui.c
index b579c50..1fe2cdf 100644
--- a/src/bin/ui.c
+++ b/src/bin/ui.c
@@ -157,6 +157,9 @@ static double weights[] =
157 38.2952, // test 86 157 38.2952, // test 86
158 5.5560, 158 5.5560,
159 0.5000, 159 0.5000,
160 10.000, // Proxy tests
161 10.000,
162 10.000,
160 163
161 0.0, // no final test - add a 0 at the end anyway to pad 164 0.0, // no final test - add a 0 at the end anyway to pad
162 0.0, 165 0.0,