Bug 1139155 - Add a mechanism to know when the APZ is done processing. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 19 Jun 2015 22:51:35 -0400
changeset 267961 23b7cd26fa9a83c997d69759148fbdc44338a57d
parent 267960 b4b1eb8f29c76d01233d6074473700a0ae303f5f
child 267962 1339cd0ef47279a77ae411bc763af0e922233749
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1139155
milestone41.0a1
Bug 1139155 - Add a mechanism to know when the APZ is done processing. r=botond
dom/ipc/TabChild.cpp
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2141,16 +2141,23 @@ TabChild::RecvHandleLongTap(const CSSPoi
 }
 
 bool
 TabChild::RecvNotifyAPZStateChange(const ViewID& aViewId,
                                    const APZStateChange& aChange,
                                    const int& aArg)
 {
   mAPZEventState->ProcessAPZStateChange(GetDocument(), aViewId, aChange, aArg);
+  if (aChange == APZStateChange::TransformEnd) {
+    // This is used by tests to determine when the APZ is done doing whatever
+    // it's doing. XXX generify this as needed when writing additional tests.
+    DispatchMessageManagerMessage(
+      NS_LITERAL_STRING("APZ:TransformEnd"),
+      NS_LITERAL_STRING("{}"));
+  }
   return true;
 }
 
 bool
 TabChild::RecvNotifyFlushComplete()
 {
   APZCCallbackHelper::NotifyFlushComplete();
   return true;
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -3118,16 +3118,17 @@ AsyncPanZoomController::HasReadyTouchBlo
 
 void AsyncPanZoomController::SetState(PanZoomState aNewState)
 {
   PanZoomState oldState;
 
   // Intentional scoping for mutex
   {
     ReentrantMonitorAutoEnter lock(mMonitor);
+    APZC_LOG("%p changing from state %d to %d\n", this, mState, aNewState);
     oldState = mState;
     mState = aNewState;
   }
 
   DispatchStateChangeNotification(oldState, aNewState);
 }
 
 void AsyncPanZoomController::DispatchStateChangeNotification(PanZoomState aOldState,