1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibWeb: Add barebones CanvasGradient object

Also add the CanvasRenderingContext2D APIs to go along with it.
Note that it can't be used for anything yet.
This commit is contained in:
Andreas Kling 2022-02-03 20:08:27 +01:00
parent 545ec334f0
commit dc3bf32307
10 changed files with 130 additions and 0 deletions

View file

@ -14,6 +14,7 @@
#include <LibGfx/Path.h>
#include <LibWeb/Bindings/Wrappable.h>
#include <LibWeb/DOM/ExceptionOr.h>
#include <LibWeb/HTML/CanvasGradient.h>
#include <LibWeb/Layout/InlineNode.h>
#include <LibWeb/Layout/LineBox.h>
@ -83,6 +84,10 @@ public:
RefPtr<TextMetrics> measure_text(String const& text);
NonnullRefPtr<CanvasGradient> create_radial_gradient(double x0, double y0, double r0, double x1, double y1, double r1);
NonnullRefPtr<CanvasGradient> create_linear_gradient(double x0, double y0, double x1, double y1);
NonnullRefPtr<CanvasGradient> create_conic_gradient(double start_angle, double x, double y);
private:
explicit CanvasRenderingContext2D(HTMLCanvasElement&);