1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 09:18:11 +00:00

LibWeb: Record painting commands in coordinates of stacking context

By storing painting command coordinates relative to the nearest
stacking context we can get rid of the Translate command.

Additionally, this allows us to easily check if the bounding
rectangles of the commands cover or intersect within a stacking
context. This should be useful if we decide to optimize by avoiding
the execution of commands that will be overpainted by the results of
subsequent commands.
This commit is contained in:
Aliaksandr Kalenik 2023-10-24 18:48:27 +02:00 committed by Andreas Kling
parent 311cc7d9b9
commit 4318bcf447
6 changed files with 76 additions and 68 deletions

View file

@ -343,8 +343,8 @@ void StackingContext::paint(PaintContext& context) const
paint_internal(context);
context.painter().pop_stacking_context(pop_stacking_context_params);
} else {
context.painter().push_stacking_context(push_stacking_context_params);
context.painter().translate(affine_transform.translation().to_rounded<int>());
context.painter().push_stacking_context(push_stacking_context_params);
paint_internal(context);
context.painter().pop_stacking_context(pop_stacking_context_params);
}