summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-02 23:07:05 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-06 00:27:09 +0200
commit369dd42d6751d1b11e1bb05d4afd3e57aed9f186 (patch)
treee91d3632444848215f6feac985f19b0b835e8eb1 /Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
parent4452b5ca098a10e31eab5c49837dfcb107fe1414 (diff)
downloadserenity-369dd42d6751d1b11e1bb05d4afd3e57aed9f186.zip
LibWeb: Make ImageData GC-allocated
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
index 5c923a6fe9..5136a4c997 100644
--- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
+++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
@@ -317,13 +317,13 @@ void CanvasRenderingContext2D::fill(Path2D& path, String const& fill_rule)
return fill_internal(transformed_path, fill_rule);
}
-RefPtr<ImageData> CanvasRenderingContext2D::create_image_data(int width, int height) const
+JS::GCPtr<ImageData> CanvasRenderingContext2D::create_image_data(int width, int height) const
{
- return ImageData::create_with_size(vm(), width, height);
+ return ImageData::create_with_size(global_object(), width, height);
}
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-getimagedata
-DOM::ExceptionOr<RefPtr<ImageData>> CanvasRenderingContext2D::get_image_data(int x, int y, int width, int height) const
+DOM::ExceptionOr<JS::GCPtr<ImageData>> CanvasRenderingContext2D::get_image_data(int x, int y, int width, int height) const
{
// 1. If either the sw or sh arguments are zero, then throw an "IndexSizeError" DOMException.
if (width == 0 || height == 0)
@@ -335,7 +335,7 @@ DOM::ExceptionOr<RefPtr<ImageData>> CanvasRenderingContext2D::get_image_data(int
// 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(vm(), width, height);
+ auto image_data = ImageData::create_with_size(global_object(), 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())