Bug 1298254 - Ensure that the flush-apz-repaints codepath also waits for pending SetTargetAPZCNotification messages on the controller thread before returning. r?dvander draft
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 23 Sep 2016 17:14:00 -0400
changeset 417292 5251d259e9fa9f1446b3c9b65450e2d328661793
parent 416981 60cc643978c7020926fe4145761e26945fcd5c37
child 417293 50bb67fb0c916f53c3be3429ea51b3cf0647c811
push id30368
push userkgupta@mozilla.com
push dateFri, 23 Sep 2016 21:14:22 +0000
reviewersdvander
bugs1298254
milestone52.0a1
Bug 1298254 - Ensure that the flush-apz-repaints codepath also waits for pending SetTargetAPZCNotification messages on the controller thread before returning. r?dvander MozReview-Commit-ID: 5bY3TeJB4KN
gfx/layers/ipc/CompositorBridgeParent.cpp
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -1655,17 +1655,19 @@ CompositorBridgeParent::FlushApzRepaints
 {
   MOZ_ASSERT(mApzcTreeManager);
   uint64_t layersId = aLayerTree->GetId();
   if (layersId == 0) {
     // The request is coming from the parent-process layer tree, so we should
     // use the compositor's root layer tree id.
     layersId = mRootLayerTreeID;
   }
-  mApzcTreeManager->FlushApzRepaints(layersId);
+  APZThreadUtils::RunOnControllerThread(NS_NewRunnableFunction([=] () {
+    mApzcTreeManager->FlushApzRepaints(layersId);
+  }));
 }
 
 void
 CompositorBridgeParent::GetAPZTestData(const LayerTransactionParent* aLayerTree,
                                        APZTestData* aOutData)
 {
   MonitorAutoLock lock(*sIndirectLayerTreesLock);
   *aOutData = sIndirectLayerTrees[mRootLayerTreeID].mApzTestData;