From: Juyeon Lee Date: Fri, 11 Jan 2019 06:52:04 +0000 (+0900) Subject: e_comp_object: add e_comp_object_native_usable_get() X-Git-Tag: submit/tizen_5.0/20190114.085223^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=827f82e29fe4324f4cb24bc5b0b0036e5acf7c8c;p=platform%2Fupstream%2Fenlightenment.git e_comp_object: add e_comp_object_native_usable_get() 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 --- diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index 135b5ca15e..52b9c977af 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -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; +} diff --git a/src/bin/e_comp_object.h b/src/bin/e_comp_object.h index e93381dd7a..0ed68201e7 100644 --- a/src/bin/e_comp_object.h +++ b/src/bin/e_comp_object.h @@ -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