mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 23:55:12 +00:00
WindowSerer+LibGUI: Send multiple rects in invalidation/flush messages.
This patch moves to sending up to 32 rects at a time when coordinating the painting between WindowServer and its clients. Rects are also merged into a minimal DisjointRectSet on the server side before painting. Interactive resize looks a lot better after this change, since we can usually do all the repainting needed in one go.
This commit is contained in:
@@ -271,3 +271,13 @@ void WSWindow::set_default_icon()
|
||||
m_icon = default_window_icon();
|
||||
m_icon_path = default_window_icon_path();
|
||||
}
|
||||
|
||||
void WSWindow::request_update(const Rect& rect)
|
||||
{
|
||||
if (m_pending_paint_rects.is_empty()) {
|
||||
deferred_invoke([this] (auto&) {
|
||||
client()->post_paint_message(*this);
|
||||
});
|
||||
}
|
||||
m_pending_paint_rects.add(rect);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user