diff options
author | Jaeun Choi <jaeun12.choi@samsung.com> | 2014-03-25 11:30:07 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2014-03-25 11:34:27 +0900 |
commit | c3890ffeb1073af40a066975563bc26e2dd58866 (patch) | |
tree | 0ee5c69bb0c279e8eeeeecffa42e5dcb0f01f931 | |
parent | d68739908f3e8d1491301e3047c07312b924ec28 (diff) |
Add font effect tests (alpha blur, rgba blur)
Patch by eunue (Jaeun Choi): D658
-rw-r--r-- | src/bin/Makefile.am | 4 | ||||
-rw-r--r-- | src/bin/font_effect_blur_alpha.c | 105 | ||||
-rw-r--r-- | src/bin/font_effect_blur_color.c | 95 | ||||
-rw-r--r-- | src/bin/tests.h | 2 |
4 files changed, 205 insertions, 1 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 0a0bc5a..4d93ab7 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am | |||
@@ -114,7 +114,9 @@ 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 | image_blend_many_smooth_same_scaled.c \ |
118 | font_effect_blur_alpha.c \ | ||
119 | font_effect_blur_color.c | ||
118 | # \ | 120 | # \ |
119 | # image_mask.c \ | 121 | # image_mask.c \ |
120 | # image_mask_2.c \ | 122 | # image_mask_2.c \ |
diff --git a/src/bin/font_effect_blur_alpha.c b/src/bin/font_effect_blur_alpha.c new file mode 100644 index 0000000..4b5f49d --- /dev/null +++ b/src/bin/font_effect_blur_alpha.c | |||
@@ -0,0 +1,105 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | |||
5 | /* metadata */ | ||
6 | #define FNAME font_effect_blur_alpha_start | ||
7 | #define NAME "Font Effect Blur (Alpha)" | ||
8 | #define ICON "text.png" | ||
9 | |||
10 | #ifndef PROTO | ||
11 | # ifndef UI | ||
12 | # include "main.h" | ||
13 | |||
14 | #include "ui.h" | ||
15 | |||
16 | |||
17 | /* standard var */ | ||
18 | static int done = 0; | ||
19 | /* private data */ | ||
20 | static Evas_Object *bg; | ||
21 | static Evas_Object *text; | ||
22 | |||
23 | extern int win_w, win_h; | ||
24 | |||
25 | |||
26 | /* setup */ | ||
27 | static void _setup(void) | ||
28 | { | ||
29 | |||
30 | Evas_Object *o; | ||
31 | o = evas_object_rectangle_add(evas); | ||
32 | evas_object_color_set(o, 0, 0, 0, 255); | ||
33 | evas_object_resize(o, win_w, win_h); | ||
34 | evas_object_show(o); | ||
35 | bg = o; | ||
36 | |||
37 | o = evas_object_text_add(evas); | ||
38 | evas_object_color_set(o, 0, 0, 0, 255); | ||
39 | evas_object_text_font_set(o, "Vera-Bold", 80); | ||
40 | evas_object_text_text_set(o, "Font Effect"); | ||
41 | evas_object_show(o); | ||
42 | text = o; | ||
43 | |||
44 | done = 0; | ||
45 | } | ||
46 | |||
47 | /* cleanup */ | ||
48 | static void _cleanup(void) | ||
49 | { | ||
50 | evas_object_del(bg); | ||
51 | evas_object_del(text); | ||
52 | } | ||
53 | |||
54 | /* loop - do things */ | ||
55 | static void _loop(double t, int f) | ||
56 | { | ||
57 | char buf[128]; | ||
58 | char *str = "blur(%d);"; | ||
59 | sprintf(buf, str, ((f % 50) + 1)); | ||
60 | evas_object_text_filter_program_set(text, buf); | ||
61 | |||
62 | FPS_STD(NAME); | ||
63 | } | ||
64 | |||
65 | /* prepend special key handlers if interactive (before STD) */ | ||
66 | static void _key(char *key) | ||
67 | { | ||
68 | KEY_STD; | ||
69 | } | ||
70 | |||
71 | |||
72 | |||
73 | |||
74 | |||
75 | |||
76 | |||
77 | |||
78 | |||
79 | |||
80 | |||
81 | |||
82 | /* template stuff - ignore */ | ||
83 | # endif | ||
84 | #endif | ||
85 | |||
86 | #ifdef UI | ||
87 | _ui_menu_item_add(ICON, NAME, FNAME); | ||
88 | #endif | ||
89 | |||
90 | #ifdef PROTO | ||
91 | void FNAME(void); | ||
92 | #endif | ||
93 | |||
94 | #ifndef PROTO | ||
95 | # ifndef UI | ||
96 | void FNAME(void) | ||
97 | { | ||
98 | ui_func_set(_key, _loop); | ||
99 | _setup(); | ||
100 | } | ||
101 | # endif | ||
102 | #endif | ||
103 | #undef FNAME | ||
104 | #undef NAME | ||
105 | #undef ICON | ||
diff --git a/src/bin/font_effect_blur_color.c b/src/bin/font_effect_blur_color.c new file mode 100644 index 0000000..d3c5cca --- /dev/null +++ b/src/bin/font_effect_blur_color.c | |||
@@ -0,0 +1,95 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | |||
5 | /* metadata */ | ||
6 | #define FNAME font_effect_blur_color_start | ||
7 | #define NAME "Font Effect Blur (Color)" | ||
8 | #define ICON "text.png" | ||
9 | |||
10 | #ifndef PROTO | ||
11 | # ifndef UI | ||
12 | # include "main.h" | ||
13 | |||
14 | #include "ui.h" | ||
15 | |||
16 | |||
17 | /* standard var */ | ||
18 | static int done = 0; | ||
19 | /* private data */ | ||
20 | static Evas_Object *text; | ||
21 | |||
22 | |||
23 | /* setup */ | ||
24 | static void _setup(void) | ||
25 | { | ||
26 | |||
27 | Evas_Object *o; | ||
28 | o = evas_object_text_add(evas); | ||
29 | evas_object_color_set(o, 0, 0, 0, 255); | ||
30 | evas_object_text_font_set(o, "Vera-Bold", 80); | ||
31 | evas_object_text_text_set(o, "Font Effect"); | ||
32 | evas_object_show(o); | ||
33 | text = o; | ||
34 | |||
35 | done = 0; | ||
36 | } | ||
37 | |||
38 | /* cleanup */ | ||
39 | static void _cleanup(void) | ||
40 | { | ||
41 | evas_object_del(text); | ||
42 | } | ||
43 | |||
44 | /* loop - do things */ | ||
45 | static void _loop(double t, int f) | ||
46 | { | ||
47 | char buf[128]; | ||
48 | char *str = "buffer:a(rgba);blend(dst=a, color=blue);blur(%d, src=a);"; | ||
49 | sprintf(buf, str, ((f % 50) + 1)); | ||
50 | evas_object_text_filter_program_set(text, buf); | ||
51 | |||
52 | FPS_STD(NAME); | ||
53 | } | ||
54 | |||
55 | /* prepend special key handlers if interactive (before STD) */ | ||
56 | static void _key(char *key) | ||
57 | { | ||
58 | KEY_STD; | ||
59 | } | ||
60 | |||
61 | |||
62 | |||
63 | |||
64 | |||
65 | |||
66 | |||
67 | |||
68 | |||
69 | |||
70 | |||
71 | |||
72 | /* template stuff - ignore */ | ||
73 | # endif | ||
74 | #endif | ||
75 | |||
76 | #ifdef UI | ||
77 | _ui_menu_item_add(ICON, NAME, FNAME); | ||
78 | #endif | ||
79 | |||
80 | #ifdef PROTO | ||
81 | void FNAME(void); | ||
82 | #endif | ||
83 | |||
84 | #ifndef PROTO | ||
85 | # ifndef UI | ||
86 | void FNAME(void) | ||
87 | { | ||
88 | ui_func_set(_key, _loop); | ||
89 | _setup(); | ||
90 | } | ||
91 | # endif | ||
92 | #endif | ||
93 | #undef FNAME | ||
94 | #undef NAME | ||
95 | #undef ICON | ||
diff --git a/src/bin/tests.h b/src/bin/tests.h index d29c9a7..998b0e5 100644 --- a/src/bin/tests.h +++ b/src/bin/tests.h | |||
@@ -91,6 +91,8 @@ | |||
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 | #include "image_blend_many_smooth_same_scaled.c" |
94 | #include "font_effect_blur_alpha.c" | ||
95 | #include "font_effect_blur_color.c" | ||
94 | #if 0 // test disabled - evas having code disabled | 96 | #if 0 // test disabled - evas having code disabled |
95 | #include "image_mask.c" | 97 | #include "image_mask.c" |
96 | #include "image_mask_2.c" | 98 | #include "image_mask_2.c" |