Bug 1083398 - Sprinkle some const keywords around. r=botond
--- 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.