mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-07 05:55:58 +01:00
render/egl: make wlr_egl struct opaque
Compositors can use wlr_egl_create_with_context if they need a custom EGL display or context.
This commit is contained in:
parent
452a8ec940
commit
f954092f22
2 changed files with 42 additions and 40 deletions
|
@ -3,6 +3,47 @@
|
|||
|
||||
#include <wlr/render/egl.h>
|
||||
|
||||
struct wlr_egl {
|
||||
EGLDisplay display;
|
||||
EGLContext context;
|
||||
EGLDeviceEXT device; // may be EGL_NO_DEVICE_EXT
|
||||
struct gbm_device *gbm_device;
|
||||
|
||||
struct {
|
||||
// Display extensions
|
||||
bool KHR_image_base;
|
||||
bool EXT_image_dma_buf_import;
|
||||
bool EXT_image_dma_buf_import_modifiers;
|
||||
bool IMG_context_priority;
|
||||
|
||||
// Device extensions
|
||||
bool EXT_device_drm;
|
||||
bool EXT_device_drm_render_node;
|
||||
|
||||
// Client extensions
|
||||
bool EXT_device_query;
|
||||
bool KHR_platform_gbm;
|
||||
bool EXT_platform_device;
|
||||
} exts;
|
||||
|
||||
struct {
|
||||
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT;
|
||||
PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
|
||||
PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
|
||||
PFNEGLQUERYWAYLANDBUFFERWL eglQueryWaylandBufferWL;
|
||||
PFNEGLQUERYDMABUFFORMATSEXTPROC eglQueryDmaBufFormatsEXT;
|
||||
PFNEGLQUERYDMABUFMODIFIERSEXTPROC eglQueryDmaBufModifiersEXT;
|
||||
PFNEGLDEBUGMESSAGECONTROLKHRPROC eglDebugMessageControlKHR;
|
||||
PFNEGLQUERYDISPLAYATTRIBEXTPROC eglQueryDisplayAttribEXT;
|
||||
PFNEGLQUERYDEVICESTRINGEXTPROC eglQueryDeviceStringEXT;
|
||||
PFNEGLQUERYDEVICESEXTPROC eglQueryDevicesEXT;
|
||||
} procs;
|
||||
|
||||
bool has_modifiers;
|
||||
struct wlr_drm_format_set dmabuf_texture_formats;
|
||||
struct wlr_drm_format_set dmabuf_render_formats;
|
||||
};
|
||||
|
||||
struct wlr_egl_context {
|
||||
EGLDisplay display;
|
||||
EGLContext context;
|
||||
|
|
|
@ -26,46 +26,7 @@
|
|||
#include <wlr/render/dmabuf.h>
|
||||
#include <wlr/render/drm_format_set.h>
|
||||
|
||||
struct wlr_egl {
|
||||
EGLDisplay display;
|
||||
EGLContext context;
|
||||
EGLDeviceEXT device; // may be EGL_NO_DEVICE_EXT
|
||||
struct gbm_device *gbm_device;
|
||||
|
||||
struct {
|
||||
// Display extensions
|
||||
bool KHR_image_base;
|
||||
bool EXT_image_dma_buf_import;
|
||||
bool EXT_image_dma_buf_import_modifiers;
|
||||
bool IMG_context_priority;
|
||||
|
||||
// Device extensions
|
||||
bool EXT_device_drm;
|
||||
bool EXT_device_drm_render_node;
|
||||
|
||||
// Client extensions
|
||||
bool EXT_device_query;
|
||||
bool KHR_platform_gbm;
|
||||
bool EXT_platform_device;
|
||||
} exts;
|
||||
|
||||
struct {
|
||||
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT;
|
||||
PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
|
||||
PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
|
||||
PFNEGLQUERYWAYLANDBUFFERWL eglQueryWaylandBufferWL;
|
||||
PFNEGLQUERYDMABUFFORMATSEXTPROC eglQueryDmaBufFormatsEXT;
|
||||
PFNEGLQUERYDMABUFMODIFIERSEXTPROC eglQueryDmaBufModifiersEXT;
|
||||
PFNEGLDEBUGMESSAGECONTROLKHRPROC eglDebugMessageControlKHR;
|
||||
PFNEGLQUERYDISPLAYATTRIBEXTPROC eglQueryDisplayAttribEXT;
|
||||
PFNEGLQUERYDEVICESTRINGEXTPROC eglQueryDeviceStringEXT;
|
||||
PFNEGLQUERYDEVICESEXTPROC eglQueryDevicesEXT;
|
||||
} procs;
|
||||
|
||||
bool has_modifiers;
|
||||
struct wlr_drm_format_set dmabuf_texture_formats;
|
||||
struct wlr_drm_format_set dmabuf_render_formats;
|
||||
};
|
||||
struct wlr_egl;
|
||||
|
||||
struct wlr_egl *wlr_egl_create_with_context(EGLDisplay display,
|
||||
EGLContext context);
|
||||
|
|
Loading…
Reference in a new issue