Bug 1570869 - Inline FrameRenderingComplete into HandleFrameOneDoc. r=nical

Depends on D40374

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2019-08-05 12:09:46 +00:00
Родитель d4aaf327fd
Коммит dd7b882fd0
2 изменённых файлов: 18 добавлений и 28 удалений

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

@ -320,7 +320,24 @@ void RenderThread::HandleFrameOneDoc(wr::WindowId aWindowId, bool aRender) {
/* aReadbackSize */ Nothing(),
/* aReadbackFormat */ Nothing(),
/* aReadbackBuffer */ Nothing(), hadSlowFrame);
FrameRenderingComplete(aWindowId);
{ // scope lock
auto windows = mWindowInfos.Lock();
auto it = windows->find(AsUint64(aWindowId));
if (it == windows->end()) {
MOZ_ASSERT(false);
return;
}
WindowInfo* info = it->second;
info->mPendingFrames.pop();
info->mIsRendering = false;
}
// The start time is from WebRenderBridgeParent::CompositeToTarget. From that
// point until now (when the frame is finally pushed to the screen) is
// equivalent to the COMPOSITE_TIME metric in the non-WR codepath.
mozilla::Telemetry::AccumulateTimeDelta(mozilla::Telemetry::COMPOSITE_TIME,
frame.mStartTime);
}
void RenderThread::WakeUp(wr::WindowId aWindowId) {
@ -546,31 +563,6 @@ void RenderThread::IncPendingFrameCount(wr::WindowId aWindowId,
PendingFrameInfo{aStartTime, aStartId, 0, aDocFrameCount, false});
}
void RenderThread::FrameRenderingComplete(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->PendingCount() > 0);
MOZ_ASSERT(info->mIsRendering);
if (info->PendingCount() <= 0) {
return;
}
PendingFrameInfo frame = std::move(info->mPendingFrames.front());
info->mPendingFrames.pop();
info->mIsRendering = false;
// The start time is from WebRenderBridgeParent::CompositeToTarget. From that
// point until now (when the frame is finally pushed to the screen) is
// equivalent to the COMPOSITE_TIME metric in the non-WR codepath.
mozilla::Telemetry::AccumulateTimeDelta(mozilla::Telemetry::COMPOSITE_TIME,
frame.mStartTime);
}
void RenderThread::NotifySlowFrame(wr::WindowId aWindowId) {
auto windows = mWindowInfos.Lock();
auto it = windows->find(AsUint64(aWindowId));

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

@ -225,8 +225,6 @@ class RenderThread final {
void IncPendingFrameCount(wr::WindowId aWindowId, const VsyncId& aStartId,
const TimeStamp& aStartTime,
uint8_t aDocFrameCount);
/// Can be called from any thread.
void FrameRenderingComplete(wr::WindowId aWindowId);
void NotifySlowFrame(wr::WindowId aWindowId);