summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-02-03 20:08:27 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-03 22:35:13 +0100
commitdc3bf32307085fee3cbbedfeb72ee10dc130d04c (patch)
treed8be0fdebbf165508ceede3789d50f855a0d313c /Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
parent545ec334f00791c39b0e7497a89e9e5001336c0e (diff)
downloadserenity-dc3bf32307085fee3cbbedfeb72ee10dc130d04c.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
index 4a521bc1e4..2b3c44321d 100644
--- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
+++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
@@ -496,4 +496,19 @@ CanvasRenderingContext2D::PreparedText CanvasRenderingContext2D::prepare_text(St
return prepared_text;
}
+NonnullRefPtr<CanvasGradient> CanvasRenderingContext2D::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> CanvasRenderingContext2D::create_linear_gradient(double x0, double y0, double x1, double y1)
+{
+ return CanvasGradient::create_linear(x0, y0, x1, y1);
+}
+
+NonnullRefPtr<CanvasGradient> CanvasRenderingContext2D::create_conic_gradient(double start_angle, double x, double y)
+{
+ return CanvasGradient::create_conic(start_angle, x, y);
+}
+
}