summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-10-02 19:15:27 -0300
committerSavio Sena <savio@expertisesolutions.com.br>2014-10-02 19:15:27 -0300
commitc9984a38ad95b4b3960594e3495b46884a9e3228 (patch)
treec5f2e48f1f802cf41cae7d0cdcc6fd71200ec6e5
parent428f271bcfbc0e525adbabded0245ba8e7455028 (diff)
expedite-cxx: Fixed more tests.
No tests are crashing anymore.
-rw-r--r--src/bin/cxx/image_blend_occlude2.cc5
-rw-r--r--src/bin/cxx/image_blend_unscaled.cc2
-rw-r--r--src/bin/cxx/image_data_argb_alpha.cc7
-rw-r--r--src/bin/cxx/image_map_3d_flow.cc21
-rw-r--r--src/bin/cxx/rect_blend.cc2
-rw-r--r--src/bin/cxx/rect_blend_few.cc7
-rw-r--r--src/bin/cxx/rect_blend_pow2.cc2
-rw-r--r--src/bin/cxx/widgets_file_icons_3.cc4
8 files changed, 27 insertions, 23 deletions
diff --git a/src/bin/cxx/image_blend_occlude2.cc b/src/bin/cxx/image_blend_occlude2.cc
index eb59769..e5b786e 100644
--- a/src/bin/cxx/image_blend_occlude2.cc
+++ b/src/bin/cxx/image_blend_occlude2.cc
@@ -38,11 +38,10 @@ static void _setup(void)
38 else 38 else
39 { 39 {
40 Evas_Coord x, y; 40 Evas_Coord x, y;
41
42 x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); 41 x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
43 y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); 42 y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
44 efl_file_set(build_path("image.png"), ""); 43 o.file_set(build_path("image.png"), "");
45 evas_obj_position_set(x, y); 44 o.evas::object::position_set(x, y);
46 } 45 }
47 o.fill_set(0, 0, 120, 160); 46 o.fill_set(0, 0, 120, 160);
48 o.evas::object::size_set(120, 160); 47 o.evas::object::size_set(120, 160);
diff --git a/src/bin/cxx/image_blend_unscaled.cc b/src/bin/cxx/image_blend_unscaled.cc
index 4d48e25..479825e 100644
--- a/src/bin/cxx/image_blend_unscaled.cc
+++ b/src/bin/cxx/image_blend_unscaled.cc
@@ -28,7 +28,7 @@ static void _setup(void)
28 { 28 {
29 evas::image o(efl::eo::parent = canvas); 29 evas::image o(efl::eo::parent = canvas);
30 images.push_back(o); 30 images.push_back(o);
31 efl_file_set(build_path("logo.png"), ""); 31 o.file_set(build_path("logo.png"), "");
32 o.fill_set(0, 0, 120, 160); 32 o.fill_set(0, 0, 120, 160);
33 o.evas::object::size_set(120, 160); 33 o.evas::object::size_set(120, 160);
34 o.visibility_set(true); 34 o.visibility_set(true);
diff --git a/src/bin/cxx/image_data_argb_alpha.cc b/src/bin/cxx/image_data_argb_alpha.cc
index 98b1695..ef9128b 100644
--- a/src/bin/cxx/image_data_argb_alpha.cc
+++ b/src/bin/cxx/image_data_argb_alpha.cc
@@ -31,7 +31,7 @@ static void _setup(void)
31 images.push_back(o); 31 images.push_back(o);
32 o.content_hint_set(EVAS_IMAGE_CONTENT_HINT_DYNAMIC); 32 o.content_hint_set(EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
33 o.colorspace_set(EVAS_COLORSPACE_ARGB8888); 33 o.colorspace_set(EVAS_COLORSPACE_ARGB8888);
34 o.evas::object::size_set(640, 480); 34 o.size_set(640, 480);
35 o.alpha_set(1); 35 o.alpha_set(1);
36 o.fill_set(0, 0, 640, 480); 36 o.fill_set(0, 0, 640, 480);
37 o.evas::object::size_set(640, 480); 37 o.evas::object::size_set(640, 480);
@@ -61,9 +61,8 @@ static void _loop(double t, int f)
61 img.evas::object::position_set(x, y); 61 img.evas::object::position_set(x, y);
62 img.evas::object::size_set(w, h); 62 img.evas::object::size_set(w, h);
63 img.fill_set(0, 0, w, h); 63 img.fill_set(0, 0, w, h);
64 unsigned int *data = static_cast<unsigned int*>(img.data_get(1)); 64 unsigned int *data = reinterpret_cast<unsigned int*>(img.data_get(1));
65 int st = evas_obj_image_stride_get(); 65 int st = img.stride_get() >> 2;
66 st = st >> 2;
67 unsigned int *p = data; 66 unsigned int *p = data;
68 for (y = 0; y < h; y++) 67 for (y = 0; y < h; y++)
69 { 68 {
diff --git a/src/bin/cxx/image_map_3d_flow.cc b/src/bin/cxx/image_map_3d_flow.cc
index f5675d0..3c948eb 100644
--- a/src/bin/cxx/image_map_3d_flow.cc
+++ b/src/bin/cxx/image_map_3d_flow.cc
@@ -33,22 +33,22 @@ static void _setup(void)
33 char buf[256]; 33 char buf[256];
34 34
35 evas::image o1(efl::eo::parent = canvas); 35 evas::image o1(efl::eo::parent = canvas);
36 images.push_back(o1);
37 snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1); // XXX 36 snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1); // XXX
38 o1.file_set(build_path(buf), ""); 37 o1.file_set(build_path(buf), "");
39 o1.fill_set(0, 0, 256, 256); 38 o1.fill_set(0, 0, 256, 256);
40 o1.evas::object::size_set(256, 256); 39 o1.evas::object::size_set(256, 256);
41 o1.smooth_scale_set(0); 40 o1.smooth_scale_set(0);
42 o1.visibility_set(true); 41 o1.visibility_set(true);
42 images.push_back(o1);
43 43
44 evas::image o2(efl::eo::parent = canvas); 44 evas::image o2(efl::eo::parent = canvas);
45 reflec.push_back(o1); 45 snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1); // XXX
46 snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1);
47 o2.file_set(build_path(buf), ""); 46 o2.file_set(build_path(buf), "");
48 o2.fill_set(0, 0, 256, 256); 47 o2.fill_set(0, 0, 256, 256);
49 o2.size_set(256, 256); 48 o2.size_set(256, 256);
50 o2.smooth_scale_set(0); 49 o2.smooth_scale_set(0);
51 o2.visibility_set(true); 50 o2.visibility_set(true);
51 reflec.push_back(o2);
52 } 52 }
53 done = 0; 53 done = 0;
54} 54}
@@ -73,13 +73,12 @@ static void _loop(double t, int f)
73 if (!m) m = evas_map_new(4); 73 if (!m) m = evas_map_new(4);
74 evas_map_smooth_set(m, 0); 74 evas_map_smooth_set(m, 0);
75 75
76 auto it_i = images.begin(); 76 efl::eina::list<evas::object>::iterator
77 auto it_r = reflec.begin(); 77 it_i = images.begin(), end_i = images.end(),
78 for (int i = 0; i < CNUM; i++) 78 it_r = reflec.begin(), end_r = reflec.end();
79 {
80 ++it_i;
81 ++it_r;
82 79
80 for (int i = 0; i < CNUM && it_i != end_i && it_r != end_r; i++)
81 {
83 Evas_Coord x = (win_w / 2); 82 Evas_Coord x = (win_w / 2);
84 Evas_Coord y = (win_h / 2); 83 Evas_Coord y = (win_h / 2);
85 Evas_Coord w = 256; 84 Evas_Coord w = 256;
@@ -186,8 +185,10 @@ static void _loop(double t, int f)
186 185
187 (*it_r).map_enable_set(1); 186 (*it_r).map_enable_set(1);
188 (*it_r).map_set(m); 187 (*it_r).map_set(m);
189 }
190 188
189 ++it_i;
190 ++it_r;
191 }
191 FPS_STD(NAME); 192 FPS_STD(NAME);
192} 193}
193 194
diff --git a/src/bin/cxx/rect_blend.cc b/src/bin/cxx/rect_blend.cc
index 7216ee1..ec391c2 100644
--- a/src/bin/cxx/rect_blend.cc
+++ b/src/bin/cxx/rect_blend.cc
@@ -42,6 +42,8 @@ static void _setup(void)
42/* cleanup */ 42/* cleanup */
43static void _cleanup() 43static void _cleanup()
44{ 44{
45 for (evas::rectangle& rec : rectangles)
46 rec.parent_set(efl::eo::base(nullptr));
45 rectangles.clear(); 47 rectangles.clear();
46} 48}
47 49
diff --git a/src/bin/cxx/rect_blend_few.cc b/src/bin/cxx/rect_blend_few.cc
index 18f4937..c4ca14e 100644
--- a/src/bin/cxx/rect_blend_few.cc
+++ b/src/bin/cxx/rect_blend_few.cc
@@ -26,10 +26,9 @@ static efl::eina::list<evas::rectangle> rectangles;
26/* setup */ 26/* setup */
27static void _setup(void) 27static void _setup(void)
28{ 28{
29 int i;
30 evas::canvas canvas(::eo_ref(G_evas)); 29 evas::canvas canvas(::eo_ref(G_evas));
31 srnd(); 30 srnd();
32 for (i = 0; i < OBNUM; i++) 31 for (int i = 0; i < OBNUM; i++)
33 { 32 {
34 evas::rectangle o(efl::eo::parent = canvas); 33 evas::rectangle o(efl::eo::parent = canvas);
35 rectangles.push_back(o); 34 rectangles.push_back(o);
@@ -37,7 +36,7 @@ static void _setup(void)
37 int r = ((rnd()&0xff) * a) / 255; 36 int r = ((rnd()&0xff) * a) / 255;
38 int g = ((rnd()&0xff) * a) / 255; 37 int g = ((rnd()&0xff) * a) / 255;
39 int b = ((rnd()&0xff) * a) / 255; 38 int b = ((rnd()&0xff) * a) / 255;
40 o.color_set(r, g, b, a); 39 o.evas::object::color_set(r, g, b, a);
41 o.visibility_set(true); 40 o.visibility_set(true);
42 } 41 }
43 done = 0; 42 done = 0;
@@ -46,6 +45,8 @@ static void _setup(void)
46/* cleanup */ 45/* cleanup */
47static void _cleanup(void) 46static void _cleanup(void)
48{ 47{
48 for (evas::rectangle& rec : rectangles)
49 rec.parent_set(efl::eo::base(nullptr));
49 rectangles.clear(); 50 rectangles.clear();
50} 51}
51 52
diff --git a/src/bin/cxx/rect_blend_pow2.cc b/src/bin/cxx/rect_blend_pow2.cc
index 562fdd1..4a3d9e2 100644
--- a/src/bin/cxx/rect_blend_pow2.cc
+++ b/src/bin/cxx/rect_blend_pow2.cc
@@ -43,6 +43,8 @@ static void _setup(void)
43/* cleanup */ 43/* cleanup */
44static void _cleanup(void) 44static void _cleanup(void)
45{ 45{
46 for (evas::rectangle& rec : rectangles)
47 rec.parent_set(efl::eo::base(nullptr));
46 rectangles.clear(); 48 rectangles.clear();
47} 49}
48 50
diff --git a/src/bin/cxx/widgets_file_icons_3.cc b/src/bin/cxx/widgets_file_icons_3.cc
index 9d7b73f..d7cfef8 100644
--- a/src/bin/cxx/widgets_file_icons_3.cc
+++ b/src/bin/cxx/widgets_file_icons_3.cc
@@ -46,7 +46,7 @@ static const char *icons[] =
46/* setup */ 46/* setup */
47static void _setup(void) 47static void _setup(void)
48{ 48{
49#if 0 49#if 0
50 int i; 50 int i;
51 evas::canvas canvas(::eo_ref(G_evas)); 51 evas::canvas canvas(::eo_ref(G_evas));
52 for (i = 0; i < NUM; i++) 52 for (i = 0; i < NUM; i++)
@@ -66,7 +66,7 @@ static void _setup(void)
66 evas_obj_visibility_set(EINA_TRUE)); 66 evas_obj_visibility_set(EINA_TRUE));
67 } 67 }
68 done = 0; 68 done = 0;
69#endif 69#endif
70} 70}
71 71
72/* cleanup */ 72/* cleanup */