LibWeb: Port painting to use the new Skia-backed Gfx::Path

SVG and and CSS border rendering now sits on top of SkPath instead of
the old Gfx::DeprecatedPath.

Due to an imperceptible (255, 255, 255) vs (255, 254, 255) color diff
in one ref test, I changed that test to not depend on border rendering
for a positive result, since that was incidental.
This commit is contained in:
Andreas Kling 2024-08-09 14:00:10 +02:00 committed by Andreas Kling
commit 137038b185
Notes: github-actions[bot] 2024-08-20 07:38:12 +00:00
37 changed files with 139 additions and 143 deletions

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibGfx/Path.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/Bindings/SVGLineElementPrototype.h>
#include <LibWeb/SVG/AttributeNames.h>
@ -40,12 +41,12 @@ void SVGLineElement::attribute_changed(FlyString const& name, Optional<String> c
}
}
Gfx::DeprecatedPath SVGLineElement::get_path(CSSPixelSize viewport_size)
Gfx::Path SVGLineElement::get_path(CSSPixelSize viewport_size)
{
auto const viewport_width = viewport_size.width().to_float();
auto const viewport_height = viewport_size.height().to_float();
Gfx::DeprecatedPath path;
Gfx::Path path;
float const x1 = m_x1.value_or({ 0, false }).resolve_relative_to(viewport_width);
float const y1 = m_y1.value_or({ 0, false }).resolve_relative_to(viewport_height);
float const x2 = m_x2.value_or({ 0, false }).resolve_relative_to(viewport_width);