Bug 1517328 - Make APZCTreeManager::FlushApzRepaints() static. r=kats

Since we no longer throttle paints, this function just sends a notification,
which does not rely on any tree manager state.

Depends on D15592

Differential Revision: https://phabricator.services.mozilla.com/D15593

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Botond Ballo 2019-01-02 20:31:23 +00:00
Родитель 0d84275a56
Коммит 8be2e31b96
3 изменённых файлов: 9 добавлений и 13 удалений

Просмотреть файл

@ -1123,7 +1123,7 @@ static bool WillHandleInput(const PanGestureOrScrollWheelInput& aPanInput) {
return APZInputBridge::ActionForWheelEvent(&wheelEvent).isSome();
}
void APZCTreeManager::FlushApzRepaints(LayersId aLayersId) {
/*static*/ void APZCTreeManager::FlushApzRepaints(LayersId aLayersId) {
// Previously, paints were throttled and therefore this method was used to
// ensure any pending paints were flushed. Now, paints are flushed
// immediately, so it is safe to simply send a notification now.

Просмотреть файл

@ -222,13 +222,6 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
void SampleForWebRender(wr::TransactionWrapper& aTxn,
const TimeStamp& aSampleTime);
/**
* Walk the tree of APZCs and flushes the repaint requests for all the APZCS
* corresponding to the given layers id. Finally, sends a flush complete
* notification to the GeckoContentController for the layers id.
*/
void FlushApzRepaints(LayersId aLayersId);
/**
* General handler for incoming input events. Manipulates the frame metrics
* based on what type of input it is. For example, a PinchGestureEvent will
@ -536,6 +529,12 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
const ScrollbarData& aScrollbarData, bool aScrollbarIsDescendant,
AsyncTransformComponentMatrix* aOutClipTransform);
/**
* Dispatch a flush complete notification from the repaint thread of the
* content controller for the given layers id.
*/
static void FlushApzRepaints(LayersId aLayersId);
// Assert that the current thread is the sampler thread for this APZCTM.
void AssertOnSamplerThread();
// Assert that the current thread is the updater thread for this APZCTM.

Просмотреть файл

@ -1352,15 +1352,12 @@ void CompositorBridgeParent::SetTestAsyncZoom(
}
void CompositorBridgeParent::FlushApzRepaints(const LayersId& aLayersId) {
MOZ_ASSERT(mApzcTreeManager);
MOZ_ASSERT(mApzUpdater);
MOZ_ASSERT(aLayersId.IsValid());
RefPtr<CompositorBridgeParent> self = this;
mApzUpdater->RunOnControllerThread(
aLayersId, NS_NewRunnableFunction(
"layers::CompositorBridgeParent::FlushApzRepaints", [=]() {
self->mApzcTreeManager->FlushApzRepaints(aLayersId);
}));
"layers::CompositorBridgeParent::FlushApzRepaints",
[=]() { APZCTreeManager::FlushApzRepaints(aLayersId); }));
}
void CompositorBridgeParent::GetAPZTestData(const LayersId& aLayersId,