1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only 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 QWAYLANDEGLWINDOW_H |
16 | #define QWAYLANDEGLWINDOW_H |
17 | |
18 | #include <QtWaylandClient/private/qwaylandwindow_p.h> |
19 | #include "qwaylandeglinclude_p.h" |
20 | #include "qwaylandeglclientbufferintegration_p.h" |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class QOpenGLFramebufferObject; |
25 | |
26 | namespace QtWaylandClient { |
27 | |
28 | class QWaylandGLContext; |
29 | |
30 | class Q_WAYLANDCLIENT_EXPORT QWaylandEglWindow : public QWaylandWindow |
31 | { |
32 | Q_OBJECT |
33 | public: |
34 | QWaylandEglWindow(QWindow *window, QWaylandDisplay *display); |
35 | ~QWaylandEglWindow(); |
36 | WindowType windowType() const override; |
37 | void ensureSize() override; |
38 | |
39 | void updateSurface(bool create); |
40 | void setGeometry(const QRect &rect) override; |
41 | QRect contentsRect() const; |
42 | |
43 | EGLSurface eglSurface() const; |
44 | GLuint contentFBO() const; |
45 | GLuint contentTexture() const; |
46 | bool needToUpdateContentFBO() const { return decoration() && (m_resize || !m_contentFBO); } |
47 | |
48 | QSurfaceFormat format() const override; |
49 | |
50 | void bindContentFBO(); |
51 | |
52 | void invalidateSurface() override; |
53 | |
54 | private: |
55 | QWaylandEglClientBufferIntegration *m_clientBufferIntegration = nullptr; |
56 | struct wl_egl_window *m_waylandEglWindow = nullptr; |
57 | |
58 | EGLSurface m_eglSurface = EGL_NO_SURFACE; |
59 | mutable bool m_resize = false; |
60 | mutable QOpenGLFramebufferObject *m_contentFBO = nullptr; |
61 | |
62 | QSurfaceFormat m_format; |
63 | QSize m_requestedSize; |
64 | }; |
65 | |
66 | } |
67 | |
68 | QT_END_NAMESPACE |
69 | |
70 | #endif // QWAYLANDEGLWINDOW_H |
71 |