mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
WindowServer+LibGUI: Simplify handling of paint event rects
Now that Vector<T> is convertible to Vector<T, n>, we don't have to manually copy the paint event rectangles.
This commit is contained in:
parent
6dec88c7fa
commit
2d244a70a1
Notes:
sideshowbarker
2024-07-19 10:23:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2d244a70a15
2 changed files with 3 additions and 13 deletions
|
@ -48,13 +48,8 @@ void GWindowServerConnection::handle(const WindowClient::Paint& message)
|
|||
#ifdef GEVENTLOOP_DEBUG
|
||||
dbgprintf("WID=%d Paint\n", message.window_id());
|
||||
#endif
|
||||
if (auto* window = GWindow::from_window_id(message.window_id())) {
|
||||
Vector<Rect, 32> rects;
|
||||
for (auto& r : message.rects()) {
|
||||
rects.append(r);
|
||||
}
|
||||
CEventLoop::current().post_event(*window, make<GMultiPaintEvent>(rects, message.window_size()));
|
||||
}
|
||||
if (auto* window = GWindow::from_window_id(message.window_id()))
|
||||
CEventLoop::current().post_event(*window, make<GMultiPaintEvent>(message.rects(), message.window_size()));
|
||||
}
|
||||
|
||||
void GWindowServerConnection::handle(const WindowClient::WindowResized& message)
|
||||
|
|
|
@ -436,12 +436,7 @@ void WSClientConnection::post_paint_message(WSWindow& window)
|
|||
if (window.is_minimized() || window.is_occluded())
|
||||
return;
|
||||
|
||||
Vector<Rect> rects;
|
||||
rects.ensure_capacity(rect_set.size());
|
||||
for (auto& r : rect_set.rects()) {
|
||||
rects.append(r);
|
||||
}
|
||||
post_message(WindowClient::Paint(window.window_id(), window.size(), rects));
|
||||
post_message(WindowClient::Paint(window.window_id(), window.size(), rect_set.rects()));
|
||||
}
|
||||
|
||||
void WSClientConnection::handle(const WindowServer::InvalidateRect& message)
|
||||
|
|
Loading…
Add table
Reference in a new issue