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/LibGfx | |
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/LibGfx')
-rw-r--r-- | Libraries/LibGfx/Painter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibGfx/Painter.cpp b/Libraries/LibGfx/Painter.cpp index 1844da6a24..9d14df6de8 100644 --- a/Libraries/LibGfx/Painter.cpp +++ b/Libraries/LibGfx/Painter.cpp @@ -68,6 +68,7 @@ ALWAYS_INLINE Color get_pixel(const Gfx::Bitmap& bitmap, int x, int y) Painter::Painter(Gfx::Bitmap& bitmap) : m_target(bitmap) { + ASSERT(bitmap.format() == Gfx::BitmapFormat::RGB32 || bitmap.format() == Gfx::BitmapFormat::RGBA32); m_state_stack.append(State()); state().font = &Font::default_font(); state().clip_rect = { { 0, 0 }, bitmap.size() }; |