-
Notifications
You must be signed in to change notification settings - Fork 6k
Add SurfaceProducer#onSurfaceAvailable, deprecate onSurfaceCreated.
#55418
Conversation
jonahwilliams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Jelly of default interface methods.
| for (ImageReaderSurfaceProducer producer : imageReaderProducers) { | ||
| if (producer.callback != null) { | ||
| producer.callback.onSurfaceCreated(); | ||
| if (producer.callback != null && producer.notifiedDestroy) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this check ensures that we don't fire the callback multiple times if the surface wasn't prev destroyed. Makes sense!
| * @deprecated Override and use {@link Callback#onSurfaceAvailable()} instead. | ||
| */ | ||
| @Deprecated(since = "Flutter 3.27", forRemoval = true) | ||
| default void onSurfaceCreated() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically let folks who haven't used SurfaceProducer.Callback not have to define both methods.
|
Reason for revert: Engine->Framework roll breakage |
…ceCreated`. (#55418)" (#55450) Reverts: #55418 Initiated by: bdero Reason for reverting: [Engine->Framework roll breakage](flutter/flutter#155727 (comment)) Original PR Author: matanlurey Reviewed By: {jonahwilliams} This change reverts the following previous change: Closes flutter/flutter#155131. Not only did I rename the method, but I also changed the contract slightly - now `onSurfaceAvailable` is _only_ invoked _after_ `onSurfaceDestroyed` has been called. The cost is a single `boolean`, and it honestly makes the API make a lot more sense than someone having to track this themselves. /cc @johnmccutchan (OOO), and @flutter/android-reviewers.
…155733) flutter/engine@d6d5fdb...d4850c1 2024-09-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Dart SDK from c2728b947e46 to 016368ee313d (1 revision) (#55444)" (flutter/engine#55454) 2024-09-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add `SurfaceProducer#onSurfaceAvailable`, deprecate `onSurfaceCreated`. (#55418)" (flutter/engine#55450) 2024-09-25 1961493+harryterkelsen@users.noreply.github.com Reland "[canvaskit] Further improve overlay optimization by splitting pictures" (flutter/engine#55402) 2024-09-25 matanlurey@users.noreply.github.com Move lint suppression from `baseline.xml` to `@SuppressLint`. (flutter/engine#55447) 2024-09-25 jonahwilliams@google.com [engine] set platform thread name to ui. (flutter/engine#55362) 2024-09-25 skia-flutter-autoroll@skia.org Roll Dart SDK from c2728b947e46 to 016368ee313d (1 revision) (flutter/engine#55444) 2024-09-25 jonahwilliams@google.com [Impeller] actually fix external texture for GLES. (flutter/engine#55414) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from e623a37de332 to 9f3b32b7b772 (2 revisions) (flutter/engine#55443) 2024-09-25 jessiewong401@gmail.com Remove usages of WindowManager's getDefaultDisplay (flutter/engine#55002) 2024-09-25 30870216+gaaclarke@users.noreply.github.com Fixes blend + color filter (flutter/engine#55411) 2024-09-25 matanlurey@users.noreply.github.com Add a boolean that exposes rotation/crop metadata capability. (flutter/engine#55434) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from 9af762100cf1 to e623a37de332 (1 revision) (flutter/engine#55439) 2024-09-25 jonahwilliams@google.com [scenario_app] delete get bitmap activity. (flutter/engine#55436) 2024-09-25 bdero@google.com [Flutter GPU] Use vm.Vector4 for clear color instead of ui.Color. (flutter/engine#55416) 2024-09-25 skia-flutter-autoroll@skia.org Roll Dart SDK from dd73afd20be5 to c2728b947e46 (1 revision) (flutter/engine#55437) 2024-09-25 30870216+gaaclarke@users.noreply.github.com adds more tasks to the engine workspace (flutter/engine#55435) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from 79e652aad7a9 to 9af762100cf1 (2 revisions) (flutter/engine#55433) 2024-09-25 matanlurey@users.noreply.github.com Add `SurfaceProducer#onSurfaceAvailable`, deprecate `onSurfaceCreated`. (flutter/engine#55418) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC bdero@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#155733) flutter/engine@d6d5fdb...d4850c1 2024-09-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Dart SDK from c2728b947e46 to 016368ee313d (1 revision) (flutter#55444)" (flutter/engine#55454) 2024-09-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add `SurfaceProducer#onSurfaceAvailable`, deprecate `onSurfaceCreated`. (flutter#55418)" (flutter/engine#55450) 2024-09-25 1961493+harryterkelsen@users.noreply.github.com Reland "[canvaskit] Further improve overlay optimization by splitting pictures" (flutter/engine#55402) 2024-09-25 matanlurey@users.noreply.github.com Move lint suppression from `baseline.xml` to `@SuppressLint`. (flutter/engine#55447) 2024-09-25 jonahwilliams@google.com [engine] set platform thread name to ui. (flutter/engine#55362) 2024-09-25 skia-flutter-autoroll@skia.org Roll Dart SDK from c2728b947e46 to 016368ee313d (1 revision) (flutter/engine#55444) 2024-09-25 jonahwilliams@google.com [Impeller] actually fix external texture for GLES. (flutter/engine#55414) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from e623a37de332 to 9f3b32b7b772 (2 revisions) (flutter/engine#55443) 2024-09-25 jessiewong401@gmail.com Remove usages of WindowManager's getDefaultDisplay (flutter/engine#55002) 2024-09-25 30870216+gaaclarke@users.noreply.github.com Fixes blend + color filter (flutter/engine#55411) 2024-09-25 matanlurey@users.noreply.github.com Add a boolean that exposes rotation/crop metadata capability. (flutter/engine#55434) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from 9af762100cf1 to e623a37de332 (1 revision) (flutter/engine#55439) 2024-09-25 jonahwilliams@google.com [scenario_app] delete get bitmap activity. (flutter/engine#55436) 2024-09-25 bdero@google.com [Flutter GPU] Use vm.Vector4 for clear color instead of ui.Color. (flutter/engine#55416) 2024-09-25 skia-flutter-autoroll@skia.org Roll Dart SDK from dd73afd20be5 to c2728b947e46 (1 revision) (flutter/engine#55437) 2024-09-25 30870216+gaaclarke@users.noreply.github.com adds more tasks to the engine workspace (flutter/engine#55435) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from 79e652aad7a9 to 9af762100cf1 (2 revisions) (flutter/engine#55433) 2024-09-25 matanlurey@users.noreply.github.com Add `SurfaceProducer#onSurfaceAvailable`, deprecate `onSurfaceCreated`. (flutter/engine#55418) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC bdero@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#155733) flutter/engine@d6d5fdb...d4850c1 2024-09-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Dart SDK from c2728b947e46 to 016368ee313d (1 revision) (flutter#55444)" (flutter/engine#55454) 2024-09-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add `SurfaceProducer#onSurfaceAvailable`, deprecate `onSurfaceCreated`. (flutter#55418)" (flutter/engine#55450) 2024-09-25 1961493+harryterkelsen@users.noreply.github.com Reland "[canvaskit] Further improve overlay optimization by splitting pictures" (flutter/engine#55402) 2024-09-25 matanlurey@users.noreply.github.com Move lint suppression from `baseline.xml` to `@SuppressLint`. (flutter/engine#55447) 2024-09-25 jonahwilliams@google.com [engine] set platform thread name to ui. (flutter/engine#55362) 2024-09-25 skia-flutter-autoroll@skia.org Roll Dart SDK from c2728b947e46 to 016368ee313d (1 revision) (flutter/engine#55444) 2024-09-25 jonahwilliams@google.com [Impeller] actually fix external texture for GLES. (flutter/engine#55414) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from e623a37de332 to 9f3b32b7b772 (2 revisions) (flutter/engine#55443) 2024-09-25 jessiewong401@gmail.com Remove usages of WindowManager's getDefaultDisplay (flutter/engine#55002) 2024-09-25 30870216+gaaclarke@users.noreply.github.com Fixes blend + color filter (flutter/engine#55411) 2024-09-25 matanlurey@users.noreply.github.com Add a boolean that exposes rotation/crop metadata capability. (flutter/engine#55434) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from 9af762100cf1 to e623a37de332 (1 revision) (flutter/engine#55439) 2024-09-25 jonahwilliams@google.com [scenario_app] delete get bitmap activity. (flutter/engine#55436) 2024-09-25 bdero@google.com [Flutter GPU] Use vm.Vector4 for clear color instead of ui.Color. (flutter/engine#55416) 2024-09-25 skia-flutter-autoroll@skia.org Roll Dart SDK from dd73afd20be5 to c2728b947e46 (1 revision) (flutter/engine#55437) 2024-09-25 30870216+gaaclarke@users.noreply.github.com adds more tasks to the engine workspace (flutter/engine#55435) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from 79e652aad7a9 to 9af762100cf1 (2 revisions) (flutter/engine#55433) 2024-09-25 matanlurey@users.noreply.github.com Add `SurfaceProducer#onSurfaceAvailable`, deprecate `onSurfaceCreated`. (flutter/engine#55418) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC bdero@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Documents (for end-users) the changes made in: - flutter/engine#55418 - flutter/engine#55434 (pending merge)
… `onSurfaceCreated`. (#55418)" (#55450)" (#55463) Reverts: #55450 Initiated by: matanlurey Reason for reverting: Fixed forward in flutter/packages#7712. Original PR Author: auto-submit[bot] Reviewed By: {fluttergithubbot} This change reverts the following previous change: Reverts: #55418 Initiated by: bdero Reason for reverting: [Engine->Framework roll breakage](flutter/flutter#155727 (comment)) Original PR Author: matanlurey Reviewed By: {jonahwilliams} This change reverts the following previous change: Closes flutter/flutter#155131. Not only did I rename the method, but I also changed the contract slightly - now `onSurfaceAvailable` is _only_ invoked _after_ `onSurfaceDestroyed` has been called. The cost is a single `boolean`, and it honestly makes the API make a lot more sense than someone having to track this themselves. /cc @johnmccutchan (OOO), and @flutter/android-reviewers.
…lutter#155733) flutter/engine@d6d5fdb...d4850c1 2024-09-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Dart SDK from c2728b947e46 to 016368ee313d (1 revision) (flutter#55444)" (flutter/engine#55454) 2024-09-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add `SurfaceProducer#onSurfaceAvailable`, deprecate `onSurfaceCreated`. (flutter#55418)" (flutter/engine#55450) 2024-09-25 1961493+harryterkelsen@users.noreply.github.com Reland "[canvaskit] Further improve overlay optimization by splitting pictures" (flutter/engine#55402) 2024-09-25 matanlurey@users.noreply.github.com Move lint suppression from `baseline.xml` to `@SuppressLint`. (flutter/engine#55447) 2024-09-25 jonahwilliams@google.com [engine] set platform thread name to ui. (flutter/engine#55362) 2024-09-25 skia-flutter-autoroll@skia.org Roll Dart SDK from c2728b947e46 to 016368ee313d (1 revision) (flutter/engine#55444) 2024-09-25 jonahwilliams@google.com [Impeller] actually fix external texture for GLES. (flutter/engine#55414) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from e623a37de332 to 9f3b32b7b772 (2 revisions) (flutter/engine#55443) 2024-09-25 jessiewong401@gmail.com Remove usages of WindowManager's getDefaultDisplay (flutter/engine#55002) 2024-09-25 30870216+gaaclarke@users.noreply.github.com Fixes blend + color filter (flutter/engine#55411) 2024-09-25 matanlurey@users.noreply.github.com Add a boolean that exposes rotation/crop metadata capability. (flutter/engine#55434) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from 9af762100cf1 to e623a37de332 (1 revision) (flutter/engine#55439) 2024-09-25 jonahwilliams@google.com [scenario_app] delete get bitmap activity. (flutter/engine#55436) 2024-09-25 bdero@google.com [Flutter GPU] Use vm.Vector4 for clear color instead of ui.Color. (flutter/engine#55416) 2024-09-25 skia-flutter-autoroll@skia.org Roll Dart SDK from dd73afd20be5 to c2728b947e46 (1 revision) (flutter/engine#55437) 2024-09-25 30870216+gaaclarke@users.noreply.github.com adds more tasks to the engine workspace (flutter/engine#55435) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from 79e652aad7a9 to 9af762100cf1 (2 revisions) (flutter/engine#55433) 2024-09-25 matanlurey@users.noreply.github.com Add `SurfaceProducer#onSurfaceAvailable`, deprecate `onSurfaceCreated`. (flutter/engine#55418) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC bdero@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#155733) flutter/engine@d6d5fdb...d4850c1 2024-09-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Dart SDK from c2728b947e46 to 016368ee313d (1 revision) (flutter#55444)" (flutter/engine#55454) 2024-09-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add `SurfaceProducer#onSurfaceAvailable`, deprecate `onSurfaceCreated`. (flutter#55418)" (flutter/engine#55450) 2024-09-25 1961493+harryterkelsen@users.noreply.github.com Reland "[canvaskit] Further improve overlay optimization by splitting pictures" (flutter/engine#55402) 2024-09-25 matanlurey@users.noreply.github.com Move lint suppression from `baseline.xml` to `@SuppressLint`. (flutter/engine#55447) 2024-09-25 jonahwilliams@google.com [engine] set platform thread name to ui. (flutter/engine#55362) 2024-09-25 skia-flutter-autoroll@skia.org Roll Dart SDK from c2728b947e46 to 016368ee313d (1 revision) (flutter/engine#55444) 2024-09-25 jonahwilliams@google.com [Impeller] actually fix external texture for GLES. (flutter/engine#55414) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from e623a37de332 to 9f3b32b7b772 (2 revisions) (flutter/engine#55443) 2024-09-25 jessiewong401@gmail.com Remove usages of WindowManager's getDefaultDisplay (flutter/engine#55002) 2024-09-25 30870216+gaaclarke@users.noreply.github.com Fixes blend + color filter (flutter/engine#55411) 2024-09-25 matanlurey@users.noreply.github.com Add a boolean that exposes rotation/crop metadata capability. (flutter/engine#55434) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from 9af762100cf1 to e623a37de332 (1 revision) (flutter/engine#55439) 2024-09-25 jonahwilliams@google.com [scenario_app] delete get bitmap activity. (flutter/engine#55436) 2024-09-25 bdero@google.com [Flutter GPU] Use vm.Vector4 for clear color instead of ui.Color. (flutter/engine#55416) 2024-09-25 skia-flutter-autoroll@skia.org Roll Dart SDK from dd73afd20be5 to c2728b947e46 (1 revision) (flutter/engine#55437) 2024-09-25 30870216+gaaclarke@users.noreply.github.com adds more tasks to the engine workspace (flutter/engine#55435) 2024-09-25 skia-flutter-autoroll@skia.org Roll Skia from 79e652aad7a9 to 9af762100cf1 (2 revisions) (flutter/engine#55433) 2024-09-25 matanlurey@users.noreply.github.com Add `SurfaceProducer#onSurfaceAvailable`, deprecate `onSurfaceCreated`. (flutter/engine#55418) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC bdero@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Closes flutter/flutter#155131.
Not only did I rename the method, but I also changed the contract slightly - now
onSurfaceAvailableis only invoked afteronSurfaceDestroyedhas been called. The cost is a singleboolean, and it honestly makes the API make a lot more sense than someone having to track this themselves./cc @johnmccutchan (OOO), and @flutter/android-reviewers.