ladybird/Userland/Libraries/LibWeb/HTML/Canvas
MacDue 8057542dea LibGfx: Simplify path storage and tidy up APIs
Rather than make path segments virtual and refcounted let's store
`Gfx::Path`s as a list of `FloatPoints` and a separate list of commands.

This reduces the size of paths, for example, a `MoveTo` goes from 24
bytes to 9 bytes (one point + a single byte command), and removes a
layer of indirection when accessing segments. A nice little bonus is
transforming a path can now be done by applying the transform to all
points in the path (without looking at the commands).

Alongside this there's been a few minor API changes:

- `path.segments()` has been removed
  * All current uses could be replaced by a new `path.is_empty()` API
  * There's also now an iterator for looping over `Gfx::Path` segments
- `path.add_path(other_path)` has been removed
  * This was a duplicate of `path.append_path(other_path)`
- `path.ensure_subpath(point)` has been removed
  * Had one use and is equivalent to an `is_empty()` check + `move_to()`
- `path.close()` and `path.close_all_subpaths()` assume an implicit
  `moveto 0,0` if there's no `moveto` at the start of a path (for
  consistency with `path.segmentize_path()`).

Only the last point could change behaviour (though in LibWeb/SVGs all
paths start with a `moveto` as per the spec, it's only possible to
construct a path without a starting `moveto` via LibGfx APIs).
2024-03-18 07:09:37 +01:00
..
CanvasCompositing.h LibWeb: Add initial implementation of CRC2D.globalAlpha 2023-06-18 20:31:11 +02:00
CanvasCompositing.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
CanvasDrawImage.cpp
CanvasDrawImage.h Everywhere: Remove unused DeprecatedString includes 2023-04-09 22:00:54 +02:00
CanvasDrawImage.idl
CanvasDrawPath.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
CanvasDrawPath.idl LibWeb: Add initial implementation of CRC2D.clip() 2023-04-09 18:42:45 +02:00
CanvasFillStrokeStyles.h LibWeb: Report when CanvasFillOrStrokeStyle parsing fails 2023-11-24 08:42:18 +01:00
CanvasFillStrokeStyles.idl LibWeb: Implement CanvasRenderingContext2D.createPattern() 2023-02-03 20:36:21 +01:00
CanvasImageData.h
CanvasImageData.idl
CanvasImageSmoothing.h LibWeb: Implement CRC2D.imageSmoothingEnabled 2023-03-29 22:48:04 +02:00
CanvasImageSmoothing.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
CanvasPath.cpp LibGfx: Simplify path storage and tidy up APIs 2024-03-18 07:09:37 +01:00
CanvasPath.h LibWeb: Add canvas context2d roundRect 2023-10-20 07:20:29 +02:00
CanvasPath.idl LibWeb: Add canvas context2d roundRect 2023-10-20 07:20:29 +02:00
CanvasPathDrawingStyles.h
CanvasPathDrawingStyles.idl LibWeb: Add Canvas Context2D basic text align and text baseline support 2023-08-05 17:17:08 +02:00
CanvasRect.h
CanvasRect.idl
CanvasState.cpp LibGfx+LibWeb: Propagate OOM when creating PaintStyles 2023-03-02 11:49:13 +01:00
CanvasState.h LibGfx+LibWeb: Move HTML::CanvasPathClipper to Gfx::PathClipper 2024-03-17 09:30:53 +01:00
CanvasState.idl
CanvasText.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
CanvasText.idl
CanvasTextDrawingStyles.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
CanvasTextDrawingStyles.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
CanvasTransform.h LibWeb: Add missing Canvas Context2D transform functions 2023-09-17 16:48:54 -06:00
CanvasTransform.idl LibWeb: Add missing Canvas Context2D transform functions 2023-09-17 16:48:54 -06:00