Bug 1435282 - Don't force the render transaction to happen immediately if we're doing an async flush. r=sotaro

This splits the FlushRendering function into sync and async versions
just for a bit more clarity. In the async version we don't want to set
the mForceRendering flag at all because we don't need to force a
rendering - if there is one already pending then that's good enough. And
anyway in practice the async version seems to only ever be invoked by
CompositorBridgeParent::SetTestSampleTime which I'll be changing in the
next patch.

MozReview-Commit-ID: 4cdU0U5B1pp

--HG--
extra : rebase_source : d7842844fca758d53121e3326d8da7fb7592ad8b
This commit is contained in:
Kartikaya Gupta 2018-02-02 10:48:25 -05:00
Родитель cfcf1eb7b5
Коммит b2e6e6deb1
3 изменённых файлов: 17 добавлений и 8 удалений

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

@ -542,7 +542,7 @@ mozilla::ipc::IPCResult
CompositorBridgeParent::RecvFlushRendering()
{
if (mOptions.UseWebRender()) {
mWrBridge->FlushRendering(/* aIsSync */ true);
mWrBridge->FlushRendering();
return IPC_OK();
}
@ -557,7 +557,7 @@ mozilla::ipc::IPCResult
CompositorBridgeParent::RecvFlushRenderingAsync()
{
if (mOptions.UseWebRender()) {
mWrBridge->FlushRendering(/* aIsSync */ false);
mWrBridge->FlushRenderingAsync();
return IPC_OK();
}
@ -1289,7 +1289,7 @@ CompositorBridgeParent::SetTestSampleTime(const uint64_t& aId,
mTestTime = aTime;
if (mWrBridge) {
mWrBridge->FlushRendering(/*aIsSync*/ false);
mWrBridge->FlushRenderingAsync();
return true;
}

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

@ -1338,7 +1338,7 @@ WebRenderBridgeParent::ScheduleGenerateFrame()
}
void
WebRenderBridgeParent::FlushRendering(bool aIsSync)
WebRenderBridgeParent::FlushRendering()
{
if (mDestroyed) {
return;
@ -1346,13 +1346,21 @@ WebRenderBridgeParent::FlushRendering(bool aIsSync)
mForceRendering = true;
if (mCompositorScheduler->FlushPendingComposite()) {
if (aIsSync) {
mApi->WaitFlushed();
}
}
mForceRendering = false;
}
void
WebRenderBridgeParent::FlushRenderingAsync()
{
if (mDestroyed) {
return;
}
mCompositorScheduler->FlushPendingComposite();
}
void
WebRenderBridgeParent::Pause()
{

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

@ -172,7 +172,8 @@ public:
void UpdateAPZ(bool aUpdateHitTestingTree);
const WebRenderScrollData& GetScrollData() const;
void FlushRendering(bool aIsSync);
void FlushRendering();
void FlushRenderingAsync();
/**
* Schedule generating WebRender frame definitely at next composite timing.