-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
[Impeller] Vulkan: Top line of text is cropped sometimes in wonderous app #128624
[Impeller] Vulkan: Top line of text is cropped sometimes in wonderous app #128624
Comments
Is this happening on the Metal backend too? If that's the case, then this is definitely a regression introduced after the 3.10 branch cut. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Please check if this is fixed after flutter/engine#42746 lands |
(I cannot repro it before or after, but it probably depends on screen size) |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Closing as fixed in flutter/engine#42746. We can re-open if this happens again. |
I can repro this, will need a slightly different fix |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Also does not repro on iPhone 13. |
Not only that, but the text itself is jittery as I scroll which does not happen on Pixels either. I wonder if there is some sort of "helpful" correction being applied somewhere? Though I'm not sure where that would be. |
This comment was marked as off-topic.
This comment was marked as off-topic.
From running locally, I can see that the glyphs in the atlas are rendered right against the edge of the glyph atlas, obviously cutting off parts of the glyph and/or antialiased pixels on some of them. Given that we should be rendering everything with 2px padding it seems like something is off... |
Something I am noticing is that on Android Skia starts from the bottom of the atlas... |
Perhaps this is caused by incorrect UV mapping needing after we added the 2px padding? Also, atlases on Android generated by Skia won't use the CoreText. There could be differences in glyph AA in atlases. So maybe we need more padding perhaps? |
I tried adding more padding but it made no difference :( . I think the glyph bounds themselves are wrong or need some other adjustment |
Reproduced this on a Pixel 3. The glyphs render correctly if I remove the |
FYI @bdero IRC the goal of adding that flag was better fidelity on iOS at the time, but obvs its not helping us on Android so we could disable it with an ifdef for now. That said, we should probably figure out how to handle these flags correctly. |
If I comment out that line, then I can still reproduce this issue on an S10 on Flutter gallery. |
Just adding a note that glyph offsets on Android are also reproducible with stroked text (perhaps even more so?). This is perhaps the same underlying issue. |
Resolves flutter/flutter#128624. It turns out that `SkFont::getBounds()` snaps results to integers on Android, but not iOS. By scaling the font up and scaling the resulting per-glyph bounds back down, we can ensure that the results are always precise enough. I also found errors with our usage of the computed bounds, but those were comparatively minor fixes.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Looked into the behavior of the flutter/engine@4ad970f patch. Skia is rounding the font metrics to integers in the flutter/engine@4ad970f is changing the font's size to 100000 to compute metrics and then scaling the metrics down to the original font size. With larger metric values, there will be less loss of precision due to the When given a huge font size like that Skia actually builds the glyphs at a smaller size and then applies scaling to produce the large size. Impeller should get the same results by obtaining the metrics from a font of size 64 instead of 100000. Or Impeller may be able to further improve the precision by using a size larger than 64 but less than the threshold that triggers |
description
I've seen this with the opengles backend and the vulkan backend. It's shown up in a couple places in the app, not just here.
I checked against the skia backend and this was not a problem.
doctor
engine version
64d0cc34e7949bd6e5b3891670e124c5cb233fa0
os
Android
screenshot
cc @bdero
The text was updated successfully, but these errors were encountered: