e_comp_object: add e_comp_object_native_usable_get() 30/197430/1 accepted/tizen/5.0/unified/20190115.173203 submit/tizen_5.0/20190114.085223
authorJuyeon Lee <juyeonne.lee@samsung.com>
Fri, 11 Jan 2019 06:52:04 +0000 (15:52 +0900)
committerJuyeon Lee <juyeonne.lee@samsung.com>
Fri, 11 Jan 2019 06:52:08 +0000 (15:52 +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: I8556401dfef907cde2b13839d94fc64bc0a18187

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

index 135b5ca15ed00b510674ea93281cdbce0115fb91..52b9c977af0b6415271061676e85b03bb256b398 100644 (file)
@@ -5755,3 +5755,31 @@ e_comp_object_map_update(Evas_Object *obj)
 
    evas_object_show(cw->map_input_obj);
 }
+
+
+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->pixmap, cw->ec);
+        return EINA_TRUE;
+     }
+
+   return EINA_FALSE;
+}
index e93381dd7ad6e208b4385c29803717d687dfe882..0ed68201e73f293a7611c414261d65c24c38d374 100644 (file)
@@ -181,6 +181,7 @@ 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);
 
+E_API Eina_Bool e_comp_object_native_usable_get(Evas_Object *obj);
 #endif
 #endif