Olli Pettay
538e64b7cb
Bug 1788125, skip rAF and rAF initiated painting when the relevant window global is suspended, r=emilio
...
This simple approach seems to match quite well what other browsers do. And tryserver results weren't horrible.
I noticed only one test failing because of the change, and it is using synchronous XHR + timers.
Now it is using rAF + sync XHR.
Differential Revision: https://phabricator.services.mozilla.com/D156238
2022-09-03 13:49:29 +00:00
Csoregi Natalia
0751b8354f
Backed out changeset f67b16cac9e0 (bug 1788125) for causing geckoview failures. CLOSED TREE
2022-09-03 14:44:14 +03:00
Olli Pettay
80b3f27285
Bug 1788125, skip rAF and rAF initiated painting when the relevant window global is suspended, r=emilio
...
This simple approach seems to match quite well what other browsers do. And tryserver results weren't horrible.
I noticed only one test failing because of the change, and it is using synchronous XHR + timers.
Now it is using rAF + sync XHR.
Differential Revision: https://phabricator.services.mozilla.com/D156238
2022-09-03 10:19:00 +00:00
Emilio Cobos Álvarez
65467ff64a
Bug 1740989 - Implement focus fixup rule. r=smaug
...
This implements the proposal in the linked spec issue, and makes
it nightly-only pending resolution + edits.
Differential Revision: https://phabricator.services.mozilla.com/D155970
2022-09-01 11:28:47 +00:00
Iulian Moraru
5c4c8e97c7
Backed out changeset d8f983951128 (bug 1740989) for causing mochitest-chrome failures on test_modal_prompts.html. CLOSED TREE
2022-09-01 01:03:29 +03:00
Emilio Cobos Álvarez
be87a9cbef
Bug 1740989 - Implement focus fixup rule. r=smaug
...
This implements the proposal in the linked spec issue, and makes
it nightly-only pending resolution + edits.
Differential Revision: https://phabricator.services.mozilla.com/D155970
2022-08-31 17:10:17 +00:00
Timothy Nikkel
9654a1afc8
Bug 1747277. Handle an unusual case when starting animated images in the refresh driver. r=dholbert
...
Differential Revision: https://phabricator.services.mozilla.com/D155464
2022-08-27 22:59:10 +00:00
Timothy Nikkel
06dc003a41
Bug 1747277. Skip some code with starting animated images in the refresh driver when we don't need it. r=dholbert
...
Differential Revision: https://phabricator.services.mozilla.com/D155463
2022-08-27 22:59:10 +00:00
Florian Quèze
aea7173901
Bug 1782693 - Stop ticking after page load when there are no pending tasks, r=smaug.
...
Differential Revision: https://phabricator.services.mozilla.com/D153451
2022-08-02 11:47:28 +00:00
Nika Layzell
8f1c2692df
Bug 1758115 - Part 2: Streamline locking, initialization and shutdown for TimelineConsumers, r=smaug
...
The current implementation of TimelineConsumers contains some unnecessary
complexity due to how it is initialized as a singleton, and the need for it to
be initialized and used in a threadsafe way. This patch attempts to simplify it
by making all members static, and removing the need to explicitly observe
shutdown for cleanup.
In addition, this approach avoids the risk of the type being accessed from
off-main-thread during initialization or shutdown.
Depends on D150442
Differential Revision: https://phabricator.services.mozilla.com/D150443
2022-06-29 15:01:51 +00:00
Olli Pettay
94a9a971ec
Bug 1771718, let idle period be shorter when frame rate is very high, r=farre
...
Differential Revision: https://phabricator.services.mozilla.com/D147643
2022-06-02 10:40:54 +00:00
Olli Pettay
d1a570c2df
Bug 1771718, nsRefreshDriver::IsInHighRateMode(), r=mstange
...
Differential Revision: https://phabricator.services.mozilla.com/D147642
2022-06-02 10:40:54 +00:00
Markus Stange
6c635cc7e4
Bug 1765399 - Replace nsIWidget::GetVsyncSource with nsIWidget::GetVsyncDispatcher. r=smaug
...
All users of nsIWidget::GetVsyncSource just want the dispatcher anyway.
Getting the dispatcher directly from the widget will allow us to remove VsyncSource::GetVsyncDispatcher.
Differential Revision: https://phabricator.services.mozilla.com/D144374
2022-05-05 02:15:17 +00:00
Markus Stange
e0f0fdcee5
Bug 1765399 - Use GetGlobalVsyncDispatcher() in RefreshDriverVsyncTimer. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D144369
2022-05-05 02:15:15 +00:00
Markus Stange
a868546919
Bug 1765399 - Add RefreshDriverVsyncDispatcher::GetVsyncRate so that VsyncRefreshDriverTimer no longer needs a pointer to the VsyncSource. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D144367
2022-05-05 02:15:15 +00:00
Markus Stange
9e1fe76fa2
Bug 1765399 - Rename RefreshTimerVsyncDispatcher to VsyncDispatcher. r=smaug
...
RefreshTimerVsyncDispatcher manages a lot more than just the
RefreshDriverVsyncTimer these days.
Differential Revision: https://phabricator.services.mozilla.com/D144363
2022-05-05 02:15:13 +00:00
Marian-Vasile Laza
f9224e56ba
Backed out 16 changesets (bug 1765399) for causing build bustages on RefPtr.h.
...
Backed out changeset 8ff5e213e351 (bug 1765399)
Backed out changeset bd164f5cc8b3 (bug 1765399)
Backed out changeset 939b577eee05 (bug 1765399)
Backed out changeset ee00e3583f42 (bug 1765399)
Backed out changeset e5001537e536 (bug 1765399)
Backed out changeset d5a4004a2955 (bug 1765399)
Backed out changeset d3c1f6c420e3 (bug 1765399)
Backed out changeset d21fca656853 (bug 1765399)
Backed out changeset 5e5a29a99c9e (bug 1765399)
Backed out changeset ce326de1e107 (bug 1765399)
Backed out changeset 3890e83660b0 (bug 1765399)
Backed out changeset 2f3ceca7aefe (bug 1765399)
Backed out changeset 40c47c498858 (bug 1765399)
Backed out changeset 3a3a2aa6de9b (bug 1765399)
Backed out changeset 4a30a4b3d30d (bug 1765399)
Backed out changeset a9115d9d648e (bug 1765399)
2022-05-05 00:30:06 +03:00
Markus Stange
a1023168dd
Bug 1765399 - Replace nsIWidget::GetVsyncSource with nsIWidget::GetVsyncDispatcher. r=smaug
...
All users of nsIWidget::GetVsyncSource just want the dispatcher anyway.
Getting the dispatcher directly from the widget will allow us to remove VsyncSource::GetVsyncDispatcher.
Differential Revision: https://phabricator.services.mozilla.com/D144374
2022-05-04 16:13:38 +00:00
Markus Stange
b347463026
Bug 1765399 - Use GetGlobalVsyncDispatcher() in RefreshDriverVsyncTimer. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D144369
2022-05-04 16:13:36 +00:00
Markus Stange
0d7eb36bc7
Bug 1765399 - Add RefreshDriverVsyncDispatcher::GetVsyncRate so that VsyncRefreshDriverTimer no longer needs a pointer to the VsyncSource. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D144367
2022-05-04 16:13:36 +00:00
Markus Stange
225c001c35
Bug 1765399 - Rename RefreshTimerVsyncDispatcher to VsyncDispatcher. r=smaug
...
RefreshTimerVsyncDispatcher manages a lot more than just the
RefreshDriverVsyncTimer these days.
Differential Revision: https://phabricator.services.mozilla.com/D144363
2022-05-04 16:13:34 +00:00
Markus Stange
71a30fe940
Bug 1765400 - Keep the strong reference to VsyncRefreshDriverTimer in the caller. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D144362
2022-05-04 01:01:05 +00:00
Markus Stange
a326a99929
Bug 1765400 - Merge most functionality of RefreshDriverVsyncObserver into VsyncRefreshDriverTimer. r=smaug
...
Before this patch, a lot of the RefreshDriver vsync timer functionality was in
RefreshDriverVsyncObserver, which is a nested class inside of VsyncRefreshDriverTimer.
This nesting is a bit unwieldy and it sometimes makes it non-obvious whether to
make changes to the timer or to the observer inside the timer.
RefreshDriverVsyncObserver was originally just created to work around lifetime
and threading issues. This patch returns it to just that purpose. All the actual
functionality moves into the timer itself.
Differential Revision: https://phabricator.services.mozilla.com/D144361
2022-05-04 01:01:05 +00:00
Markus Stange
e96280ff69
Bug 1765400 - Make NotifyVsync return void. r=smaug
...
Nobody was checking the return value anywhere.
Differential Revision: https://phabricator.services.mozilla.com/D144360
2022-05-04 01:01:04 +00:00
Markus Stange
d0f44be27d
Bug 1759581 - Use clamped(). r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D141016
2022-04-20 16:16:40 +00:00
Markus Stange
7dd5f23c80
Bug 1759581 - Leave rate as a TimeDuration and don't convert it to milliseconds. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D141015
2022-04-20 16:16:40 +00:00
Markus Stange
0a89bcb4fa
Bug 1759581 - Use different timeForOutsideTick variables in the different paths. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D141014
2022-04-20 16:16:39 +00:00
Markus Stange
4c78a0f2e0
Bug 1759581 - Move more code around. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D141013
2022-04-20 16:16:39 +00:00
Markus Stange
b947a2c04c
Bug 1759581 - Introduce more TimeStamp variables and make the nested tick handling more explicit. r=smaug
...
Unlike https://phabricator.services.mozilla.com/D141012 , this doesn't change behavior.
Depends on D141011
Differential Revision: https://phabricator.services.mozilla.com/D143757
2022-04-20 16:16:39 +00:00
Markus Stange
d696790a35
Bug 1759581 - Move some code around. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D141011
2022-04-20 16:16:38 +00:00
Markus Stange
fe2c593066
Bug 1759581 - Return early if RefreshDriverVsyncObserver is notified after its timer has gone away. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D141010
2022-04-20 16:16:38 +00:00
Olli Pettay
b50a38785d
Bug 1763451, when refresh rate is very high, don't let it affect idle processing in the parent process too much, r=mstange
...
Differential Revision: https://phabricator.services.mozilla.com/D143357
2022-04-11 20:54:30 +00:00
Olli Pettay
49d4d2f5d1
Bug 1762090, don't block refreshdrivers for too long time on linux, r=mstange
...
Explicitly detect the case when main thread has been empty, and if so, don't give other tasks
extra time.
Differential Revision: https://phabricator.services.mozilla.com/D142740
2022-04-06 00:40:25 +00:00
Olli Pettay
1028c5b245
Bug 1760007, use less frequent painting during page load only if there is something else to do. r=mstange
...
Differential Revision: https://phabricator.services.mozilla.com/D141923
2022-03-24 18:48:52 +00:00
Markus Stange
72d2c92e14
Bug 1759234 - Merge VsyncSource::Display into VsyncSource. r=smaug
...
Every `VsyncSource` currently only has a single `Display` associated with it.
This means that we're not making use of the `Display` abstraction at all.
This patch gets rid of `Display` by merging it into `VsyncSource`.
Originally, the intention of the `Display` abstraction was to use it for
per-monitor vsync. There would be one software `VsyncSource` and one hardware
`VsyncSource`, and the hardware `VsyncSource` would have one `Display` per
screen. But in reality, things have played out differently: The only platform
with per-monitor vsync is currently Linux Wayland, which has per-**widget**
vsync. And it has chosen to have one `VsyncSource` per widget, with a single
`Display` each.
For the macOS implementation of per-monitor vsync, I think it also makes
sense to have one `VsyncSource` per screen.
We already need to handle switching between VsyncSources, for switching
between software and hardware vsync, if the pref `layout.frame_rate` is
changed. So we might as well reuse that same switching capability for
switching between screens, when a window moves between screens or when a
tab moves between windows on different screens.
Differential Revision: https://phabricator.services.mozilla.com/D140891
2022-03-15 18:13:56 +00:00
Daniel Holbert
4bd139da25
Bug 1758199: Add null-check for GetPresContext() in nsRefreshDriver::NotifyDOMContentLoaded. r=emilio
...
Differential Revision: https://phabricator.services.mozilla.com/D141054
2022-03-15 04:33:42 +00:00
Olli Pettay
6053195932
Bug 1755006, reduce framerate if the main thread is busy handling also other tasks, r=mstange
...
Differential Revision: https://phabricator.services.mozilla.com/D140046
2022-03-14 23:28:33 +00:00
Cristian Tuns
c9f9f7de1f
Backed out changeset 0211ed711a1c (bug 1755006) for causing mochitest failures on browser_ext_pageAction_context.js,browser_panel_list_accessibility.js CLOSED TREE
2022-03-14 06:53:10 -04:00
Olli Pettay
0adad430a5
Bug 1755006, reduce framerate if the main thread is busy handling also other tasks, r=mstange
...
Differential Revision: https://phabricator.services.mozilla.com/D140046
2022-03-13 21:26:14 +00:00
Julien Wajsberg
70193931ab
Bug 1752861 - [profiler] Rename and expose to JS some existing frame labels as well as adding a few r=mstange
...
Differential Revision: https://phabricator.services.mozilla.com/D140389
2022-03-11 09:18:30 +00:00
Marian-Vasile Laza
c71ed5e057
Backed out changeset d3f40b4651f5 (bug 1755006) for causing mochitest failures on test_pointerlock-api.html. CLOSED TREE
2022-03-10 17:54:53 -08:00
Olli Pettay
0005e7e8e8
Bug 1755006, reduce framerate if the main thread is busy handling also other tasks, r=mstange
...
Differential Revision: https://phabricator.services.mozilla.com/D140046
2022-03-10 23:04:55 +00:00
Markus Stange
9c6b453225
Bug 1757822 - Restore pre-bug 1676760 runnable priority in non-e10s mode. r=smaug
...
This should be unnecessary, but using vsync priority in non-e10s mode caused
an existing intermittent to become more frequent, see bug 1737709 comment 22.
This special case will go away once mozilla::BrowserTabsRemoteAutostart is removed.
Differential Revision: https://phabricator.services.mozilla.com/D140105
2022-03-03 18:11:30 +00:00
Markus Stange
ed492cf0ec
Bug 1676760 - Rename Add/RemoveChildRefreshTimer. r=smaug
...
It is used by far more than just content process refresh driver timers.
Differential Revision: https://phabricator.services.mozilla.com/D139769
2022-03-01 22:48:19 +00:00
Markus Stange
fb32509b76
Bug 1676760 - Use DataMutex for pending vsync tracking and rename variables so that they don't refer to "parent process" even though they're also used in the content process. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D139767
2022-03-01 22:48:18 +00:00
Markus Stange
b6962f63f7
Bug 1676760 - Remove ParentProcessVsyncNotifier. r=smaug
...
Seems excessive to have a separate class for this, it really just calls a method on a different thread.
Differential Revision: https://phabricator.services.mozilla.com/D139766
2022-03-01 22:48:18 +00:00
Markus Stange
7188f6a098
Bug 1676760 - Always use vsync priority for the ParentProcessVsyncNotifier runnable. r=smaug
...
This check was there for single process Android and is no longer needed.
Differential Revision: https://phabricator.services.mozilla.com/D139765
2022-03-01 22:48:18 +00:00
Markus Stange
dfba3589d5
Bug 1676760 - Rename NotifyParentProcessVsync to NotifyVsyncOnMainThread and add some comments. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D139764
2022-03-01 22:48:17 +00:00
Markus Stange
02825d0f39
Bug 1676760 - Fix comments on VsyncRefreshDriverTimer member variables. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D139763
2022-03-01 22:48:17 +00:00
Markus Stange
b20dd11929
Bug 1676760 - Replace VsyncRefreshDriverTimer constructors with named creation methods. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D139762
2022-03-01 22:48:16 +00:00