From c684af1f83c7a5b8d18ce41d5df589718720cec6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 16 Mar 2021 12:10:31 +0100 Subject: [PATCH] LibWeb: Use Gfx::Bitmap::RGBA8888 for ImageData bitmaps This makes the colors show up correctly when using putImageData() to draw an ImageData onto a CanvasRenderingContext2D. :^) --- Userland/Libraries/LibWeb/HTML/ImageData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/ImageData.cpp b/Userland/Libraries/LibWeb/HTML/ImageData.cpp index fd39fbf43d..d0fbfd9d0b 100644 --- a/Userland/Libraries/LibWeb/HTML/ImageData.cpp +++ b/Userland/Libraries/LibWeb/HTML/ImageData.cpp @@ -46,7 +46,7 @@ RefPtr ImageData::create_with_size(JS::GlobalObject& global_object, i auto data_handle = JS::make_handle(data); - auto bitmap = Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::BGRA8888, Gfx::IntSize(width, height), 1, width * sizeof(u32), (u32*)data->data()); + auto bitmap = Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::RGBA8888, Gfx::IntSize(width, height), 1, width * sizeof(u32), (u32*)data->data()); if (!bitmap) return nullptr; return adopt(*new ImageData(bitmap.release_nonnull(), move(data_handle)));