15#ifndef WAYLANDEGLINTEGRATION_H
16#define WAYLANDEGLINTEGRATION_H
18#include <QtWaylandCompositor/private/qwlclientbufferintegration_p.h>
19#include <QtCore/QScopedPointer>
20#include <QtCore/QPointer>
21#include <QtWaylandCompositor/private/qwlclientbuffer_p.h>
25class WaylandEglClientBufferIntegrationPrivate;
29 Q_DECLARE_PRIVATE(WaylandEglClientBufferIntegration)
31 WaylandEglClientBufferIntegration();
32 ~WaylandEglClientBufferIntegration() override;
34 void initializeHardware(
struct ::wl_display *display) override;
36 QtWayland::ClientBuffer *createBufferFor(wl_resource *buffer) override;
39 Q_DISABLE_COPY(WaylandEglClientBufferIntegration)
40 QScopedPointer<WaylandEglClientBufferIntegrationPrivate> d_ptr;
48 WaylandEglClientBuffer(WaylandEglClientBufferIntegration* integration, wl_resource *bufferResource);
49 ~WaylandEglClientBuffer() override;
51 QWaylandBufferRef::BufferFormatEgl bufferFormatEgl()
const override;
52 QSize size()
const override;
53 QWaylandSurface::Origin origin()
const override;
54 quintptr lockNativeBuffer() override;
55 void unlockNativeBuffer(quintptr native_buffer)
const override;
56 QOpenGLTexture *toOpenGlTexture(
int plane) override;
57 void setCommitted(QRegion &damage) override;
58 bool isProtected() override;
61 friend class WaylandEglClientBufferIntegration;
62 friend class WaylandEglClientBufferIntegrationPrivate;
64 BufferState *d =
nullptr;
65 QPointer<WaylandEglClientBufferIntegration> m_integration;
void handleEglstreamTexture(WaylandEglClientBuffer *buffer, wl_resource *bufferHandle)
QOpenGLContext * localContext
static WaylandEglClientBufferIntegrationPrivate * get(WaylandEglClientBufferIntegration *integration)
PFNEGLCREATEIMAGEKHRPROC egl_create_image
PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl_egl_image_target_texture_2d
void initEglTexture(WaylandEglClientBuffer *buffer, EGLint format)
bool initEglStream(WaylandEglClientBuffer *buffer, struct ::wl_resource *bufferHandle)
PFNEGLUNBINDWAYLANDDISPLAYWL egl_unbind_wayland_display
QOffscreenSurface * offscreenSurface
void initBuffer(WaylandEglClientBuffer *buffer)
void registerBuffer(struct ::wl_resource *buffer, BufferState state)
void setupBufferAndCleanup(BufferState *bs, QOpenGLTexture *texture, int plane)
PFNEGLBINDWAYLANDDISPLAYWL egl_bind_wayland_display
WaylandEglClientBufferIntegrationPrivate()
QEGLStreamConvenience * funcs
PFNEGLQUERYWAYLANDBUFFERWL_compat egl_query_wayland_buffer
#define GL_TEXTURE_EXTERNAL_OES
QVarLengthArray< EGLImageKHR, 3 > egl_images
QMetaObject::Connection texturesAboutToBeDestroyedConnection[3]
QOpenGLContext * texturesContext[3]
QOpenGLTexture * textures[3]
static QOpenGLTexture::TextureFormat openGLFormatFromEglFormat(EGLint format)
#define EGL_TEXTURE_Y_U_V_WL
#define EGL_TEXTURE_EXTERNAL_WL
typedef void(GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)(GLenum target
struct wl_resource EGLint EGLint * value
EGLContext EGLenum EGLClientBuffer const EGLint * attrib_list
typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL_compat)(EGLDisplay dpy
#define EGL_WAYLAND_BUFFER_WL
#define EGL_TEXTURE_Y_XUXV_WL
#define EGL_WAYLAND_Y_INVERTED_WL
#define EGL_WAYLAND_PLANE_WL
typedef EGLImageKHR(EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC)(EGLDisplay dpy
static QT_BEGIN_NAMESPACE const char * egl_error_string(EGLint code)
static QWaylandBufferRef::BufferFormatEgl formatFromEglFormat(EGLint format)
#define EGL_TEXTURE_Y_UV_WL
#define EGL_WAYLAND_EGLSTREAM_WL
struct wl_resource * buffer
struct wl_resource EGLint attribute