Bug 1479075 - Ensure FlushRenderingAsync actually flushes the compositor. r=sotaro
authorKartikaya Gupta <kgupta@mozilla.com>
Sat, 28 Jul 2018 04:47:08 -0400
changeset 428846 2799f012459c05f34f42ae4007f3515adb902e1e
parent 428845 ce5febb8f86305c322b0e172f6a26037a16e1ee1
child 428847 fe6d3afb3cabccbe891f561c592e51069068354e
push id34347
push userbtara@mozilla.com
push dateSat, 28 Jul 2018 21:47:10 +0000
treeherdermozilla-central@33ff92501b9b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1479075
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1479075 - Ensure FlushRenderingAsync actually flushes the compositor. r=sotaro MozReview-Commit-ID: AfVIwLj2YJp
gfx/layers/ipc/CompositorBridgeParent.cpp
gfx/layers/wr/WebRenderBridgeParent.cpp
gfx/layers/wr/WebRenderBridgeParent.h
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -611,17 +611,17 @@ CompositorBridgeParent::RecvFlushRenderi
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 CompositorBridgeParent::RecvFlushRenderingAsync()
 {
   if (mWrBridge) {
-    mWrBridge->FlushRenderingAsync();
+    mWrBridge->FlushRendering(false);
     return IPC_OK();
   }
 
   return RecvFlushRendering();
 }
 
 mozilla::ipc::IPCResult
 CompositorBridgeParent::RecvForcePresent()
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -1662,37 +1662,29 @@ WebRenderBridgeParent::ScheduleGenerateF
 {
   if (mCompositorScheduler) {
     mAsyncImageManager->SetWillGenerateFrame();
     mCompositorScheduler->ScheduleComposition();
   }
 }
 
 void
-WebRenderBridgeParent::FlushRendering()
+WebRenderBridgeParent::FlushRendering(bool aWaitForPresent)
 {
   if (mDestroyed) {
     return;
   }
 
   // This gets called during e.g. window resizes, so we need to flush the
   // scene (which has the display list at the new window size).
   FlushSceneBuilds();
   FlushFrameGeneration();
-  FlushFramePresentation();
-}
-
-void
-WebRenderBridgeParent::FlushRenderingAsync()
-{
-  if (mDestroyed) {
-    return;
+  if (aWaitForPresent) {
+    FlushFramePresentation();
   }
-
-  mCompositorScheduler->FlushPendingComposite();
 }
 
 void
 WebRenderBridgeParent::Pause()
 {
   MOZ_ASSERT(IsRootWebRenderBridgeParent());
 #ifdef MOZ_WIDGET_ANDROID
   if (!IsRootWebRenderBridgeParent() || mDestroyed) {
--- a/gfx/layers/wr/WebRenderBridgeParent.h
+++ b/gfx/layers/wr/WebRenderBridgeParent.h
@@ -163,18 +163,17 @@ public:
 
   void ExtractImageCompositeNotifications(nsTArray<ImageCompositeNotificationInfo>* aNotifications);
 
   wr::IdNamespace GetIdNamespace()
   {
     return mIdNamespace;
   }
 
-  void FlushRendering();
-  void FlushRenderingAsync();
+  void FlushRendering(bool aWaitForPresent = true);
 
   /**
    * Schedule generating WebRender frame definitely at next composite timing.
    *
    * WebRenderBridgeParent uses composite timing to check if there is an update
    * to AsyncImagePipelines. If there is no update, WebRenderBridgeParent skips
    * to generate frame. If we need to generate new frame at next composite timing,
    * call this method.