Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qxcbeglwindow.cpp
Go to the documentation of this file.
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#include "qxcbeglwindow.h"
5
7
8#include <QtGui/private/qeglconvenience_p.h>
9
10#ifndef EGL_EXT_platform_base
11typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list);
12#endif
13
15
18 , m_glIntegration(glIntegration)
19 , m_config(nullptr)
20 , m_surface(EGL_NO_SURFACE)
21{
22}
23
25{
26 eglDestroySurface(m_glIntegration->eglDisplay(), m_surface);
27}
28
30{
31 m_config = q_configFromGLFormat(m_glIntegration->eglDisplay(), format);
32 m_format = q_glFormatFromConfig(m_glIntegration->eglDisplay(), m_config, format);
33}
34
35const xcb_visualtype_t *QXcbEglWindow::createVisual()
36{
37 QXcbScreen *scr = xcbScreen();
38 if (!scr)
40
41 xcb_visualid_t id = m_glIntegration->getCompatibleVisualId(scr->screen(), m_config);
42 return scr->visualForId(id);
43}
44
46{
48
49 // this is always true without egl_x11
50 if (m_glIntegration->usingPlatformDisplay()) {
51 auto createPlatformWindowSurface = reinterpret_cast<PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC>(
52 eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"));
53 m_surface = createPlatformWindowSurface(m_glIntegration->eglDisplay(),
54 m_config,
55 reinterpret_cast<void *>(&m_window),
56 nullptr);
57 return;
58 }
59
60#if QT_CONFIG(egl_x11)
61 m_surface = eglCreateWindowSurface(m_glIntegration->eglDisplay(), m_config, m_window, nullptr);
62#endif
63}
64
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
\inmodule QtGui
Definition qwindow.h:63
bool usingPlatformDisplay() const
xcb_visualid_t getCompatibleVisualId(xcb_screen_t *screen, EGLConfig config) const
EGLDisplay eglDisplay() const
QXcbEglWindow(QWindow *window, QXcbEglIntegration *glIntegration)
void resolveFormat(const QSurfaceFormat &format) override
const xcb_visualtype_t * createVisual() override
void create() override
xcb_screen_t * screen() const
Definition qxcbscreen.h:152
const xcb_visualtype_t * visualForId(xcb_visualid_t visualid) const
xcb_window_t m_window
Definition qxcbwindow.h:214
virtual const xcb_visualtype_t * createVisual()
QSurfaceFormat m_format
Definition qxcbwindow.h:236
QXcbScreen * xcbScreen() const
virtual void create()
Combined button and popup list for selecting options.
EGLConfig q_configFromGLFormat(EGLDisplay display, const QSurfaceFormat &format, bool highestPixelFormat, int surfaceType)
QSurfaceFormat q_glFormatFromConfig(EGLDisplay display, const EGLConfig config, const QSurfaceFormat &referenceFormat)
typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform
GLint GLsizei GLsizei GLenum format
EGLConfig config
EGLConfig void * native_window
typedef EGLSurface(EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)(EGLDisplay dpy
EGLConfig void const EGLint * attrib_list
QObject::connect nullptr
aWidget window() -> setWindowTitle("New Window Title")
[2]