summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-05-13 07:56:56 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-13 07:56:56 -0400
commit37093983bfd55022f5757eb70ff929cd4701d3d3 (patch)
tree6e38fde3f7ba61c85eb12af32a74efc925a7c541
parent3a1058aab1f68a07021b23e9e02fe9f3f4315267 (diff)
add clipped image proxy test
Summary: this is a test with lots of image proxies which have clippers Depends on D8836 Reviewers: cedric Reviewed By: cedric Tags: #expedite Differential Revision: https://phab.enlightenment.org/D8877
-rw-r--r--src/bin/meson.build1
-rw-r--r--src/bin/proxy_image_clipped.c124
-rw-r--r--src/bin/tests.h1
3 files changed, 126 insertions, 0 deletions
diff --git a/src/bin/meson.build b/src/bin/meson.build
index 710b6c9..b8abc11 100644
--- a/src/bin/meson.build
+++ b/src/bin/meson.build
@@ -94,6 +94,7 @@ expedite_sources = [ 'main.c',
94 'image_blend_occlude3_very_many.c', 94 'image_blend_occlude3_very_many.c',
95 'poly_blend.c', 95 'poly_blend.c',
96 'proxy_image.c', 96 'proxy_image.c',
97 'proxy_image_clipped.c',
97 'proxy_text_fixed.c', 98 'proxy_text_fixed.c',
98 'proxy_text_random.c', 99 'proxy_text_random.c',
99 'line_blend.c', 100 'line_blend.c',
diff --git a/src/bin/proxy_image_clipped.c b/src/bin/proxy_image_clipped.c
new file mode 100644
index 0000000..d47a21e
--- /dev/null
+++ b/src/bin/proxy_image_clipped.c
@@ -0,0 +1,124 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME image_blend_clipped_proxy_start
7#define NAME "Image Blend Clipped Proxy"
8#define ICON "blend.png"
9
10#ifndef PROTO
11# ifndef UI
12# include "main.h"
13
14/* standard var */
15static int done = 0;
16/* private data */
17static Evas_Object *o_images[OBNUM * 2];
18
19/* setup */
20static void _setup(void)
21{
22 int i;
23 Evas_Object *o,*src;
24
25 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
26 efl_file_simple_load(o, build_path("logo.png"), NULL);
27 efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
28 efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
29 efl_gfx_entity_visible_set(o, EINA_TRUE);
30 src = o;
31 o_images[0] = src;
32
33 for (i = 1; i < OBNUM; i += 2)
34 {
35 Eo *clip;
36 o = efl_add(EFL_CANVAS_PROXY_CLASS, evas);
37 o_images[i] = o;
38 efl_canvas_proxy_source_set(o, src);
39 efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
40 efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
41 efl_gfx_entity_visible_set(o, EINA_TRUE);
42
43 clip = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
44 o_images[i + 1] = clip;
45 efl_canvas_object_clipper_set(o, clip);
46 efl_gfx_entity_size_set(clip, EINA_SIZE2D(120, 80));
47 efl_gfx_entity_visible_set(clip, EINA_TRUE);
48 }
49 done = 0;
50}
51
52/* cleanup */
53static void _cleanup(void)
54{
55 int i;
56 for (i = 0; i < OBNUM * 2; i++) efl_del(o_images[i]);
57}
58
59/* loop - do things */
60static void _loop(double t, int f)
61{
62 int i;
63 Evas_Coord x, y, w, h;
64 for (i = 0; i < OBNUM * 2; i++)
65 {
66 w = 120;
67 h = 160;
68 x = (win_w / 2) - (w / 2);
69 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
70 y = (win_h / 2) - (h / 2);
71 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
72 efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
73 if (i < 1) continue;
74 i++;
75 if ((i - 1) % 4)
76 efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y + h / 2));
77 else
78 efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
79 }
80 FPS_STD(NAME);
81}
82
83/* prepend special key handlers if interactive (before STD) */
84static void _key(const char *key)
85{
86 KEY_STD;
87}
88
89
90
91
92
93
94
95
96
97
98
99
100/* template stuff - ignore */
101# endif
102#endif
103
104#ifdef UI
105_ui_menu_item_add(ICON, NAME, FNAME);
106#endif
107
108#ifdef PROTO
109void FNAME(void);
110#endif
111
112#ifndef PROTO
113# ifndef UI
114void FNAME(void)
115{
116 ui_func_set(_key, _loop);
117 _setup();
118}
119# endif
120#endif
121#undef FNAME
122#undef NAME
123#undef ICON
124
diff --git a/src/bin/tests.h b/src/bin/tests.h
index 4f21d05..dc58148 100644
--- a/src/bin/tests.h
+++ b/src/bin/tests.h
@@ -87,6 +87,7 @@
87#include "image_blend_occlude3_very_many.c" 87#include "image_blend_occlude3_very_many.c"
88#include "poly_blend.c" 88#include "poly_blend.c"
89#include "proxy_image.c" 89#include "proxy_image.c"
90#include "proxy_image_clipped.c"
90#include "proxy_text_fixed.c" 91#include "proxy_text_fixed.c"
91#include "proxy_text_random.c" 92#include "proxy_text_random.c"
92#include "line_blend.c" 93#include "line_blend.c"