mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 06:15:07 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue