1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 14:15:07 +00:00

LibGUI: Coalesce update rects at the GWindow level.

This commit is contained in:
Andreas Kling 2019-02-10 14:46:43 +01:00
parent 53d34a0885
commit 08322ab8e1
4 changed files with 10 additions and 8 deletions

View file

@ -38,7 +38,6 @@ void GWidget::event(GEvent& event)
{
switch (event.type()) {
case GEvent::Paint:
m_pending_paint_event_rects.clear();
return handle_paint_event(static_cast<GPaintEvent&>(event));
case GEvent::Resize:
return handle_resize_event(static_cast<GResizeEvent&>(event));
@ -175,11 +174,6 @@ void GWidget::update(const Rect& rect)
auto* w = window();
if (!w)
return;
for (auto& pending_rect : m_pending_paint_event_rects) {
if (pending_rect.contains(rect))
return;
}
m_pending_paint_event_rects.append(rect);
w->update(rect.translated(window_relative_rect().location()));
}