diff options
author | Andreas Kling <kling@serenityos.org> | 2021-03-16 11:48:42 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-16 11:50:03 +0100 |
commit | e0f32626bcae634528327e43bcfa59c810c5a3ef (patch) | |
tree | 072c22a299de5df27324e9174818298b9d34845d /Userland/Applications | |
parent | 0bfdf95af6afa4ed32cea574eaec661b63263c94 (diff) | |
download | serenity-e0f32626bcae634528327e43bcfa59c810c5a3ef.zip |
LibGfx: Rename 32-bit BitmapFormats to BGRA8888 and BGRx888x
The previous names (RGBA32 and RGB32) were misleading since that's not
the actual byte order in memory. The new names reflect exactly how the
color values get laid out in bitmap data.
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/DisplaySettings/MonitorWidget.cpp | 2 | ||||
-rw-r--r-- | Userland/Applications/PixelPaint/Image.cpp | 4 | ||||
-rw-r--r-- | Userland/Applications/PixelPaint/Layer.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Applications/DisplaySettings/MonitorWidget.cpp b/Userland/Applications/DisplaySettings/MonitorWidget.cpp index db60aa3233..2f04c19426 100644 --- a/Userland/Applications/DisplaySettings/MonitorWidget.cpp +++ b/Userland/Applications/DisplaySettings/MonitorWidget.cpp @@ -116,7 +116,7 @@ void MonitorWidget::paint_event(GUI::PaintEvent& event) // Render text label scaled with scale factor to hint at its effect. // FIXME: Once bitmaps have intrinsic scale factors, we could create a bitmap with an intrinsic scale factor of m_desktop_scale_factor // and that should give us the same effect with less code. - auto text_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::RGBA32, Gfx::IntSize { painter.font().width(displayed_resolution_string) + 1, painter.font().glyph_height() + 1 }); + auto text_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, Gfx::IntSize { painter.font().width(displayed_resolution_string) + 1, painter.font().glyph_height() + 1 }); GUI::Painter text_painter(*text_bitmap); text_painter.set_font(painter.font()); diff --git a/Userland/Applications/PixelPaint/Image.cpp b/Userland/Applications/PixelPaint/Image.cpp index 248ccc1bb0..4638b83bad 100644 --- a/Userland/Applications/PixelPaint/Image.cpp +++ b/Userland/Applications/PixelPaint/Image.cpp @@ -141,7 +141,7 @@ void Image::save(const String& file_path) const void Image::export_bmp(const String& file_path) { - auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, m_size); + auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, m_size); GUI::Painter painter(*bitmap); paint_into(painter, { 0, 0, m_size.width(), m_size.height() }); @@ -154,7 +154,7 @@ void Image::export_bmp(const String& file_path) void Image::export_png(const String& file_path) { - auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::RGBA32, m_size); + auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, m_size); GUI::Painter painter(*bitmap); paint_into(painter, { 0, 0, m_size.width(), m_size.height() }); diff --git a/Userland/Applications/PixelPaint/Layer.cpp b/Userland/Applications/PixelPaint/Layer.cpp index e607113c32..8a0627d765 100644 --- a/Userland/Applications/PixelPaint/Layer.cpp +++ b/Userland/Applications/PixelPaint/Layer.cpp @@ -66,7 +66,7 @@ Layer::Layer(Image& image, const Gfx::IntSize& size, const String& name) : m_image(image) , m_name(name) { - m_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::RGBA32, size); + m_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, size); } Layer::Layer(Image& image, const Gfx::Bitmap& bitmap, const String& name) |