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
QEGLPlatformContext Class Referenceabstract

An EGL context implementation. More...

#include <qeglplatformcontext_p.h>

+ Inheritance diagram for QEGLPlatformContext:
+ Collaboration diagram for QEGLPlatformContext:

Public Types

enum  Flag { NoSurfaceless = 0x01 }
 

Public Member Functions

 QEGLPlatformContext (const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLConfig *config=nullptr, Flags flags={ })
 
 ~QEGLPlatformContext ()
 
void initialize () override
 Called after a new instance is constructed.
 
bool makeCurrent (QPlatformSurface *surface) override
 
void doneCurrent () override
 
void swapBuffers (QPlatformSurface *surface) override
 Reimplement in subclass to native swap buffers calls.
 
QFunctionPointer getProcAddress (const char *procName) override
 Reimplement in subclass to allow dynamic querying of OpenGL symbols.
 
QSurfaceFormat format () const override
 
bool isSharing () const override
 
bool isValid () const override
 
EGLContext nativeContext () const override
 
EGLConfig config () const override
 
EGLDisplay display () const override
 
virtual void invalidateContext () override
 
EGLContext eglContext () const
 
EGLDisplay eglDisplay () const
 
EGLConfig eglConfig () const
 
- Public Member Functions inherited from QPlatformOpenGLContext
 QPlatformOpenGLContext ()
 
virtual ~QPlatformOpenGLContext ()
 
virtual GLuint defaultFramebufferObject (QPlatformSurface *surface) const
 Reimplement in subclass if your platform uses framebuffer objects for surfaces.
 
virtual void beginFrame ()
 Called when the RHI begins rendering a new frame in the context.
 
virtual void endFrame ()
 Called when the RHI ends rendering a in the context.
 
QOpenGLContextcontext () const
 

Static Public Member Functions

template<typename T >
static QOpenGLContextcreateFrom (EGLContext context, EGLDisplay contextDisplay, EGLDisplay platformDisplay, QOpenGLContext *shareContext)
 
- Static Public Member Functions inherited from QPlatformOpenGLContext
static bool parseOpenGLVersion (const QByteArray &versionString, int &major, int &minor)
 

Protected Member Functions

 QEGLPlatformContext ()
 
virtual EGLSurface eglSurfaceForPlatformSurface (QPlatformSurface *surface)=0
 
virtual EGLSurface createTemporaryOffscreenSurface ()
 
virtual void destroyTemporaryOffscreenSurface (EGLSurface surface)
 
virtual void runGLChecks ()
 

Detailed Description

An EGL context implementation.

Since
5.2

Implement QPlatformOpenGLContext using EGL. To use it in platform plugins a subclass must be created since eglSurfaceForPlatformSurface() has to be reimplemented. This function is used for mapping platform surfaces (windows) to EGL surfaces and is necessary since different platform plugins may have different ways of handling native windows (for example, a plugin may choose not to back every platform window by a real EGL surface). Other than that, no further customization is necessary.

Definition at line 27 of file qeglplatformcontext_p.h.

Member Enumeration Documentation

◆ Flag

Enumerator
NoSurfaceless 

Definition at line 31 of file qeglplatformcontext_p.h.

Constructor & Destructor Documentation

◆ QEGLPlatformContext() [1/2]

◆ ~QEGLPlatformContext()

QEGLPlatformContext::~QEGLPlatformContext ( )

Definition at line 388 of file qeglplatformcontext.cpp.

◆ QEGLPlatformContext() [2/2]

QEGLPlatformContext::QEGLPlatformContext ( )
inlineprotected

Definition at line 85 of file qeglplatformcontext_p.h.

Member Function Documentation

◆ config()

EGLConfig QEGLPlatformContext::config ( ) const
inlineoverride

Definition at line 75 of file qeglplatformcontext_p.h.

Referenced by QEGLPlatformContext().

+ Here is the caller graph for this function:

◆ createFrom()

template<typename T >
static QOpenGLContext * QEGLPlatformContext::createFrom ( EGLContext context,
EGLDisplay contextDisplay,
EGLDisplay platformDisplay,
QOpenGLContext * shareContext )
inlinestatic

Definition at line 40 of file qeglplatformcontext_p.h.

References context, QOpenGLContextPrivate::get(), QOpenGLContext::handle(), and qWarning.

+ Here is the call graph for this function:

◆ createTemporaryOffscreenSurface()

EGLSurface QEGLPlatformContext::createTemporaryOffscreenSurface ( )
protectedvirtual

Reimplemented in QEglFSContext, and QtWaylandClient::QWaylandGLContext.

Definition at line 241 of file qeglplatformcontext.cpp.

References q_configFromGLFormat().

Referenced by QEglFSContext::createTemporaryOffscreenSurface().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ destroyTemporaryOffscreenSurface()

void QEGLPlatformContext::destroyTemporaryOffscreenSurface ( EGLSurface surface)
protectedvirtual

Reimplemented in QEglFSContext, and QtWaylandClient::QWaylandGLContext.

Definition at line 259 of file qeglplatformcontext.cpp.

Referenced by QEglFSContext::destroyTemporaryOffscreenSurface().

+ Here is the caller graph for this function:

◆ display()

EGLDisplay QEGLPlatformContext::display ( ) const
inlineoverride

Definition at line 76 of file qeglplatformcontext_p.h.

◆ doneCurrent()

void QEGLPlatformContext::doneCurrent ( )
overridevirtual

Implements QPlatformOpenGLContext.

Reimplemented in QQnxGLContext, QXcbEglContext, and QtWaylandClient::QWaylandGLContext.

Definition at line 396 of file qeglplatformcontext.cpp.

References ok, and qWarning.

Referenced by QQnxGLContext::doneCurrent(), and QXcbEglContext::doneCurrent().

+ Here is the caller graph for this function:

◆ eglConfig()

EGLConfig QEGLPlatformContext::eglConfig ( ) const

Definition at line 833 of file qeglplatformcontext.cpp.

Referenced by QtWaylandClient::QWaylandGLContext::QWaylandGLContext(), QtWaylandClient::QWaylandGLContext::createTemporaryOffscreenSurface(), QAndroidPlatformOpenGLContext::eglSurfaceForPlatformSurface(), and QAndroidPlatformOpenGLContext::swapBuffers().

+ Here is the caller graph for this function:

◆ eglContext()

EGLContext QEGLPlatformContext::eglContext ( ) const

Definition at line 823 of file qeglplatformcontext.cpp.

Referenced by QtWaylandClient::QWaylandGLContext::QWaylandGLContext(), eglContextForContext(), and QtWaylandClient::QWaylandGLContext::makeCurrent().

+ Here is the caller graph for this function:

◆ eglDisplay()

◆ eglSurfaceForPlatformSurface()

virtual EGLSurface QEGLPlatformContext::eglSurfaceForPlatformSurface ( QPlatformSurface * surface)
protectedpure virtual

Implemented in QDirectFbEGLContext, QAndroidPlatformOpenGLContext, QEglFSContext, QMinimalEglContext, QQnxGLContext, QXcbEglContext, and QtWaylandClient::QWaylandGLContext.

Referenced by makeCurrent(), and swapBuffers().

+ Here is the caller graph for this function:

◆ format()

QSurfaceFormat QEGLPlatformContext::format ( ) const
overridevirtual

Implements QPlatformOpenGLContext.

Definition at line 818 of file qeglplatformcontext.cpp.

Referenced by QtWaylandClient::QWaylandGLContext::QWaylandGLContext(), QEglFSContext::createTemporaryOffscreenSurface(), and QtWaylandClient::QWaylandGLContext::swapBuffers().

+ Here is the caller graph for this function:

◆ getProcAddress()

QFunctionPointer QEGLPlatformContext::getProcAddress ( const char * procName)
overridevirtual

Reimplement in subclass to allow dynamic querying of OpenGL symbols.

As opposed to e.g. the wglGetProcAddress function on Windows, Qt expects this methods to be able to return valid function pointers even for standard OpenGL symbols.

Implements QPlatformOpenGLContext.

Reimplemented in QtWaylandClient::QWaylandGLContext.

Definition at line 415 of file qeglplatformcontext.cpp.

References i, and qstrcmp().

+ Here is the call graph for this function:

◆ initialize()

void QEGLPlatformContext::initialize ( )
overridevirtual

Called after a new instance is constructed.

The default implementation does nothing.

Subclasses can use this function to perform additional initialization that relies on virtual functions.

Reimplemented from QPlatformOpenGLContext.

Definition at line 233 of file qeglplatformcontext.cpp.

◆ invalidateContext()

virtual void QEGLPlatformContext::invalidateContext ( )
inlineoverridevirtual

Definition at line 78 of file qeglplatformcontext_p.h.

Referenced by QtWaylandClient::QWaylandGLContext::QWaylandGLContext().

+ Here is the caller graph for this function:

◆ isSharing()

bool QEGLPlatformContext::isSharing ( ) const
inlineoverridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 71 of file qeglplatformcontext_p.h.

◆ isValid()

bool QEGLPlatformContext::isValid ( ) const
inlineoverridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 72 of file qeglplatformcontext_p.h.

Referenced by QtWaylandClient::QWaylandGLContext::makeCurrent().

+ Here is the caller graph for this function:

◆ makeCurrent()

bool QEGLPlatformContext::makeCurrent ( QPlatformSurface * surface)
overridevirtual

Implements QPlatformOpenGLContext.

Reimplemented in QQnxGLContext, QXcbEglContext, and QtWaylandClient::QWaylandGLContext.

Definition at line 345 of file qeglplatformcontext.cpp.

References eglDisplay(), EGLSurface(), eglSurfaceForPlatformSurface(), QPlatformSurface::format(), ok, Q_ASSERT, qEnvironmentVariableIsSet(), qgetenv(), qWarning, QSurface::supportsOpenGL(), and QPlatformSurface::surface().

Referenced by QAndroidPlatformOpenGLContext::makeCurrent(), QQnxGLContext::makeCurrent(), QXcbEglContext::makeCurrent(), and QAndroidPlatformOpenGLContext::swapBuffers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nativeContext()

EGLContext QEGLPlatformContext::nativeContext ( ) const
inlineoverride

Definition at line 74 of file qeglplatformcontext_p.h.

◆ runGLChecks()

void QEGLPlatformContext::runGLChecks ( )
protectedvirtual

Reimplemented in QEglFSContext.

Definition at line 264 of file qeglplatformcontext.cpp.

◆ swapBuffers()

void QEGLPlatformContext::swapBuffers ( QPlatformSurface * surface)
overridevirtual

Reimplement in subclass to native swap buffers calls.

The implementation must support being called in a thread different than the gui-thread.

Implements QPlatformOpenGLContext.

Reimplemented in QQnxGLContext, QXcbEglContext, and QtWaylandClient::QWaylandGLContext.

Definition at line 404 of file qeglplatformcontext.cpp.

References EGLSurface(), eglSurfaceForPlatformSurface(), ok, and qWarning.

Referenced by QAndroidPlatformOpenGLContext::swapBuffers(), QEglFSContext::swapBuffers(), QQnxGLContext::swapBuffers(), and QXcbEglContext::swapBuffers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: