A connection to an EGL display. Only one connection per application instance is sufficient. More...
#include <display.h>
Public Member Functions | |
| Display () | |
| virtual | ~Display () |
| virtual bool | IsValid () const |
| virtual std::unique_ptr< Config > | ChooseConfig (ConfigDescriptor config) const |
Choose a config that most closely matches a given descriptor. If there are no matches, this method returns nullptr. | |
| virtual std::unique_ptr< Context > | CreateContext (const Config &config, const Context *share_context) |
Create a context with a supported config. The supported config can be obtained via a successful call to ChooseConfig. | |
| virtual std::unique_ptr< Surface > | CreateWindowSurface (const Config &config, EGLNativeWindowType window) |
| Create a window surface. The window is an opaque pointer whose value value is platform specific. For instance, ANativeWindow on Android. | |
| virtual std::unique_ptr< Surface > | CreatePixelBufferSurface (const Config &config, size_t width, size_t height) |
| Create an offscreen pixelbuffer surface. These are of limited use except in the context where applications need to render to a texture in an offscreen context. In such cases, a 1x1 pixel buffer surface is created to obtain a surface that can be used to make the context current on the background thread. | |
| const EGLDisplay & | GetHandle () const |
A connection to an EGL display. Only one connection per application instance is sufficient.
The display connection is used to first choose a config from among the available, create a context from that config, and then use that context with a surface on one (and only one) thread at a time.
| impeller::egl::Display::Display | ( | ) |
Definition at line 16 of file display.cc.
References IMPELLER_LOG_EGL_ERROR.
|
virtual |
Definition at line 26 of file display.cc.
References IMPELLER_LOG_EGL_ERROR.
|
virtual |
Choose a config that most closely matches a given descriptor. If there are no matches, this method returns nullptr.
| [in] | config | The configuration |
nullptr otherwise. Definition at line 73 of file display.cc.
References impeller::egl::ConfigDescriptor::api, impeller::egl::ConfigDescriptor::color_format, impeller::egl::ConfigDescriptor::depth_bits, IMPELLER_LOG_EGL_ERROR, impeller::egl::kOpenGL, impeller::egl::kOpenGLES2, impeller::egl::kOpenGLES3, impeller::egl::kPBuffer, impeller::egl::kRGB565, impeller::egl::kRGBA8888, impeller::egl::kWindow, impeller::egl::ConfigDescriptor::samples, impeller::egl::ConfigDescriptor::stencil_bits, and impeller::egl::ConfigDescriptor::surface_type.
|
virtual |
Create a context with a supported config. The supported config can be obtained via a successful call to ChooseConfig.
| [in] | config | The configuration. |
| [in] | share_context | The share context. Context within the same share-group use the same handle table. The contexts should still only be used exclusively on each thread however. |
nullptr otherwise. Definition at line 38 of file display.cc.
References impeller::egl::Config::GetDescriptor(), impeller::egl::Config::GetHandle(), impeller::egl::Context::GetHandle(), IMPELLER_LOG_EGL_ERROR, impeller::egl::kOpenGL, impeller::egl::kOpenGLES2, and impeller::egl::kOpenGLES3.
|
virtual |
Create an offscreen pixelbuffer surface. These are of limited use except in the context where applications need to render to a texture in an offscreen context. In such cases, a 1x1 pixel buffer surface is created to obtain a surface that can be used to make the context current on the background thread.
| [in] | config | The configuration |
| [in] | width | The width |
| [in] | height | The height |
nullptr otherwise. Definition at line 188 of file display.cc.
References impeller::egl::Config::GetHandle(), height, IMPELLER_LOG_EGL_ERROR, surface, and width.
|
virtual |
Create a window surface. The window is an opaque pointer whose value value is platform specific. For instance, ANativeWindow on Android.
| [in] | config | A valid configuration. One can be obtained via ChooseConfig. |
| [in] | window | An opaque pointer to a platform specific window handle. |
nullptr otherwise. Definition at line 172 of file display.cc.
References impeller::egl::Config::GetHandle(), IMPELLER_LOG_EGL_ERROR, surface, and window.
| const EGLDisplay & impeller::egl::Display::GetHandle | ( | ) | const |
Definition at line 209 of file display.cc.
|
virtual |
Definition at line 34 of file display.cc.