Bug 1567319 - Discard payloads for no-op composites. r=bas

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2019-08-15 17:54:17 +00:00
parent a938574c60
commit dfad7a59cc
2 changed files with 18 additions and 0 deletions

View File

@ -592,6 +592,12 @@ void LayerManagerComposite::UpdateAndRender() {
// Composition requested, but nothing has changed. Don't do any work.
mClonedLayerTreeProperties = LayerProperties::CloneFrom(GetRoot());
mProfilerScreenshotGrabber.NotifyEmptyFrame();
// Discard the current payloads. These payloads did not require a composite
// (they caused no changes to anything visible), so we don't want to measure
// their latency.
mPayload.Clear();
return;
}
@ -987,6 +993,12 @@ bool LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion,
if (actualBounds.IsEmpty()) {
mProfilerScreenshotGrabber.NotifyEmptyFrame();
mCompositor->GetWidget()->PostRender(&widgetContext);
// Discard the current payloads. These payloads did not require a composite
// (they caused no changes to anything visible), so we don't want to measure
// their latency.
mPayload.Clear();
return true;
}

View File

@ -313,6 +313,12 @@ void LayerManagerMLGPU::Composite() {
if (!mSwapChain->ApplyNewInvalidRegion(std::move(mInvalidRegion),
diagnosticRect)) {
mProfilerScreenshotGrabber.NotifyEmptyFrame();
// Discard the current payloads. These payloads did not require a composite
// (they caused no changes to anything visible), so we don't want to measure
// their latency.
mPayload.Clear();
return;
}