diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/bin/Makefile.am | 19 | ||||
-rw-r--r-- | src/bin/line_blend.c | 143 | ||||
-rw-r--r-- | src/bin/tests.h | 1 | ||||
-rw-r--r-- | src/bin/ui.c | 1 |
6 files changed, 168 insertions, 1 deletions
@@ -33,3 +33,7 @@ | |||
33 | 2013-01-23 Yakov Goldberg | 33 | 2013-01-23 Yakov Goldberg |
34 | 34 | ||
35 | * Porting to Eo | 35 | * Porting to Eo |
36 | |||
37 | 2013-02-18 Cedric Bail | ||
38 | |||
39 | * Test and benchmark lines. | ||
@@ -6,6 +6,7 @@ Changes since Expedite 1.7.0: | |||
6 | Additions: | 6 | Additions: |
7 | 7 | ||
8 | * Support for Wayland engines | 8 | * Support for Wayland engines |
9 | * Test and benchmark lines | ||
9 | 10 | ||
10 | Removals: | 11 | Removals: |
11 | 12 | ||
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 5e742d1..022bb30 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am | |||
@@ -112,7 +112,24 @@ image_blend_occlude3_very_many.c \ | |||
112 | poly_blend.c \ | 112 | 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 | ||
117 | # \ | ||
118 | # image_mask.c \ | ||
119 | # image_mask_2.c \ | ||
120 | # image_mask_3.c \ | ||
121 | # image_mask_4.c \ | ||
122 | # image_mask_5.c \ | ||
123 | # image_mask_6.c \ | ||
124 | # image_mask_7.c \ | ||
125 | # image_mask_8.c \ | ||
126 | # image_mask_9.c \ | ||
127 | # image_mask_10.c \ | ||
128 | # image_mask_11.c \ | ||
129 | # image_mask_12.c \ | ||
130 | # image_mask_13.c \ | ||
131 | # image_mask_14.c \ | ||
132 | # image_mask_15.c | ||
116 | 133 | ||
117 | expedite_CFLAGS = @WIN32_CFLAGS@ @WAYLAND_CLIENT_CFLAGS@ @WAYLAND_EGL_CFLAGS@ | 134 | expedite_CFLAGS = @WIN32_CFLAGS@ @WAYLAND_CLIENT_CFLAGS@ @WAYLAND_EGL_CFLAGS@ |
118 | expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@ | 135 | expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@ |
diff --git a/src/bin/line_blend.c b/src/bin/line_blend.c new file mode 100644 index 0000000..dedc471 --- /dev/null +++ b/src/bin/line_blend.c | |||
@@ -0,0 +1,143 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | |||
5 | /* metadata */ | ||
6 | #define FNAME line_blend_start | ||
7 | #define NAME "Line Blend" | ||
8 | #define ICON "rect.png" | ||
9 | |||
10 | #ifndef PROTO | ||
11 | # ifndef UI | ||
12 | # include "main.h" | ||
13 | |||
14 | /* standard var */ | ||
15 | static int done = 0; | ||
16 | /* private data */ | ||
17 | static Evas_Object *o_images[OBNUM]; | ||
18 | |||
19 | /* setup */ | ||
20 | static void _setup(void) | ||
21 | { | ||
22 | int i; | ||
23 | Evas_Object *o; | ||
24 | srnd(); | ||
25 | for (i = 0; i < OBNUM; i++) | ||
26 | { | ||
27 | int r, g, b, a; | ||
28 | |||
29 | o = eo_add(EVAS_OBJ_LINE_CLASS, evas); | ||
30 | o_images[i] = o; | ||
31 | a = (rnd()&0xff) / 2; | ||
32 | r = ((rnd()&0xff) * a) / 255; | ||
33 | g = ((rnd()&0xff) * a) / 255; | ||
34 | b = ((rnd()&0xff) * a) / 255; | ||
35 | eo_do(o, | ||
36 | evas_obj_color_set(r, g, b, a), | ||
37 | evas_obj_line_xy_set(((win_w / 2) * (rnd()&0xff)) / 255, | ||
38 | ((win_h / 2) * (rnd()&0xff)) / 255, | ||
39 | ((win_w / 2) * (rnd()&0xff)) / 255 + (win_w / 2), | ||
40 | ((win_h / 2) * (rnd()&0xff)) / 255 + (win_h / 2)), | ||
41 | evas_obj_visibility_set(EINA_TRUE)); | ||
42 | |||
43 | |||
44 | } | ||
45 | done = 0; | ||
46 | } | ||
47 | |||
48 | /* cleanup */ | ||
49 | static void _cleanup(void) | ||
50 | { | ||
51 | int i; | ||
52 | for (i = 0; i < OBNUM; i++) eo_del(o_images[i]); | ||
53 | } | ||
54 | |||
55 | #define PI (double) 3.141592654 | ||
56 | |||
57 | static void | ||
58 | _rotate_point(Evas_Coord *ox, Evas_Coord *oy, int r) | ||
59 | { | ||
60 | double d; | ||
61 | double x, y; | ||
62 | double angle; | ||
63 | |||
64 | x = *ox - (win_w / 2); | ||
65 | y = *oy - (win_h / 2); | ||
66 | |||
67 | d = sqrt(x * x + y * y); | ||
68 | |||
69 | angle = atan((double) y / (double) x); | ||
70 | if (x < 0) angle -= PI; | ||
71 | |||
72 | switch (r & 0x3) | ||
73 | { | ||
74 | case 0: angle += 1 * PI / 180; break; | ||
75 | case 1: angle += -1 * PI / 180; break; | ||
76 | case 2: angle += 7 * PI / 180; break; | ||
77 | case 3: angle += -1 * PI / 180; break; | ||
78 | } | ||
79 | |||
80 | *ox = d * cos(angle) + (win_w / 2); | ||
81 | *oy = d * sin(angle) + (win_h / 2); | ||
82 | } | ||
83 | |||
84 | /* loop - do things */ | ||
85 | static void _loop(double t, int f) | ||
86 | { | ||
87 | int i; | ||
88 | Evas_Coord ox1, oy1, ox2, oy2; | ||
89 | Evas_Object *o; | ||
90 | |||
91 | for (i = 0; i < OBNUM; i++) | ||
92 | { | ||
93 | o = o_images[i]; | ||
94 | eo_do(o, evas_obj_line_xy_get(&ox1, &oy1, &ox2, &oy2)); | ||
95 | |||
96 | _rotate_point(&ox1, &oy1, i); | ||
97 | _rotate_point(&ox2, &oy2, i); | ||
98 | eo_do(o, evas_obj_line_xy_set(ox1, oy1, ox2, oy2)); | ||
99 | } | ||
100 | FPS_STD(NAME); | ||
101 | } | ||
102 | |||
103 | /* prepend special key handlers if interactive (before STD) */ | ||
104 | static 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 | ||
129 | void FNAME(void); | ||
130 | #endif | ||
131 | |||
132 | #ifndef PROTO | ||
133 | # ifndef UI | ||
134 | void 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 8607950..d9a35ac 100644 --- a/src/bin/tests.h +++ b/src/bin/tests.h | |||
@@ -89,6 +89,7 @@ | |||
89 | #include "proxy_image.c" | 89 | #include "proxy_image.c" |
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 | #if 0 // test disabled - evas having code disabled | 93 | #if 0 // test disabled - evas having code disabled |
93 | #include "image_mask.c" | 94 | #include "image_mask.c" |
94 | #include "image_mask_2.c" | 95 | #include "image_mask_2.c" |
diff --git a/src/bin/ui.c b/src/bin/ui.c index eb132dd..55c48cd 100644 --- a/src/bin/ui.c +++ b/src/bin/ui.c | |||
@@ -202,6 +202,7 @@ static double weights[] = | |||
202 | 0.0, | 202 | 0.0, |
203 | 0.0, | 203 | 0.0, |
204 | 0.0, | 204 | 0.0, |
205 | 0.0, | ||
205 | 0.0 | 206 | 0.0 |
206 | }; | 207 | }; |
207 | 208 | ||