ladybird/Userland/Libraries/LibWeb/Painting/ShadowPainting.h
Aliaksandr Kalenik 99217bf6db LibWeb/Painting: Do not paint box outer shadows not visible in viewport
This change separates the box outer shadow metrics calculations into a
separate function. This function is then used to obtain the shadow
bounding rectangle and skip painting if the entire shadow is outside
of the viewport.
2023-10-19 08:29:06 +02:00

32 lines
935 B
C++

/*
* 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>
#include <LibWeb/Painting/PaintOuterBoxShadowParams.h>
#include <LibWeb/Painting/ShadowData.h>
namespace Web::Painting {
void paint_inner_box_shadow(Gfx::Painter&, PaintOuterBoxShadowParams params);
Gfx::IntRect get_outer_box_shadow_bounding_rect(PaintOuterBoxShadowParams params);
void paint_outer_box_shadow(Gfx::Painter& painter, PaintOuterBoxShadowParams params);
void paint_box_shadow(
PaintContext&,
CSSPixelRect const& bordered_content_rect,
CSSPixelRect const& borderless_content_rect,
BordersData const& borders_data,
BorderRadiiData const&,
Vector<ShadowData> const&);
void paint_text_shadow(PaintContext&, Layout::LineBoxFragment const&, Vector<ShadowData> const&);
}