mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 15:10:19 +00:00
LibWeb: Inline apply_backdrop_filter function into paint_backdrop_filter
No need to have a separate file for this small function.
This commit is contained in:
parent
8164be7ac8
commit
0bfcf73524
Notes:
github-actions[bot]
2024-07-29 15:49:47 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/0bfcf73524d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/886
5 changed files with 9 additions and 44 deletions
|
@ -17,7 +17,6 @@ source_set("Painting") {
|
|||
"Command.cpp",
|
||||
"DisplayList.cpp",
|
||||
"DisplayListRecorder.cpp",
|
||||
"FilterPainting.cpp",
|
||||
"GradientPainting.cpp",
|
||||
"ImagePaintable.cpp",
|
||||
"InlinePaintable.cpp",
|
||||
|
|
|
@ -558,7 +558,6 @@ set(SOURCES
|
|||
Painting/DisplayListPlayerSkia.cpp
|
||||
Painting/DisplayListRecorder.cpp
|
||||
Painting/GradientPainting.cpp
|
||||
Painting/FilterPainting.cpp
|
||||
Painting/ImagePaintable.cpp
|
||||
Painting/InlinePaintable.cpp
|
||||
Painting/LabelablePaintable.cpp
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2022, MacDue <macdue@dueutil.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
#include <LibWeb/Painting/BorderRadiusCornerClipper.h>
|
||||
#include <LibWeb/Painting/FilterPainting.h>
|
||||
|
||||
namespace Web::Painting {
|
||||
|
||||
void apply_backdrop_filter(PaintContext& context, CSSPixelRect const& backdrop_rect, BorderRadiiData const& border_radii_data, CSS::ResolvedBackdropFilter const& backdrop_filter)
|
||||
{
|
||||
auto backdrop_region = context.rounded_device_rect(backdrop_rect);
|
||||
|
||||
ScopedCornerRadiusClip corner_clipper { context, backdrop_region, border_radii_data };
|
||||
context.display_list_recorder().apply_backdrop_filter(backdrop_region.to_type<int>(), border_radii_data, backdrop_filter);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2022, MacDue <macdue@dueutil.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibWeb/CSS/BackdropFilter.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::Painting {
|
||||
|
||||
void apply_backdrop_filter(PaintContext&, CSSPixelRect const&, BorderRadiiData const&, CSS::ResolvedBackdropFilter const&);
|
||||
|
||||
}
|
|
@ -16,7 +16,6 @@
|
|||
#include <LibWeb/Layout/BlockContainer.h>
|
||||
#include <LibWeb/Layout/Viewport.h>
|
||||
#include <LibWeb/Painting/BackgroundPainting.h>
|
||||
#include <LibWeb/Painting/FilterPainting.h>
|
||||
#include <LibWeb/Painting/PaintableBox.h>
|
||||
#include <LibWeb/Painting/SVGPaintable.h>
|
||||
#include <LibWeb/Painting/SVGSVGPaintable.h>
|
||||
|
@ -438,9 +437,15 @@ void PaintableBox::paint_border(PaintContext& context) const
|
|||
|
||||
void PaintableBox::paint_backdrop_filter(PaintContext& context) const
|
||||
{
|
||||
auto& backdrop_filter = computed_values().backdrop_filter();
|
||||
if (!backdrop_filter.is_none())
|
||||
apply_backdrop_filter(context, absolute_border_box_rect(), normalized_border_radii_data(), backdrop_filter);
|
||||
auto const& backdrop_filter = computed_values().backdrop_filter();
|
||||
if (backdrop_filter.is_none()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto backdrop_region = context.rounded_device_rect(absolute_border_box_rect());
|
||||
auto border_radii_data = normalized_border_radii_data();
|
||||
ScopedCornerRadiusClip corner_clipper { context, backdrop_region, border_radii_data };
|
||||
context.display_list_recorder().apply_backdrop_filter(backdrop_region.to_type<int>(), border_radii_data, backdrop_filter);
|
||||
}
|
||||
|
||||
void PaintableBox::paint_background(PaintContext& context) const
|
||||
|
|
Loading…
Reference in a new issue