Bug 1551392 - Remove RenderThread::DecPendingFrameCount() r=nical

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
sotaro 2019-05-14 07:18:03 +00:00
parent 5108fcd99f
commit 5195dc0de7
2 changed files with 8 additions and 35 deletions

View File

@ -344,13 +344,12 @@ static void NotifyDidStartRender(layers::CompositorBridgeParent* aBridge) {
}
}
void RenderThread::UpdateAndRender(wr::WindowId aWindowId,
const VsyncId& aStartId,
const TimeStamp& aStartTime, bool aRender,
const Maybe<gfx::IntSize>& aReadbackSize,
const Maybe<wr::ImageFormat>& aReadbackFormat,
const Maybe<Range<uint8_t>>& aReadbackBuffer,
bool aHadSlowFrame) {
void RenderThread::UpdateAndRender(
wr::WindowId aWindowId, const VsyncId& aStartId,
const TimeStamp& aStartTime, bool aRender,
const Maybe<gfx::IntSize>& aReadbackSize,
const Maybe<wr::ImageFormat>& aReadbackFormat,
const Maybe<Range<uint8_t>>& aReadbackBuffer, bool aHadSlowFrame) {
AUTO_PROFILER_TRACING("Paint", "Composite", GRAPHICS);
MOZ_ASSERT(IsInRenderThread());
MOZ_ASSERT(aRender || aReadbackBuffer.isNothing());
@ -372,8 +371,8 @@ void RenderThread::UpdateAndRender(wr::WindowId aWindowId,
bool rendered = false;
RendererStats stats = {0};
if (aRender) {
rendered = renderer->UpdateAndRender(aReadbackSize, aReadbackFormat,
aReadbackBuffer, aHadSlowFrame, &stats);
rendered = renderer->UpdateAndRender(
aReadbackSize, aReadbackFormat, aReadbackBuffer, aHadSlowFrame, &stats);
} else {
renderer->Update();
}
@ -489,30 +488,6 @@ void RenderThread::IncPendingFrameCount(wr::WindowId aWindowId,
it->second->mDocFrameCounts.push(aDocFrameCount);
}
void RenderThread::DecPendingFrameCount(wr::WindowId aWindowId) {
auto windows = mWindowInfos.Lock();
auto it = windows->find(AsUint64(aWindowId));
if (it == windows->end()) {
MOZ_ASSERT(false);
return;
}
WindowInfo* info = it->second;
MOZ_ASSERT(info->mPendingCount > 0);
if (info->mPendingCount <= 0) {
return;
}
info->mPendingCount--;
// This function gets called for "nop frames" where nothing was rendered or
// composited. But we count this time because the non-WR codepath equivalent
// in CompositorBridgeParent::ComposeToTarget also counts such frames. And
// anyway this should be relatively infrequent so it shouldn't skew the
// numbers much.
mozilla::Telemetry::AccumulateTimeDelta(mozilla::Telemetry::COMPOSITE_TIME,
info->mStartTimes.front());
info->mStartTimes.pop();
info->mStartIds.pop();
}
mozilla::Pair<bool, bool> RenderThread::IncRenderingFrameCount(
wr::WindowId aWindowId, bool aRender) {
auto windows = mWindowInfos.Lock();

View File

@ -218,8 +218,6 @@ class RenderThread final {
const TimeStamp& aStartTime,
uint8_t aDocFrameCount);
/// Can be called from any thread.
void DecPendingFrameCount(wr::WindowId aWindowId);
/// Can be called from any thread.
mozilla::Pair<bool, bool> IncRenderingFrameCount(wr::WindowId aWindowId,
bool aRender);
/// Can be called from any thread.