-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `FontContextHandle` was really only used on FreeType platforms to store the `FT_Library` handle to use for creating faces. Each `FontContext` and `FontCacheThread` would create its own `FontContextHandle`. This change removes this data structure in favor of a mutex-protected shared `FontContextHandle` for an entire Servo process. The handle is initialized using a `OnceLock` to ensure that it only happens once and also that it stays alive for the entire process lifetime. In addition to greatly simplifying the code, this will make it possible for different threads to share platform-specific `FontHandle`s, avoiding multiple allocations for a single font. The only downside to all of this is that memory usage of FreeType fonts isn't measured (though the mechanism is still there). This is because the `FontCacheThread` currently doesn't do any memory measurement. Eventually this *will* happen though, during the font system redesign. In exchange, this should reduce the memory usage since there is only a single FreeType library loaded into memory now. This is part of #32033.
- Loading branch information
Showing
16 changed files
with
152 additions
and
247 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.