mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
@@ -191,9 +191,14 @@ void WSEventLoop::on_receive_from_client(int client_id, const WSAPI_ClientMessag
|
||||
case WSAPI_ClientMessage::Type::GetClipboardContents:
|
||||
post_event(client, make<WSAPIGetClipboardContentsRequest>(client_id));
|
||||
break;
|
||||
case WSAPI_ClientMessage::Type::InvalidateRect:
|
||||
post_event(client, make<WSAPIInvalidateRectRequest>(client_id, message.window_id, message.window.rect));
|
||||
case WSAPI_ClientMessage::Type::InvalidateRect: {
|
||||
Vector<Rect, 32> rects;
|
||||
ASSERT(message.rect_count <= 32);
|
||||
for (int i = 0; i < message.rect_count; ++i)
|
||||
rects.append(message.rects[i]);
|
||||
post_event(client, make<WSAPIInvalidateRectRequest>(client_id, message.window_id, rects));
|
||||
break;
|
||||
}
|
||||
case WSAPI_ClientMessage::Type::DidFinishPainting:
|
||||
post_event(client, make<WSAPIDidFinishPaintingNotification>(client_id, message.window_id, message.window.rect));
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user