mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +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
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGfx/Path.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/SVGRectElementPrototype.h>
|
||||
#include <LibWeb/SVG/AttributeNames.h>
|
||||
|
@ -46,14 +47,14 @@ void SVGRectElement::attribute_changed(FlyString const& name, Optional<String> c
|
|||
}
|
||||
}
|
||||
|
||||
Gfx::DeprecatedPath SVGRectElement::get_path(CSSPixelSize)
|
||||
Gfx::Path SVGRectElement::get_path(CSSPixelSize)
|
||||
{
|
||||
float width = m_width.value_or(0);
|
||||
float height = m_height.value_or(0);
|
||||
float x = m_x.value_or(0);
|
||||
float y = m_y.value_or(0);
|
||||
|
||||
Gfx::DeprecatedPath path;
|
||||
Gfx::Path path;
|
||||
// If width or height is zero, rendering is disabled.
|
||||
if (width == 0 || height == 0)
|
||||
return path;
|
||||
|
@ -106,6 +107,8 @@ Gfx::DeprecatedPath SVGRectElement::get_path(CSSPixelSize)
|
|||
if (rx > 0 && ry > 0)
|
||||
path.elliptical_arc_to({ x + rx, y }, corner_radii, x_axis_rotation, large_arc_flag, sweep_flag);
|
||||
|
||||
path.close();
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue