diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-08-11 17:39:37 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-08-14 11:30:40 +0200 |
commit | 6644f3ab440e4a5b13536a812acffd5dce1d9ba8 (patch) | |
tree | cb763451c32952a88b78f843846d68412b107ab1 /Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h | |
parent | 389f1ee6f54a089aa9b7b0618ed477f8a7cfd4c1 (diff) | |
download | serenity-6644f3ab440e4a5b13536a812acffd5dce1d9ba8.zip |
LibWeb: Teach CRC2D to draw Path2Ds :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h index c225a47110..4eb0c4ee6d 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h +++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h @@ -64,13 +64,13 @@ public: void begin_path(); void stroke(); + void stroke(Path2D const& path); void fill_text(String const&, float x, float y, Optional<double> max_width); void stroke_text(String const&, float x, float y, Optional<double> max_width); - // FIXME: We should only have one fill(), really. Fix the wrapper generator! - void fill(Gfx::Painter::WindingRule); void fill(String const& fill_rule); + void fill(Path2D& path, String const& fill_rule); RefPtr<ImageData> create_image_data(int width, int height) const; DOM::ExceptionOr<RefPtr<ImageData>> get_image_data(int x, int y, int width, int height) const; @@ -118,6 +118,9 @@ private: HTMLCanvasElement& canvas_element(); HTMLCanvasElement const& canvas_element() const; + void stroke_internal(Gfx::Path const&); + void fill_internal(Gfx::Path&, String const& fill_rule); + // https://html.spec.whatwg.org/multipage/canvas.html#drawing-state struct DrawingState { Gfx::AffineTransform transform; |