Bug 1538540 - Speculatively revert SetDocumentView usage r=kats
authorDoug Thayer <dothayer@mozilla.com>
Sun, 21 Apr 2019 02:00:11 +0000
changeset 470329 6cbc4908bc4bb8e260cb452d36d5a1c9abf4468f
parent 470328 76a363f06ebd40d418d483b41b12721ab728f38c
child 470330 43c7c3f10a71a5bede2282db7dcd80d674cf237d
push id112863
push usershindli@mozilla.com
push dateMon, 22 Apr 2019 09:53:25 +0000
treeherdermozilla-inbound@ab1da7fa2ad0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1538540
milestone68.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 1538540 - Speculatively revert SetDocumentView usage r=kats This is a bit of a stab in the dark, but I wanted to rule it out as a potential cause. See comment in the code for some justification. Differential Revision: https://phabricator.services.mozilla.com/D28240
gfx/layers/wr/WebRenderBridgeParent.cpp
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -915,21 +915,32 @@ bool WebRenderBridgeParent::SetDisplayLi
   if (aValidTransaction) {
     if (IsRootWebRenderBridgeParent()) {
       if (aRenderRoot != wr::RenderRoot::Default) {
         MutexAutoLock lock(mRenderRootRectMutex);
         mRenderRootRects[aRenderRoot] = ViewAs<ScreenPixel>(
             aRect, PixelCastJustification::LayoutDeviceIsScreenForTabDims);
       }
       LayoutDeviceIntSize widgetSize = mWidget->GetClientSize();
-      LayoutDeviceIntRect rect = RoundedToInt(aRect);
-      rect.SetWidth(
-          std::max(0, std::min(widgetSize.width - rect.X(), rect.Width())));
-      rect.SetHeight(
-          std::max(0, std::min(widgetSize.height - rect.Y(), rect.Height())));
+      LayoutDeviceIntRect rect;
+      if (gfxPrefs::WebRenderSplitRenderRoots()) {
+        rect = RoundedToInt(aRect);
+        rect.SetWidth(
+            std::max(0, std::min(widgetSize.width - rect.X(), rect.Width())));
+        rect.SetHeight(
+            std::max(0, std::min(widgetSize.height - rect.Y(), rect.Height())));
+      } else {
+        // XXX: If we can't have multiple documents, just use the
+        // pre-document- splitting behavior of directly applying the client
+        // size. This is a speculative and temporary attempt to address bug
+        // 1538540, as an incorrect rect supplied to SetDocumentView can cause
+        // us to not build a frame and potentially render with stale texture
+        // cache items.
+        rect = LayoutDeviceIntRect(LayoutDeviceIntPoint(), widgetSize);
+      }
       aTxn.SetDocumentView(rect, widgetSize);
     }
     gfx::Color clearColor(0.f, 0.f, 0.f, 0.f);
     aTxn.SetDisplayList(clearColor, aWrEpoch,
                         wr::ToLayoutSize(RoundedToInt(aRect).Size()),
                         mPipelineId, aContentSize, aDLDesc, dlData);
 
     if (aObserveLayersUpdate) {