diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2016-04-29 11:16:49 -0500 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2016-05-18 12:05:33 -0500 |
commit | 1774b5992396f9067c94afa256982ac78fcafd49 (patch) | |
tree | 07699bddb81e14d1d9acedd0feed216e831bd11c | |
parent | 91d16899b1f448c3909a879698b3354d22bfec73 (diff) | |
download | enlightenment-1774b5992396f9067c94afa256982ac78fcafd49.tar.gz |
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.
-rw-r--r-- | src/bin/e_pixmap.c | 16 | ||||
-rw-r--r-- | src/bin/e_pixmap.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index 2bd94a77fb..0a77df0093 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -668,6 +668,22 @@ e_pixmap_parent_window_get(E_Pixmap *cp) } 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_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns) { Eina_Bool ret = EINA_FALSE; diff --git a/src/bin/e_pixmap.h b/src/bin/e_pixmap.h index 8370efe340..cdd1f18af7 100644 --- a/src/bin/e_pixmap.h +++ b/src/bin/e_pixmap.h @@ -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 int64_t e_pixmap_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 void e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache); E_API Eina_Bool e_pixmap_image_refresh(E_Pixmap *cp); |