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 | #ifndef QXCBEGLINTEGRATION_H |
5 | #define QXCBEGLINTEGRATION_H |
6 | |
7 | #include "qxcbglintegration.h" |
8 | |
9 | #include "qxcbeglwindow.h" |
10 | |
11 | #include <QtGui/QOpenGLContext> |
12 | #include <qpa/qplatformopenglcontext.h> |
13 | #include <QtGui/qpa/qplatformscreen.h> |
14 | #include <QtGui/QScreen> |
15 | |
16 | #include "qxcbscreen.h" |
17 | |
18 | #include "qxcbeglinclude.h" |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | class QXcbEglNativeInterfaceHandler; |
23 | |
24 | class QXcbEglIntegration : public QXcbGlIntegration |
25 | , public QNativeInterface::Private::QEGLIntegration |
26 | { |
27 | public: |
28 | QXcbEglIntegration(); |
29 | ~QXcbEglIntegration(); |
30 | |
31 | bool initialize(QXcbConnection *connection) override; |
32 | |
33 | QXcbWindow *createWindow(QWindow *window) const override; |
34 | QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; |
35 | QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; |
36 | QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; |
37 | |
38 | bool supportsThreadedOpenGL() const override { return true; } |
39 | |
40 | EGLDisplay eglDisplay() const { return m_egl_display; } |
41 | |
42 | xcb_visualid_t getCompatibleVisualId(xcb_screen_t *screen, EGLConfig config) const; |
43 | private: |
44 | QXcbConnection *m_connection; |
45 | EGLDisplay m_egl_display; |
46 | |
47 | QScopedPointer<QXcbEglNativeInterfaceHandler> m_native_interface_handler; |
48 | }; |
49 | |
50 | QT_END_NAMESPACE |
51 | #endif //QXCBEGLINTEGRATION_H |
52 |