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
--- 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;