Texture Layer Hybrid Composition
See also: Hybrid Composition
Texture Layer Hybrid Composition (TLHC) is one of several modes for displaying platform views on Android. See Android Platform Views for an overview of modes.
It was introduced in Flutter 3.0 to combine the best aspects of Virtual Display and Hybrid Composition while addressing their most significant issues. While it was originally intended to replace both, it turned out to have some limitations that prevented serving as a complete replacement, so is now a third option.
TLHC uses a custom FrameLayout
, which is placed in the native view hierarchy as normal, but redirects drawing to a canvas that backs a Flutter Texture
in order to compose with the rest of the Flutter UI as normal (without the layering and threading complexities of Hybrid Composition).
- Because of the APIs involved, this requires SDK level 23 or later, so does not support quite as far back as Virtual Display (SDK 20+) or Hybrid Composition (SDK 19+).
-
Android
SurfaceView
s bypass the normal drawing mechanism of Android views, so are not redirected as expected. Instead, they draw as if the redirect did not happen, which generally causes them to draw over all Flutter content.- To mitigate this, platform views attempt to automatically fall back to another mode when a
SurfaceView
is present. However, this currently only works if theSurfaceView
is present when the platform view is created.
- To mitigate this, platform views attempt to automatically fall back to another mode when a
-
Android
TextureView
s do not always show updates correctly. This is still under investigation, and for now affected plugins are best off using another mode.
To see all known issues specific to this mode, search for the tlhc-only
label.
- Home of the Wiki
- Roadmap
- API Reference (stable)
- API Reference (main)
- Glossary
- Contributor Guide
- Chat on Discord
- Design documents
- Code of Conduct
- Issue triage reports (latest)
- Our Values
- Tree hygiene
- Issue hygiene and Triage
- Style guide for Flutter repo
- Project teams
- Contributor access
- What should I work on?
- Popular issues
- Running and writing tests
- Release process
- Flutter Framework Gardener Rotation
- Rolling Dart
- Manual Engine Roll with Breaking Commits
- Updating Material Design Fonts & Icons
- Postmortems and Retrospectives
- Hotfix Documentation Best Practices
- In case of emergency
- Landing Changes With Autosubmit
- Setting up the Framework development environment
- The Framework architecture
- API Docs code block generation
- Running examples
- Using the Dart analyzer
- The flutter run variants
- Test coverage for package:flutter
- Writing a golden-file test for package:flutter
- Managing template image assets
- Setting up the Engine development environment
- Compiling the engine
- Debugging the engine
- Using Sanitizers with the Flutter Engine
- Testing the engine
- The Engine architecture
- Flutter's modes
- Crashes
- more...
- Setting up the Packages development environment
- Plugins and Packages repository structure
- Contributing to Plugins and Packages
- Understanding Packages tests
- Plugin Tests
- Releasing a Plugin or Package
- more...