1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 17:45:07 +00:00

LibGfx: Remove redundant bits() method

In all circumstances, this returned exactly the same thing as scanline_u8(),
so let's just remove the silly detour.

This does not add any new dependency on Bitmap-internals, because that already existed.
This commit is contained in:
Ben Wiederhake 2020-09-06 01:10:33 +02:00 committed by Andreas Kling
parent 25ccd40d5a
commit d6673b384e
4 changed files with 17 additions and 30 deletions

View file

@ -118,7 +118,7 @@ static int ensure_realized_icon(IconContainerType& container)
auto shared_buffer = SharedBuffer::create_with_size(container.icon()->size_in_bytes());
ASSERT(shared_buffer);
auto shared_icon = Gfx::Bitmap::create_with_shared_buffer(Gfx::BitmapFormat::RGBA32, *shared_buffer, container.icon()->size());
memcpy(shared_buffer->data(), container.icon()->bits(0), container.icon()->size_in_bytes());
memcpy(shared_buffer->data(), container.icon()->scanline_u8(0), container.icon()->size_in_bytes());
shared_buffer->seal();
shared_buffer->share_with(WindowServerConnection::the().server_pid());
container.set_icon(shared_icon);