Paint styles were stored as display list resources, which kept path painting tied to in-process C++ objects. Move the gradient and pattern payload into FillPath and StrokePath instead, with gradient stops serialized as parallel color and position spans. This is prep work for making display lists serializable across the IPC boundary without needing to marshal SVG paint style objects separately.
21 lines
576 B
C++
21 lines
576 B
C++
/*
|
|
* Copyright (c) 2026, Tim Ledbetter <tim.ledbetter@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Painting/DisplayList.h>
|
|
#include <LibWeb/Painting/PaintStyle.h>
|
|
|
|
namespace Web::Painting {
|
|
|
|
PatternPaintStyle::PatternPaintStyle(NonnullRefPtr<DisplayList> tile_display_list, Gfx::FloatRect tile_rect, Optional<Gfx::AffineTransform> pattern_transform)
|
|
: m_tile_display_list(move(tile_display_list))
|
|
, m_tile_rect(tile_rect)
|
|
, m_pattern_transform(move(pattern_transform))
|
|
{
|
|
}
|
|
|
|
PatternPaintStyle::~PatternPaintStyle() = default;
|
|
|
|
}
|