mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00: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
Notes:
github-actions[bot]
2025-04-16 16:44:04 +00:00
Author: https://github.com/ADKaster
Commit: 280ae45210
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4362
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/Hendiadyoin1
3 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue