-
- Downloads
Bug 1645528 - Connect nsRefreshDrivers in content processes with a...
Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio To allow `requestAnimationFrame()` and similar things to run at monitor speed if there is only a window-specific vsyncsource available. This is the case for Wayland and, in the future, EGL/X11. Other backends may opt for window specific vsyncsources as well at some point. The idea is to, instead of using global vsync objects, expose a vsyncsource from nsWindow and use it for refresh drivers. For the content process, move VsyncChild to BrowserChild, so for each Browserchild there is only one VsyncChild to which all refresh drivers connect. IPC in managed either by PBrowser or PBackground. Right now, PBrowser is only used on Wayland, as both PBrowser and the Wayland vsyncsource run on the main thread. Other backends keep using the background thread for now. While at it, make it so that we constantly update the refresh rate. This is necessary for Wayland, but also on other platforms variable refresh rates are increasingly common. When using PVsync, limit updates to once in every 250ms in order to minimize overhead while still updating fast. How to test: - run the Wayland backend - enable `widget.wayland_vsync.enabled` - optionally: disable `privacy.reduceTimerPrecision` - run `vsynctester.com` or `testufo.com` Expected results: Instead of fixed 60Hz, things should update at monitor refresh rate - e.g. 144Hz Original patch by Kenny Levinsen. Differential Revision: https://phabricator.services.mozilla.com/D93173
Showing
- dom/ipc/BrowserChild.cpp 40 additions, 0 deletionsdom/ipc/BrowserChild.cpp
- dom/ipc/BrowserChild.h 11 additions, 0 deletionsdom/ipc/BrowserChild.h
- dom/ipc/BrowserParent.cpp 26 additions, 0 deletionsdom/ipc/BrowserParent.cpp
- dom/ipc/BrowserParent.h 9 additions, 0 deletionsdom/ipc/BrowserParent.h
- dom/ipc/PBrowser.ipdl 7 additions, 0 deletionsdom/ipc/PBrowser.ipdl
- dom/ipc/PVsync.ipdl 7 additions, 7 deletionsdom/ipc/PVsync.ipdl
- dom/ipc/VsyncChild.cpp 44 additions, 17 deletionsdom/ipc/VsyncChild.cpp
- dom/ipc/VsyncChild.h 14 additions, 31 deletionsdom/ipc/VsyncChild.h
- dom/ipc/VsyncParent.cpp 38 additions, 38 deletionsdom/ipc/VsyncParent.cpp
- dom/ipc/VsyncParent.h 17 additions, 19 deletionsdom/ipc/VsyncParent.h
- dom/ipc/moz.build 5 additions, 0 deletionsdom/ipc/moz.build
- ipc/glue/BackgroundChildImpl.cpp 6 additions, 6 deletionsipc/glue/BackgroundChildImpl.cpp
- ipc/glue/BackgroundParentImpl.cpp 5 additions, 5 deletionsipc/glue/BackgroundParentImpl.cpp
- ipc/glue/BackgroundParentImpl.h 0 additions, 5 deletionsipc/glue/BackgroundParentImpl.h
- layout/base/nsPresContext.cpp 0 additions, 3 deletionslayout/base/nsPresContext.cpp
- layout/base/nsRefreshDriver.cpp 65 additions, 148 deletionslayout/base/nsRefreshDriver.cpp
- layout/base/nsRefreshDriver.h 0 additions, 12 deletionslayout/base/nsRefreshDriver.h
- layout/base/nsRefreshObservers.h 0 additions, 3 deletionslayout/base/nsRefreshObservers.h
- layout/ipc/moz.build 0 additions, 11 deletionslayout/ipc/moz.build
Loading
Please register or sign in to comment