Skip to content

Commit

Permalink
Bug 1668878 - Stop doing catch-up composites on webrender. r=mattwoodrow
Browse files Browse the repository at this point in the history
Currently, when webrender fails to render a frame on time, it will
attempt to catch up by rendering the next frame immediately (part way
through the vsync period) rather than delaying until the next
vsync. The idea is that even though the first frame missed vsync, the
next frame can hopefully still be rendered on time.

However, on Android, because of the default EGL swap interval of zero,
the driver blocks rather than allowing 2 frames to be rendered in a
single vsync. This guarantees that the next frame will also miss its
vsync, and so on. Other platforms may avoid this by setting the swap
interval to zero. While that was an option on Android too, it was felt
that the premise of catch up composites was still flawed: a
late-started composite is unlikely to meet its deadline, even if the
driver does not block. Better to cut our losses and wait for the next
vsync.

Differential Revision: https://phabricator.services.mozilla.com/D92958
  • Loading branch information
jamienicol committed Oct 8, 2020
1 parent 436fcfb commit 60847b9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions gfx/layers/wr/WebRenderBridgeParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ void WebRenderBridgeParent::SetOMTASampleTime() {
void WebRenderBridgeParent::CompositeIfNeeded() {
if (mSkippedComposite) {
mSkippedComposite = false;
CompositeToTarget(mSkippedCompositeId, nullptr, nullptr);
mCompositorScheduler->ScheduleComposition();
}
}

Expand Down Expand Up @@ -1999,7 +1999,6 @@ void WebRenderBridgeParent::CompositeToTarget(VsyncId aId,
wr::RenderThread::Get()->TooManyPendingFrames(mApi->GetId())) {
// Render thread is busy, try next time.
mSkippedComposite = true;
mSkippedCompositeId = aId;
ResetPreviousSampleTime();

// Record that we skipped presenting a frame for
Expand Down
1 change: 0 additions & 1 deletion gfx/layers/wr/WebRenderBridgeParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,6 @@ class WebRenderBridgeParent final : public PWebRenderBridgeParent,
CompositionOpportunityId mCompositionOpportunityId;
nsCString mInitError;

VsyncId mSkippedCompositeId;
TimeStamp mMostRecentComposite;

#if defined(MOZ_WIDGET_ANDROID)
Expand Down

0 comments on commit 60847b9

Please sign in to comment.