-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] faster glyph atlas generation by removing data copies #41290
Conversation
…ions of fonts. - updated the existing test to be a proper unit test
This reverts commit 383d200.
72c2f6a to
c3238c1
Compare
|
|
||
| static ISize OptimumAtlasSizeForFontGlyphPairs( | ||
| const FontGlyphPair::Vector& pairs, | ||
| namespace { |
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.
what does putting in a namespace like this do?
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.
It should have no functional difference in this case. I was playing around with making that function templated and looks like I left that change in there by happenstance.
| size_t i = 0; | ||
| for (auto it = pairs.begin(); it != pairs.end(); ++i, ++it) { | ||
| const auto& pair = *it; |
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 don't really love this. Does it make a significant improvement on the generated code?
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.
It was required because you can't index into std::unordered_set. We could use a foreach loop but it isn't really cleaner imo.
Previously we were copying all of the data in the std::unordered_set to make a std::vector just so we could cleanly index into the data. But since the order of iteration of an std::unordered_set is deterministic, we don't really need to copy the data just to index into it.
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.
makes sense
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 with nits
…125069) flutter/engine@6d263ea...5fcc7b7 2023-04-18 [email protected] [Impeller] Gpu model information to Skia gold (flutter/engine#41216) 2023-04-18 [email protected] [Impeller] faster glyph atlas generation by removing data copies (flutter/engine#41290) 2023-04-18 [email protected] Migrate android AOT to engine_v2. (flutter/engine#41229) 2023-04-18 [email protected] Roll Skia from 5bd4bdc0d8e2 to f80ee1088861 (8 revisions) (flutter/engine#41302) 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
fixes flutter/flutter#124996
This is the best I could come up with easily. It doesn't give as good of a result as I'd hoped. I measured it with a simple microbenchmark derived from one of the unit tests and it gave a 6% decrease in time ( 241.314us vs 257.626us) on macos release builds (run with rosetta).
Improvements:
the benchmark
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.