mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:27:35 +00:00
LibGfx: Give GlyphBitmap its rows data as Bytes
Instead of giving it a raw pointer to the start of the font's rows data and an offset, give it the Bytes for its rows only.
This commit is contained in:
parent
a3b91378df
commit
f6c40abdb1
2 changed files with 7 additions and 7 deletions
|
@ -23,9 +23,8 @@ namespace Gfx {
|
|||
class GlyphBitmap {
|
||||
public:
|
||||
GlyphBitmap() = default;
|
||||
GlyphBitmap(u8 const* rows, size_t start_index, IntSize size)
|
||||
GlyphBitmap(Bytes rows, IntSize size)
|
||||
: m_rows(rows)
|
||||
, m_start_index(start_index)
|
||||
, m_size(size)
|
||||
{
|
||||
}
|
||||
|
@ -46,11 +45,10 @@ public:
|
|||
private:
|
||||
AK::Bitmap bitmap(size_t y) const
|
||||
{
|
||||
return { const_cast<u8*>(m_rows) + bytes_per_row() * (m_start_index + y), bytes_per_row() * 8 };
|
||||
return { const_cast<u8*>(m_rows.offset_pointer(bytes_per_row() * y)), bytes_per_row() * 8 };
|
||||
}
|
||||
|
||||
u8 const* m_rows { nullptr };
|
||||
size_t m_start_index { 0 };
|
||||
Bytes m_rows;
|
||||
IntSize m_size { 0, 0 };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue