diff --git a/gfx/layers/ipc/AsyncPanZoomController.cpp b/gfx/layers/ipc/AsyncPanZoomController.cpp index 19706fd22485..5e35be6d349a 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.cpp +++ b/gfx/layers/ipc/AsyncPanZoomController.cpp @@ -530,7 +530,7 @@ nsEventStatus AsyncPanZoomController::OnScaleBegin(const PinchGestureInput& aEve } SetState(PINCHING); - mLastZoomFocus = aEvent.mFocusPoint; + mLastZoomFocus = gfx::Point(aEvent.mFocusPoint.x, aEvent.mFocusPoint.y); return nsEventStatus_eConsumeNoDefault; } @@ -553,7 +553,7 @@ nsEventStatus AsyncPanZoomController::OnScale(const PinchGestureInput& aEvent) { gfxFloat resolution = CalculateResolution(mFrameMetrics).width; gfxFloat userZoom = mFrameMetrics.mZoom.width; - nsIntPoint focusPoint = aEvent.mFocusPoint; + gfx::Point focusPoint = gfx::Point(aEvent.mFocusPoint.x, aEvent.mFocusPoint.y); gfxFloat xFocusChange = (mLastZoomFocus.x - focusPoint.x) / resolution; gfxFloat yFocusChange = (mLastZoomFocus.y - focusPoint.y) / resolution; // If displacing by the change in focus point will take us off page bounds, @@ -833,7 +833,7 @@ void AsyncPanZoomController::ScrollBy(const gfx::Point& aOffset) { } void AsyncPanZoomController::ScaleWithFocus(float aZoom, - const nsIntPoint& aFocus) { + const gfx::Point& aFocus) { float zoomFactor = aZoom / mFrameMetrics.mZoom.width; gfxFloat resolution = CalculateResolution(mFrameMetrics).width; diff --git a/gfx/layers/ipc/AsyncPanZoomController.h b/gfx/layers/ipc/AsyncPanZoomController.h index 6b629618c3a6..79b193529d0d 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.h +++ b/gfx/layers/ipc/AsyncPanZoomController.h @@ -342,7 +342,7 @@ protected: * * XXX: Fix focus point calculations. */ - void ScaleWithFocus(float aScale, const nsIntPoint& aFocus); + void ScaleWithFocus(float aScale, const gfx::Point& aFocus); /** * Schedules a composite on the compositor thread. Wrapper for @@ -546,7 +546,7 @@ private: // Stores the previous focus point if there is a pinch gesture happening. Used // to allow panning by moving multiple fingers (thus moving the focus point). - nsIntPoint mLastZoomFocus; + gfx::Point mLastZoomFocus; // Stores the state of panning and zooming this frame. This is protected by // |mMonitor|; that is, it should be held whenever this is updated. diff --git a/gfx/layers/ipc/Axis.cpp b/gfx/layers/ipc/Axis.cpp index 83f98f5acb28..1134681bda5a 100644 --- a/gfx/layers/ipc/Axis.cpp +++ b/gfx/layers/ipc/Axis.cpp @@ -245,7 +245,7 @@ float Axis::DisplacementWillOverscrollAmount(float aDisplacement) { } } -Axis::Overscroll Axis::ScaleWillOverscroll(float aScale, int32_t aFocus) { +Axis::Overscroll Axis::ScaleWillOverscroll(float aScale, float aFocus) { float originAfterScale = (GetOrigin() + aFocus) * aScale - aFocus; bool both = ScaleWillOverscrollBothSides(aScale); @@ -264,7 +264,7 @@ Axis::Overscroll Axis::ScaleWillOverscroll(float aScale, int32_t aFocus) { return OVERSCROLL_NONE; } -float Axis::ScaleWillOverscrollAmount(float aScale, int32_t aFocus) { +float Axis::ScaleWillOverscrollAmount(float aScale, float aFocus) { float originAfterScale = (GetOrigin() + aFocus) * aScale - aFocus; switch (ScaleWillOverscroll(aScale, aFocus)) { case OVERSCROLL_MINUS: return originAfterScale - GetPageStart() * aScale; diff --git a/gfx/layers/ipc/Axis.h b/gfx/layers/ipc/Axis.h index e296889f9ae2..c3eb6a7f6a2b 100644 --- a/gfx/layers/ipc/Axis.h +++ b/gfx/layers/ipc/Axis.h @@ -143,7 +143,7 @@ public: * scroll offset in such a way that it remains in the same place on the page * relative. */ - Overscroll ScaleWillOverscroll(float aScale, int32_t aFocus); + Overscroll ScaleWillOverscroll(float aScale, float aFocus); /** * If a scale will overscroll the axis, this returns the amount and in what @@ -153,7 +153,7 @@ public: * scroll offset in such a way that it remains in the same place on the page * relative. */ - float ScaleWillOverscrollAmount(float aScale, int32_t aFocus); + float ScaleWillOverscrollAmount(float aScale, float aFocus); /** * Checks if an axis will overscroll in both directions by computing the