mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1822175 - Clean up dynamic refresh rate support on GeckoView. r=geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D172782
This commit is contained in:
parent
dc003c64c8
commit
56258a05fc
@ -6,6 +6,7 @@
|
||||
|
||||
#include "AndroidVsync.h"
|
||||
|
||||
#include "AndroidBridge.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
/**
|
||||
@ -113,6 +114,8 @@ void AndroidVsync::Impl::UpdateObservingVsync() {
|
||||
|
||||
// Always called on the Java UI thread.
|
||||
void AndroidVsync::NotifyVsync(int64_t aFrameTimeNanos) {
|
||||
MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
|
||||
|
||||
// Convert aFrameTimeNanos to a TimeStamp. The value converts trivially to
|
||||
// the internal ticks representation of TimeStamp_posix; both use the
|
||||
// monotonic clock and are in nanoseconds.
|
||||
@ -131,13 +134,13 @@ void AndroidVsync::NotifyVsync(int64_t aFrameTimeNanos) {
|
||||
}
|
||||
|
||||
void AndroidVsync::OnMaybeUpdateRefreshRate() {
|
||||
// Do not keep the lock held while calling OnVsync.
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
auto impl = mImpl.Lock();
|
||||
|
||||
nsTArray<Observer*> observers;
|
||||
{
|
||||
auto impl = mImpl.Lock();
|
||||
observers.AppendElements(impl->mInputObservers);
|
||||
observers.AppendElements(impl->mRenderObservers);
|
||||
}
|
||||
observers.AppendElements(impl->mRenderObservers);
|
||||
|
||||
for (Observer* observer : observers) {
|
||||
observer->OnMaybeUpdateRefreshRate();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user