mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Cherry-picks c7362b4755 to 3.32 stable **without** the changes to the pre-existing `SurfaceProducer.getSurface` method, only the addition of `SurfaceProducer.getForcedNewSurface`.
Note that this change is already present in the 3.35 beta.
### Issue Link:
What is the link to the issue this cherry-pick is addressing?
https://github.com/flutter/flutter/issues/155294, https://github.com/flutter/flutter/issues/169506
### Changelog Description:
Adds a new method for requesting a new surface from the embedder than any previously returned.
### Impact Description:
Developers using `SurfaceProducer.getForcedNewSurface` will receive a `Surface` that is different than previous calls to `SurfaceProducer.getForcedNewSurface` or pre-existing method `SurfaceProducer.getSurface`.
In other words, there is no impact to current users. This is a new method, so there will be a gap between 3.32.0 and 3.32.8, but I think it's worth landing because this would unblock fixing resuming/pausing the camera preview as described by the linked issues.
### Workaround:
Working around the need for the new `getForcedSurface` method (like the `camera` issues linked above require) can be done by creating new `SurfaceProducer`s; however, this might have other side-effect unbeknownst to me.
### Risk:
### Test Coverage:
Are you confident that your fix is well-tested by automated tests?
### Validation Steps:
You can test with https://github.com/flutter/packages/pull/9360 (which I accidentally landed because I forgot this wasn't in stable yet...oops).
Flutter Engine
Setting up the Engine development environment
See here
gclient bootstrap
Flutter engine uses gclient to manage dependencies.
If you've already cloned the flutter repository: