Граф коммитов

57 Коммитов

Автор SHA1 Сообщение Дата
Markus Stange 959b804216 Bug 1772463 - Move mVsyncSkipCounter into mState. r=bas
VsyncDispatcher::NotifyVsync can be called from two different threads
at the same time, if it just swapped out its vsync source and the old
vsync source is still notifying it. So we need to protect mVsyncSkipCounter
behind a lock.

Differential Revision: https://phabricator.services.mozilla.com/D148958
2022-07-19 18:51:46 +00:00
Bas Schouten 65e1ec38c4 Bug 1768662: Add a pref for a frame-rate divisor. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D145980
2022-05-11 17:15:51 +00:00
Markus Stange 2d423f22c5 Bug 1765399 - Invert the relationship between VsyncSource and VsyncDispatcher: The VsyncDispatcher now owns the source. r=smaug
This makes vsync source swapping much more natural.

The VsyncSource now only has a reference to the VsyncDispatcher for the duration
during which the dispatcher is listening to vsync. Whenever the dispatcher is
not listening to vsync, the source has no reference to the dispatcher and there
is no cycle.

This patch also adds the ability to register multiple dispatchers with the same
source. This ability is not used yet; a vsync source always has zero or one
dispatchers at the moment. It is in preparation for a future patch where there
will be one dispatcher per widget.

Furthermore, nothing uses gfxPlatform::GetGlobalVsync anymore, so it is removed.

Differential Revision: https://phabricator.services.mozilla.com/D144375
2022-05-05 02:15:18 +00:00
Markus Stange 46f08c5128 Bug 1765399 - Move main thread observers to the vsync dispatcher. r=smaug
Main thread observers (previously "generic" observers) are only used
by Windows touchpad scrolling so far.

Differential Revision: https://phabricator.services.mozilla.com/D144371
2022-05-05 02:15:16 +00:00
Markus Stange befea532eb 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 107d6dbd85 Bug 1765399 - Register CompositorVsyncDispatcher with VsyncDispatcher instead of directly with the VsyncSource. r=smaug
This makes it so that the VsyncSource doesn't need to keep track of the compositor vsync dispatchers.
And the moving-between-sources logic needs to be handled only for the VsyncDispatcher.

Once we have one VsyncDispatcher per window, we can probably eliminate CompositorVsyncDispatcher.

Differential Revision: https://phabricator.services.mozilla.com/D144366
2022-05-05 02:15:14 +00:00
Markus Stange 97bbfd7658 Bug 1765399 - Expand the comment for VsyncDispatcher. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D144365
2022-05-05 02:15:14 +00:00
Markus Stange 5ef3c929f4 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 1cd0ac703f 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 43cb4a509e Bug 1765399 - Invert the relationship between VsyncSource and VsyncDispatcher: The VsyncDispatcher now owns the source. r=smaug
This makes vsync source swapping much more natural.

The VsyncSource now only has a reference to the VsyncDispatcher for the duration
during which the dispatcher is listening to vsync. Whenever the dispatcher is
not listening to vsync, the source has no reference to the dispatcher and there
is no cycle.

This patch also adds the ability to register multiple dispatchers with the same
source. This ability is not used yet; a vsync source always has zero or one
dispatchers at the moment. It is in preparation for a future patch where there
will be one dispatcher per widget.

Furthermore, nothing uses gfxPlatform::GetGlobalVsync anymore, so it is removed.

Differential Revision: https://phabricator.services.mozilla.com/D144375
2022-05-04 16:13:39 +00:00
Markus Stange 7c466f6189 Bug 1765399 - Move main thread observers to the vsync dispatcher. r=smaug
Main thread observers (previously "generic" observers) are only used
by Windows touchpad scrolling so far.

Differential Revision: https://phabricator.services.mozilla.com/D144371
2022-05-04 16:13:37 +00:00
Markus Stange adc1d5dcf1 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 77efabb139 Bug 1765399 - Register CompositorVsyncDispatcher with VsyncDispatcher instead of directly with the VsyncSource. r=smaug
This makes it so that the VsyncSource doesn't need to keep track of the compositor vsync dispatchers.
And the moving-between-sources logic needs to be handled only for the VsyncDispatcher.

Once we have one VsyncDispatcher per window, we can probably eliminate CompositorVsyncDispatcher.

Differential Revision: https://phabricator.services.mozilla.com/D144366
2022-05-04 16:13:35 +00:00
Markus Stange a0566787ca Bug 1765399 - Expand the comment for VsyncDispatcher. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D144365
2022-05-04 16:13:35 +00:00
Markus Stange 070677f86a 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 e08560bb25 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
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Markus Stange 47c6beb1ee 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
Markus Stange 3ce08a4e07 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 d85ed119fd Bug 1676760 - Remove unused RefreshTimerVsyncDispatcher::SetParentRefreshTimer. r=smaug
Even in the parent process, VsyncRefreshDriverTimer uses AddChildRefreshTimer.

Differential Revision: https://phabricator.services.mozilla.com/D139768
2022-03-01 22:48:19 +00:00
Andrew Osmond c439ab6cd3 Bug 1738971 - Part 3. Rework VsyncChild to allow multiple implementations. r=gfx-reviewers,jgilbert
VsyncChild is main thread only, and we would like to reuse PVsync on the
worker threads via PBackgroundChild which already implements it. This
patch does the necessary refactoring to have multiple implementations of
PVsyncChild.

Differential Revision: https://phabricator.services.mozilla.com/D130264
2021-12-10 02:57:50 +00:00
Csoregi Natalia 1c7cae16d7 Backed out 17 changesets (bug 1738971, bug 1736177) for bp-hybrid failures and others. CLOSED TREE
Backed out changeset 828633114de2 (bug 1736177)
Backed out changeset 5be8557c4721 (bug 1736177)
Backed out changeset 49f8b4205a46 (bug 1736177)
Backed out changeset 2610d4464ad5 (bug 1736177)
Backed out changeset 6d6c78c31c28 (bug 1736177)
Backed out changeset d55f1ee88bb9 (bug 1736177)
Backed out changeset bf588f8ffcf1 (bug 1736177)
Backed out changeset 86f6f6d86c6c (bug 1736177)
Backed out changeset f400c75c5829 (bug 1736177)
Backed out changeset 4a34124d5f4e (bug 1736177)
Backed out changeset 70aff7fcd001 (bug 1736177)
Backed out changeset db2347ee8147 (bug 1736177)
Backed out changeset 3dde5ddb65e5 (bug 1738971)
Backed out changeset 894ba6b7b68f (bug 1738971)
Backed out changeset dc4503052cf1 (bug 1738971)
Backed out changeset d9aef3e9797e (bug 1738971)
Backed out changeset 562a1e8e5ac3 (bug 1738971)
2021-12-10 01:13:23 +02:00
Andrew Osmond 9788a2fa0a Bug 1738971 - Part 3. Rework VsyncChild to allow multiple implementations. r=gfx-reviewers,jgilbert
VsyncChild is main thread only, and we would like to reuse PVsync on the
worker threads via PBackgroundChild which already implements it. This
patch does the necessary refactoring to have multiple implementations of
PVsyncChild.

Differential Revision: https://phabricator.services.mozilla.com/D130264
2021-12-09 19:25:23 +00:00
Kenny Levinsen 510af72a67 Bug 1614212 - Migrate global VsyncSource users correctly on frame rate change r=sotaro
CompositorVsyncDispatcher holds a reference to the VsyncSource, so it must be informed on change.

Differential Revision: https://phabricator.services.mozilla.com/D65878

--HG--
extra : moz-landing-system : lando
2020-03-16 23:24:39 +00:00
Simon Giesecke cb0734d274 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in widget. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D66012

--HG--
extra : moz-landing-system : lando
2020-03-16 10:56:57 +00:00
Bogdan Tara c60fd3fdd2 Backed out 4 changesets (bug 1613985) for causing build bustages CLOSED TREE
Backed out changeset fba0caac746c (bug 1613985)
Backed out changeset 8605d7a19107 (bug 1613985)
Backed out changeset 41e858fbf235 (bug 1613985)
Backed out changeset 847433cf1e0a (bug 1613985)
2020-03-16 12:41:41 +02:00
Simon Giesecke 2d961c08ab Bug 1613985 - Use default for equivalent-to-default constructors/destructors in widget. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D66012

--HG--
extra : moz-landing-system : lando
2020-03-16 09:14:12 +00:00
Coroiu Cristina 9cec9676e6 Backed out changeset ef75f461147c (bug 1614212) for GTest failures 2020-03-16 03:52:15 +02:00
Kenny Levinsen a3358b92f4 Bug 1614212 - Migrate global VsyncSource users correctly on frame rate change r=sotaro
CompositorVsyncDispatcher holds a reference to the VsyncSource, so it must be informed on change.

Differential Revision: https://phabricator.services.mozilla.com/D65878

--HG--
extra : moz-landing-system : lando
2020-03-16 00:05:20 +00:00
Mihai Alexandru Michis 611150ca29 Backed out changeset 8bc3cd786136 (bug 1614212) for causing leaks.
CLOSED TREE
2020-03-13 19:21:34 +02:00
Kenny Levinsen 04165219d8 Bug 1614212 - Migrate global VsyncSource users correctly on frame rate change r=sotaro
CompositorVsyncDispatcher holds a reference to the VsyncSource, so it must be informed on change.

Differential Revision: https://phabricator.services.mozilla.com/D65878

--HG--
extra : moz-landing-system : lando
2020-03-13 16:04:36 +00:00
Kenny Levinsen 1c5650fe48 Bug 1542808 - Implement widget-local VsyncSource for Wayland windows. r=stransky,lsalzman
Lets Wayland sessions run vsync off wayland surface frame callbacks by creating
an interface for widgets to return a local VsyncSource, if applicable.

This interface is currently used for the compositor, and for refresh drivers
in the parent process. It is not yet used for vsync in content processes.

Differential Revision: https://phabricator.services.mozilla.com/D28430

--HG--
extra : moz-landing-system : lando
2019-11-27 00:21:33 +00:00
Matt Woodrow e3453844bf Bug 1510853 - Introduce VsyncId and VsyncEvent for identifying vsyncs without timestamp comparisons. r=jrmuizel
MozReview-Commit-ID: 6TO6hYOdJYo

Differential Revision: https://phabricator.services.mozilla.com/D13757

--HG--
extra : moz-landing-system : lando
2018-12-07 23:27:28 +00:00
Ciure Andrei 22c96f2cb4 Backed out 4 changesets (bug 1510853) for TelemetryHistogramEnums.h build bustages CLOSED TREE
Backed out changeset 80baa7b09930 (bug 1510853)
Backed out changeset d1ef6db7fc28 (bug 1510853)
Backed out changeset ae190948ad73 (bug 1510853)
Backed out changeset 0ade0aa77b2f (bug 1510853)
2018-12-07 19:38:47 +02:00
Matt Woodrow 6c3cd9bd00 Bug 1510853 - Introduce VsyncId and VsyncEvent for identifying vsyncs without timestamp comparisons. r=jrmuizel
MozReview-Commit-ID: 6TO6hYOdJYo

Differential Revision: https://phabricator.services.mozilla.com/D13757

--HG--
extra : moz-landing-system : lando
2018-12-07 17:06:11 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
David Anderson 969d03ec34 Implement vsync notification for remote compositors. (bug 1285625 part 3, r=mchang) 2016-07-19 11:56:07 -07:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Bobby Holley 97b9240b34 Bug 1188696 - Hoist nsRefPtr.h into MFBT. r=froydnj 2015-07-29 10:44:59 -07:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Mason Chang fece617c9b Bug 1098701. Part 2: Allow disabling thread assertions. r=kats 2015-01-23 11:19:53 -08:00
Mason Chang 94e7103a97 Bug 1095242. Part 5: Unobserve vsync in RefreshTimerVsyncDispatcher. r=kats 2015-01-20 08:31:26 -08:00
Mason Chang ebe0a9bec5 Bug 1095242. Part 4: Unobserve vsync in CompositorVsyncDispatcher. r=kats 2015-01-20 08:31:24 -08:00
Mason Chang 8242846001 Bug 1119850 - Modify Vsync Timestamp on Mac to be the previous vsync timestamp. r=mstange 2015-01-09 09:37:00 +01:00
JerryShih a362575e49 Bug 1118841 - Implement the RefreshTimerVsyncDispatcher. r=kats 2015-01-07 18:17:36 -08:00
Mason Chang 2166723055 Bug 1113725. Rename VsyncDispatcher to CompositorVsyncDispatcher. r=kats 2014-12-19 12:52:42 -08:00