Bug 1256728: Don't force presentation during resize. r=jrmuizel a=ritu
authorBas Schouten <bschouten@mozilla.com>
Mon, 18 Apr 2016 13:23:15 +0000
changeset 326176 ca9f8dc6b0307249e1d117df3f057f2634571c9a
parent 326175 f485ca11d5d597330094223dd9cc9dfa035f7ab3
child 326177 40067bd54ccb778ef8b73717bb704ab7abe1cefd
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, ritu
bugs1256728
milestone47.0
Bug 1256728: Don't force presentation during resize. r=jrmuizel a=ritu
widget/windows/nsWindow.cpp
widget/windows/nsWindowGfx.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -5793,16 +5793,17 @@ nsWindow::FinishLiveResizing(ResizeState
 {
   if (mResizeState == RESIZING) {
     nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
     if (observerService) {
       observerService->NotifyObservers(nullptr, "live-resize-end", nullptr);
     }
   }
   mResizeState = aNewState;
+  ForcePresent();
 }
 
 /**************************************************************
  *
  * SECTION: Broadcast messaging
  *
  * Broadcast messages to all windows.
  *
--- a/widget/windows/nsWindowGfx.cpp
+++ b/widget/windows/nsWindowGfx.cpp
@@ -164,18 +164,20 @@ nsIWidgetListener* nsWindow::GetPaintLis
 {
   if (mDestroyCalled)
     return nullptr;
   return mAttachedWidgetListener ? mAttachedWidgetListener : mWidgetListener;
 }
 
 void nsWindow::ForcePresent()
 {
-  if (CompositorChild* remoteRenderer = GetRemoteRenderer()) {
-    remoteRenderer->SendForcePresent();
+  if (mResizeState != RESIZING) {
+    if (CompositorChild* remoteRenderer = GetRemoteRenderer()) {
+      remoteRenderer->SendForcePresent();
+    }
   }
 }
 
 bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel)
 {
   // We never have reentrant paint events, except when we're running our RPC
   // windows event spin loop. If we don't trap for this, we'll try to paint,
   // but view manager will refuse to paint the surface, resulting is black