evas_object: Add function to test if hardware plane status changed
authorDerek Foreman <derek.foreman.samsung@gmail.com>
Mon, 22 Oct 2018 15:22:26 +0000 (10:22 -0500)
committerWonki Kim <wonki_.kim@samsung.com>
Tue, 18 Dec 2018 04:20:08 +0000 (13:20 +0900)
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

src/lib/evas/canvas/evas_image_private.h
src/lib/evas/canvas/evas_object_image.c
src/lib/evas/include/evas_inline.x
src/lib/evas/include/evas_private.h

index 9ba1303..0abb387 100755 (executable)
@@ -156,6 +156,7 @@ struct _Evas_Image_Data
    Eina_Bool         legacy_type : 1;
    Eina_Bool         skip_head : 1;
    Eina_Bool         can_scanout : 1;
+   Eina_Bool         plane_status : 1;
 };
 
 /* shared functions between legacy and new eo classes */
index ec25d1d..7606c0c 100755 (executable)
@@ -55,6 +55,7 @@ static void         evas_object_image_render_prepare(Evas_Object *obj, Evas_Obje
 static void         evas_object_image_filled_resize_listener(void *data, Evas *eo_e, Evas_Object *eo_obj, void *einfo);
 
 static int          evas_object_image_is_on_plane(Evas_Object *obj EINA_UNUSED, Evas_Object_Protected_Data *pd EINA_UNUSED, void *type_private_data);
+static int          evas_object_image_plane_changed(Evas_Object *obj EINA_UNUSED, Evas_Object_Protected_Data *pd EINA_UNUSED, void *type_private_data);
 static const Evas_Object_Func object_func =
 {
    /* methods (compulsory) */
@@ -76,6 +77,7 @@ static const Evas_Object_Func object_func =
    evas_object_image_can_map,
    evas_object_image_render_prepare,   // render_prepare
    evas_object_image_is_on_plane,
+   evas_object_image_plane_changed
 };
 
 static const Evas_Object_Image_Load_Opts default_load_opts = {
@@ -1786,6 +1788,21 @@ evas_object_image_is_on_plane(Evas_Object *obj EINA_UNUSED, Evas_Object_Protecte
    if (o->plane) return 1;
    return 0;
 }
+
+static int
+evas_object_image_plane_changed(Evas_Object *obj EINA_UNUSED, Evas_Object_Protected_Data *pd EINA_UNUSED, void *type_private_data)
+{
+   Evas_Image_Data *o = type_private_data;
+
+   if (!!o->plane != o->plane_status)
+     {
+        o->plane_status = !!o->plane;
+        return 1;
+     }
+
+   return 0;
+}
+
 static void
 evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *type_private_data,
                          void *engine, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
index 739a59b..c83c1a0 100644 (file)
@@ -126,6 +126,14 @@ evas_object_is_on_plane(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
 }
 
 static inline int
+evas_object_plane_changed(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
+{
+   if (obj->func->plane_changed)
+     return obj->func->plane_changed(eo_obj, obj, obj->private_data);
+   return 0;
+}
+
+static inline int
 evas_event_freezes_through(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
 {
    if (obj->freeze_events) return 1;
index d319f3b..a16824f 100755 (executable)
@@ -1265,6 +1265,7 @@ struct _Evas_Object_Func
 // from disk or uploading to texture etc.
    void (*render_prepare) (Evas_Object *obj, Evas_Object_Protected_Data *pd, Eina_Bool do_async);
    int (*is_on_plane) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
+   int (*plane_changed) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
 };
 
 struct _Evas_Func