Bug 1500821 - Call RecordFrame() only for non-empty frame at NotifyDidRender() r=mattwoodrow
authorsotaro <sotaro.ikeda.g@gmail.com>
Tue, 23 Oct 2018 13:21:02 +0900
changeset 490737 bd15c0cbc18ab4fc6dcac68c8be86a88e1ee7e76
parent 490736 a0fac96b947ef3dbcd50106e66d14b8ff4b5a7fa
child 490738 47a7b32e57373e38139dd540394fd527442e59a2
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersmattwoodrow
bugs1500821
milestone65.0a1
Bug 1500821 - Call RecordFrame() only for non-empty frame at NotifyDidRender() r=mattwoodrow
gfx/webrender_bindings/RenderThread.cpp
--- a/gfx/webrender_bindings/RenderThread.cpp
+++ b/gfx/webrender_bindings/RenderThread.cpp
@@ -330,19 +330,23 @@ RenderThread::RunEvent(wr::WindowId aWin
   aEvent->Run(*this, aWindowId);
   aEvent = nullptr;
 }
 
 static void
 NotifyDidRender(layers::CompositorBridgeParent* aBridge,
                 wr::WrPipelineInfo aInfo,
                 TimeStamp aStart,
-                TimeStamp aEnd)
+                TimeStamp aEnd,
+                bool aRender)
 {
-  if (aBridge->GetWrBridge()) {
+  if (aRender && aBridge->GetWrBridge()) {
+    // We call this here to mimic the behavior in LayerManagerComposite, as to
+    // not change what Talos measures. That is, we do not record an empty frame
+    // as a frame.
     aBridge->GetWrBridge()->RecordFrame();
   }
 
   for (uintptr_t i = 0; i < aInfo.epochs.length; i++) {
     aBridge->NotifyPipelineRendered(
         aInfo.epochs.data[i].pipeline_id,
         aInfo.epochs.data[i].epoch,
         aStart,
@@ -392,17 +396,18 @@ RenderThread::UpdateAndRender(wr::Window
   MOZ_ASSERT(pipelineMgr);
   pipelineMgr->NotifyPipelinesUpdated(info);
 
   layers::CompositorThreadHolder::Loop()->PostTask(NewRunnableFunction(
     "NotifyDidRenderRunnable",
     &NotifyDidRender,
     renderer->GetCompositorBridge(),
     info,
-    aStartTime, end
+    aStartTime, end,
+    aRender
   ));
 }
 
 void
 RenderThread::Pause(wr::WindowId aWindowId)
 {
   MOZ_ASSERT(IsInRenderThread());