mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
LibGfx: Rename WOFF[2]::try_load_from_externally_owned_memory()
Typeface::try_load_from_externally_owned_memory() relies on that external owner keeping the memory around. However, neither WOFF nor WOFF2 do so - they both create separate ByteBuffers to hold the TTF data. So, rename them to make it clearer that they don't have any requirements on the byte owner.
This commit is contained in:
parent
23009779e1
commit
6b762331df
Notes:
github-actions[bot]
2025-05-03 11:03:42 +00:00
Author: https://github.com/AtkinsSJ
Commit: 6b762331df
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4536
10 changed files with 14 additions and 14 deletions
|
@ -274,12 +274,12 @@ ErrorOr<NonnullRefPtr<Gfx::Typeface const>> FontLoader::try_load_font()
|
|||
}
|
||||
}
|
||||
if (mime_type->essence() == "font/woff"sv || mime_type->essence() == "application/font-woff"sv) {
|
||||
if (auto result = WOFF::try_load_from_externally_owned_memory(resource()->encoded_data()); !result.is_error()) {
|
||||
if (auto result = WOFF::try_load_from_bytes(resource()->encoded_data()); !result.is_error()) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (mime_type->essence() == "font/woff2"sv || mime_type->essence() == "application/font-woff2"sv) {
|
||||
if (auto result = WOFF2::try_load_from_externally_owned_memory(resource()->encoded_data()); !result.is_error()) {
|
||||
if (auto result = WOFF2::try_load_from_bytes(resource()->encoded_data()); !result.is_error()) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue