mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
LibWeb: Pass ImageData as non-const to CanvasImageData mixin methods
CRC2D needs to manipulate the ImageData object in put_image_data()
This commit is contained in:
parent
91b549f797
commit
280ae45210
|
|
@ -18,7 +18,7 @@ public:
|
|||
virtual WebIDL::ExceptionOr<GC::Ref<ImageData>> create_image_data(int width, int height, Optional<ImageDataSettings> const& settings = {}) const = 0;
|
||||
virtual WebIDL::ExceptionOr<GC::Ref<ImageData>> create_image_data(ImageData const&) const = 0;
|
||||
virtual WebIDL::ExceptionOr<GC::Ptr<ImageData>> get_image_data(int x, int y, int width, int height, Optional<ImageDataSettings> const& settings = {}) const = 0;
|
||||
virtual void put_image_data(ImageData const&, float x, float y) = 0;
|
||||
virtual void put_image_data(ImageData&, float x, float y) = 0;
|
||||
|
||||
protected:
|
||||
CanvasImageData() = default;
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ WebIDL::ExceptionOr<GC::Ptr<ImageData>> CanvasRenderingContext2D::get_image_data
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-putimagedata-short
|
||||
void CanvasRenderingContext2D::put_image_data(ImageData const& image_data, float x, float y)
|
||||
void CanvasRenderingContext2D::put_image_data(ImageData& image_data, float x, float y)
|
||||
{
|
||||
// The putImageData(imageData, dx, dy) method steps are to put pixels from an ImageData onto a bitmap,
|
||||
// given imageData, this's output bitmap, dx, dy, 0, 0, imageData's width, and imageData's height.
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public:
|
|||
virtual WebIDL::ExceptionOr<GC::Ref<ImageData>> create_image_data(int width, int height, Optional<ImageDataSettings> const& settings = {}) const override;
|
||||
virtual WebIDL::ExceptionOr<GC::Ref<ImageData>> create_image_data(ImageData const& image_data) const override;
|
||||
virtual WebIDL::ExceptionOr<GC::Ptr<ImageData>> get_image_data(int x, int y, int width, int height, Optional<ImageDataSettings> const& settings = {}) const override;
|
||||
virtual void put_image_data(ImageData const&, float x, float y) override;
|
||||
virtual void put_image_data(ImageData&, float x, float y) override;
|
||||
|
||||
virtual void reset_to_default_state() override;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user