2021-09-19 15:00:47 +01:00
|
|
|
/*
|
2022-02-08 14:48:37 +00:00
|
|
|
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
|
2021-09-19 15:00:47 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2021-10-02 21:56:05 +02:00
|
|
|
#include <LibGfx/Color.h>
|
2022-03-24 15:20:25 +00:00
|
|
|
#include <LibWeb/Forward.h>
|
2021-10-02 21:56:05 +02:00
|
|
|
#include <LibWeb/Painting/PaintContext.h>
|
2021-09-19 15:00:47 +01:00
|
|
|
|
|
|
|
|
namespace Web::Painting {
|
|
|
|
|
|
2022-03-23 16:55:22 +00:00
|
|
|
enum class ShadowPlacement {
|
2022-02-08 15:33:27 +00:00
|
|
|
Outer,
|
|
|
|
|
Inner,
|
|
|
|
|
};
|
|
|
|
|
|
2022-03-23 16:55:22 +00:00
|
|
|
struct ShadowData {
|
2022-02-08 15:33:27 +00:00
|
|
|
Gfx::Color color;
|
2022-10-27 16:22:19 +01:00
|
|
|
CSSPixels offset_x;
|
|
|
|
|
CSSPixels offset_y;
|
|
|
|
|
CSSPixels blur_radius;
|
|
|
|
|
CSSPixels spread_distance;
|
2022-03-23 16:55:22 +00:00
|
|
|
ShadowPlacement placement;
|
2021-09-19 15:00:47 +01:00
|
|
|
};
|
|
|
|
|
|
2022-10-27 16:22:19 +01:00
|
|
|
void paint_box_shadow(PaintContext&, CSSPixelRect const&, BorderRadiiData const&, Vector<ShadowData> const&);
|
2022-03-24 15:20:25 +00:00
|
|
|
void paint_text_shadow(PaintContext&, Layout::LineBoxFragment const&, Vector<ShadowData> const&);
|
2021-09-19 15:00:47 +01:00
|
|
|
|
|
|
|
|
}
|