1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:37:45 +00:00

WindowServer+LibGUI: Notify DisplayLinks at 60 fps no matter what

The original implementation only sent out notifications when there was
something being drawn on screen. If nothing was going on, we'd get too
lazy and just not notify display links.

This obviously break requestAnimationFrame(), so now we just drive the
DisplayLinks at 60 fps no matter what. :^)
This commit is contained in:
Andreas Kling 2020-04-22 00:07:48 +02:00
parent 2d4c91df8e
commit 5326eebb1b
5 changed files with 47 additions and 2 deletions

View file

@ -34,6 +34,7 @@
namespace WindowServer {
class ClientConnection;
class Cursor;
enum class WallpaperMode {
@ -65,6 +66,9 @@ public:
void invalidate_cursor();
Gfx::Rect current_cursor_rect() const;
void increment_display_link_count(Badge<ClientConnection>);
void decrement_display_link_count(Badge<ClientConnection>);
private:
Compositor();
void init_bitmaps();
@ -96,6 +100,9 @@ private:
String m_wallpaper_path;
WallpaperMode m_wallpaper_mode { WallpaperMode::Unchecked };
RefPtr<Gfx::Bitmap> m_wallpaper;
RefPtr<Core::Timer> m_display_link_notify_timer;
size_t m_display_link_count { 0 };
};
}