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
qxcbeglcontext.h
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// Qt-Security score:significant reason:default
4
5#pragma once
6
8#include <QtGui/private/qeglplatformcontext_p.h>
9#include <QtGui/private/qeglpbuffer_p.h>
10
12
14{
15public:
17 QXcbEglContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share, EGLDisplay display)
19 {
20 }
21
22 void swapBuffers(QPlatformSurface *surface) override
23 {
24 QEGLPlatformContext::swapBuffers(surface);
25 if (surface->surface()->surfaceClass() == QSurface::Window) {
26 QXcbWindow *platformWindow = static_cast<QXcbWindow *>(surface);
27 // OpenGL context might be bound to a non-gui thread use QueuedConnection to sync
28 // the window from the platformWindow's thread as QXcbWindow is no QObject, an
29 // event is sent to QXcbConnection. (this is faster than a metacall)
30 if (platformWindow->needsSync())
31 platformWindow->postSyncWindowRequest();
32 }
33 }
34
35 bool makeCurrent(QPlatformSurface *surface) override
36 {
37 return QEGLPlatformContext::makeCurrent(surface);
38 }
39
41 {
42 QEGLPlatformContext::doneCurrent();
43 }
44
45 EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override
46 {
47 if (surface->surface()->surfaceClass() == QSurface::Window)
48 return static_cast<QXcbEglWindow *>(surface)->eglSurface();
49 else
50 return static_cast<QEGLPbuffer *>(surface)->pbuffer();
51 }
52};
53
54QT_END_NAMESPACE
EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override
QXcbEglContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share, EGLDisplay display)
bool makeCurrent(QPlatformSurface *surface) override
void swapBuffers(QPlatformSurface *surface) override
Reimplement in subclass to native swap buffers calls.
void doneCurrent() override
QOpenGLContext * createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override
bool supportsThreadedOpenGL() const override
QPlatformOffscreenSurface * createPlatformOffscreenSurface(QOffscreenSurface *surface) const override
QXcbWindow * createWindow(QWindow *window) const override
bool usingPlatformDisplay() const
bool initialize(QXcbConnection *connection) override
xcb_visualid_t getCompatibleVisualId(xcb_screen_t *screen, EGLConfig config) const
EGLDisplay eglDisplay() const
QPlatformOpenGLContext * createPlatformOpenGLContext(QOpenGLContext *context) const override
QXcbEglWindow(QWindow *window, QXcbEglIntegration *glIntegration)
void resolveFormat(const QSurfaceFormat &format) override
EGLSurface eglSurface() const
const xcb_visualtype_t * createVisual() override
void create() override
QXcbEglIntegration * glIntegration() const
int antialiasingEnabled() const
Definition qxcbscreen.h:67
xcb_colormap_t colormapForVisual(xcb_visualid_t) const
QFontEngine::SubpixelAntialiasingType subpixelType() const
Definition qxcbscreen.h:66
QFontEngine::HintStyle hintStyle() const
Definition qxcbscreen.h:65
bool compositingActive() const
void addScreen(QPlatformScreen *s)
int forcedDpi() const
Definition qxcbscreen.h:64
const xcb_visualtype_t * visualForId(xcb_visualid_t) const
xcb_window_t root() const
Definition qxcbscreen.h:43
QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number)
void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event)
handle the XCB screen change event and update properties
const xcb_visualtype_t * visualForFormat(const QSurfaceFormat &format) const
QSize physicalSize() const
Definition qxcbscreen.h:41
quint8 depthOfVisual(xcb_visualid_t) const
int number() const
Definition qxcbscreen.h:39
QXcbXSettings * xSettings() const
QList< QPlatformScreen * > screens() const
Definition qxcbscreen.h:46
void setScreens(QList< QPlatformScreen * > &&sl)
Definition qxcbscreen.h:47
void subscribeToXFixesSelectionNotify()
void setPrimaryScreen(QPlatformScreen *s)
void removeScreen(QPlatformScreen *s)
Definition qxcbscreen.h:48
QRect availableGeometry(const QRect &screenGeometry) const
void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event)
QSize size() const
Definition qxcbscreen.h:40
QXcbScreen * screenAt(const QPoint &pos) const
QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const
QString windowManagerName() const
Definition qxcbscreen.h:69
xcb_screen_t * screen() const
Definition qxcbscreen.h:38
std::optional< VisualInfo > getVisualInfo(xcb_screen_t *screen, std::optional< xcb_visualid_t > requestedVisualId, std::optional< uint8_t > requestedDepth=std::nullopt)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2568
#define Q_XCB_EXPORT
Definition qxcbexport.h:14