flutter/engine
Matan Lurey 9467677fef
Change timing of onSurfaceDestroyed to match onSurfaceCleanup (#161252)
Follow-up to https://github.com/flutter/flutter/pull/160937
(https://github.com/flutter/flutter/issues/160933).

This more or less mirrors what we did already for `onSurfaceCreated` to
match `onSurfaceAvailable`.

With this approach, the master branch should immediately start seeing
better behavior in terms of being able to use the `onSurfaceDestroyed`
callback effectively (before the surface has been released). For
example, for a plugin that already uses `onSurfaceDestroyed`, [i.e
`camerax`](97ce56a68e/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java):

```java
@Override
public void onSurfaceDestroyed() {
  // Invalidate the SurfaceRequest so that CameraX knows to to make a new request
  // for a surface.
  request.invalidate();
}
```

... the request is now invalidated _before_ the surface has been
destroyed, which is what (I believe) we wanted?

---

Folks that want to publish package updates that _definitely_ use the
correct timing will have to wait for the next stable.

/cc @hasali19 would be great to get your input here.
2025-01-07 21:15:09 +00:00
..
scripts gclient template file clarifications (#160882) 2024-12-27 19:36:20 +00:00
src Change timing of onSurfaceDestroyed to match onSurfaceCleanup (#161252) 2025-01-07 21:15:09 +00:00
README.md Clarify where gclient is run from. (#160889) 2024-12-27 21:37:24 +00:00

Flutter Engine

gclient bootstrap

Flutter engine uses gclient to manage dependencies.

If you've already cloned the flutter repository:

  1. Copy one of the engine/scripts/*.gclient to the root folder as .gclient:
    1. Googlers: copy rbe.gclient to enable faster builds with RBE
    2. Everyone else: copy standard.gclient
  2. run gclient sync from the root folder