Valentin Hăloiu 18b9cd0233 Add format field to EGL surface backing store (flutter/engine#54499)
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
2024-09-27 00:23:13 +00:00
Languages
Dart 75%
C++ 16.5%
Objective-C++ 2.9%
Java 2.8%
Objective-C 0.7%
Other 1.9%