mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb/CSS: Improved implementation of background-blend-mode
This is a improved version ofa73cd88f0c
The old commit was reverted in552dd18696
The new version only paints an element into a new layer if background blend modes other than normal are used. The rasterization performance of most websites should therefore not suffer. Co-Authored-By: Alexander Kalenik <kalenik.aliaksandr@gmail.com>
This commit is contained in:
parent
6906f1722a
commit
9973b01848
Notes:
github-actions[bot]
2025-04-01 11:39:02 +00:00
Author: https://github.com/skyz1
Commit: 9973b01848
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4150
16 changed files with 311 additions and 198 deletions
|
@ -14,6 +14,7 @@
|
|||
#include <LibWeb/Layout/Box.h>
|
||||
#include <LibWeb/Layout/ReplacedBox.h>
|
||||
#include <LibWeb/Layout/Viewport.h>
|
||||
#include <LibWeb/Painting/Blending.h>
|
||||
#include <LibWeb/Painting/DisplayListRecorder.h>
|
||||
#include <LibWeb/Painting/PaintableBox.h>
|
||||
#include <LibWeb/Painting/SVGSVGPaintable.h>
|
||||
|
@ -313,16 +314,7 @@ void StackingContext::paint(PaintContext& context) const
|
|||
auto transform_matrix = paintable_box().transform();
|
||||
auto transform_origin = paintable_box().transform_origin().to_type<float>();
|
||||
|
||||
Gfx::CompositingAndBlendingOperator compositing_and_blending_operator;
|
||||
switch (paintable_box().computed_values().mix_blend_mode()) {
|
||||
#undef __ENUMERATE
|
||||
#define __ENUMERATE(mix_blend_mode) \
|
||||
case CSS::MixBlendMode::mix_blend_mode: \
|
||||
compositing_and_blending_operator = Gfx::CompositingAndBlendingOperator::mix_blend_mode; \
|
||||
break;
|
||||
ENUMERATE_MIX_BLEND_MODES(__ENUMERATE)
|
||||
#undef __ENUMERATE
|
||||
}
|
||||
Gfx::CompositingAndBlendingOperator compositing_and_blending_operator = mix_blend_mode_to_compositing_and_blending_operator(paintable_box().computed_values().mix_blend_mode());
|
||||
|
||||
DisplayListRecorder::PushStackingContextParams push_stacking_context_params {
|
||||
.opacity = opacity,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue