4#ifndef DRMEGLSERVERBUFFERINTEGRATION_H
5#define DRMEGLSERVERBUFFERINTEGRATION_H
7#include <QtWaylandClient/private/qwayland-wayland.h>
8#include <QtCore/QVariant>
9#include "qwayland-drm-egl-server-buffer.h"
10#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
13#include <QtWaylandClient/private/qwaylanddisplay_p.h>
14#include <QtCore/QTextStream>
17#include <EGL/eglext.h>
19typedef void *EGLImageKHR;
20typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer,
const EGLint *attrib_list);
21typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
24#ifndef GL_OES_EGL_image
43 QOpenGLTexture *m_texture =
nullptr;
55 inline EGLImageKHR
eglCreateImageKHR(EGLContext ctx, EGLenum target, EGLClientBuffer buffer,
const EGLint *attrib_list);
62 const QString &interface, uint32_t version);
65 PFNEGLCREATEIMAGEKHRPROC m_egl_create_image;
66 PFNEGLDESTROYIMAGEKHRPROC m_egl_destroy_image;
67 PFNGLEGLIMAGETARGETTEXTURE2DOESPROC m_gl_egl_image_target_texture;
68 QWaylandDisplay *m_display =
nullptr;
69 EGLDisplay m_egl_display = EGL_NO_DISPLAY;
70 bool m_egl_initialized =
false;
75 if (!m_egl_initialized)
77 if (!m_egl_create_image) {
78 qWarning(
"DrmEglServerBufferIntegration: Trying to used unresolved function eglCreateImageKHR");
79 return EGL_NO_IMAGE_KHR;
81 return m_egl_create_image(m_egl_display, ctx, target, buffer,attrib_list);
86 if (!m_egl_destroy_image) {
87 qWarning(
"DrmEglServerBufferIntegration: Trying to use unresolved function eglDestroyImageKHR");
90 return m_egl_destroy_image(m_egl_display, image);
95 if (!m_gl_egl_image_target_texture) {
96 qWarning(
"DrmEglServerBufferIntegration: Trying to use unresolved function glEGLImageTargetRenderbufferStorageOES");
99 m_gl_egl_image_target_texture(target,image);
void initialize(QWaylandDisplay *display) override
void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
EGLImageKHR eglCreateImageKHR(EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
EGLBoolean eglDestroyImageKHR(EGLImageKHR image)
QOpenGLTexture * toOpenGlTexture() override
DrmServerBuffer(DrmEglServerBufferIntegration *integration, int32_t name, int32_t width, int32_t height, int32_t stride, int32_t format)
~DrmServerBuffer() override
Combined button and popup list for selecting options.