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

[Impeller] Need a Skia API for loading emoji fonts directly and bypassing SkCanvas #147996

Closed
jonahwilliams opened this issue May 8, 2024 · 6 comments
Assignees
Labels
dependency: skia Skia team may need to help us e: impeller Impeller rendering backend issues and features requests P1 High-priority issues at the top of the work list team-engine Owned by Engine team triaged-engine Triaged by Engine team

Comments

@jonahwilliams
Copy link
Member

In order to render emoji, we need to populate a glyph atlas using an SkCanvas. The software rasterization of these images (frequently pngs) is quite slow and may not be necessary, depending on how the OS APis works. If we are able to load an emoji at the correct scale, it would be advantageous to bypass the software canvas, load the png into a host buffer and blit onto our atlas.

If we need to resize the image, then there may be faster routes than software but its probably less clear.

image

@jonahwilliams jonahwilliams added e: impeller Impeller rendering backend issues and features requests team-engine Owned by Engine team dependency: skia Skia team may need to help us labels May 8, 2024
@jonahwilliams
Copy link
Member Author

image

If we could just get the png we could bypass all of this...

@jonahwilliams
Copy link
Member Author

#138798

@jonahwilliams
Copy link
Member Author

Basically we need to be able to call something like SkScalerContext_FreeType::generateImage, but give it our own buffer.

@jonahwilliams jonahwilliams added P2 Important issues not at the top of the work list triaged-engine Triaged by Engine team labels May 13, 2024
@jonahwilliams
Copy link
Member Author

Here is an example of what Skia does on the same app: notice the second round of software rasterization can be avoided:

image

@jonahwilliams jonahwilliams self-assigned this May 17, 2024
@jonahwilliams jonahwilliams added P1 High-priority issues at the top of the work list and removed P2 Important issues not at the top of the work list labels May 17, 2024
@jonahwilliams
Copy link
Member Author

Turns out this was our bug. For reasons I don't fully understand, using the Vulkan staging buffer as the canvas src is absolutely destroying the throughput here. We don't actually need this.

Copy link

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependency: skia Skia team may need to help us e: impeller Impeller rendering backend issues and features requests P1 High-priority issues at the top of the work list team-engine Owned by Engine team triaged-engine Triaged by Engine team
Projects
None yet
Development

No branches or pull requests

1 participant