Bug 1083398 - Sprinkle some const keywords around. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 16 Oct 2014 10:14:37 -0400
changeset 210758 ebf4483757474f625926717d4d0e05208b5bb078
parent 210757 ef38d26cac45c3c80b3e823eebcfcef2afbb2c93
child 210759 d05cd2481d96c37dd6db35bdec30f527c8ce00df
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbotond
bugs1083398
milestone36.0a1
Bug 1083398 - Sprinkle some const keywords around. r=botond
gfx/layers/apz/src/AsyncPanZoomController.cpp
gfx/layers/apz/src/AsyncPanZoomController.h
gfx/layers/apz/src/Axis.cpp
gfx/layers/apz/src/Axis.h
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -1771,17 +1771,17 @@ float AsyncPanZoomController::PanDistanc
   ToGlobalScreenCoordinates(&panVector, panStart);
   return NS_hypot(panVector.x, panVector.y);
 }
 
 ScreenPoint AsyncPanZoomController::PanStart() const {
   return ScreenPoint(mX.PanStart(), mY.PanStart());
 }
 
-const ScreenPoint AsyncPanZoomController::GetVelocityVector() {
+const ScreenPoint AsyncPanZoomController::GetVelocityVector() const {
   return ScreenPoint(mX.GetVelocity(), mY.GetVelocity());
 }
 
 void AsyncPanZoomController::HandlePanningWithTouchAction(double aAngle) {
   // Handling of cross sliding will need to be added in this method after touch-action released
   // enabled by default.
   if (CurrentTouchBlock()->TouchActionAllowsPanningXY()) {
     if (mX.CanScrollNow() && mY.CanScrollNow()) {
--- a/gfx/layers/apz/src/AsyncPanZoomController.h
+++ b/gfx/layers/apz/src/AsyncPanZoomController.h
@@ -486,17 +486,17 @@ protected:
    * Unlikely PanDistance(), this function returns a point in local screen
    * coordinates.
    */
   ScreenPoint PanStart() const;
 
   /**
    * Gets a vector of the velocities of each axis.
    */
-  const ScreenPoint GetVelocityVector();
+  const ScreenPoint GetVelocityVector() const;
 
   /**
    * Gets the first touch point from a MultiTouchInput.  This gets only
    * the first one and assumes the rest are either missing or not relevant.
    */
   ScreenPoint GetFirstTouchScreenPoint(const MultiTouchInput& aEvent);
 
   /**
--- a/gfx/layers/apz/src/Axis.cpp
+++ b/gfx/layers/apz/src/Axis.cpp
@@ -315,17 +315,17 @@ CSSCoord Axis::ScaleWillOverscrollAmount
     return (originAfterScale - GetPageStart()) / zoom;
   }
   if (plus) {
     return (originAfterScale + (GetCompositionLength() / aScale) - GetPageEnd()) / zoom;
   }
   return 0;
 }
 
-float Axis::GetVelocity() {
+float Axis::GetVelocity() const {
   return mAxisLocked ? 0 : mVelocity;
 }
 
 void Axis::SetVelocity(float aVelocity) {
   mVelocity = aVelocity;
 }
 
 ScreenCoord Axis::GetCompositionEnd() const {
--- a/gfx/layers/apz/src/Axis.h
+++ b/gfx/layers/apz/src/Axis.h
@@ -146,17 +146,17 @@ public:
    */
   bool CanScrollNow() const;
 
   void SetAxisLocked(bool aAxisLocked) { mAxisLocked = aAxisLocked; }
 
   /**
    * Gets the raw velocity of this axis at this moment.
    */
-  float GetVelocity();
+  float GetVelocity() const;
 
   /**
    * Sets the raw velocity of this axis at this moment.
    * Intended to be called only when the axis "takes over" a velocity from
    * another APZC, in which case there are no touch points available to call
    * UpdateWithTouchAtDevicePoint. In other circumstances,
    * UpdateWithTouchAtDevicePoint should be used and the velocity calculated
    * there.