matanlurey · GitHub

@matanlurey

@matanlurey

…cer-camera-android

This was referenced

Apr 8, 2024

Closed

Closed

Merged

5 tasks

auto-submit Bot pushed a commit to flutter-team-archive/engine that referenced this pull request

Apr 18, 2024
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
### Issue Link:
What is the link to the issue this cherry-pick is addressing?
Test failures in Impeller migration PR: flutter/packages#6461
### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/wiki/Hotfix-Documentation-Best-Practices) for examples
Ensure that Android platform view updates are posted on correct thread when platform view is created on background handler.
### Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)
Migration to Impeller plugin APIs is blocked.
### Workaround:
Is there a workaround for this issue?
Disable impeller
### Risk:
What is the risk level of this cherry-pick?
### Test Coverage:
Are you confident that your fix is well-tested by automated tests?
  However the tests are in flutter/packages and not flutter/engine.
### Validation Steps:
What are the steps to validate that this fix works?
Run the unit tests on the linked PR in flutter/packages
…ducer-camera-android

@matanlurey

@matanlurey

Closed

johnmccutchan

Jonah Williams added 2 commits

May 24, 2024 09:50

Jonah Williams

jonahwilliams

stuartmorgan-g

jonahwilliams

jonahwilliams

@stuartmorgan-g

Jonah Williams

jonahwilliams

…ce-producer-camera-android

camsim99

Co-authored-by: Camille Simon <43054281+camsim99@users.noreply.github.com>

@auto-submit

@auto-submit

auto-submit Bot deleted the migrate-surface-producer-camera-android branch

May 29, 2024 18:53

Merged

auto-submit Bot pushed a commit to flutter/flutter that referenced this pull request

May 30, 2024

victorsanni pushed a commit to victorsanni/flutter that referenced this pull request

May 31, 2024

Merged

auto-submit Bot pushed a commit that referenced this pull request

Jun 21, 2024

Closed

11 tasks

Closed

creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request

Jun 10, 2026
…lutter#6461)
_**WIP**: We do not plan to land this PR until the next stable release (>= April 3rd 2024)_.
Work towards flutter/flutter#145930.
## Details
Migrates uses of `createSurfaceTexture` to `createSurfaceProducer`, which is intended to have no change in behavior, but _does_ change the backend rendering path, so it will require more testing (and we're also open to minor API renames or changes before it becomes stable).
## Background
Android plugins previously requested a `SurfaceTexture` from the Android embedder, and used that to produce a `Surface` to render external textures on (i.e. `video_player`).  This worked because 100% of Flutter applications on Android used OpenGLES (via our Skia backend), and `SurfaceTexture` is actually an (opaque) OpenGLES-texture.
Starting soon (roughly ~Q3, this is not a guarantee and just an estimate), Flutter on Android will start to use our new Impeller graphics backend, which on newer devices (`>= API_VERSION_28`), will default to the Vulkan, _not_ OpenGLES. In other words, `SurfaceTexture` will cease to work (it is possible, but non-trivial, to map an OpenGLES texture over to Vulkan).
After consultation with the Android team, they helped us understand that vending `SurfaceTexture` (the _consumer-side_ API) was never the right abstraction, and we should have been vending the _producer-side_ API, or `Surface` directly. The new `SurfaceProducer` API is exactly that - it generates a `Surface`, and similar to our platform view strategy, picks the "right" _consumer-side_ implementation details _for_ the user/plugin packages.
The new `SurfaceProducer` API has 2 possible rendering types (as an implementation detail):
- `SurfaceTexture`, for older OpenGLES devices, which works exactly as it does today.
- `ImageReader`, for newer OpenGLES _or_ Vulkan devices.
These are some subtle nuances in how these two APIs work differently (one example: flutter/flutter#144407), but our theory at this point is we don't expect these changes to be observed by any users, and we have other ideas if necessary.
> [!NOTE]
> These invariants are [tested on CI in `flutter/engine`](https://github.com/flutter/engine/tree/main/testing/scenario_app/android#ci-configuration).
Points of contact:
- @matanlurey or @jonahwilliams  (Flutter Engine)
- @johnmccutchan or @reidbaker  (Flutter on Android)

creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request

Jun 10, 2026

bisor0627 pushed a commit to bisor0627/packages that referenced this pull request

Jun 19, 2026
…lutter#6461)
_**WIP**: We do not plan to land this PR until the next stable release (>= April 3rd 2024)_.
Work towards flutter/flutter#145930.
## Details
Migrates uses of `createSurfaceTexture` to `createSurfaceProducer`, which is intended to have no change in behavior, but _does_ change the backend rendering path, so it will require more testing (and we're also open to minor API renames or changes before it becomes stable).
## Background
Android plugins previously requested a `SurfaceTexture` from the Android embedder, and used that to produce a `Surface` to render external textures on (i.e. `video_player`).  This worked because 100% of Flutter applications on Android used OpenGLES (via our Skia backend), and `SurfaceTexture` is actually an (opaque) OpenGLES-texture.
Starting soon (roughly ~Q3, this is not a guarantee and just an estimate), Flutter on Android will start to use our new Impeller graphics backend, which on newer devices (`>= API_VERSION_28`), will default to the Vulkan, _not_ OpenGLES. In other words, `SurfaceTexture` will cease to work (it is possible, but non-trivial, to map an OpenGLES texture over to Vulkan).
After consultation with the Android team, they helped us understand that vending `SurfaceTexture` (the _consumer-side_ API) was never the right abstraction, and we should have been vending the _producer-side_ API, or `Surface` directly. The new `SurfaceProducer` API is exactly that - it generates a `Surface`, and similar to our platform view strategy, picks the "right" _consumer-side_ implementation details _for_ the user/plugin packages.
The new `SurfaceProducer` API has 2 possible rendering types (as an implementation detail):
- `SurfaceTexture`, for older OpenGLES devices, which works exactly as it does today.
- `ImageReader`, for newer OpenGLES _or_ Vulkan devices.
These are some subtle nuances in how these two APIs work differently (one example: flutter/flutter#144407), but our theory at this point is we don't expect these changes to be observed by any users, and we have other ideas if necessary.
> [!NOTE]
> These invariants are [tested on CI in `flutter/engine`](https://github.com/flutter/engine/tree/main/testing/scenario_app/android#ci-configuration).
Points of contact:
- @matanlurey or @jonahwilliams  (Flutter Engine)
- @johnmccutchan or @reidbaker  (Flutter on Android)

bisor0627 pushed a commit to bisor0627/packages that referenced this pull request

Jun 19, 2026

Read the original on github.com ↗