Bug 1599887 - Update frame is when WR rendering is skipped r=nical

wr::WebRenderPipelineInfo needs to be handled even when WR rendering does not happen.

Differential Revision: https://phabricator.services.mozilla.com/D55899
This commit is contained in:
sotaro
2019-12-06 13:06:21 +00:00
parent 07cdb06bff
commit d0c54fc702
7 changed files with 39 additions and 27 deletions

View File

@@ -528,40 +528,29 @@ void AsyncImagePipelineManager::NotifyPipelinesUpdated(
wr::RenderedFrameId aLastCompletedFrameId) {
MOZ_ASSERT(wr::RenderThread::IsInRenderThread());
MOZ_ASSERT(mLastCompletedFrameId <= aLastCompletedFrameId.mId);
MOZ_ASSERT(aLatestFrameId.IsValid());
// This is called on the render thread, so we just stash the data into
// mPendingUpdates and process it later on the compositor thread.
mPendingUpdates.push_back(aInfo);
mLastCompletedFrameId = aLastCompletedFrameId.mId;
// If aLatestFrameId is valid then a render has been submitted.
if (aLatestFrameId.IsValid()) {
mLastCompletedFrameId = aLastCompletedFrameId.mId;
{
// We need to lock for mRenderSubmittedUpdates because it can be accessed
// on the compositor thread.
MutexAutoLock lock(mRenderSubmittedUpdatesLock);
{
// We need to lock for mRenderSubmittedUpdates because it can be accessed
// on the compositor thread.
MutexAutoLock lock(mRenderSubmittedUpdatesLock);
// Move the pending updates into the submitted ones. Note that this clears
// mPendingUpdates.
mRenderSubmittedUpdates.emplace_back(aLatestFrameId,
std::move(mPendingUpdates));
}
// Queue a runnable on the compositor thread to process the updates.
// This will also call CheckForTextureHostsNotUsedByGPU.
layers::CompositorThreadHolder::Loop()->PostTask(
NewRunnableMethod("ProcessPipelineUpdates", this,
&AsyncImagePipelineManager::ProcessPipelineUpdates));
} else if (mLastCompletedFrameId < aLastCompletedFrameId.mId) {
// We're not running ProcessPipelineUpdates but a later frame has completed,
// so queue a runnable on the compositor thread to check if any TextureHosts
// can be released.
mLastCompletedFrameId = aLastCompletedFrameId.mId;
layers::CompositorThreadHolder::Loop()->PostTask(NewRunnableMethod(
"CheckForTextureHostsNotUsedByGPU", this,
&AsyncImagePipelineManager::CheckForTextureHostsNotUsedByGPU));
// Move the pending updates into the submitted ones. Note that this clears
// mPendingUpdates.
mRenderSubmittedUpdates.emplace_back(aLatestFrameId,
std::move(mPendingUpdates));
}
// Queue a runnable on the compositor thread to process the updates.
// This will also call CheckForTextureHostsNotUsedByGPU.
layers::CompositorThreadHolder::Loop()->PostTask(
NewRunnableMethod("ProcessPipelineUpdates", this,
&AsyncImagePipelineManager::ProcessPipelineUpdates));
}
void AsyncImagePipelineManager::ProcessPipelineUpdates() {