diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-08-12 17:52:43 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-08-14 11:30:40 +0200 |
commit | aa3cb8b425b7e9464c650fec816c0c0532a17e41 (patch) | |
tree | b2594374354afed1be0e97401467c8dce2bc067e /Userland/Libraries/LibWeb/HTML/Canvas | |
parent | afabd613bd1dad7f2597edeef76f9c193ff4fa0d (diff) | |
download | serenity-aa3cb8b425b7e9464c650fec816c0c0532a17e41.zip |
LibWeb: Extract CanvasFillStrokeStyles class from CRC2D
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/Canvas')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h b/Userland/Libraries/LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h index 0f0e773256..d65da16932 100644 --- a/Userland/Libraries/LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h +++ b/Userland/Libraries/LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h @@ -10,6 +10,7 @@ #include <AK/String.h> #include <LibWeb/HTML/Canvas/CanvasState.h> +#include <LibWeb/HTML/CanvasGradient.h> namespace Web::HTML { @@ -41,6 +42,21 @@ public: return my_drawing_state().stroke_style.to_string(); } + NonnullRefPtr<CanvasGradient> create_radial_gradient(double x0, double y0, double r0, double x1, double y1, double r1) + { + return CanvasGradient::create_radial(x0, y0, r0, x1, y1, r1); + } + + NonnullRefPtr<CanvasGradient> create_linear_gradient(double x0, double y0, double x1, double y1) + { + return CanvasGradient::create_linear(x0, y0, x1, y1); + } + + NonnullRefPtr<CanvasGradient> create_conic_gradient(double start_angle, double x, double y) + { + return CanvasGradient::create_conic(start_angle, x, y); + } + protected: CanvasFillStrokeStyles() = default; |