Bug 1402498 - Mark two methods of AxisPhysicsModel as const. r?rhunt draft
authorMarkus Stange <mstange@themasta.com>
Sun, 17 Sep 2017 13:41:14 +0200
changeset 672904 4da81c2f12538a316a4238b80ff434a82a7e3811
parent 672903 2a8a8a30faef7b3e1233523db4ee96f89ab03055
child 672905 55eeebb91408a86b5f43647e4dbf7e36addae23b
push id82420
push userbmo:mstange@themasta.com
push dateFri, 29 Sep 2017 22:38:50 +0000
reviewersrhunt
bugs1402498
milestone58.0a1
Bug 1402498 - Mark two methods of AxisPhysicsModel as const. r?rhunt MozReview-Commit-ID: BTL8YwAIHtu
gfx/layers/AxisPhysicsModel.cpp
gfx/layers/AxisPhysicsModel.h
--- a/gfx/layers/AxisPhysicsModel.cpp
+++ b/gfx/layers/AxisPhysicsModel.cpp
@@ -42,23 +42,23 @@ AxisPhysicsModel::AxisPhysicsModel(doubl
 }
 
 AxisPhysicsModel::~AxisPhysicsModel()
 {
 
 }
 
 double
-AxisPhysicsModel::GetVelocity()
+AxisPhysicsModel::GetVelocity() const
 {
   return LinearInterpolate(mPrevState.v, mNextState.v, mProgress);
 }
 
 double
-AxisPhysicsModel::GetPosition()
+AxisPhysicsModel::GetPosition() const
 {
   return LinearInterpolate(mPrevState.p, mNextState.p, mProgress);
 }
 
 void
 AxisPhysicsModel::SetVelocity(double aVelocity)
 {
   mNextState.v = aVelocity;
--- a/gfx/layers/AxisPhysicsModel.h
+++ b/gfx/layers/AxisPhysicsModel.h
@@ -32,27 +32,27 @@ public:
    * Advance the physics simulation.
    * |aDelta| is the time since the last sample.
    */
   void Simulate(const TimeDuration& aDeltaTime);
 
   /**
    * Gets the raw velocity of this axis at this moment.
    */
-  double GetVelocity();
+  double GetVelocity() const;
 
   /**
    * Sets the raw velocity of this axis at this moment.
    */
   void SetVelocity(double aVelocity);
 
   /**
    * Gets the raw position of this axis at this moment.
    */
-  double GetPosition();
+  double GetPosition() const;
 
   /**
    * Sets the raw position of this axis at this moment.
    */
   void SetPosition(double aPosition);
 
 protected: