ladybird/Userland/Libraries/LibWeb/SVG
Jelle Raaijmakers 5865cf5864 LibWeb: Use bitmap's alpha type instead of assuming unpremultiplied
When converting a `Gfx::Bitmap` to a Skia bitmap, we cannot assume the
color data is unpremultiplied. For example, everything canvas-related
uses premultiplied color data:

  https://html.spec.whatwg.org/multipage/canvas.html#premultiplied-alpha-and-the-2d-rendering-context

We were probably assuming unpremultiplied since that is what the PNG
decoder gives us. Since we now make `Gfx::Bitmap` identify what alpha
type is being used, we can instruct Skia a bit better :^)

Update our `EdgeFlagPathRasterizer` to use premultiplied alpha instead
of unpremultiplied so we can apply alpha correctly for path masks.

This fixes the dark borders sometimes visible when SVGs are blended
with a colored background.

This also exposed an issue with our `CanvasRenderingContext2D`, which is
supposed to hold a bitmap with premultiplied alpha internally but expose
a bitmap with unpremultiplied alpha in `CanvasImageData`. Expand our C2D
test to include the alpha channel as well.

Finally, this also exposed an off-by-one issue in
`EdgeFlagPathRasterizer` which caused the last scanlines for edges to
render incorrectly. We had some reference images which included these
corruptions (they were almost unnoticeable), so update them as well.
2024-08-07 18:51:12 +02:00
..
AttributeNames.cpp LibWeb: Implement SVGElement.className 2024-07-10 10:28:43 +02:00
AttributeNames.h LibWeb: Implement SVGElement.className 2024-07-10 10:28:43 +02:00
AttributeParser.cpp LibWeb: Use ErrorOr to propagate SVG attribute parsing errors 2024-03-20 09:09:35 +01:00
AttributeParser.h LibWeb: Implement the SVG clip-rule attribute 2024-05-14 23:01:18 +01:00
Default.css
SVGAElement.cpp LibWeb/SVG: SVGAElement includes SVGURIReference 2024-07-16 21:43:53 +02:00
SVGAElement.h LibWeb/SVG: SVGAElement includes SVGURIReference 2024-07-16 21:43:53 +02:00
SVGAElement.idl LibWeb/SVG: SVGAElement includes SVGURIReference 2024-07-16 21:43:53 +02:00
SVGAnimatedLength.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGAnimatedLength.h
SVGAnimatedLength.idl
SVGAnimatedNumber.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGAnimatedNumber.h
SVGAnimatedNumber.idl
SVGAnimatedRect.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
SVGAnimatedRect.h
SVGAnimatedRect.idl
SVGAnimatedString.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGAnimatedString.h
SVGAnimatedString.idl
SVGAnimatedTransformList.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGAnimatedTransformList.h LibWeb: Stub out SVGAnimatedTransformList 2024-04-01 21:10:35 +02:00
SVGAnimatedTransformList.idl LibWeb: Stub out SVGAnimatedTransformList 2024-04-01 21:10:35 +02:00
SVGCircleElement.cpp LibWeb: Use GCPtr for Element::layout_node 2024-05-03 20:48:32 +02: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: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGClipPathElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGClipPathElement.idl LibWeb: Use 'FIXME' extended attribute where possible 2024-05-19 16:24:11 +02:00
SVGDecodedImageData.cpp LibWeb: Use bitmap's alpha type instead of assuming unpremultiplied 2024-08-07 18:51:12 +02:00
SVGDecodedImageData.h LibWeb: Stop deadlocking on unit tests 2024-07-03 15:01:03 +02:00
SVGDefsElement.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGDefsElement.h LibWeb: Special case SVG masks during layout 2024-03-12 08:51:50 +01:00
SVGDefsElement.idl
SVGDescElement.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGDescElement.h LibWeb: Implement <desc> SVG element 2024-04-17 07:17:27 +02:00
SVGDescElement.idl LibWeb: Implement <desc> SVG element 2024-04-17 07:17:27 +02:00
SVGElement.cpp LibWeb/SVG: Implement SVGElement.ownerSVGElement 2024-07-16 21:43:53 +02:00
SVGElement.h LibWeb/SVG: Implement SVGElement.ownerSVGElement 2024-07-16 21:43:53 +02:00
SVGElement.idl LibWeb/SVG: Implement SVGElement.ownerSVGElement 2024-07-16 21:43:53 +02:00
SVGEllipseElement.cpp LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGEllipseElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGEllipseElement.idl
SVGFitToViewBox.idl LibWeb: Use 'FIXME' extended attribute where possible 2024-05-19 16:24:11 +02:00
SVGForeignObjectElement.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGForeignObjectElement.h
SVGForeignObjectElement.idl
SVGGElement.cpp
SVGGElement.h
SVGGeometryElement.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGGeometryElement.h
SVGGeometryElement.idl LibWeb: Add FIXMEs for missing SVGGeometryElement attributes 2024-07-10 10:28:43 +02:00
SVGGradientElement.cpp LibWeb/SVG: SVGGradientElement includes SVGURIReference 2024-07-16 21:43:53 +02:00
SVGGradientElement.h LibWeb/SVG: SVGGradientElement includes SVGURIReference 2024-07-16 21:43:53 +02:00
SVGGradientElement.idl LibWeb/SVG: SVGGradientElement includes SVGURIReference 2024-07-16 21:43:53 +02:00
SVGGraphicsElement.cpp LibWeb/SVG: Ensure SVG transform has an inverse before using it 2024-07-22 09:13:25 +02:00
SVGGraphicsElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGGraphicsElement.idl LibWeb: Use 'FIXME' extended attribute where possible 2024-05-19 16:24:11 +02:00
SVGLength.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGLength.h LibWeb: Move SVGLength unit constants to header 2024-04-01 21:10:35 +02:00
SVGLength.idl LibWeb/SVG: Stub missing SVGLength attributes 2024-07-21 10:50:05 +02:00
SVGLinearGradientElement.cpp LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGLinearGradientElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGLinearGradientElement.idl
SVGLineElement.cpp LibWeb: Support percentage values in SVG line element 2024-07-21 19:56:38 +02:00
SVGLineElement.h LibWeb: Support percentage values in SVG line element 2024-07-21 19:56:38 +02:00
SVGLineElement.idl
SVGMaskElement.cpp LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGMaskElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGMaskElement.idl LibWeb: Use 'FIXME' extended attribute where possible 2024-05-19 16:24:11 +02:00
SVGPathElement.cpp LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGPathElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGPathElement.idl
SVGPolygonElement.cpp LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGPolygonElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGPolygonElement.idl
SVGPolylineElement.cpp LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGPolylineElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGPolylineElement.idl
SVGRadialGradientElement.cpp LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGRadialGradientElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGRadialGradientElement.idl
SVGRectElement.cpp LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGRectElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGRectElement.idl
SVGScriptElement.cpp LibWeb/SVG: SVGScriptElement includes SVGURIReference 2024-07-16 21:43:53 +02:00
SVGScriptElement.h LibWeb/SVG: SVGScriptElement includes SVGURIReference 2024-07-16 21:43:53 +02:00
SVGScriptElement.idl LibWeb/SVG: SVGScriptElement includes SVGURIReference 2024-07-16 21:43:53 +02:00
SVGStopElement.cpp LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGStopElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGStopElement.idl
SVGStyleElement.cpp LibWeb: Use correct scope when removing style sheet inside a shadow tree 2024-07-23 11:12:18 +02:00
SVGStyleElement.h LibJS+LibWeb: Fix a ton of JS_CELL-like macro issues 2024-05-30 09:29:20 -06:00
SVGStyleElement.idl
SVGSVGElement.cpp LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGSVGElement.h LibWeb: Pass the old attribute value to Element::attribute_changed() 2024-07-10 07:04:08 +02:00
SVGSVGElement.idl LibWeb: Use 'FIXME' extended attribute where possible 2024-05-19 16:24:11 +02:00
SVGSymbolElement.cpp LibWeb/SVG: SVGSymbolElement includes SVGFitToViewBox 2024-07-21 10:50:05 +02:00
SVGSymbolElement.h LibWeb/SVG: SVGSymbolElement includes SVGFitToViewBox 2024-07-21 10:50:05 +02:00
SVGSymbolElement.idl LibWeb/SVG: SVGSymbolElement includes SVGFitToViewBox 2024-07-21 10:50:05 +02:00
SVGTextContentElement.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGTextContentElement.h LibWeb: Stub SVGTextContentElement.getStartPositionOfChar() 2024-04-01 21:10:35 +02:00
SVGTextContentElement.idl LibWeb: Use 'FIXME' extended attribute where possible 2024-05-19 16:24:11 +02:00
SVGTextElement.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGTextElement.h
SVGTextElement.idl
SVGTextPathElement.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGTextPathElement.h
SVGTextPathElement.idl LibWeb: Use 'FIXME' extended attribute where possible 2024-05-19 16:24:11 +02:00
SVGTextPositioningElement.cpp LibWeb: Support percentage values in SVG text positioning element 2024-07-21 19:56:38 +02:00
SVGTextPositioningElement.h LibWeb: Support percentage values in SVG text positioning element 2024-07-21 19:56:38 +02:00
SVGTextPositioningElement.idl LibWeb: Use 'FIXME' extended attribute where possible 2024-05-19 16:24:11 +02:00
SVGTitleElement.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGTitleElement.h
SVGTitleElement.idl LibWeb: Fix spec link to SVGTitleElement 2024-04-17 07:17:27 +02:00
SVGTransform.cpp LibWeb/SVG: Stub SVGTransform.setSkewY 2024-05-07 17:33:27 -06:00
SVGTransform.h LibWeb/SVG: Stub SVGTransform.setSkewY 2024-05-07 17:33:27 -06:00
SVGTransform.idl LibWeb: Use 'FIXME' extended attribute where possible 2024-05-19 16:24:11 +02:00
SVGTransformList.cpp LibWeb/SVG: Implement SVGTransformList.numberOfItems 2024-06-02 19:55:53 +02:00
SVGTransformList.h LibWeb/SVG: Implement SVGTransformList.numberOfItems 2024-06-02 19:55:53 +02:00
SVGTransformList.idl LibWeb/SVG: Implement SVGTransformList.numberOfItems 2024-06-02 19:55:53 +02:00
SVGTSpanElement.cpp LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h 2024-04-27 18:29:35 -04:00
SVGTSpanElement.h
SVGTSpanElement.idl
SVGURIReference.h
SVGURIReference.idl
SVGUseElement.cpp LibWeb: Rename SharedImageRequest to SharedResourceRequest 2024-08-05 11:26:41 +02:00
SVGUseElement.h LibWeb: Rename SharedImageRequest to SharedResourceRequest 2024-08-05 11:26:41 +02:00
SVGUseElement.idl
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 the bare minimum to render SVGAElement (<a>) 2024-06-23 19:15:24 +02:00
ViewBox.cpp
ViewBox.h