forked from enlightenment/enlightenment
Add e_pixmap API for testing if a pixmap is a native surface
DMAbuf for wayland will complicate determining whether a pixmap can use a native surface or not, so we add an API here to check this. Note that this doesn't take compositor capabilities into account - for example, X pixmaps need GL enabled to use native surfaces. This is already tested elsewhere.
This commit is contained in:
parent
91d16899b1
commit
1774b59923
|
@ -667,6 +667,22 @@ e_pixmap_parent_window_get(E_Pixmap *cp)
|
||||||
return cp->parent;
|
return cp->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
E_API Eina_Bool
|
||||||
|
e_pixmap_is_pixels(E_Pixmap *cp)
|
||||||
|
{
|
||||||
|
switch (cp->type)
|
||||||
|
{
|
||||||
|
case E_PIXMAP_TYPE_X:
|
||||||
|
return EINA_FALSE;
|
||||||
|
case E_PIXMAP_TYPE_WL:
|
||||||
|
if (!cp->buffer) return EINA_TRUE;
|
||||||
|
if (cp->buffer->shm_buffer) return EINA_TRUE;
|
||||||
|
return EINA_FALSE;
|
||||||
|
default:
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
E_API Eina_Bool
|
E_API Eina_Bool
|
||||||
e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns)
|
e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,6 +38,7 @@ E_API E_Pixmap *e_pixmap_find(E_Pixmap_Type type, ...);
|
||||||
E_API E_Client *e_pixmap_find_client(E_Pixmap_Type type, ...);
|
E_API E_Client *e_pixmap_find_client(E_Pixmap_Type type, ...);
|
||||||
E_API int64_t e_pixmap_window_get(E_Pixmap *cp);
|
E_API int64_t e_pixmap_window_get(E_Pixmap *cp);
|
||||||
E_API Ecore_Window e_pixmap_parent_window_get(E_Pixmap *cp);
|
E_API Ecore_Window e_pixmap_parent_window_get(E_Pixmap *cp);
|
||||||
|
E_API Eina_Bool e_pixmap_is_pixels(E_Pixmap *cp);
|
||||||
E_API Eina_Bool e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns);
|
E_API Eina_Bool e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns);
|
||||||
E_API void e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache);
|
E_API void e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache);
|
||||||
E_API Eina_Bool e_pixmap_image_refresh(E_Pixmap *cp);
|
E_API Eina_Bool e_pixmap_image_refresh(E_Pixmap *cp);
|
||||||
|
|
Loading…
Reference in New Issue