Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@eyebrowsoffire
Copy link
Contributor

Our treatment of the interaction between offset and transform was incorrect. Modified our platform view unit tests to cover more cases of nested offsets and transforms.

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Jul 17, 2024
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #53967 at sha 9565fa0

// are applied properly.
sb.pushOffset(50, 50);
sb.pushTransform(Matrix4.rotationZ(0.1).toFloat64());
sb.pushOffset(25, 25);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe make a separate copy of the test? The previous scenario with a transform that's not sandwiched between two offsets seems like an interesting case to test too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea.

style.width = '${logicalWidth}px';
style.height = '${logicalHeight}px';
style.left = '${logicalLeft}px';
style.top = '${logicalTop}px';
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe top/left properties invalidate layout when updated, but transform only invalidates painting and therefore is much more efficient. Can we use transform: translate(x, y) instead of top/left?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I didn't know that. Good idea.

style.width = '${_bounds!.width}px';
style.height = '${_bounds!.height}px';
style.left = '0px';
style.top = '0px';
Copy link
Contributor

Choose a reason for hiding this comment

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

I think top/left are no-ops when transform is present. No need to set them (unless this is unsetting the previously set values, in which case maybe clear them so the browser doesn't need to parse anything).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I was doing this to unset any previously set values. But if we're always using a transform in all cases as per your other suggestion, we'll never be setting these at all, so I can clean this up.

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #53967 at sha 5e3d6c0

@eyebrowsoffire eyebrowsoffire requested a review from yjbanov July 18, 2024 19:10
Copy link
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

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

LGTM

Depending on how complex the remaining fixes for transforms and clipping in platform views are, consider generalizing and reusing some code in embedded_views.dart for laying out and clipping platform views.

@eyebrowsoffire eyebrowsoffire added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 18, 2024
@auto-submit auto-submit bot merged commit b65c93e into flutter:main Jul 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 18, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 18, 2024
…152004)

flutter/engine@766f7be...b65c93e

2024-07-18 [email protected] [skwasm] Combine offset and transform properly. (flutter/engine#53967)
2024-07-18 [email protected] Gracefully fail when `gn desc` returns no targets. (flutter/engine#53999)

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 [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
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…lutter#152004)

flutter/engine@766f7be...b65c93e

2024-07-18 [email protected] [skwasm] Combine offset and transform properly. (flutter/engine#53967)
2024-07-18 [email protected] Gracefully fail when `gn desc` returns no targets. (flutter/engine#53999)

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 [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
…lutter#152004)

flutter/engine@766f7be...b65c93e

2024-07-18 [email protected] [skwasm] Combine offset and transform properly. (flutter/engine#53967)
2024-07-18 [email protected] Gracefully fail when `gn desc` returns no targets. (flutter/engine#53999)

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 [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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine will affect goldens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants