Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Google Maps rendering issues in TLHC mode when using LATEST renderer #5408

Merged
merged 1 commit into from Nov 29, 2023

Conversation

johnmccutchan
Copy link
Contributor

The Google Maps LATEST renderer always uses a TextureView. We can use a signal from this TextureView to perform view invalidation that fixes the rendering glitches (missing updates) in TLHC mode.

NOTE: We have an internal bug 311013682 requesting an official way of achieving this functionality but if the bug is ever acted on it will take many months/years before we can rely on this functionality.

In the meantime, chain the internal SurfaceTextureListener with our own and piggyback on the OnSurfaceTextureUpdated callback to invalidate the MapView.

Fixes flutter/flutter#103686

Tested on an emulator and a physical device (Pixel 6 Pro).

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update https://pub.dev/packages/google_maps_flutter_android#texture-layer-hybrid-composition with new guidance. Although if possible, we should also switch the default if this resolves the issue (and leave the switch only as an escape hatch if there are surprise issues). I think this would address all cases:

  • LATEST would always get this codepath (and work)
  • LEGACY would presumably either get this codepath (and work) or hit the SurfaceView codepath in Maps and then automatically fall out of TLHC anyway due to the engine fallback logic (so work).

Does that sound right?

@johnmccutchan
Copy link
Contributor Author

We should update https://pub.dev/packages/google_maps_flutter_android#texture-layer-hybrid-composition with new guidance. Although if possible, we should also switch the default if this resolves the issue (and leave the switch only as an escape hatch if there are surprise issues). I think this would address all cases:

  • LATEST would always get this codepath (and work)
  • LEGACY would presumably either get this codepath (and work) or hit the SurfaceView codepath in Maps and then automatically fall out of TLHC anyway due to the engine fallback logic (so work).

Does that sound right?

I've updated the docs, PTAL.

The Google Maps LATEST renderer always uses a TextureView. We can use a signal
from this TextureView to perform view invalidation that fixes the rendering
glitches (missing updates) in TLHC mode.

NOTE: We have an internal bug 311013682 requesting an official way of achieving
this functionality but if the bug is ever acted on it will take many months/years
before we can rely on this functionality.

In the meantime, chain the internal SurfaceTextureListener with our own and
piggyback on the OnSurfaceTextureUpdated callback to invalidate the MapView.

Fixes flutter/flutter#103686

Tested on an emulator and a physical device (Pixel 6 Pro).
Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nit


* Fixes missing updates in TLHC mode.
* Switched default display mode to TLHC mode.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Switches

(Per our style guide for changelogs.)

@johnmccutchan johnmccutchan merged commit e393d45 into flutter:main Nov 29, 2023
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 30, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 30, 2023
flutter/packages@e4aaba8...bc72d15

2023-11-30 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[pointer_interceptor] Add platform interface" (flutter/packages#5524)
2023-11-30 louisehsu@google.com [pointer_interceptor] Add platform interface (flutter/packages#5499)
2023-11-29 engine-flutter-autoroll@skia.org Roll Flutter from 6bf3ccd to 5e5b529 (58 revisions) (flutter/packages#5519)
2023-11-29 john@johnmccutchan.com Fix Google Maps rendering issues in TLHC mode when using LATEST renderer (flutter/packages#5408)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@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
HugoOlthof pushed a commit to moneybird/packages that referenced this pull request Dec 13, 2023
…rer (flutter#5408)

The Google Maps LATEST renderer always uses a TextureView. We can use a
signal from this TextureView to perform view invalidation that fixes the
rendering glitches (missing updates) in TLHC mode.

NOTE: We have an internal bug 311013682 requesting an official way of
achieving this functionality but if the bug is ever acted on it will
take many months/years before we can rely on this functionality.

In the meantime, chain the internal SurfaceTextureListener with our own
and piggyback on the OnSurfaceTextureUpdated callback to invalidate the
MapView.

Fixes flutter/flutter#103686

Tested on an emulator and a physical device (Pixel 6 Pro).
caseycrogers pushed a commit to caseycrogers/flutter that referenced this pull request Dec 29, 2023
flutter/packages@e4aaba8...bc72d15

2023-11-30 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[pointer_interceptor] Add platform interface" (flutter/packages#5524)
2023-11-30 louisehsu@google.com [pointer_interceptor] Add platform interface (flutter/packages#5499)
2023-11-29 engine-flutter-autoroll@skia.org Roll Flutter from 6bf3ccd to 5e5b529 (58 revisions) (flutter/packages#5519)
2023-11-29 john@johnmccutchan.com Fix Google Maps rendering issues in TLHC mode when using LATEST renderer (flutter/packages#5408)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@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
@reidbaker reidbaker mentioned this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants