1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:47:45 +00:00

LibWeb: Extract CanvasTransform class from CRC2D

The implementation of this got a little funky, because it has to access
methods from CanvasState.
This commit is contained in:
Sam Atkins 2022-08-12 14:48:11 +01:00 committed by Andreas Kling
parent 08e6071ebb
commit aa87b9699e
5 changed files with 101 additions and 69 deletions

View file

@ -5,6 +5,7 @@
#import <HTML/CanvasGradient.idl>
#import <HTML/Canvas/CanvasPath.idl>
#import <HTML/Canvas/CanvasState.idl>
#import <HTML/Canvas/CanvasTransform.idl>
#import <HTML/Path2D.idl>
// https://html.spec.whatwg.org/multipage/canvas.html#canvasrenderingcontext2d
@ -15,10 +16,6 @@ interface CanvasRenderingContext2D {
undefined strokeRect(double x, double y, double w, double h);
undefined clearRect(double x, double y, double w, double h);
undefined scale(double x, double y);
undefined translate(double x, double y);
undefined rotate(double radians);
undefined beginPath();
// FIXME: `DOMString` should be `CanvasFillRule`
undefined fill(optional DOMString fillRule = "nonzero");
@ -50,10 +47,6 @@ interface CanvasRenderingContext2D {
CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
CanvasGradient createConicGradient(double startAngle, double x, double y);
undefined transform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
undefined setTransform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
undefined resetTransform();
// undefined clip(optional CanvasFillRule fillRule = "nonzero");
// undefined clip(Path2D path, optional CanvasFillRule fillRule = "nonzero");
// FIXME: Replace this with the two definitions above.
@ -62,4 +55,5 @@ interface CanvasRenderingContext2D {
};
CanvasRenderingContext2D includes CanvasState;
CanvasRenderingContext2D includes CanvasTransform;
CanvasRenderingContext2D includes CanvasPath;