mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibGfx: Remove Bitmap and Painter "scale" concept
We don't need intrinsic scale factors for Gfx::Bitmap in Ladybird, as everything flows through the CSS / device pixel ratio mechanism. This patch also removes various unused functions instead of adapting them to the change.
This commit is contained in:
@@ -30,7 +30,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<ImageData>> ImageData::create(JS::Realm& re
|
||||
// 2. Initialize this given sw, sh, and settings set to settings.
|
||||
// 3. Initialize the image data of this to transparent black.
|
||||
auto data = TRY(JS::Uint8ClampedArray::create(realm, sw * sh * 4));
|
||||
auto bitmap = TRY_OR_THROW_OOM(vm, Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::RGBA8888, Gfx::IntSize(sw, sh), 1, sw * sizeof(u32), data->data().data()));
|
||||
auto bitmap = TRY_OR_THROW_OOM(vm, Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::RGBA8888, Gfx::IntSize(sw, sh), sw * sizeof(u32), data->data().data()));
|
||||
|
||||
return realm.heap().allocate<ImageData>(realm, realm, bitmap, data);
|
||||
}
|
||||
@@ -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::IntSize(sw, height), 1, sw * sizeof(u32), uint8_clamped_array_data.data().data()));
|
||||
auto bitmap = TRY_OR_THROW_OOM(vm, Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::RGBA8888, 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user