Bug 1377688 - Remove RenderThread::NewScrollFrameReady() r=kats
authorsotaro <sotaro.ikeda.g@gmail.com>
Mon, 10 Jul 2017 10:46:41 +0900
changeset 606118 3735f14246b9c54fd57787379f783f69ad503b30
parent 606117 7e31c78c123a3988cf7676632fb52017c4b973c7
child 606119 a41a33fc1db6fad63965e0f0f2e745e47838858e
push id67608
push userkgupta@mozilla.com
push dateMon, 10 Jul 2017 11:23:08 +0000
reviewerskats
bugs1377688
milestone56.0a1
Bug 1377688 - Remove RenderThread::NewScrollFrameReady() r=kats WebRenderBridgeParent::CompositeToTarget() calls WebRenderAPI::GenerateFrame() if it is necessary to trigger UpdateAndRender(). It is not necessary to trigger UpdateAndRender() by new_scroll_frame_ready
gfx/webrender_bindings/RenderThread.cpp
gfx/webrender_bindings/RenderThread.h
--- a/gfx/webrender_bindings/RenderThread.cpp
+++ b/gfx/webrender_bindings/RenderThread.cpp
@@ -166,36 +166,16 @@ RenderThread::NewFrameReady(wr::WindowId
     return;
   }
 
   UpdateAndRender(aWindowId);
   DecPendingFrameCount(aWindowId);
 }
 
 void
-RenderThread::NewScrollFrameReady(wr::WindowId aWindowId, bool aCompositeNeeded)
-{
-  if (mHasShutdown) {
-    return;
-  }
-
-  if (!IsInRenderThread()) {
-    Loop()->PostTask(NewRunnableMethod<wr::WindowId, bool>(
-      "wr::RenderThread::NewScrollFrameReady",
-      this,
-      &RenderThread::NewScrollFrameReady,
-      aWindowId,
-      aCompositeNeeded));
-    return;
-  }
-
-  UpdateAndRender(aWindowId);
-}
-
-void
 RenderThread::RunEvent(wr::WindowId aWindowId, UniquePtr<RendererEvent> aEvent)
 {
   if (!IsInRenderThread()) {
     Loop()->PostTask(
       NewRunnableMethod<wr::WindowId, UniquePtr<RendererEvent>&&>(
         "wr::RenderThread::RunEvent",
         this,
         &RenderThread::RunEvent,
@@ -399,18 +379,20 @@ extern "C" {
 void wr_notifier_new_frame_ready(WrWindowId aWindowId)
 {
   mozilla::wr::RenderThread::Get()->IncPendingFrameCount(aWindowId);
   mozilla::wr::RenderThread::Get()->NewFrameReady(mozilla::wr::WindowId(aWindowId));
 }
 
 void wr_notifier_new_scroll_frame_ready(WrWindowId aWindowId, bool aCompositeNeeded)
 {
-  mozilla::wr::RenderThread::Get()->NewScrollFrameReady(mozilla::wr::WindowId(aWindowId),
-                                                        aCompositeNeeded);
+  // It is not necessary to update rendering with new_scroll_frame_ready.
+  // WebRenderBridgeParent::CompositeToTarget() is implemented to call
+  // WebRenderAPI::GenerateFrame() if it is necessary to trigger UpdateAndRender().
+  // See Bug 1377688.
 }
 
 void wr_notifier_external_event(WrWindowId aWindowId, size_t aRawEvent)
 {
   mozilla::UniquePtr<mozilla::wr::RendererEvent> evt(
     reinterpret_cast<mozilla::wr::RendererEvent*>(aRawEvent));
   mozilla::wr::RenderThread::Get()->RunEvent(mozilla::wr::WindowId(aWindowId),
                                              mozilla::Move(evt));
--- a/gfx/webrender_bindings/RenderThread.h
+++ b/gfx/webrender_bindings/RenderThread.h
@@ -102,19 +102,16 @@ public:
   RendererOGL* GetRenderer(wr::WindowId aWindowId);
 
   // RenderNotifier implementation
 
   /// Automatically forwarded to the render thread.
   void NewFrameReady(wr::WindowId aWindowId);
 
   /// Automatically forwarded to the render thread.
-  void NewScrollFrameReady(wr::WindowId aWindowId, bool aCompositeNeeded);
-
-  /// Automatically forwarded to the render thread.
   void PipelineSizeChanged(wr::WindowId aWindowId, uint64_t aPipelineId, float aWidth, float aHeight);
 
   /// Automatically forwarded to the render thread.
   void RunEvent(wr::WindowId aWindowId, UniquePtr<RendererEvent> aCallBack);
 
   /// Can only be called from the render thread.
   void UpdateAndRender(wr::WindowId aWindowId);