LibWeb: Do not allocate mask bitmap for CSS "clip-path" property

Instead, it could be applied directly as a clip path in Skia painter.

As a side bonus, we get rid of some DeprecatedPath and
AntiAliasingPainter usage.
This commit is contained in:
Aliaksandr Kalenik 2024-08-20 17:27:08 +02:00 committed by Alexander Kalenik
commit bc20e3ac6c
Notes: github-actions[bot] 2024-08-20 18:01:47 +00:00
10 changed files with 25 additions and 32 deletions

View file

@ -5,12 +5,13 @@
*/
#include "BasicShapeStyleValue.h"
#include <LibGfx/Path.h>
namespace Web::CSS {
Gfx::DeprecatedPath Polygon::to_path(CSSPixelRect reference_box, Layout::Node const& node) const
Gfx::Path Polygon::to_path(CSSPixelRect reference_box, Layout::Node const& node) const
{
Gfx::DeprecatedPath path;
Gfx::Path path;
bool first = true;
for (auto const& point : points) {
Gfx::FloatPoint resolved_point {
@ -44,7 +45,7 @@ String Polygon::to_string() const
BasicShapeStyleValue::~BasicShapeStyleValue() = default;
Gfx::DeprecatedPath BasicShapeStyleValue::to_path(CSSPixelRect reference_box, Layout::Node const& node) const
Gfx::Path BasicShapeStyleValue::to_path(CSSPixelRect reference_box, Layout::Node const& node) const
{
return m_basic_shape.visit([&](auto const& shape) {
return shape.to_path(reference_box, node);