e_comp_object: add e_comp_object_native_usable_get() 63/196863/6
authorJuyeon Lee <juyeonne.lee@samsung.com>
Mon, 7 Jan 2019 00:37:02 +0000 (09:37 +0900)
committerJuyeon Lee <juyeonne.lee@samsung.com>
Tue, 8 Jan 2019 09:21:14 +0000 (18:21 +0900)
API e_comp_object_native_usable_get returns if cw->obj is drawable using ns
when a client attaching and committing NULL buffer, its pixmap is changed unusable
and at the same time, server make the client unmap and emit hide effect
to run hide effect, moudules can refer if a window still holds native surface
by using this api

Change-Id: I976fa4662b7ba931d1ceba81ee8f4518171dbb21

src/bin/e_comp_object.c
src/bin/e_comp_object.h

index e0f70987215a6861b9f2acbdde62722f24c9f974..6f08273608b2699b5aa8076fa472f8ddd1c10902 100644 (file)
@@ -5818,3 +5818,30 @@ e_comp_object_render_trace_set(Evas_Object *obj, Eina_Bool set)
 
    return EINA_TRUE;
 }
+
+E_API Eina_Bool
+e_comp_object_native_usable_get(Evas_Object *obj)
+{
+   API_ENTRY EINA_FALSE;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, EINA_FALSE);
+
+   if (cw->ec->input_only) return EINA_FALSE;
+   if (cw->external_content) return EINA_FALSE;
+   if (e_comp_object_content_type_get(cw->ec->frame) != E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE) return EINA_FALSE;
+
+   /* just return true value, if it is normal case */
+   if (e_pixmap_usable_get(cw->ec->pixmap)) return EINA_TRUE;
+
+   /* abnormal case */
+   Evas_Native_Surface *ns;
+   ns = evas_object_image_native_surface_get(cw->obj);
+
+   /* client pixmap is not usable but cw->obj is drawable due to it holds valid native surface*/
+   if (ns)
+     {
+        ELOGF("COMP", "Client pixmap is Not usable but still holds valid native surface", cw->ec);
+        return EINA_TRUE;
+     }
+
+   return EINA_FALSE;
+}
index eb6a31c131458b0ea1dbcd7ebb25e8f725f0750c..b13e8e945ee27a0e888d6fae2de982d5c5955b8f 100644 (file)
@@ -185,6 +185,8 @@ E_API void e_comp_object_indicator_size_set(Evas_Object *obj, int w, int h);
 E_API void e_comp_object_map_update(Evas_Object *obj);
 
 EINTERN Eina_Bool e_comp_object_render_trace_set(Evas_Object *obj, Eina_Bool set);
+
+E_API Eina_Bool e_comp_object_native_usable_get(Evas_Object *obj);
 #endif
 #endif