mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
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:
parent
a3cc03f180
commit
137038b185
Notes:
github-actions[bot]
2024-08-20 07:38:12 +00:00
Author: https://github.com/awesomekling
Commit: 137038b185
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1024
37 changed files with 139 additions and 143 deletions
|
@ -105,10 +105,9 @@ void SVGPathElement::attribute_changed(FlyString const& name, Optional<String> c
|
|||
m_instructions = AttributeParser::parse_path_data(value.value_or(String {}));
|
||||
}
|
||||
|
||||
template<typename PathType>
|
||||
PathType path_from_path_instructions(ReadonlySpan<PathInstruction> instructions)
|
||||
Gfx::Path path_from_path_instructions(ReadonlySpan<PathInstruction> instructions)
|
||||
{
|
||||
PathType path;
|
||||
Gfx::Path path;
|
||||
Optional<Gfx::FloatPoint> previous_control_point;
|
||||
PathInstructionType last_instruction = PathInstructionType::Invalid;
|
||||
|
||||
|
@ -274,19 +273,9 @@ PathType path_from_path_instructions(ReadonlySpan<PathInstruction> instructions)
|
|||
return path;
|
||||
}
|
||||
|
||||
Gfx::Path path_from_path_instructions(ReadonlySpan<PathInstruction> instructions)
|
||||
Gfx::Path SVGPathElement::get_path(CSSPixelSize)
|
||||
{
|
||||
return path_from_path_instructions<Gfx::Path>(instructions);
|
||||
}
|
||||
|
||||
Gfx::DeprecatedPath deprecated_path_from_path_instructions(ReadonlySpan<PathInstruction> instructions)
|
||||
{
|
||||
return path_from_path_instructions<Gfx::DeprecatedPath>(instructions);
|
||||
}
|
||||
|
||||
Gfx::DeprecatedPath SVGPathElement::get_path(CSSPixelSize)
|
||||
{
|
||||
return deprecated_path_from_path_instructions(m_instructions);
|
||||
return path_from_path_instructions(m_instructions);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue