summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2014-03-25 11:30:07 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-03-25 11:34:27 +0900
commitc3890ffeb1073af40a066975563bc26e2dd58866 (patch)
tree0ee5c69bb0c279e8eeeeecffa42e5dcb0f01f931
parentd68739908f3e8d1491301e3047c07312b924ec28 (diff)
Add font effect tests (alpha blur, rgba blur)
Patch by eunue (Jaeun Choi): D658
-rw-r--r--src/bin/Makefile.am4
-rw-r--r--src/bin/font_effect_blur_alpha.c105
-rw-r--r--src/bin/font_effect_blur_color.c95
-rw-r--r--src/bin/tests.h2
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 \
114proxy_text_fixed.c \ 114proxy_text_fixed.c \
115proxy_text_random.c \ 115proxy_text_random.c \
116line_blend.c \ 116line_blend.c \
117image_blend_many_smooth_same_scaled.c 117image_blend_many_smooth_same_scaled.c \
118font_effect_blur_alpha.c \
119font_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 */
18static int done = 0;
19/* private data */
20static Evas_Object *bg;
21static Evas_Object *text;
22
23extern int win_w, win_h;
24
25
26/* setup */
27static 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 */
48static void _cleanup(void)
49{
50 evas_object_del(bg);
51 evas_object_del(text);
52}
53
54/* loop - do things */
55static 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) */
66static 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
91void FNAME(void);
92#endif
93
94#ifndef PROTO
95# ifndef UI
96void 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 */
18static int done = 0;
19/* private data */
20static Evas_Object *text;
21
22
23/* setup */
24static 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 */
39static void _cleanup(void)
40{
41 evas_object_del(text);
42}
43
44/* loop - do things */
45static 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) */
56static 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
81void FNAME(void);
82#endif
83
84#ifndef PROTO
85# ifndef UI
86void 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"