2020-12-04 18:02:21 +01:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2020, Andreas Kling <andreas@ladybird.org>
|
2023-08-02 17:24:14 +01:00
|
|
|
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
2020-12-04 18:02:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-12-04 18:02:21 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibGfx/Forward.h>
|
2021-01-06 10:34:31 +01:00
|
|
|
#include <LibWeb/CSS/ComputedValues.h>
|
2025-07-19 19:35:33 -07:00
|
|
|
#include <LibWeb/Export.h>
|
2023-10-15 04:27:48 +02:00
|
|
|
#include <LibWeb/Forward.h>
|
|
|
|
|
#include <LibWeb/Painting/BorderRadiiData.h>
|
|
|
|
|
#include <LibWeb/Painting/BordersData.h>
|
2020-12-04 18:02:21 +01:00
|
|
|
|
|
|
|
|
namespace Web::Painting {
|
|
|
|
|
|
2023-08-02 17:24:14 +01:00
|
|
|
// Returns OptionalNone if there is no outline to paint.
|
2025-07-19 19:35:33 -07:00
|
|
|
WEB_API Optional<BordersData> borders_data_for_outline(Layout::Node const&, Color outline_color, CSS::OutlineStyle outline_style, CSSPixels outline_width);
|
2023-08-02 17:24:14 +01:00
|
|
|
|
2024-11-25 17:30:31 +04:00
|
|
|
void paint_border(DisplayListRecorder& painter, BorderEdge edge, DevicePixelRect const& rect, CornerRadius const& radius, CornerRadius const& opposite_radius, BordersDataDevicePixels const& borders_data, Gfx::Path&, bool last);
|
2025-07-19 19:35:33 -07:00
|
|
|
WEB_API void paint_all_borders(DisplayListRecorder& painter, DevicePixelRect const& border_rect, CornerRadii const& corner_radii, BordersDataDevicePixels const&);
|
2020-12-04 18:02:21 +01:00
|
|
|
|
2023-11-19 22:03:48 +01:00
|
|
|
Gfx::Color border_color(BorderEdge edge, BordersDataDevicePixels const& borders_data);
|
2023-07-10 16:56:22 +08:00
|
|
|
|
2020-12-04 18:02:21 +01:00
|
|
|
}
|