|
@@ -691,6 +691,20 @@ NonnullRefPtr<CanvasGradient> CanvasRenderingContext2D::create_conic_gradient(do
|
|
|
return CanvasGradient::create_conic(start_angle, x, y);
|
|
|
}
|
|
|
|
|
|
+// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-transform
|
|
|
+void CanvasRenderingContext2D::transform(double a, double b, double c, double d, double e, double f)
|
|
|
+{
|
|
|
+ // 1. If any of the arguments are infinite or NaN, then return.
|
|
|
+ if (!isfinite(a) || !isfinite(b) || !isfinite(c) || !isfinite(d) || !isfinite(e) || !isfinite(f))
|
|
|
+ return;
|
|
|
+
|
|
|
+ // 2. Replace the current transformation matrix with the result of multiplying the current transformation matrix with the matrix described by:
|
|
|
+ // a c e
|
|
|
+ // b d f
|
|
|
+ // 0 0 1
|
|
|
+ m_drawing_state.transform.multiply({ static_cast<float>(a), static_cast<float>(b), static_cast<float>(c), static_cast<float>(d), static_cast<float>(e), static_cast<float>(f) });
|
|
|
+}
|
|
|
+
|
|
|
// https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument
|
|
|
DOM::ExceptionOr<CanvasImageSourceUsability> check_usability_of_image(CanvasImageSource const& image)
|
|
|
{
|