Bug 1640783. Should only call ClearPendingVisualScrollUpdate if we painted to the widget. r=botond
authorTimothy Nikkel <tnikkel@gmail.com>
Wed, 03 Jun 2020 07:50:16 +0000
changeset 597755 82f34f32a892ed53e861e338abbaa58610b4cd2c
parent 597754 0f765a8fefd4f14c333517890015732e4cdbc068
child 597756 39185e9b6a640f9a919308f2036c2c26741dda6a
push id13310
push userffxbld-merge
push dateMon, 29 Jun 2020 14:50:06 +0000
treeherdermozilla-beta@15a59a0afa5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1640783
milestone79.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 1640783. Should only call ClearPendingVisualScrollUpdate if we painted to the widget. r=botond If we called PaintFrame for drawWindow or something other than painting to the widget the visual scroll update won't make it to the compositor, so don't clear it. This doesn't fix anything specifically, just noticed it while reading code. Differential Revision: https://phabricator.services.mozilla.com/D76781
layout/base/PresShell.h
layout/base/nsLayoutUtils.cpp
--- a/layout/base/PresShell.h
+++ b/layout/base/PresShell.h
@@ -1666,17 +1666,18 @@ class PresShell final : public nsStubDoc
   /**
    * Alias for SetCapturingContent(nullptr, CaptureFlags::None) for making
    * callers what they do clearer.
    */
   static void ReleaseCapturingContent() {
     PresShell::SetCapturingContent(nullptr, CaptureFlags::None);
   }
 
-  // Called at the end of nsLayoutUtils::PaintFrame().
+  // Called at the end of nsLayoutUtils::PaintFrame() if we were painting to
+  // the widget.
   // This is used to clear any pending visual scroll updates that have been
   // acknowledged, to make sure they don't stick around for the next paint.
   void EndPaint();
 
   /**
    * Tell the presshell that the given frame's reflow was interrupted.  This
    * will mark as having dirty children a path from the given frame (inclusive)
    * to the nearest ancestor with a dirty subtree, or to the reflow root
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -4136,17 +4136,19 @@ nsresult nsLayoutUtils::PaintFrame(gfxCo
   }
 #endif
 
   TimeStamp paintStart = TimeStamp::Now();
   RefPtr<LayerManager> layerManager =
       list->PaintRoot(builder, aRenderingContext, flags);
   Telemetry::AccumulateTimeDelta(Telemetry::PAINT_RASTERIZE_TIME, paintStart);
 
-  presShell->EndPaint();
+  if (builder->IsPaintingToWindow()) {
+    presShell->EndPaint();
+  }
   builder->Check();
 
   if (StaticPrefs::gfx_logging_painted_pixel_count_enabled()) {
     LogPaintedPixelCount(layerManager, paintStart);
   }
 
   if (consoleNeedsDisplayList) {
     DumpAfterPaintDisplayList(ss, builder, list, layerManager);