1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 04:27:35 +00:00

WindowServer+LibGUI: Coalesce multiple client paints into GMultiPaintEvents.

This allows GWindow to paint up to 32 separate rects before telling the
WindowServer to flip the buffers. Quite a bit smoother. :^)
This commit is contained in:
Andreas Kling 2019-04-20 17:37:28 +02:00
parent 7efd61fcf5
commit 7234900f61
6 changed files with 54 additions and 18 deletions

View file

@ -84,8 +84,11 @@ void GEventLoop::handle_paint_event(const WSAPI_ServerMessage& event, GWindow& w
#ifdef GEVENTLOOP_DEBUG
dbgprintf("WID=%x Paint [%d,%d %dx%d]\n", event.window_id, event.paint.rect.location.x, event.paint.rect.location.y, event.paint.rect.size.width, event.paint.rect.size.height);
#endif
Vector<Rect, 32> rects;
ASSERT(event.rect_count <= 32);
for (int i = 0; i < event.rect_count; ++i)
post_event(window, make<GPaintEvent>(event.rects[i], event.paint.window_size));
rects.append(event.rects[i]);
post_event(window, make<GMultiPaintEvent>(rects, event.paint.window_size));
}
void GEventLoop::handle_resize_event(const WSAPI_ServerMessage& event, GWindow& window)