mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 01:59:14 +03:00
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. :^)
This commit is contained in:
parent
fe861512c8
commit
c684af1f83
Notes:
sideshowbarker
2024-07-18 21:18:31 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c684af1f83c
@ -46,7 +46,7 @@ RefPtr<ImageData> 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)));
|
||||
|
Loading…
Reference in New Issue
Block a user