mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Trying to use the `GL_BGRA8_EXT` format for the EGL surface backing store on *desktop* OpenGL platforms would fail at:82d8bc5844/shell/platform/embedder/embedder.cc (L869)This seems to be a known issue and both the Linux and Windows embedders have some logic to pick a different format depending on the OpenGL context information:bc8c82d157/shell/platform/windows/compositor_opengl.cc (L23-L34)bc8c82d157/shell/platform/linux/fl_framebuffer.cc (L81-L104)This pull-request gets rid of the hard-coded `GL_BGRA8_EXT` format and makes it configurable by adding a `format` field to the `FlutterOpenGLSurface` struct. _Disclaimer_: This has only been tested on desktop Linux (Wayland) using the `GR_GL_RGBA8` format which seemed to work as expected. This change is related to the recently introduced EGL surface backing store: https://github.com/flutter/flutter/issues/58363 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style