Bug 1469746 - Rebuild display lists in full when we start/stop computing visibility for plugins. r?miko draft
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 20 Jun 2018 14:24:46 +1200
changeset 808591 45e7e8782cdea01f245276cc18bf7eca29e55c94
parent 808296 dedec5b41db435701f38548c8b4d0d7b5204a4ae
push id113430
push usermwoodrow@mozilla.com
push dateWed, 20 Jun 2018 02:25:22 +0000
reviewersmiko
bugs1469746
milestone62.0a1
Bug 1469746 - Rebuild display lists in full when we start/stop computing visibility for plugins. r?miko MozReview-Commit-ID: 3xHoYBBA4Fy
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -3594,16 +3594,20 @@ nsLayoutUtils::PaintFrame(gfxContext* aR
   }
 
   // If the root has embedded plugins, flag the builder so we know we'll need
   // to update plugin geometry after painting.
   if ((aFlags & PaintFrameFlags::PAINT_WIDGET_LAYERS) &&
       !(aFlags & PaintFrameFlags::PAINT_DOCUMENT_RELATIVE) &&
       rootPresContext->NeedToComputePluginGeometryUpdates()) {
     builder.SetWillComputePluginGeometry(true);
+
+    // Disable partial updates for this paint as the list we're about to
+    // build has plugin-specific differences that won't trigger invalidations.
+    builder.SetDisablePartialUpdates(true);
   }
 
   nsRect canvasArea(nsPoint(0, 0), aFrame->GetSize());
   bool ignoreViewportScrolling =
     aFrame->GetParent() ? false : presShell->IgnoringViewportScrolling();
   if (ignoreViewportScrolling && rootScrollFrame) {
     nsIScrollableFrame* rootScrollableFrame =
       presShell->GetRootScrollFrameAsScrollable();
@@ -3944,16 +3948,20 @@ nsLayoutUtils::PaintFrame(gfxContext* aR
     }
 
     // We told the compositor thread not to composite when it received the
     // transaction because we wanted to update plugins first. Schedule the
     // composite now.
     if (layerManager) {
       layerManager->ScheduleComposite();
     }
+
+    // Disable partial updates for the following paint as well, as we now have
+    // a plugin-specific display list.
+    builder.SetDisablePartialUpdates(true);
   }
 
   builder.Check();
 
   {
     AUTO_PROFILER_TRACING("Paint", "DisplayListResources");
 
     // Flush the list so we don't trigger the IsEmpty-on-destruction assertion