Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
waylandeglclientbufferintegration_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef WAYLANDEGLINTEGRATION_H
16#define WAYLANDEGLINTEGRATION_H
17
18#include <QtWaylandCompositor/private/qwlclientbufferintegration_p.h>
19#include <QtCore/QScopedPointer>
20#include <QtCore/QPointer>
21#include <QtWaylandCompositor/private/qwlclientbuffer_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class WaylandEglClientBufferIntegrationPrivate;
26
27class Q_WAYLANDCOMPOSITOR_EXPORT WaylandEglClientBufferIntegration : public QObject, public QtWayland::ClientBufferIntegration
28{
29 Q_DECLARE_PRIVATE(WaylandEglClientBufferIntegration)
30public:
31 WaylandEglClientBufferIntegration();
32 ~WaylandEglClientBufferIntegration() override;
33
34 void initializeHardware(struct ::wl_display *display) override;
35
36 QtWayland::ClientBuffer *createBufferFor(wl_resource *buffer) override;
37
38private:
39 Q_DISABLE_COPY(WaylandEglClientBufferIntegration)
40 QScopedPointer<WaylandEglClientBufferIntegrationPrivate> d_ptr;
41};
42
43struct BufferState;
44
45class Q_WAYLANDCOMPOSITOR_EXPORT WaylandEglClientBuffer : public QtWayland::ClientBuffer
46{
47public:
48 WaylandEglClientBuffer(WaylandEglClientBufferIntegration* integration, wl_resource *bufferResource);
49 ~WaylandEglClientBuffer() override;
50
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;
59
60private:
61 friend class WaylandEglClientBufferIntegration;
62 friend class WaylandEglClientBufferIntegrationPrivate;
63
64 BufferState *d = nullptr;
65 QPointer<WaylandEglClientBufferIntegration> m_integration;
66};
67
68QT_END_NAMESPACE
69
70#endif // WAYLANDEGLINTEGRATION_H
void handleEglstreamTexture(WaylandEglClientBuffer *buffer, wl_resource *bufferHandle)
static WaylandEglClientBufferIntegrationPrivate * get(WaylandEglClientBufferIntegration *integration)
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl_egl_image_target_texture_2d
void initEglTexture(WaylandEglClientBuffer *buffer, EGLint format)
bool initEglStream(WaylandEglClientBuffer *buffer, struct ::wl_resource *bufferHandle)
void registerBuffer(struct ::wl_resource *buffer, BufferState state)
void setupBufferAndCleanup(BufferState *bs, QOpenGLTexture *texture, int plane)
#define GL_TEXTURE_EXTERNAL_OES
QVarLengthArray< EGLImageKHR, 3 > egl_images
BufferState()=default
QMetaObject::Connection texturesAboutToBeDestroyedConnection[3]
QOpenGLContext * texturesContext[3]
static QOpenGLTexture::TextureFormat openGLFormatFromEglFormat(EGLint format)
#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_Y_INVERTED_WL
#define MYERRCODE(x)
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_WAYLAND_EGLSTREAM_WL
struct wl_resource * buffer
struct wl_resource EGLint attribute