Add EGL Surface backing store (#43683)

Allows using an EGL surface as a flutter backing store. Way more convenient for GBM than hacking gbm bo's into GL FBOs.

This resolves https://github.com/flutter/flutter/issues/58363

Currently, the embedder API assumes that the compositor (if it exists) will let flutter render into FBOs or Textures and then composite the whole thing onto the actual (EGL) window surface. I think this assumption is also documented a bit in https://github.com/flutter/flutter/issues/38466

However, in my case, I want let the hardware do the composition (using the linux KMS API), and render each flutter layer into it's own EGL surface.

It's possible to hack around this by creating your own GBM BOs, importing those as EGL images, then importing those as GL Render Buffers and attaching those to GL FBOs and that works (tested it). However, that's basically reimplementing 50% of the whole GBM/EGL "window" system integration for no reason.

This PR adds:
1. To the embedder API:
   - a new kind of OpenGL Backing store: `FlutterOpenGLSurface`
     - consisting of just a `make_current` and destruction callback (plus userdata)
     - the make_current callback should make the target surface current, i.e. `eglMakeCurrent(..., surf, surf)`
     - will be called by the engine before rendering onto the backing store
2. Some wiring to call make_current before rendering into the backing store

## TODO:

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
19 files changed
tree: bb86d5219450afc8e9206b91c2ed3b07017cdd8b
  1. .github/
  2. .vscode/
  3. assets/
  4. benchmarking/
  5. bin/
  6. build/
  7. build_overrides/
  8. ci/
  9. common/
  10. display_list/
  11. docs/
  12. examples/
  13. flow/
  14. flutter_frontend_server/
  15. flutter_vma/
  16. fml/
  17. impeller/
  18. lib/
  19. runtime/
  20. shell/
  21. skia/
  22. sky/
  23. testing/
  24. third_party/
  25. tools/
  26. vulkan/
  27. wasm/
  28. web_sdk/
  29. .ci.yaml
  30. .clang-format
  31. .clang-tidy
  32. .clangd
  33. .engine-release.version
  34. .gitattributes
  35. .gitignore
  36. .pylintrc
  37. .style.yapf
  38. analysis_options.yaml
  39. AUTHORS
  40. BUILD.gn
  41. CODEOWNERS
  42. CONTRIBUTING.md
  43. DEPS
  44. Doxyfile
  45. LICENSE
  46. pubspec.yaml
  47. README.md
README.md

Flutter Engine

Flutter CI Status OpenSSF Scorecard SLSA 1

Flutter is Google's SDK for crafting beautiful, fast user experiences for mobile, web, and desktop from a single codebase. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.

The Flutter Engine is a portable runtime for hosting Flutter applications. It implements Flutter's core libraries, including animation and graphics, file and network I/O, accessibility support, plugin architecture, and a Dart runtime and compile toolchain. Most developers will interact with Flutter via the Flutter Framework, which provides a modern, reactive framework, and a rich set of platform, layout and foundation widgets.

If you want to run/contribute to Flutter Web engine, more tooling can be found at felt. This is a tool written to make web engine development experience easy.

If you are new to Flutter, then you will find more general information on the Flutter project, including tutorials and samples, on our Web site at Flutter.dev. For specific information about Flutter's APIs, consider our API reference which can be found at the docs.flutter.dev.

Flutter is a fully open source project, and we welcome contributions. Information on how to get started can be found at our contributor guide.