1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:18:11 +00:00

LibWeb: Generate CanvasRenderingContext2D bindings from IDL :^)

We're still missing optional argument support, so this implementation
doesn't support fill(), only fill(fill_rule).

Still it's really nice to get rid of so much hand-written wrapper code.
This commit is contained in:
Andreas Kling 2020-06-22 18:39:22 +02:00
parent f361d25ec8
commit 9ce25bbf1d
8 changed files with 84 additions and 505 deletions

View file

@ -72,12 +72,15 @@ public:
void line_to(float x, float y);
void quadratic_curve_to(float cx, float cy, float x, float y);
void stroke();
void fill(Gfx::Painter::WindingRule);
RefPtr<ImageData> create_image_data(JS::GlobalObject&, int width, int height) const;
// FIXME: We should only have one fill(), really. Fix the wrapper generator!
void fill(Gfx::Painter::WindingRule);
void fill(const String& fill_rule);
RefPtr<ImageData> create_image_data(int width, int height) const;
void put_image_data(const ImageData&, float x, float y);
HTMLCanvasElement* element() { return m_element; }
HTMLCanvasElement* canvas() { return m_element; }
private:
explicit CanvasRenderingContext2D(HTMLCanvasElement&);