summaryrefslogtreecommitdiffstats
path: root/layout/generic/ScrollAnimationMSDPhysics.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /layout/generic/ScrollAnimationMSDPhysics.cpp
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.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.cpp14
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");
}