mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1193842 - Delete touch resampling preference and non resampling paths. r=kats
This commit is contained in:
parent
4dc95d2e4b
commit
b8648efcd2
@ -1147,9 +1147,6 @@ pref("dom.mozSettings.allowForceReadOnly", false);
|
||||
// RequestSync API is enabled by default on B2G.
|
||||
pref("dom.requestSync.enabled", true);
|
||||
|
||||
// Resample touch events on b2g
|
||||
pref("gfx.touch.resample", true);
|
||||
|
||||
// Comma separated list of activity names that can only be provided by
|
||||
// the system app in dev mode.
|
||||
pref("dom.activities.developer_mode_only", "import-app");
|
||||
|
@ -241,7 +241,6 @@ private:
|
||||
DECL_GFX_PREF(Live, "gfx.perf-warnings.enabled", PerfWarnings, bool, false);
|
||||
DECL_GFX_PREF(Live, "gfx.testing.device-reset", DeviceResetForTesting, int32_t, 0);
|
||||
DECL_GFX_PREF(Live, "gfx.testing.device-fail", DeviceFailForTesting, bool, false);
|
||||
DECL_GFX_PREF(Once, "gfx.touch.resample", TouchResampling, bool, false);
|
||||
|
||||
// These times should be in milliseconds
|
||||
DECL_GFX_PREF(Once, "gfx.touch.resample.delay-threshold", TouchResampleVsyncDelayThreshold, int32_t, 20);
|
||||
|
@ -76,8 +76,6 @@ GeckoTouchDispatcher::GeckoTouchDispatcher()
|
||||
gfxPrefs::GetSingleton();
|
||||
|
||||
mEnabledUniformityInfo = gfxPrefs::UniformityInfo();
|
||||
mResamplingEnabled = gfxPrefs::TouchResampling() &&
|
||||
gfxPrefs::HardwareVsyncEnabled();
|
||||
mVsyncAdjust = TimeDuration::FromMilliseconds(gfxPrefs::TouchVsyncSampleAdjust());
|
||||
mMaxPredict = TimeDuration::FromMilliseconds(gfxPrefs::TouchResampleMaxPredict());
|
||||
mOldTouchThreshold = TimeDuration::FromMilliseconds(gfxPrefs::TouchResampleOldTouchThreshold());
|
||||
@ -90,15 +88,12 @@ GeckoTouchDispatcher::SetCompositorVsyncScheduler(mozilla::layers::CompositorVsy
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
// We assume on b2g that there is only 1 CompositorParent
|
||||
MOZ_ASSERT(mCompositorVsyncScheduler == nullptr);
|
||||
if (mResamplingEnabled) {
|
||||
mCompositorVsyncScheduler = aObserver;
|
||||
}
|
||||
mCompositorVsyncScheduler = aObserver;
|
||||
}
|
||||
|
||||
void
|
||||
GeckoTouchDispatcher::NotifyVsync(TimeStamp aVsyncTimestamp)
|
||||
{
|
||||
MOZ_ASSERT(mResamplingEnabled);
|
||||
layers::APZThreadUtils::AssertOnControllerThread();
|
||||
DispatchTouchMoveEvents(aVsyncTimestamp);
|
||||
}
|
||||
@ -125,12 +120,6 @@ GeckoTouchDispatcher::NotifyTouch(MultiTouchInput& aTouch, TimeStamp aEventTime)
|
||||
|
||||
mTouchMoveEvents.push_back(aTouch);
|
||||
mHavePendingTouchMoves = true;
|
||||
if (mResamplingEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
layers::APZThreadUtils::RunOnControllerThread(NewRunnableMethod(
|
||||
this, &GeckoTouchDispatcher::DispatchTouchMoveEvents, TimeStamp::Now()));
|
||||
} else {
|
||||
{ // scope lock
|
||||
MutexAutoLock lock(mTouchQueueLock);
|
||||
@ -146,12 +135,10 @@ GeckoTouchDispatcher::DispatchTouchNonMoveEvent(MultiTouchInput aInput)
|
||||
{
|
||||
layers::APZThreadUtils::AssertOnControllerThread();
|
||||
|
||||
if (mResamplingEnabled) {
|
||||
// Flush pending touch move events, if there are any
|
||||
// (DispatchTouchMoveEvents will check the mHavePendingTouchMoves flag and
|
||||
// bail out if there's nothing to be done).
|
||||
NotifyVsync(TimeStamp::Now());
|
||||
}
|
||||
// Flush pending touch move events, if there are any
|
||||
// (DispatchTouchMoveEvents will check the mHavePendingTouchMoves flag and
|
||||
// bail out if there's nothing to be done).
|
||||
NotifyVsync(TimeStamp::Now());
|
||||
DispatchTouchEvent(aInput);
|
||||
|
||||
{ // scope lock
|
||||
@ -173,27 +160,22 @@ GeckoTouchDispatcher::DispatchTouchMoveEvents(TimeStamp aVsyncTime)
|
||||
}
|
||||
mHavePendingTouchMoves = false;
|
||||
|
||||
if (mResamplingEnabled) {
|
||||
int touchCount = mTouchMoveEvents.size();
|
||||
TimeDuration vsyncTouchDiff = aVsyncTime - mTouchMoveEvents.back().mTimeStamp;
|
||||
// The delay threshold is a positive pref, but we're testing to see if the
|
||||
// vsync time is delayed from the touch, so add a negative sign.
|
||||
bool isDelayedVsyncEvent = vsyncTouchDiff < -mDelayedVsyncThreshold;
|
||||
bool isOldTouch = vsyncTouchDiff > mOldTouchThreshold;
|
||||
bool resample = (touchCount > 1) && !isDelayedVsyncEvent && !isOldTouch;
|
||||
int touchCount = mTouchMoveEvents.size();
|
||||
TimeDuration vsyncTouchDiff = aVsyncTime - mTouchMoveEvents.back().mTimeStamp;
|
||||
// The delay threshold is a positive pref, but we're testing to see if the
|
||||
// vsync time is delayed from the touch, so add a negative sign.
|
||||
bool isDelayedVsyncEvent = vsyncTouchDiff < -mDelayedVsyncThreshold;
|
||||
bool isOldTouch = vsyncTouchDiff > mOldTouchThreshold;
|
||||
bool resample = (touchCount > 1) && !isDelayedVsyncEvent && !isOldTouch;
|
||||
|
||||
if (!resample) {
|
||||
touchMove = mTouchMoveEvents.back();
|
||||
mTouchMoveEvents.clear();
|
||||
if (!isDelayedVsyncEvent && !isOldTouch) {
|
||||
mTouchMoveEvents.push_back(touchMove);
|
||||
}
|
||||
} else {
|
||||
ResampleTouchMoves(touchMove, aVsyncTime);
|
||||
}
|
||||
} else {
|
||||
if (!resample) {
|
||||
touchMove = mTouchMoveEvents.back();
|
||||
mTouchMoveEvents.clear();
|
||||
if (!isDelayedVsyncEvent && !isOldTouch) {
|
||||
mTouchMoveEvents.push_back(touchMove);
|
||||
}
|
||||
} else {
|
||||
ResampleTouchMoves(touchMove, aVsyncTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user