mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-19 16:59:47 +00:00
LibGfx: Saner memory usage of indexed bitmaps
Indexed bitmaps used to allocate four times the required amount of memory. Also, we should acknowledge that the underlying data is not always RGBA32, and instead cast it only when the true type is known.
This commit is contained in:
parent
d6673b384e
commit
9c3a33762b
Notes:
sideshowbarker
2024-07-19 02:44:58 +09:00
Author: https://github.com/BenWiederhake
Commit: 9c3a33762b
Pull-request: https://github.com/SerenityOS/serenity/pull/3398
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/nico
5 changed files with 89 additions and 86 deletions
|
@ -77,7 +77,7 @@ void SprayTool::paint_it()
|
|||
continue;
|
||||
if (ypos < 0 || ypos >= bitmap.height())
|
||||
continue;
|
||||
bitmap.set_pixel<Gfx::BitmapFormat::RGB32>(xpos, ypos, m_color);
|
||||
bitmap.set_pixel<Gfx::StorageFormat::RGBA32>(xpos, ypos, m_color);
|
||||
}
|
||||
|
||||
layer->did_modify_bitmap(*m_editor->image());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue