diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h index 614fef9334..c740439d31 100644 --- a/src/lib/evas/Evas_GL.h +++ b/src/lib/evas/Evas_GL.h @@ -5117,8 +5117,9 @@ typedef unsigned long long EvasGLTime; * Version 4: [version 3] + GLES3.0 + GLES3.0 extensions * Version 5: [version 4] + GLES3.1 * Version 6: [version 5] + GLES3.2 + * Version 7: [version 7] + query formats + modifiers */ -#define EVAS_GL_API_VERSION 6 +#define EVAS_GL_API_VERSION 7 /** * @brief The Evas GL API @@ -6106,6 +6107,25 @@ EvasGLImage *img = glapi->evasglCreateImageForContext * new APIs here, please bump the struct version number (together with * the EFL version bump). */ + + /** + * @name Evas GL Wayland functions + * + * Evas_GL_API version 7 or higher. + * + * @since 1.26 + * @{ */ + /** + * @anchor evasglQueryDmaBufFormats + * @brief Direct map to eglQueryDmaBufFormatsEXT + */ + Eina_Bool (*evasglQueryDmaBufFormats) (Evas_GL *evas_gl, int max_formats, int *formats, int *num_formats); + /** + * @anchor evasglQueryDmaBufModifiers + * @brief RDirect map to eglQueryDmaBufModifiersEXT + */ + Eina_Bool (*evasglQueryDmaBufModifiers) (Evas_GL *evas_gl, int format, int max_modifiers, uint64_t *modifiers, Eina_Bool *external_only, int *num_modifiers); + /** @} */ }; /** diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c index 11e76eed8b..1d47f98214 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c @@ -414,6 +414,24 @@ _evgl_evasglQueryWaylandBuffer(Evas_GL *evas_gl, return EXT_FUNC_EGL(eglQueryWaylandBufferWL)(dpy, buffer, attribute, value); } +static Eina_Bool +_evgl_evasglQueryDmaBufFormats(Evas_GL *evas_gl, + int max_formats, int *formats, int *num_formats) +{ + EGLDisplay dpy = EGLDISPLAY_GET(evas_gl); + if (!dpy) return EINA_FALSE; + return EXT_FUNC_EGL(eglQueryDmaBufFormatsEXT)(dpy, max_formats, formats, num_formats); +} + +static Eina_Bool +_evgl_evasglQueryDmaBufModifiers(Evas_GL *evas_gl, + int format, int max_modifiers, uint64_t *modifiers, Eina_Bool *external_only, int *num_modifiers) +{ + EGLDisplay dpy = EGLDISPLAY_GET(evas_gl); + if (!dpy) return EINA_FALSE; + return EXT_FUNC_EGL(eglQueryDmaBufModifiersEXT)(dpy, format, max_modifiers, modifiers, external_only, num_modifiers); +} + #else #endif diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h index 581dd6c3b3..3a5afcbdfc 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h @@ -1675,6 +1675,25 @@ _EVASGL_EXT_BEGIN(EGL_WL_bind_wayland_display) _EVASGL_EXT_END() +_EVASGL_EXT_BEGIN(EGL_EXT_image_dma_buf_import_modifiers) + + _EVASGL_EXT_DRVNAME(EGL_EXT_image_dma_buf_import_modifiers) + + _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLBoolean, eglQueryDmaBufFormatsEXT, (EGLDisplay dpy, int max_formats, int *formats, int *num_formats), (dpy, max_formats, formats, num_formats)) + _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglQueryDmaBufFormatsEXT") + _EVASGL_EXT_FUNCTION_PRIVATE_END() + _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLBoolean, eglQueryDmaBufModifiersEXT, (EGLDisplay dpy, int format, int max_modifiers, uint64_t *modifiers, Eina_Bool *external_only, int *num_modifiers), (dpy, format, max_modifiers, modifiers, external_only, num_modifiers)) + _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglQueryDmaBufModifiersEXT") + _EVASGL_EXT_FUNCTION_PRIVATE_END() + + _EVASGL_EXT_FUNCTION_BEGIN(Eina_Bool, evasglQueryDmaBufFormats, (Evas_GL *evas_gl, int max_formats, int *formats, int *num_formats), (evas_gl, max_formats, formats, num_formats)) + _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglQueryDmaBufFormats) + _EVASGL_EXT_FUNCTION_END() + _EVASGL_EXT_FUNCTION_BEGIN(Eina_Bool, evasglQueryDmaBufModifiers, (Evas_GL *evas_gl, int format, int max_modifiers, uint64_t *modifiers, Eina_Bool *external_only, int *num_modifiers), (evas_gl, format, max_modifiers, modifiers, external_only, num_modifiers)) + _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglQueryDmaBufModifiers) + _EVASGL_EXT_FUNCTION_END() +_EVASGL_EXT_END() + #if 0 _EVASGL_EXT_BEGIN(EGL_SEC_map_image)