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
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
4#ifndef QXCBEGLCONTEXT_H
5#define QXCBEGLCONTEXT_H
6
7#include "qxcbeglwindow.h"
8#include <QtGui/private/qeglplatformcontext_p.h>
9#include <QtGui/private/qeglpbuffer_p.h>
10
12
14{
15public:
18 : QEGLPlatformContext(glFormat, share, display, nullptr)
19 {
20 }
21
22 void swapBuffers(QPlatformSurface *surface) override
23 {
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 {
38 }
39
40 void doneCurrent() override
41 {
43 }
44
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
55#endif //QXCBEGLCONTEXT_H
56
A pbuffer-based implementation of QPlatformOffscreenSurface for EGL.
An EGL context implementation.
void swapBuffers(QPlatformSurface *surface) override
Reimplement in subclass to native swap buffers calls.
bool makeCurrent(QPlatformSurface *surface) override
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
The QPlatformSurface class provides an abstraction for a surface.
QSurface * surface() const
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
SurfaceClass surfaceClass() const
Returns the surface class of this surface.
Definition qsurface.cpp:121
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
void postSyncWindowRequest()
bool needsSync() const
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
typedef EGLSurface(EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy
typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform
QObject::connect nullptr