ladybird/Userland/Libraries/LibWeb/SVG
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
..
AttributeNames.cpp LibWeb: Add xlink:href to SVG attribute names 2023-12-30 18:50:29 +01:00
AttributeNames.h LibWeb: Add xlink:href to SVG attribute names 2023-12-30 18:50:29 +01:00
AttributeParser.cpp
AttributeParser.h
Default.css
SVGAnimatedLength.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGAnimatedLength.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGAnimatedLength.idl
SVGAnimatedNumber.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGAnimatedNumber.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGAnimatedNumber.idl LibWeb: Format all .idl files to use four space indentation 2024-01-18 14:00:06 +01:00
SVGAnimatedRect.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGAnimatedRect.h LibWeb: Add SVGSVGElement.viewBox attribute 2024-01-25 08:23:41 +01:00
SVGAnimatedRect.idl LibWeb: Add SVGSVGElement.viewBox attribute 2024-01-25 08:23:41 +01:00
SVGAnimatedString.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGAnimatedString.h LibWeb: Implement SVGAnimatedString 2023-12-30 18:50:29 +01:00
SVGAnimatedString.idl LibWeb: Format all .idl files to use four space indentation 2024-01-18 14:00:06 +01:00
SVGCircleElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGCircleElement.h LibWeb: Update SVG <circle> element to use geometry properties 2024-03-04 10:50:32 +01:00
SVGCircleElement.idl
SVGClipPathElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGClipPathElement.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGClipPathElement.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
SVGDecodedImageData.cpp Everywhere: Use unqualified AK::URL 2024-02-25 08:54:31 +01:00
SVGDecodedImageData.h Everywhere: Use unqualified AK::URL 2024-02-25 08:54:31 +01:00
SVGDefsElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGDefsElement.h LibWeb: Special case SVG masks during layout 2024-03-12 08:51:50 +01:00
SVGDefsElement.idl
SVGElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGElement.h LibWeb: Port Element::attribute_changed from DeprecatedString to String 2023-11-19 08:16:34 +00:00
SVGElement.idl
SVGEllipseElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGEllipseElement.h LibWeb: Update SVG get_path() API to take a viewport size 2024-03-04 10:50:32 +01:00
SVGEllipseElement.idl
SVGFitToViewBox.idl LibWeb: Add SVGSVGElement.viewBox attribute 2024-01-25 08:23:41 +01:00
SVGForeignObjectElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGForeignObjectElement.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGForeignObjectElement.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
SVGGElement.cpp LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGGElement.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGGeometryElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGGeometryElement.h LibWeb: Update SVG get_path() API to take a viewport size 2024-03-04 10:50:32 +01:00
SVGGeometryElement.idl
SVGGradientElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGGradientElement.h LibWeb: Handle reference cycles in SVG gradient linking 2024-03-11 18:29:10 +01:00
SVGGradientElement.idl
SVGGraphicsElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGGraphicsElement.h Everywhere: Use unqualified AK::URL 2024-02-25 08:54:31 +01:00
SVGGraphicsElement.idl
SVGLength.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGLength.h LibWeb: Add helper to convert CSS LengthPercentage to SVGLength 2024-03-04 10:50:32 +01:00
SVGLength.idl
SVGLinearGradientElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGLinearGradientElement.h LibWeb: Handle reference cycles in SVG gradient linking 2024-03-11 18:29:10 +01:00
SVGLinearGradientElement.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
SVGLineElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGLineElement.h LibWeb: Update SVG get_path() API to take a viewport size 2024-03-04 10:50:32 +01:00
SVGLineElement.idl
SVGMaskElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGMaskElement.h LibWeb: Special case SVG masks during layout 2024-03-12 08:51:50 +01:00
SVGMaskElement.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
SVGPathElement.cpp LibGfx: Simplify path storage and tidy up APIs 2024-03-18 07:09:37 +01:00
SVGPathElement.h LibWeb: Update SVG get_path() API to take a viewport size 2024-03-04 10:50:32 +01:00
SVGPathElement.idl
SVGPolygonElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGPolygonElement.h LibWeb: Update SVG get_path() API to take a viewport size 2024-03-04 10:50:32 +01:00
SVGPolygonElement.idl
SVGPolylineElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGPolylineElement.h LibWeb: Update SVG get_path() API to take a viewport size 2024-03-04 10:50:32 +01:00
SVGPolylineElement.idl
SVGRadialGradientElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGRadialGradientElement.h LibWeb: Handle reference cycles in SVG gradient linking 2024-03-11 18:29:10 +01:00
SVGRadialGradientElement.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
SVGRectElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGRectElement.h LibWeb: Update SVG get_path() API to take a viewport size 2024-03-04 10:50:32 +01:00
SVGRectElement.idl
SVGScriptElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGScriptElement.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGScriptElement.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
SVGStopElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGStopElement.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGStopElement.idl
SVGStyleElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGStyleElement.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGStyleElement.idl
SVGSVGElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGSVGElement.h LibWeb: Add initial support for nesting SVG viewports 2024-01-27 18:12:13 +01:00
SVGSVGElement.idl LibWeb: Add SVGSVGElement.viewBox attribute 2024-01-25 08:23:41 +01:00
SVGSymbolElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGSymbolElement.h LibWeb: Add initial support for nesting SVG viewports 2024-01-27 18:12:13 +01:00
SVGSymbolElement.idl
SVGTextContentElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGTextContentElement.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
SVGTextContentElement.idl
SVGTextElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGTextElement.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGTextElement.idl
SVGTextPathElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGTextPathElement.h LibWeb: Add SVGURIReference 2023-12-30 18:50:29 +01:00
SVGTextPathElement.idl LibWeb: Format all .idl files to use four space indentation 2024-01-18 14:00:06 +01:00
SVGTextPositioningElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGTextPositioningElement.h LibWeb: Port Element::attribute_changed from DeprecatedString to String 2023-11-19 08:16:34 +00:00
SVGTextPositioningElement.idl
SVGTitleElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGTitleElement.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGTitleElement.idl
SVGTSpanElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGTSpanElement.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
SVGTSpanElement.idl
SVGURIReference.h LibWeb: Add SVGURIReference 2023-12-30 18:50:29 +01:00
SVGURIReference.idl LibWeb: Add SVGURIReference 2023-12-30 18:50:29 +01:00
SVGUseElement.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGUseElement.h LibWeb: Implement SVGUseElement#href 2023-12-30 18:50:29 +01:00
SVGUseElement.idl LibWeb: Implement SVGUseElement#href 2023-12-30 18:50:29 +01:00
SVGViewport.h LibWeb: Update SVG <circle> element to use geometry properties 2024-03-04 10:50:32 +01:00
TagNames.cpp
TagNames.h LibWeb: Add initial support for SVG <textPath> 2023-12-19 21:29:03 +01:00
ViewBox.cpp Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
ViewBox.h