diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /layout/generic/ScrollAnimationMSDPhysics.cpp | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/generic/ScrollAnimationMSDPhysics.cpp')
-rw-r--r-- | layout/generic/ScrollAnimationMSDPhysics.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/layout/generic/ScrollAnimationMSDPhysics.cpp b/layout/generic/ScrollAnimationMSDPhysics.cpp index de67f9c59a..8f0ae32d3b 100644 --- a/layout/generic/ScrollAnimationMSDPhysics.cpp +++ b/layout/generic/ScrollAnimationMSDPhysics.cpp @@ -5,7 +5,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ScrollAnimationMSDPhysics.h" +#include "mozilla/Logging.h" #include "mozilla/StaticPrefs_general.h" +#include "mozilla/ToString.h" + +static mozilla::LazyLogModule sApzMsdLog("apz.msd"); +#define MSD_LOG(...) MOZ_LOG(sApzMsdLog, LogLevel::Debug, (__VA_ARGS__)) using namespace mozilla; @@ -108,13 +113,17 @@ double ScrollAnimationMSDPhysics::ComputeSpringConstant( } void ScrollAnimationMSDPhysics::SimulateUntil(const TimeStamp& aTime) { - if (!mLastSimulatedTime || aTime < mLastSimulatedTime) { + if (!mLastSimulatedTime || aTime <= mLastSimulatedTime) { return; } TimeDuration delta = aTime - mLastSimulatedTime; mModelX.Simulate(delta); mModelY.Simulate(delta); mLastSimulatedTime = aTime; + MSD_LOG("Simulated for duration %f, finished %d position %s velocity %s\n", + delta.ToMilliseconds(), IsFinished(aTime), + ToString(CSSPoint::FromAppUnits(PositionAt(aTime))).c_str(), + ToString(CSSPoint::FromAppUnits(VelocityAt(aTime))).c_str()); } nsPoint ScrollAnimationMSDPhysics::PositionAt(const TimeStamp& aTime) { @@ -152,6 +161,9 @@ ScrollAnimationMSDPhysics::NonOscillatingAxisPhysicsMSDModel:: ClampVelocityToMaximum(aInitialVelocity, aInitialPosition, aInitialDestination, aSpringConstant), aSpringConstant, aDampingRatio) { + MSD_LOG("Constructing axis physics model with parameters %f %f %f %f %f\n", + aInitialPosition, aInitialDestination, aInitialVelocity, + aSpringConstant, aDampingRatio); MOZ_ASSERT(aDampingRatio >= 1.0, "Damping ratio must be >= 1.0 to avoid oscillation"); } |