From: Juyeon Lee Date: Mon, 7 Jan 2019 00:37:02 +0000 (+0900) Subject: e_comp_object: add e_comp_object_native_usable_get() X-Git-Tag: submit/tizen/20190109.012349~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f452dc30ea521c615e6e186b6ef94ea7380d178;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: I976fa4662b7ba931d1ceba81ee8f4518171dbb21 --- diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index e0f7098721..6f08273608 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -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; +} diff --git a/src/bin/e_comp_object.h b/src/bin/e_comp_object.h index eb6a31c131..b13e8e945e 100644 --- a/src/bin/e_comp_object.h +++ b/src/bin/e_comp_object.h @@ -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