mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibWeb: Remove ImageData's create_with_size() and use create() instead
Removes ImageData::create_with_size() and redirects previous usage to ImageData::create().
This commit is contained in:
parent
8a1e88677f
commit
51847bbebf
Notes:
sideshowbarker
2024-07-16 23:59:28 +09:00
Author: https://github.com/kennethmyhra
Commit: 51847bbebf
Pull-request: https://github.com/SerenityOS/serenity/pull/23692
Reviewed-by: https://github.com/awesomekling
5 changed files with 5 additions and 26 deletions
|
@ -374,9 +374,9 @@ void CanvasRenderingContext2D::fill(Path2D& path, StringView fill_rule)
|
|||
return fill_internal(transformed_path, parse_fill_rule(fill_rule));
|
||||
}
|
||||
|
||||
JS::GCPtr<ImageData> CanvasRenderingContext2D::create_image_data(int width, int height) const
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<ImageData>> CanvasRenderingContext2D::create_image_data(int width, int height) const
|
||||
{
|
||||
return ImageData::create_with_size(realm(), width, height);
|
||||
return ImageData::create(realm(), width, height);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-getimagedata
|
||||
|
@ -392,7 +392,7 @@ WebIDL::ExceptionOr<JS::GCPtr<ImageData>> CanvasRenderingContext2D::get_image_da
|
|||
|
||||
// 3. Let imageData be a new ImageData object.
|
||||
// 4. Initialize imageData given sw, sh, settings set to settings, and defaultColorSpace set to this's color space.
|
||||
auto image_data = ImageData::create_with_size(realm(), width, height);
|
||||
auto image_data = TRY(ImageData::create(realm(), width, height));
|
||||
|
||||
// NOTE: We don't attempt to create the underlying bitmap here; if it doesn't exist, it's like copying only transparent black pixels (which is a no-op).
|
||||
if (!canvas_element().bitmap())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue