Debian Codegraph @

src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h

raw
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 // Qt-Security score:significant reason:default
4
5 #pragma once
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 bool canCreatePlatformOffscreenSurface() const override;
38
39 bool supportsThreadedOpenGL() const override { return true; }
40
41 EGLDisplay eglDisplay() const { return m_egl_display; }
42
43 bool usingPlatformDisplay() const { return m_using_platform_display; }
44
45 xcb_visualid_t getCompatibleVisualId(xcb_screen_t *screen, EGLConfig config) const;
46 private:
47 QXcbConnection *m_connection;
48 EGLDisplay m_egl_display;
49 bool m_using_platform_display;
50
51 QScopedPointer<QXcbEglNativeInterfaceHandler> m_native_interface_handler;
52 };
53
54 QT_END_NAMESPACE