Bug 1455715 - Fix some controller thread tasks that were bypassing the updater thread. r?botond
These tasks have an implicit ordering with other tasks that are
dispatched from the compositor thread to the updater thread, and so they
need to be bounced through the updater thread before we run them on the
controller thread.
MozReview-Commit-ID: 92nIYgyV8A2
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -1394,19 +1394,20 @@ CompositorBridgeParent::SetTestAsyncZoom
mApzUpdater->SetTestAsyncZoom(aLayersId, aScrollId, aZoom);
}
}
void
CompositorBridgeParent::FlushApzRepaints(const LayersId& aLayersId)
{
MOZ_ASSERT(mApzcTreeManager);
+ MOZ_ASSERT(mApzUpdater);
MOZ_ASSERT(aLayersId.IsValid());
RefPtr<CompositorBridgeParent> self = this;
- APZThreadUtils::RunOnControllerThread(NS_NewRunnableFunction(
+ mApzUpdater->RunOnControllerThread(aLayersId, NS_NewRunnableFunction(
"layers::CompositorBridgeParent::FlushApzRepaints",
[=]() { self->mApzcTreeManager->FlushApzRepaints(aLayersId); }));
}
void
CompositorBridgeParent::GetAPZTestData(const LayersId& aLayersId,
APZTestData* aOutData)
{
@@ -1416,32 +1417,32 @@ CompositorBridgeParent::GetAPZTestData(c
}
}
void
CompositorBridgeParent::SetConfirmedTargetAPZC(const LayersId& aLayersId,
const uint64_t& aInputBlockId,
const nsTArray<ScrollableLayerGuid>& aTargets)
{
- if (!mApzcTreeManager) {
+ if (!mApzcTreeManager || !mApzUpdater) {
return;
}
// Need to specifically bind this since it's overloaded.
void (APZCTreeManager::*setTargetApzcFunc)
(uint64_t, const nsTArray<ScrollableLayerGuid>&) =
&APZCTreeManager::SetTargetAPZC;
RefPtr<Runnable> task =
NewRunnableMethod<uint64_t,
StoreCopyPassByConstLRef<nsTArray<ScrollableLayerGuid>>>(
"layers::CompositorBridgeParent::SetConfirmedTargetAPZC",
mApzcTreeManager.get(),
setTargetApzcFunc,
aInputBlockId,
aTargets);
- APZThreadUtils::RunOnControllerThread(task.forget());
+ mApzUpdater->RunOnControllerThread(aLayersId, task.forget());
}
void
CompositorBridgeParent::InitializeLayerManager(const nsTArray<LayersBackend>& aBackendHints)
{
NS_ASSERTION(!mLayerManager, "Already initialised mLayerManager");
NS_ASSERTION(!mCompositor, "Already initialised mCompositor");