From: jinbong.lee Date: Thu, 15 May 2025 11:43:07 +0000 (+0900) Subject: e_pixmap : add native_surface_init function X-Git-Tag: accepted/tizen/unified/20250520.164259~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bafe3b9502ca6da9dba047c577d165ff239e7c10;p=platform%2Fupstream%2Fenlightenment.git e_pixmap : add native_surface_init function Change-Id: I158557fa2ebba871f6e9454875a4a333a05a4f9c Signed-off-by: jinbong.lee --- diff --git a/src/bin/core/e_pixmap.c b/src/bin/core/e_pixmap.c index 85e2cf9734..af61cf1119 100644 --- a/src/bin/core/e_pixmap.c +++ b/src/bin/core/e_pixmap.c @@ -573,6 +573,38 @@ e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns) return ret; } +E_API bool +e_pixmap_view_native_surface_init(E_Pixmap *cp, E_View_Native_Surface *ns) +{ + Eina_Bool ret = EINA_FALSE; + + EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ns, EINA_FALSE); + EINA_SAFETY_ON_FALSE_RETURN_VAL(cp->type == E_PIXMAP_TYPE_WL, EINA_FALSE); + + ns->version = E_VIEW_NATIVE_SURFACE_VERSION; + if (cp->buffer && cp->buffer->type == E_COMP_WL_BUFFER_TYPE_NATIVE) + { + ns->type = E_VIEW_NATIVE_SURFACE_WL; + ns->data.wl.legacy_buffer = cp->buffer->resource; + ret = !cp->buffer->shm_buffer; + } + else if (cp->buffer && cp->buffer->type == E_COMP_WL_BUFFER_TYPE_TBM) + { + ns->type = E_VIEW_NATIVE_SURFACE_TBM; + ns->data.tbm.buffer = cp->buffer->tbm_surface; + if (cp->buffer->tbm_surface) + ret = EINA_TRUE; + } + else /* SHM buffer or VIDEO buffer */ + { + ns->type = E_VIEW_NATIVE_SURFACE_NONE; + ret = EINA_FALSE; + } + + return ret; +} + E_API void e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache) { diff --git a/src/include/e_pixmap.h b/src/include/e_pixmap.h index 300effcea3..2b8fe47348 100644 --- a/src/include/e_pixmap.h +++ b/src/include/e_pixmap.h @@ -7,6 +7,7 @@ extern "C" { #include #include +#include typedef struct _E_Pixmap E_Pixmap; typedef struct _E_Pixmap_Hook E_Pixmap_Hook; @@ -46,6 +47,7 @@ E_API E_Client *e_pixmap_find_client_by_res_id(uint32_t res_id); E_API uint32_t e_pixmap_res_id_get(E_Pixmap *cp); E_API uint64_t e_pixmap_window_get(E_Pixmap *cp); E_API Eina_Bool e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns); +E_API bool e_pixmap_view_native_surface_init(E_Pixmap *cp, E_View_Native_Surface *ns); E_API void e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache); E_API E_Pixmap_Hook *e_pixmap_hook_add(E_Pixmap_Hook_Point hookpoint, E_Pixmap_Hook_Cb func, const void *data);