1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:37:46 +00:00

LibGfx: Remove OpenType::Font::m_buffer

At first glance this looks like it holds the memory that the various
slices point into... but it actually doesn't own that memory. Nobody
uses m_buffer, so it serves no purpose.
This commit is contained in:
Sam Atkins 2023-10-21 16:57:50 +01:00 committed by Andreas Kling
parent 984a2c314b
commit 5455ecf650
2 changed files with 1 additions and 6 deletions

View file

@ -278,7 +278,6 @@ ErrorOr<NonnullRefPtr<Font>> Font::try_load_from_offset(ReadonlyBytes buffer, u3
} }
return adopt_ref(*new Font( return adopt_ref(*new Font(
move(buffer),
move(head), move(head),
move(name), move(name),
move(hhea), move(hhea),

View file

@ -82,7 +82,6 @@ private:
static ErrorOr<NonnullRefPtr<Font>> try_load_from_offset(ReadonlyBytes, unsigned index = 0); static ErrorOr<NonnullRefPtr<Font>> try_load_from_offset(ReadonlyBytes, unsigned index = 0);
Font( Font(
ReadonlyBytes bytes,
Head&& head, Head&& head,
Name&& name, Name&& name,
Hhea&& hhea, Hhea&& hhea,
@ -98,8 +97,7 @@ private:
Optional<CBLC> cblc, Optional<CBLC> cblc,
Optional<CBDT> cbdt, Optional<CBDT> cbdt,
Optional<GPOS> gpos) Optional<GPOS> gpos)
: m_buffer(move(bytes)) : m_head(move(head))
, m_head(move(head))
, m_name(move(name)) , m_name(move(name))
, m_hhea(move(hhea)) , m_hhea(move(hhea))
, m_maxp(move(maxp)) , m_maxp(move(maxp))
@ -119,8 +117,6 @@ private:
RefPtr<Core::Resource> m_resource; RefPtr<Core::Resource> m_resource;
ReadonlyBytes m_buffer;
// These are stateful wrappers around non-owning slices // These are stateful wrappers around non-owning slices
Head m_head; Head m_head;
Name m_name; Name m_name;