mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
WindowServer: Skip blitting windows into the back buffer if possible.
Windows that don't intersect any of the dirty rects don't need to be copied into the back buffer since they won't be affected by the subsequent flushes.
This commit is contained in:
parent
b6c3df5188
commit
61bba1b9dd
Notes:
sideshowbarker
2024-07-19 16:01:15 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/61bba1b9dd4
1 changed files with 11 additions and 0 deletions
|
@ -284,6 +284,15 @@ void WSWindowManager::compose()
|
|||
return false;
|
||||
};
|
||||
|
||||
auto any_dirty_rect_intersects_window = [&invalidated_rects] (const WSWindow& window) {
|
||||
auto window_rect = outerRectForWindow(window.rect());
|
||||
for (auto& dirty_rect : invalidated_rects) {
|
||||
if (dirty_rect.intersects(window_rect))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
for (auto& r : invalidated_rects) {
|
||||
if (any_window_contains_rect(r))
|
||||
continue;
|
||||
|
@ -293,6 +302,8 @@ void WSWindowManager::compose()
|
|||
for (auto* window = m_windows_in_order.head(); window; window = window->next()) {
|
||||
if (!window->backing())
|
||||
continue;
|
||||
if (!any_dirty_rect_intersects_window(*window))
|
||||
continue;
|
||||
paintWindowFrame(*window);
|
||||
m_back_painter->blit(window->position(), *window->backing());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue