summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-14 15:12:25 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-14 15:12:25 -0700
commit24eca8a7788d626135e948887c777009fc28d022 (patch)
tree1716f2a45fa1fe1cdf2a0259f99a3daf7fab7a80 /src
parenta927cdd1a41f418dd1ca6f5db5138e629b1b3758 (diff)
evas: use new efl interface polygon API
Diffstat (limited to 'src')
-rw-r--r--src/bin/poly_blend.c66
1 files changed, 30 insertions, 36 deletions
diff --git a/src/bin/poly_blend.c b/src/bin/poly_blend.c
index 54b6951..5fbadf5 100644
--- a/src/bin/poly_blend.c
+++ b/src/bin/poly_blend.c
@@ -19,47 +19,42 @@ static Evas_Object *o_images[OBNUM];
19static void 19static void
20poly(Evas_Object *o, int type, Evas_Coord x, Evas_Coord y) 20poly(Evas_Object *o, int type, Evas_Coord x, Evas_Coord y)
21{ 21{
22 if (o) 22 efl_canvas_polygon_points_clear(o);
23 evas_obj_polygon_points_clear(o);
24 switch (type % 4) 23 switch (type % 4)
25 { 24 {
26 case 0: /* triangle */ 25 case 0: /* triangle */
27 if (o) 26 efl_canvas_polygon_point_add(o, x + 50, y + 0);
28 evas_obj_polygon_point_add(o, x + 50, y + 0); 27 efl_canvas_polygon_point_add(o, x + 100, y + 100);
29 evas_obj_polygon_point_add(o, x + 100, y + 100); 28 efl_canvas_polygon_point_add(o, x + 0, y + 100);
30 evas_obj_polygon_point_add(o, x + 0, y + 100); 29 break;
31 break;
32 case 1: /* square */ 30 case 1: /* square */
33 if (o) 31 efl_canvas_polygon_point_add(o, x + 0, y + 0);
34 evas_obj_polygon_point_add(o, x + 0, y + 0); 32 efl_canvas_polygon_point_add(o, x + 100, y + 0);
35 evas_obj_polygon_point_add(o, x + 100, y + 0); 33 efl_canvas_polygon_point_add(o, x + 100, y + 100);
36 evas_obj_polygon_point_add(o, x + 100, y + 100); 34 efl_canvas_polygon_point_add(o, x + 0, y + 100);
37 evas_obj_polygon_point_add(o, x + 0, y + 100); 35 break;
38 break;
39 case 2: /* hex */ 36 case 2: /* hex */
40 if (o) 37 efl_canvas_polygon_point_add(o, x + 50, y + 0);
41 evas_obj_polygon_point_add(o, x + 50, y + 0); 38 efl_canvas_polygon_point_add(o, x + 100, y + 30);
42 evas_obj_polygon_point_add(o, x + 100, y + 30); 39 efl_canvas_polygon_point_add(o, x + 100, y + 70);
43 evas_obj_polygon_point_add(o, x + 100, y + 70); 40 efl_canvas_polygon_point_add(o, x + 50, y + 100);
44 evas_obj_polygon_point_add(o, x + 50, y + 100); 41 efl_canvas_polygon_point_add(o, x + 0, y + 70);
45 evas_obj_polygon_point_add(o, x + 0, y + 70); 42 efl_canvas_polygon_point_add(o, x + 0, y + 30);
46 evas_obj_polygon_point_add(o, x + 0, y + 30); 43 break;
47 break;
48 case 3: /* star */ 44 case 3: /* star */
49 if (o) 45 efl_canvas_polygon_point_add(o, x + 50, y + 0);
50 evas_obj_polygon_point_add(o, x + 50, y + 0); 46 efl_canvas_polygon_point_add(o, x + 60, y + 40);
51 evas_obj_polygon_point_add(o, x + 60, y + 40); 47 efl_canvas_polygon_point_add(o, x + 90, y + 30);
52 evas_obj_polygon_point_add(o, x + 90, y + 30); 48 efl_canvas_polygon_point_add(o, x + 70, y + 60);
53 evas_obj_polygon_point_add(o, x + 70, y + 60); 49 efl_canvas_polygon_point_add(o, x + 90, y + 100);
54 evas_obj_polygon_point_add(o, x + 90, y + 100); 50 efl_canvas_polygon_point_add(o, x + 50, y + 70);
55 evas_obj_polygon_point_add(o, x + 50, y + 70); 51 efl_canvas_polygon_point_add(o, x + 10, y + 100);
56 evas_obj_polygon_point_add(o, x + 10, y + 100); 52 efl_canvas_polygon_point_add(o, x + 30, y + 60);
57 evas_obj_polygon_point_add(o, x + 30, y + 60); 53 efl_canvas_polygon_point_add(o, x + 10, y + 30);
58 evas_obj_polygon_point_add(o, x + 10, y + 30); 54 efl_canvas_polygon_point_add(o, x + 40, y + 40);
59 evas_obj_polygon_point_add(o, x + 40, y + 40); 55 break;
60 break;
61 default: 56 default:
62 break; 57 break;
63 } 58 }
64} 59}
65 60
@@ -73,13 +68,12 @@ static void _setup(void)
73 { 68 {
74 int r, g, b, a; 69 int r, g, b, a;
75 70
76 o = eo_add(EVAS_POLYGON_CLASS, evas); 71 o = eo_add(EFL_CANVAS_POLYGON_CLASS, evas);
77 o_images[i] = o; 72 o_images[i] = o;
78 a = (rnd()&0xff) / 2; 73 a = (rnd()&0xff) / 2;
79 r = ((rnd()&0xff) * a) / 255; 74 r = ((rnd()&0xff) * a) / 255;
80 g = ((rnd()&0xff) * a) / 255; 75 g = ((rnd()&0xff) * a) / 255;
81 b = ((rnd()&0xff) * a) / 255; 76 b = ((rnd()&0xff) * a) / 255;
82 if (o)
83 efl_gfx_color_set(o, r, g, b, a); 77 efl_gfx_color_set(o, r, g, b, a);
84 efl_gfx_visible_set(o, EINA_TRUE); 78 efl_gfx_visible_set(o, EINA_TRUE);
85 poly(o, i, 0, 0); 79 poly(o, i, 0, 0);