-
Notifications
You must be signed in to change notification settings - Fork 6k
[ios]ignore single edge pixel instead of rounding #51687
[ios]ignore single edge pixel instead of rounding #51687
Conversation
33188cb to
1100700
Compare
1100700 to
f31b39c
Compare
f31b39c to
55566db
Compare
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.
Could we solve this problem a bit differently? Correct me if I'm wrong, but the "overlay" flutter view is sized exactly to the platform view right? Could we let it overhang the platform view by 1px to completely remove the border?
The overlay platform view is the size of the intersection (after rounding).
That is already the previous behavior that this PR is trying to revert back to. For example, if the platform view's edge is at pixel |
|
Oh wait, is the screenshot you posted Before or After? |
|
Ah, I see. The problem is that when doing the query, the region code clips the intersecting rectangles to the query rect. We sort of want to query against roundIn, but intersect them against roundOut, but region doesn't provide that capability. So, the proposed fix is to just query against roundOut and then filter them after the fact? This also points out that we have redundant intersections - first region intersects against the query rectangle, and then later the PV embedder code intersects them against the PV rectangle (which is also the query rectangle). |
|
Looking through the code, there is so much waste in it all.
|
flar
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.
I feel like we are fighting the region/rtree system here and we need to rethink all of these APIs. Also, see my comment on the efficiency of the whole process - much wasted work going on here at a bunch of levels.
shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm
Outdated
Show resolved
Hide resolved
The screenshot was before the fix (with the border). This PR removes the border. I added the screenshot after the fix as well. |
|
@flar I created a separate issue to track the potential performance improvement around the double-for-loop: flutter/flutter#145802 I'd strongly prefer to keep that untouched for now, and have a separate PR for that improvement, so that we can measure it in the benchmark. |
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
|
i'm gonna land it before the cut to fix the issue, but feel free to leave more comment. |
…145841) flutter/engine@00dab0d...b7dddee 2024-03-27 [email protected] Fail pre-submit if a negative image is encountered as part of `goldctl imgtest add`. (flutter/engine#51685) 2024-03-27 [email protected] [ios]ignore single edge pixel instead of rounding (flutter/engine#51687) 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],[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
The previous PR flutter/flutter#143420 rounds out the layers and rounds in the platform views. This results in missing pixel on the edge of the intersection when there's fractional coordinate (as shown in the screenshot below), because platform view is below the layers.
It turns out that we have to round out both platform view and layers, because:
This PR simply skips the single (or partial) pixel on the edge, which is a special case, while still preserve the
roundOutbehavior for general non-edge cases.Before the fix, notice a very thin gray line cutting through the purple box:
Then after the fix, the gray line is gone:
List which issues are fixed by this PR. You must list at least one issue.
flutter/flutter#143420
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.