From 65b87bace9d4dd91ef94dc2ebc9449f6457cbf9d Mon Sep 17 00:00:00 2001 From: MacDue Date: Fri, 5 Jan 2024 23:32:29 +0000 Subject: [PATCH] LibGfx: Move Gfx::color_for_format() to header --- Userland/Libraries/LibGfx/Painter.cpp | 13 ------------- Userland/Libraries/LibGfx/Painter.h | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index 6d2417a707..3109f95853 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -43,19 +43,6 @@ namespace Gfx { -ALWAYS_INLINE static Color color_for_format(BitmapFormat format, ARGB32 value) -{ - switch (format) { - case BitmapFormat::BGRA8888: - return Color::from_argb(value); - case BitmapFormat::BGRx8888: - return Color::from_rgb(value); - // FIXME: Handle other formats - default: - VERIFY_NOT_REACHED(); - } -} - template ALWAYS_INLINE Color get_pixel(Gfx::Bitmap const& bitmap, int x, int y) { diff --git a/Userland/Libraries/LibGfx/Painter.h b/Userland/Libraries/LibGfx/Painter.h index 43b90ad19c..3205fe456b 100644 --- a/Userland/Libraries/LibGfx/Painter.h +++ b/Userland/Libraries/LibGfx/Painter.h @@ -27,6 +27,19 @@ namespace Gfx { +ALWAYS_INLINE static Color color_for_format(BitmapFormat format, ARGB32 value) +{ + switch (format) { + case BitmapFormat::BGRA8888: + return Color::from_argb(value); + case BitmapFormat::BGRx8888: + return Color::from_rgb(value); + // FIXME: Handle other formats + default: + VERIFY_NOT_REACHED(); + } +} + class Painter { public: static constexpr int LINE_SPACING = 4;