Skip to content

Conversation

@yaakovschectman
Copy link
Contributor

Replace the old JSON-based encoding of polygons and polylines to use structured pigeon type.

flutter/flutter#152926

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@yaakovschectman yaakovschectman marked this pull request as ready for review August 14, 2024 17:10
return points;
}

static List<LatLng> toPoints(List<Messages.PlatformLatLng> data) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please call this pointsFromPigeon, matching the style of some of the existing methods, so that we don't have two things with the same name, one of which takes Object, because it makes it hard to clearly reason about which one is being called since List<Messages.PlatformLatLng> is also an Object. Having clearly separable codepaths makes the Object versions less of a foot-gun for as long as we have to have them.

final List<List<LatLng>> holes = new ArrayList<>(data.size());

for (Object rawHole : data) {
for (List<Messages.PlatformLatLng> rawHole : data) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just hole now that this is a typed structure instead of an Object.

final int color;
final bool geodesic;
final int jointType;
// TODO(schectman): convert to structured data.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should have detail about the exact meaning/source of the object, like the old json TODO.


@VisibleForTesting
static List<LatLng> toPoints(Object o) {
static List<LatLng> pointsFromPigeon(Object o) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You've renamed the non-Pigeon version to say it's for Pigeon. The Pigeon version is the one that takes a List<Messages.PlatformLatLng>.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm, I thought there were still unconverted codepaths that used toPoints, but now that you've changed the names it looks like there aren't; it's marked VisibleForTesting, and there are no references I see within the file. If toPoints is dead code now, it should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see a reference to it remaining at

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's a unit test, not production code.

Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM!

@yaakovschectman yaakovschectman merged commit 50e4138 into flutter:main Aug 21, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 22, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 22, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 23, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 23, 2024
flutter/packages@c5d03ee...d862279

2024-08-22 [email protected] Serve benchmarks with COOP/COEP headers in wasm mode. (flutter/packages#7423)
2024-08-21 [email protected] [google_maps_flutter_android] Convert `PlatformPolygon` and `PlatformPolyline` to Pigeon (flutter/packages#7406)
2024-08-21 [email protected] [pigeon] simplifies int handling across the codec, verifies ints in collections (flutter/packages#7392)
2024-08-21 [email protected] Roll Flutter (stable) from 80c2e84 to 5874a72 (9 revisions) (flutter/packages#7472)
2024-08-21 49699333+dependabot[bot]@users.noreply.github.com [interactive_media_ads]: Bump androidx.annotation:annotation from 1.8.1 to 1.8.2 in /packages/interactive_media_ads/android (flutter/packages#7384)
2024-08-21 [email protected] Roll Flutter from e7da16d to b8f89f7 (28 revisions) (flutter/packages#7471)
2024-08-21 [email protected] [interactive_media_ads] Adds a contribution doc (flutter/packages#7460)
2024-08-21 49699333+dependabot[bot]@users.noreply.github.com [webview]: Bump androidx.annotation:annotation from 1.8.1 to 1.8.2 in /packages/webview_flutter/webview_flutter_android/android (flutter/packages#7373)
2024-08-21 [email protected] [script] Remove unnecessary breaks in default clauses of switch statements (flutter/packages#7469)

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 [email protected],[email protected] 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
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
flutter/packages@c5d03ee...d862279

2024-08-22 [email protected] Serve benchmarks with COOP/COEP headers in wasm mode. (flutter/packages#7423)
2024-08-21 [email protected] [google_maps_flutter_android] Convert `PlatformPolygon` and `PlatformPolyline` to Pigeon (flutter/packages#7406)
2024-08-21 [email protected] [pigeon] simplifies int handling across the codec, verifies ints in collections (flutter/packages#7392)
2024-08-21 [email protected] Roll Flutter (stable) from 80c2e84 to 5874a72 (9 revisions) (flutter/packages#7472)
2024-08-21 49699333+dependabot[bot]@users.noreply.github.com [interactive_media_ads]: Bump androidx.annotation:annotation from 1.8.1 to 1.8.2 in /packages/interactive_media_ads/android (flutter/packages#7384)
2024-08-21 [email protected] Roll Flutter from e7da16d to b8f89f7 (28 revisions) (flutter/packages#7471)
2024-08-21 [email protected] [interactive_media_ads] Adds a contribution doc (flutter/packages#7460)
2024-08-21 49699333+dependabot[bot]@users.noreply.github.com [webview]: Bump androidx.annotation:annotation from 1.8.1 to 1.8.2 in /packages/webview_flutter/webview_flutter_android/android (flutter/packages#7373)
2024-08-21 [email protected] [script] Remove unnecessary breaks in default clauses of switch statements (flutter/packages#7469)

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 [email protected],[email protected] 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants