mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +00:00
LibWeb: Make new ImageData()
use unpremultiplied color data
This was already the case for `context.createImageData()`, but I forgot to do the same for `new ImageData()`. Add a regression test for both cases.
This commit is contained in:
parent
bd55e85027
commit
e926b4cbfb
Notes:
github-actions[bot]
2024-08-20 18:39:59 +00:00
Author: https://github.com/gmta
Commit: e926b4cbfb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1134
3 changed files with 32 additions and 1 deletions
|
@ -74,7 +74,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<ImageData>> ImageData::create(JS::Realm& re
|
|||
return WebIDL::IndexSizeError::create(realm, "Source height must be equal to the calculated height of the data."_fly_string);
|
||||
|
||||
// 7. Initialize this given sw, sh, settings set to settings, and source set to data.
|
||||
auto bitmap = TRY_OR_THROW_OOM(vm, Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::RGBA8888, Gfx::AlphaType::Premultiplied, Gfx::IntSize(sw, height), sw * sizeof(u32), uint8_clamped_array_data.data().data()));
|
||||
auto bitmap = TRY_OR_THROW_OOM(vm, Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::RGBA8888, Gfx::AlphaType::Unpremultiplied, Gfx::IntSize(sw, height), sw * sizeof(u32), uint8_clamped_array_data.data().data()));
|
||||
|
||||
return realm.heap().allocate<ImageData>(realm, realm, bitmap, uint8_clamped_array_data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue