mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
LibGUI: Avoid needlessly copying vectors of rects
This commit is contained in:
parent
3907bacfcd
commit
cd0a1fa5b0
Notes:
sideshowbarker
2024-07-18 21:55:53 +09:00
Author: https://github.com/tomuta Commit: https://github.com/SerenityOS/serenity/commit/cd0a1fa5b0d Pull-request: https://github.com/SerenityOS/serenity/pull/5370
@ -416,12 +416,8 @@ void Window::handle_multi_paint_event(MultiPaintEvent& event)
|
||||
else if (created_new_backing_store)
|
||||
set_current_backing_store(*m_back_store, true);
|
||||
|
||||
if (is_visible()) {
|
||||
Vector<Gfx::IntRect> rects_to_send;
|
||||
for (auto& r : rects)
|
||||
rects_to_send.append(r);
|
||||
WindowServerConnection::the().post_message(Messages::WindowServer::DidFinishPainting(m_window_id, rects_to_send));
|
||||
}
|
||||
if (is_visible())
|
||||
WindowServerConnection::the().post_message(Messages::WindowServer::DidFinishPainting(m_window_id, rects));
|
||||
}
|
||||
|
||||
void Window::handle_key_event(KeyEvent& event)
|
||||
@ -606,10 +602,7 @@ void Window::update(const Gfx::IntRect& a_rect)
|
||||
auto rects = move(m_pending_paint_event_rects);
|
||||
if (rects.is_empty())
|
||||
return;
|
||||
Vector<Gfx::IntRect> rects_to_send;
|
||||
for (auto& r : rects)
|
||||
rects_to_send.append(r);
|
||||
WindowServerConnection::the().post_message(Messages::WindowServer::InvalidateRect(m_window_id, rects_to_send, false));
|
||||
WindowServerConnection::the().post_message(Messages::WindowServer::InvalidateRect(m_window_id, rects, false));
|
||||
});
|
||||
}
|
||||
m_pending_paint_event_rects.append(a_rect);
|
||||
|
Loading…
Reference in New Issue
Block a user