summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman.samsung@gmail.com>2018-10-22 10:22:26 -0500
committerDerek Foreman <derek.foreman.samsung@gmail.com>2018-12-14 09:52:03 -0600
commitac065749a667b96140efcba62d334993fd12c44e (patch)
treebfed3d41ed8689e44a0307ad9c6d178e099d0173 /src/lib/evas
parent73e5bb84a137e1b5472599b87caa2af85b35d787 (diff)
evas_object: Add function to test if hardware plane status changed
This is used to check if an object has been put on or removed from a hardware plane between calls. Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com> Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D7192
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/canvas/evas_image_private.h1
-rw-r--r--src/lib/evas/canvas/evas_object_image.c17
-rw-r--r--src/lib/evas/include/evas_inline.x8
-rw-r--r--src/lib/evas/include/evas_private.h1
4 files changed, 27 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
index ef76267968..ac7b29c574 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -148,6 +148,7 @@ struct _Evas_Image_Data
148 Eina_Bool legacy_type : 1; 148 Eina_Bool legacy_type : 1;
149 Eina_Bool skip_head : 1; 149 Eina_Bool skip_head : 1;
150 Eina_Bool can_scanout : 1; 150 Eina_Bool can_scanout : 1;
151 Eina_Bool plane_status : 1;
151}; 152};
152 153
153/* shared functions between legacy and new eo classes */ 154/* shared functions between legacy and new eo classes */
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index cd11d54914..7834ce087e 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -55,6 +55,7 @@ static void evas_object_image_render_prepare(Evas_Object *obj, Evas_Obje
55static void evas_object_image_filled_resize_listener(void *data, Evas *eo_e, Evas_Object *eo_obj, void *einfo); 55static void evas_object_image_filled_resize_listener(void *data, Evas *eo_e, Evas_Object *eo_obj, void *einfo);
56 56
57static int evas_object_image_is_on_plane(Evas_Object *obj EINA_UNUSED, Evas_Object_Protected_Data *pd EINA_UNUSED, void *type_private_data); 57static int evas_object_image_is_on_plane(Evas_Object *obj EINA_UNUSED, Evas_Object_Protected_Data *pd EINA_UNUSED, void *type_private_data);
58static int evas_object_image_plane_changed(Evas_Object *obj EINA_UNUSED, Evas_Object_Protected_Data *pd EINA_UNUSED, void *type_private_data);
58static const Evas_Object_Func object_func = 59static const Evas_Object_Func object_func =
59{ 60{
60 /* methods (compulsory) */ 61 /* methods (compulsory) */
@@ -76,6 +77,7 @@ static const Evas_Object_Func object_func =
76 evas_object_image_can_map, 77 evas_object_image_can_map,
77 evas_object_image_render_prepare, // render_prepare 78 evas_object_image_render_prepare, // render_prepare
78 evas_object_image_is_on_plane, 79 evas_object_image_is_on_plane,
80 evas_object_image_plane_changed
79}; 81};
80 82
81static const Evas_Object_Image_Load_Opts default_load_opts = { 83static const Evas_Object_Image_Load_Opts default_load_opts = {
@@ -1753,6 +1755,21 @@ evas_object_image_is_on_plane(Evas_Object *obj EINA_UNUSED, Evas_Object_Protecte
1753 if (o->plane) return 1; 1755 if (o->plane) return 1;
1754 return 0; 1756 return 0;
1755} 1757}
1758
1759static int
1760evas_object_image_plane_changed(Evas_Object *obj EINA_UNUSED, Evas_Object_Protected_Data *pd EINA_UNUSED, void *type_private_data)
1761{
1762 Evas_Image_Data *o = type_private_data;
1763
1764 if (!!o->plane != o->plane_status)
1765 {
1766 o->plane_status = !!o->plane;
1767 return 1;
1768 }
1769
1770 return 0;
1771}
1772
1756static void 1773static void
1757evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *type_private_data, 1774evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *type_private_data,
1758 void *engine, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async) 1775 void *engine, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x
index 739a59b32d..c83c1a0bc6 100644
--- a/src/lib/evas/include/evas_inline.x
+++ b/src/lib/evas/include/evas_inline.x
@@ -126,6 +126,14 @@ evas_object_is_on_plane(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
126} 126}
127 127
128static inline int 128static inline int
129evas_object_plane_changed(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
130{
131 if (obj->func->plane_changed)
132 return obj->func->plane_changed(eo_obj, obj, obj->private_data);
133 return 0;
134}
135
136static inline int
129evas_event_freezes_through(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) 137evas_event_freezes_through(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
130{ 138{
131 if (obj->freeze_events) return 1; 139 if (obj->freeze_events) return 1;
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index db2498708a..76621161af 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1261,6 +1261,7 @@ struct _Evas_Object_Func
1261// from disk or uploading to texture etc. 1261// from disk or uploading to texture etc.
1262 void (*render_prepare) (Evas_Object *obj, Evas_Object_Protected_Data *pd, Eina_Bool do_async); 1262 void (*render_prepare) (Evas_Object *obj, Evas_Object_Protected_Data *pd, Eina_Bool do_async);
1263 int (*is_on_plane) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data); 1263 int (*is_on_plane) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
1264 int (*plane_changed) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
1264}; 1265};
1265 1266
1266struct _Evas_Func 1267struct _Evas_Func