diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2020-09-12 11:14:44 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-12 11:35:41 +0200 |
commit | e3101c74c641aa9dd826189599ed58a6f92eed0b (patch) | |
tree | 317c867e30b3340e87284f8198d1982ebc82072f /Libraries/LibGUI | |
parent | 568d53c9b1eb81b38aaccd904cce682f8a7d0cf0 (diff) | |
download | serenity-e3101c74c641aa9dd826189599ed58a6f92eed0b.zip |
LibGUI: Use new Bitmap::minimum_pitch method
Also, make sure that the painter actually draws on a RGB(A) bitmap.
Closes #3460.
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r-- | Libraries/LibGUI/Window.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibGUI/Window.cpp b/Libraries/LibGUI/Window.cpp index aba48f26f6..4e15ca5eea 100644 --- a/Libraries/LibGUI/Window.cpp +++ b/Libraries/LibGUI/Window.cpp @@ -635,7 +635,7 @@ RefPtr<Gfx::Bitmap> Window::create_shared_bitmap(Gfx::BitmapFormat format, const { ASSERT(WindowServerConnection::the().server_pid()); ASSERT(!size.is_empty()); - size_t pitch = round_up_to_power_of_two(size.width() * sizeof(Gfx::RGBA32), 16); + size_t pitch = Gfx::Bitmap::minimum_pitch(size.width(), format); size_t size_in_bytes = size.height() * pitch; auto shared_buffer = SharedBuffer::create_with_size(size_in_bytes); ASSERT(shared_buffer); |