1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

LibWeb: Make requestAnimationFrame() work in multi-process mode

Since we don't have a direct connection to WindowServer, this is slighly
more naive implementation than what we were doing for single-process
mode.

Basically, there's a global RequestAnimationFrameDriver object that
has a 16ms single-shot timer. Whenever someone registers for a RAF
callback, we start the timer (if needed).

This is not ideal, but it's better than nothing. :^)
This commit is contained in:
Andreas Kling 2021-09-13 02:03:06 +02:00
parent f21041861b
commit 7632cce5e5
2 changed files with 80 additions and 14 deletions

View file

@ -19,6 +19,8 @@
namespace Web::DOM {
class RequestAnimationFrameCallback;
class Window final
: public RefCounted<Window>
, public EventTarget {
@ -90,6 +92,8 @@ private:
NonnullOwnPtr<HighResolutionTime::Performance> m_performance;
NonnullRefPtr<CSS::Screen> m_screen;
RefPtr<Event> m_current_event;
HashMap<i32, NonnullRefPtr<RequestAnimationFrameCallback>> m_request_animation_frame_callbacks;
};
}