diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-26 05:20:32 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-26 05:20:32 +0100 |
commit | 7cf3c7461c54ea6bdcfdbd47f1e2644ca5d0f35a (patch) | |
tree | 686fd26a6bdef3da271d773fac53d24608fbc47e /WindowServer | |
parent | 3a401d5249a453f952086e7096499853961bb2f3 (diff) | |
download | serenity-7cf3c7461c54ea6bdcfdbd47f1e2644ca5d0f35a.zip |
Refactor GUI rendering model to be two-phased.
Instead of clients painting whenever they feel like it, we now ask that they
paint in response to a paint message.
After finishing painting, clients notify the WindowServer about the rect(s)
they painted into and then flush eventually happens, etc.
This stuff leaves us with a lot of badly named things. Need to fix that.
Diffstat (limited to 'WindowServer')
-rw-r--r-- | WindowServer/WSEventLoop.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/WindowServer/WSEventLoop.cpp b/WindowServer/WSEventLoop.cpp index 948a103881..29aa34b9ca 100644 --- a/WindowServer/WSEventLoop.cpp +++ b/WindowServer/WSEventLoop.cpp @@ -94,6 +94,21 @@ void WSEventLoop::post_event(WSEventReceiver* receiver, OwnPtr<WSEvent>&& event) } } + if (event->type() == WSEvent::Paint) { + auto& invalidation_event = static_cast<WSPaintEvent&>(*event); + for (auto& queued_event : m_queued_events) { + if (receiver == queued_event.receiver && queued_event.event->type() == WSEvent::Paint) { + auto& queued_invalidation_event = static_cast<WSPaintEvent&>(*queued_event.event); + if (queued_invalidation_event.rect().is_empty() || queued_invalidation_event.rect().contains(invalidation_event.rect())) { +#ifdef WSEVENTLOOP_DEBUG + dbgprintf("Swallow WM_Paint\n"); +#endif + return; + } + } + } + } + m_queued_events.append({ receiver, move(event) }); if (current != m_server_process) |