mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09: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
|
@ -23,7 +23,7 @@ struct Global {
|
|||
TEST_CASE(tolerate_incorrect_sfnt_size)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("woff2/incorrect_sfnt_size.woff2"sv)));
|
||||
auto font = TRY_OR_FAIL(WOFF2::try_load_from_externally_owned_memory(file->bytes()));
|
||||
auto font = TRY_OR_FAIL(WOFF2::try_load_from_bytes(file->bytes()));
|
||||
EXPECT_EQ(font->family(), "Test"_string);
|
||||
EXPECT_EQ(font->glyph_count(), 4u);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ TEST_CASE(malformed_woff2)
|
|||
|
||||
for (auto test_input : test_inputs) {
|
||||
auto file = MUST(Core::MappedFile::map(test_input));
|
||||
auto font_or_error = WOFF2::try_load_from_externally_owned_memory(file->bytes());
|
||||
auto font_or_error = WOFF2::try_load_from_bytes(file->bytes());
|
||||
EXPECT(font_or_error.is_error());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue