Bug 936500 - Don't copy Axis when creating a FlingAnimation. r=kats
authorChris Lord <chrislord.net@gmail.com>
Fri, 13 Dec 2013 19:37:42 +0000
changeset 160464 5d3f25ce4a6a9cd75acc71c73cc9e0600b53a33e
parent 160463 56a287aa20fd855b1bae2f20e62045118b96448b
child 160465 0aef240c39d31ba2bb61c1a1d3c6a7a92dfd0bf3
push id25834
push userphilringnalda@gmail.com
push dateSun, 15 Dec 2013 02:20:53 +0000
treeherdermozilla-central@9fcc6330dc69 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs936500
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 936500 - Don't copy Axis when creating a FlingAnimation. r=kats FlingAnimation was, likely accidentally, creating copies of the axes it was animating and operating on those, which lead to problems when displayports were calculated based on the original copies which housed old values.
gfx/layers/ipc/AsyncPanZoomController.cpp
--- a/gfx/layers/ipc/AsyncPanZoomController.cpp
+++ b/gfx/layers/ipc/AsyncPanZoomController.cpp
@@ -275,33 +275,33 @@ GetFrameTime() {
   if (sFrameTime.IsNull()) {
     return TimeStamp::Now();
   }
   return sFrameTime;
 }
 
 class FlingAnimation: public AsyncPanZoomAnimation {
 public:
-  FlingAnimation(AxisX aX, AxisY aY)
+  FlingAnimation(AxisX& aX, AxisY& aY)
     : AsyncPanZoomAnimation(TimeDuration::FromMilliseconds(gFlingRepaintInterval))
     , mX(aX)
     , mY(aY)
   {}
   /**
    * Advances a fling by an interpolated amount based on the passed in |aDelta|.
    * This should be called whenever sampling the content transform for this
    * frame. Returns true if the fling animation should be advanced by one frame,
    * or false if there is no fling or the fling has ended.
    */
   virtual bool Sample(FrameMetrics& aFrameMetrics,
                       const TimeDuration& aDelta);
 
 private:
-  AxisX mX;
-  AxisY mY;
+  AxisX& mX;
+  AxisY& mY;
 };
 
 class ZoomAnimation: public AsyncPanZoomAnimation {
 public:
   ZoomAnimation(CSSPoint aStartOffset, CSSToScreenScale aStartZoom,
                 CSSPoint aEndOffset, CSSToScreenScale aEndZoom)
     : mStartOffset(aStartOffset)
     , mStartZoom(aStartZoom)