summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Painting/ShadowPainting.h
blob: 129a969682194e517793c39257bc1ad490d861d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibGfx/Color.h>
#include <LibWeb/Forward.h>
#include <LibWeb/Painting/PaintContext.h>

namespace Web::Painting {

enum class ShadowPlacement {
    Outer,
    Inner,
};

struct ShadowData {
    Gfx::Color color;
    int offset_x;
    int offset_y;
    int blur_radius;
    int spread_distance;
    ShadowPlacement placement;
};

void paint_box_shadow(PaintContext&, Gfx::IntRect const&, Vector<ShadowData> const&);
void paint_text_shadow(PaintContext&, Layout::LineBoxFragment const&, Vector<ShadowData> const&);

}