mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user