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
|
|
|
|
|
|
2022-06-13 23:33:54 +01:00
|
|
|
#include <LibGfx/AntiAliasingPainter.h>
|
2020-12-04 18:02:21 +01:00
|
|
|
#include <LibGfx/Forward.h>
|
2021-01-06 10:34:31 +01:00
|
|
|
#include <LibWeb/CSS/ComputedValues.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 {
|
|
|
|
|
|
|
|
|
|
enum class BorderEdge {
|
|
|
|
|
Top,
|
|
|
|
|
Right,
|
|
|
|
|
Bottom,
|
|
|
|
|
Left,
|
|
|
|
|
};
|
2022-06-15 21:13:44 +01:00
|
|
|
|
2023-08-02 17:24:14 +01:00
|
|
|
// Returns OptionalNone if there is no outline to paint.
|
|
|
|
|
Optional<BordersData> borders_data_for_outline(Layout::Node const&, Color outline_color, CSS::OutlineStyle outline_style, CSSPixels outline_width);
|
|
|
|
|
|
2024-08-09 21:00:01 +02:00
|
|
|
void paint_border(DisplayListRecorder& painter, BorderEdge edge, DevicePixelRect const& rect, Gfx::CornerRadius const& radius, Gfx::CornerRadius const& opposite_radius, BordersDataDevicePixels const& borders_data, Gfx::Path&, bool last);
|
2024-06-23 18:40:10 +02:00
|
|
|
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
|
|
|
}
|