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// Qt-Security score:significant reason:default
4
5//
6// W A R N I N G
7// -------------
8//
9// This file is not part of the Qt API. It exists purely as an
10// implementation detail. This header file may change from version to
11// version without notice, or even be removed.
12//
13// We mean it.
14//
15
16#ifndef WAYLANDEGLINTEGRATION_H
17#define WAYLANDEGLINTEGRATION_H
18
19#include <QtWaylandCompositor/private/qwlclientbufferintegration_p.h>
20#include <QtCore/QScopedPointer>
21#include <QtCore/QPointer>
22#include <QtWaylandCompositor/private/qwlclientbuffer_p.h>
23
24QT_BEGIN_NAMESPACE
25
26class WaylandEglClientBufferIntegrationPrivate;
27
28class Q_WAYLANDCOMPOSITOR_EXPORT WaylandEglClientBufferIntegration : public QObject, public QtWayland::ClientBufferIntegration
29{
30 Q_DECLARE_PRIVATE(WaylandEglClientBufferIntegration)
31public:
32 WaylandEglClientBufferIntegration();
33 ~WaylandEglClientBufferIntegration() override;
34
35 void initializeHardware(struct ::wl_display *display) override;
36
37 QtWayland::ClientBuffer *createBufferFor(wl_resource *buffer) override;
38
39private:
40 Q_DISABLE_COPY(WaylandEglClientBufferIntegration)
41 QScopedPointer<WaylandEglClientBufferIntegrationPrivate> d_ptr;
42};
43
44struct BufferState;
45
46class Q_WAYLANDCOMPOSITOR_EXPORT WaylandEglClientBuffer : public QtWayland::ClientBuffer
47{
48public:
49 WaylandEglClientBuffer(WaylandEglClientBufferIntegration* integration, wl_resource *bufferResource);
50 ~WaylandEglClientBuffer() override;
51
52 QWaylandBufferRef::BufferFormatEgl bufferFormatEgl() const override;
53 QSize size() const override;
54 QWaylandSurface::Origin origin() const override;
55 quintptr lockNativeBuffer() override;
56 void unlockNativeBuffer(quintptr native_buffer) const override;
57 QOpenGLTexture *toOpenGlTexture(int plane) override;
58 void setCommitted(QRegion &damage) override;
59 bool isProtected() override;
60
61private:
62 friend class WaylandEglClientBufferIntegration;
63 friend class WaylandEglClientBufferIntegrationPrivate;
64
65 BufferState *d = nullptr;
66 QPointer<WaylandEglClientBufferIntegration> m_integration;
67};
68
69QT_END_NAMESPACE
70
71#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