mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 11:48:06 +00:00
LibWeb: Use efficient background repeat path for either direction
We're able to efficiently draw repeated bitmaps through Skia, but for backgrounds we only did so if the background was `repeat-x` _and_ `repeat-y`, and not if just one was set. This meant that for backgrounds that were only repeating in one direction, we were taking the slow path. Turns out that this slow path also produced graphical artifacts when zooming in and out, so let's not do that :^)
This commit is contained in:
parent
30e8f3f1ad
commit
70b52e0994
Notes:
github-actions[bot]
2025-05-09 19:40:20 +00:00
Author: https://github.com/gmta
Commit: 70b52e0994
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4672
4 changed files with 23 additions and 1 deletions
|
@ -295,7 +295,7 @@ void paint_background(PaintContext& context, PaintableBox const& paintable_box,
|
|||
fill_rect.unite(image_device_rect);
|
||||
});
|
||||
display_list_recorder.fill_rect(fill_rect.to_type<int>(), color.value());
|
||||
} else if (is<CSS::ImageStyleValue>(image) && repeat_x && repeat_y && !repeat_x_has_gap && !repeat_y_has_gap) {
|
||||
} else if (is<CSS::ImageStyleValue>(image) && (repeat_x || repeat_y) && !repeat_x_has_gap && !repeat_y_has_gap) {
|
||||
// Use a dedicated painting command for repeated images instead of recording a separate command for each instance
|
||||
// of a repeated background, so the painter has the opportunity to optimize the painting of repeated images.
|
||||
auto dest_rect = context.rounded_device_rect(image_rect);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue