EGL implementation of GlGraphicsContext. More...
#include <kanzi/platform/platform/gl/graphics_context/egl/egl_graphics_context.hpp>
Classes | |
| struct | ContextData |
| Context-specific data. More... | |
| struct | EglExtensionFlags |
| Represents support for EGL extensions. More... | |
| struct | EglInfo |
| EGL information. More... | |
| struct | SurfaceData |
| Surface-specific data. More... | |
| struct | ThreadData |
| Thread-specific data. More... | |
Protected Types | |
| using | ContextContainer |
| using | ContextNodePtr |
| using | SurfaceContainer |
| using | SurfaceNodePtr |
| using | ThreadContainer |
| using | ThreadNodePtr |
Protected Member Functions | |
| KZ_NO_DISCARD PresentMode | clampToSupportedPresentMode (PresentMode mode) noexcept |
| Clamps provided PresentMode to a supported subset. | |
| virtual KZ_NO_DISCARD unique_ptr< AbstractWindowSurface > | createDummySurface (EGLPBufferSurface &&pbuffer) noexcept |
| Creates the dummy surface wrapper used for surfaceless context fallback. | |
| virtual KZ_NO_DISCARD ContextNodePtr | createEGLContext (const EGLConfig &config, ::EGLContext parentContext) noexcept |
| Creates a new suitable context for provided config. | |
| virtual KZ_NO_DISCARD unique_ptr< AbstractWindowSurface > | createWindowSurface (NativeSurfaceHandle windowHandle, const EGLConfig &config, SurfaceColorSpace colorSpace) noexcept |
| Factory function to create window surface. | |
| virtual bool | destroySurfaceInternal (SurfaceNodePtr surfaceNode) noexcept |
| Destroys EGL surface. | |
| KZ_NO_DISCARD ContextNodePtr | ensureEGLContext (const EGLConfig &config, ::EGLContext parentContext) noexcept |
| Finds the context that renders surfaces of a config, or creates one. | |
| virtual KZ_NO_DISCARD ::EGLNativeDisplayType | fetchNativeDisplay (PlatformContext &platformContext) |
| Gets a native EGL display. | |
| KZ_NO_DISCARD ContextNodePtr | findLastUsedContext (thread::id threadId) noexcept |
| Finds last context that was used on a specified thread. | |
| KZ_NO_DISCARD const EGLDisplay & | getDisplay () const noexcept |
| Gets EGL display. | |
| KZ_NO_DISCARD const GLFunctionPointers & | getGlFunctionPointers () const noexcept |
| Gets GL function pointers struct. | |
| virtual KZ_NO_DISCARD flat_set< string_view > | getUndiscoverableEglExtensions () noexcept |
| Gets extensions that platform does not report support for, but are nevertheless supported. | |
| virtual KZ_NO_DISCARD GLFunctionPointers | loadGlFunctions () noexcept |
| Loads required GL function pointers. | |
| virtual bool | makeCurrentInternal (ContextNodePtr contextNode, SurfaceNodePtr surfaceNode) noexcept |
| Makes provided context and surface current on this thread. | |
| KZ_NO_DISCARD flat_set< string_view > | queryEglExtensions () const noexcept |
| Queries supported EGL extensions. | |
| KZ_NO_DISCARD flat_set< string_view > | queryGlExtensions () const noexcept |
| Queries supported GL extensions. | |
| virtual KZ_NO_DISCARD EGLConfig | selectEGLConfig (const SurfaceProperties &properties) noexcept |
| Selects EGL config based on provided surface properties. | |
| KZ_NO_DISCARD SurfaceColorSpace | selectSuitableColorSpace (const SurfaceProperties &properties) noexcept |
| Selects suitable colorspace for specified surface properties. | |
| void | setSwapInterval (SurfaceNodePtr surfaceNode, ContextNodePtr contextNode, ContextNodePtr lastUsedContextNode, PresentMode presentMode) noexcept |
| Sets swap interval for a specified surface, while preserving current EGL context and surface. | |
| virtual bool | setSwapIntervalForCurrentSurface (PresentMode mode) noexcept |
| Sets swap interval for current surface based on present mode. | |
| KZ_NO_DISCARD vector< EGLint > | surfaceColorSpaceToAttributes (SurfaceColorSpace colorSpace) noexcept |
| Constructs EGL attributes for a specified SurfaceColorSpace. | |
EGL implementation of GlGraphicsContext.
|
explicit |
Constructor.
| platform | Platform to use. |
| info | Initialization info struct. |
|
virtualdefault |
Destructor.
|
overridevirtual |
GlGraphicsContext::initialize() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::shutdown() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::swapBuffers() implementation.
Implements kanzi::platform::GlGraphicsContext.
Reimplemented in kanzi::platform::EglOhosGraphicsContext, and kanzi::platform::EglQnxStreamsGraphicsContext.
|
overridevirtual |
GlGraphicsContext::createThreadContext() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::destroyThreadContext() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::createSurface() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::destroySurface() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::getSurfaceProperties() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::getSurfaceGLContext() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::makeSurfaceCurrent() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::getCurrentSurfaceContext() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::getSurfaces() implementation.
Implements kanzi::platform::GlGraphicsContext.
GlGraphicsContext::getGLProcAddress() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::makeThreadCurrent() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::isFeatureEnabled() implementation.
Implements kanzi::platform::GlGraphicsContext.
|
overridevirtual |
GlGraphicsContext::updateSurfaceDimensions() implementation.
On Android, creates the EGL window surface again when its size differs from the new dimensions, because Android EGL implementations can acquire the next buffer when the previous one is swapped, at the size the window had then.
Reimplemented from kanzi::platform::GlGraphicsContext.
|
noexcept |
Provides basic information about current API backend.
|
protectednoexcept |
Clamps provided PresentMode to a supported subset.
| mode | Present mode to clamp. |
|
protectedvirtualnoexcept |
Sets swap interval for current surface based on present mode.
| mode | Present mode. |
Reimplemented in kanzi::platform::EglEmscriptenGraphicsContext, and kanzi::platform::EglQnxStreamsGraphicsContext.
|
protectednoexcept |
Finds the context that renders surfaces of a config, or creates one.
This is the root context when it can render the config. Otherwise, the surfaces of a config share a context, which is created for the first of them.
| config | EGL config. |
| parentContext | Context to share data with. |
|
protectedvirtualnoexcept |
Creates a new suitable context for provided config.
When EGL_KHR_no_config_context is supported, creates the context without a config, so that it can also render surfaces of other configs with the same client version.
| config | EGL config. |
| parentContext | Context to share data with. |
|
protectedvirtualnoexcept |
Destroys EGL surface.
| surfaceNode | Surface node to destroy. |
surfaceNode is a valid node.
|
protectedvirtualnoexcept |
|
protectednoexcept |
Selects suitable colorspace for specified surface properties.
| properties | Surface properties. |
|
protectednoexcept |
Finds last context that was used on a specified thread.
| threadId | Thread ID. |
|
protectednoexcept |
Constructs EGL attributes for a specified SurfaceColorSpace.
| colorSpace | Surface color space. |
|
protectedvirtualnoexcept |
Factory function to create window surface.
| windowHandle | Opaque platform specific window handle. |
| config | EGL config. |
| colorSpace | Surface color space. |
Reimplemented in kanzi::platform::EglQnxStreamsGraphicsContext.
|
protectedvirtualnoexcept |
Creates the dummy surface wrapper used for surfaceless context fallback.
| pbuffer | EGL pbuffer surface. |
Reimplemented in kanzi::platform::EglEmscriptenGraphicsContext, and kanzi::platform::EglQnxStreamsGraphicsContext.
|
protectednoexcept |
|
protectedvirtualnoexcept |
Selects EGL config based on provided surface properties.
| properties | Surface properties. |
Reimplemented in kanzi::platform::EglEmscriptenGraphicsContext, and kanzi::platform::EglQnxStreamsGraphicsContext.
|
protectedvirtualnoexcept |
Gets extensions that platform does not report support for, but are nevertheless supported.
Reimplemented in kanzi::platform::EglEmscriptenGraphicsContext.
|
protectedvirtualnoexcept |
Loads required GL function pointers.
Reimplemented in kanzi::platform::EglOhosGraphicsContext.
|
protectedvirtual |
Gets a native EGL display.
| platformContext | Platform context. |
Reimplemented in kanzi::platform::EglWaylandGraphicsContext, and kanzi::platform::EglX11GraphicsContext.
|
protectednoexcept |
Queries supported EGL extensions.
m_display is a valid display handle.
|
protectednoexcept |
Queries supported GL extensions.
m_glPointers.getIntegerv is a valid function pointer. m_glPointers.getStringi is a valid function pointer.
|
protectednoexcept |
Gets EGL display.
|
protectednoexcept |
Gets GL function pointers struct.