mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
# Original pull request description This introduces the `egl::Surface` and `egl::WindowSurface` types to abstract a raw `EGLSurface`. This also removes some - but not all - EGL surface logic out from `EGLManager`. Subsequent pull requests will be necessary to: 1. Move ownership of the `egl::WindowSurface` from `egl::Manager` to `FlutterWindowsView` 2. Refactor external texture's off-screen EGL surface to use `egl::Surface` Part of https://github.com/flutter/flutter/issues/141996 # Reland https://github.com/flutter/engine/pull/49983 was reverted as it introduced a crash if the render surface fails to be created even though EGL was initialized successfully. This pull request is split into the following commits: 1.c0b11be79fis the original pull request unchanged 2.1dc7813845is the fix: it checks a surface is valid before using it. This also adds several tests to prevent this kind of regression. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Windows Platform Embedder
This code is the glue between the Flutter engine and the Windows platform. It is responsible for:
- Launching the Flutter engine.
- Providing a view for the Flutter engine to render into.
- Dispatching events to the Flutter engine.
For more information on embedders, see the Flutter architectural overview.
Caution
This is a best effort attempt to document the Windows embedder. It is not guaranteed to be up to date or complete. If you find a discrepancy, please send a pull request!
See also:
- Flutter tool's Windows logic - Builds and runs Flutter Windows apps on the command line.
- Windows app template - The entrypoint for Flutter Windows app. This launches the Windows embedder.
platform-windowsGitHub issues label#hackers-desktopDiscord channel
Developing
See:
- Setting up the Engine development environment
- Compiling for Windows
- Debugging Windows builds with Visual Studio
Notable files
Some notable files include:
flutter_windows_engine.h- Connects the Windows embedder to the Flutter engine.flutter_windows_view.h- The logic for a Flutter view.flutter_window.h- Integrates a Flutter view with Windows (using a win32 child window).//shell/platform/embedder/embedder.h- The API boundary between the Windows embedder and the Flutter engine.