diff options
author | Savio Sena <savio@expertisesolutions.com.br> | 2014-10-22 02:31:15 -0200 |
---|---|---|
committer | Savio Sena <savio@expertisesolutions.com.br> | 2014-10-22 02:31:15 -0200 |
commit | d7cfdd0557bc0fde539a912fb34ee8abb7b947ab (patch) | |
tree | 472b167a9374a7b405a0c23404729464b74ff24a /src | |
parent | 0afccbf4e120f252fb2b082ccf5f49df3ff41625 (diff) |
expedite-cxx: Port last missing test.
This one passed for some reason, it was still in C.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/cxx/font_effect_blur_alpha.cc | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/bin/cxx/font_effect_blur_alpha.cc b/src/bin/cxx/font_effect_blur_alpha.cc index 543cad1..8577327 100644 --- a/src/bin/cxx/font_effect_blur_alpha.cc +++ b/src/bin/cxx/font_effect_blur_alpha.cc | |||
@@ -19,23 +19,21 @@ | |||
19 | static int done = 0; | 19 | static int done = 0; |
20 | extern int win_w, win_h; | 20 | extern int win_w, win_h; |
21 | /* private data */ | 21 | /* private data */ |
22 | static Evas_Object *text; | 22 | static evas::text *text; |
23 | static const int MAX_BLUR = 100; | 23 | static const int MAX_BLUR = 100; |
24 | 24 | ||
25 | /* setup */ | 25 | /* setup */ |
26 | static void _setup(void) | 26 | static void _setup(void) |
27 | { | 27 | { |
28 | |||
29 | Evas_Object *o; | ||
30 | int w,h; | 28 | int w,h; |
31 | 29 | evas::canvas canvas(::eo_ref(G_evas)); | |
32 | o = evas_object_text_add(G_evas); | 30 | evas::text *o = new evas::text(efl::eo::parent = canvas); |
33 | evas_object_color_set(o, 0, 0, 0, 255); | 31 | o->evas::object::color_set(0, 0, 0, 255); |
34 | evas_object_text_font_set(o, "Vera-Bold", 80); | 32 | o->font_set("Vera-Bold", 80); |
35 | evas_object_text_text_set(o, "Font Effect"); | 33 | o->text_set("Font Effect"); |
36 | evas_object_show(o); | 34 | o->visibility_set(true); |
37 | evas_object_geometry_get(o, NULL, NULL, &w, &h); | 35 | o->evas::object::size_get(&w, &h); |
38 | evas_object_move(o, (win_w / 2) - (w / 2) - MAX_BLUR, (win_h / 2) - (h / 2) - MAX_BLUR); | 36 | o->evas::object::position_set((win_w / 2) - (w / 2) - MAX_BLUR, (win_h / 2) - (h / 2) - MAX_BLUR); |
39 | text = o; | 37 | text = o; |
40 | 38 | ||
41 | done = 0; | 39 | done = 0; |
@@ -44,17 +42,20 @@ static void _setup(void) | |||
44 | /* cleanup */ | 42 | /* cleanup */ |
45 | static void _cleanup(void) | 43 | static void _cleanup(void) |
46 | { | 44 | { |
47 | evas_object_del(text); | 45 | text->visibility_set(false); |
46 | delete text; | ||
48 | } | 47 | } |
49 | 48 | ||
50 | /* loop - do things */ | 49 | /* loop - do things */ |
51 | static void _loop(double t, int f) | 50 | static void _loop(double t, int f) |
52 | { | 51 | { |
53 | char buf[256]; | 52 | if (text) |
54 | char *str = "padding_set(%d);blur(%d,color=black);"; | 53 | { |
55 | sprintf(buf, str, MAX_BLUR, ((f % MAX_BLUR) + 1)); | 54 | char buf[256]; |
56 | eo_do(text, evas_obj_text_filter_program_set(buf)); | 55 | char *str = "padding_set(%d);blur(%d,color=black);"; |
57 | 56 | sprintf(buf, str, MAX_BLUR, ((f % MAX_BLUR) + 1)); | |
57 | text->filter_program_set(buf); | ||
58 | } | ||
58 | FPS_STD(NAME); | 59 | FPS_STD(NAME); |
59 | } | 60 | } |
60 | 61 | ||