Bug 1495055 - Accept layout viewport updates from the main thread right away. r=kats
authorBotond Ballo <botond@mozilla.com>
Wed, 03 Oct 2018 15:36:02 +0000
changeset 495145 ed9b268816b4eaa409b7587e36ea267ce604ce3c
parent 495144 347e93fd4d032db27bd760140cee7dfd3ab5e6d4
child 495146 fd895bb95b99a0f0b1d8995279141773aa741703
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1495055
milestone64.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 1495055 - Accept layout viewport updates from the main thread right away. r=kats Previously we would wait at least one transaction from the time the composition bounds (visual viewport) was updated, but this causes problems due to the visual and layout viewport being out of sync after a screen resize, such as one due to dynamic toolbar transitions in Fennec. Differential Revision: https://phabricator.services.mozilla.com/D7368
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -4213,28 +4213,24 @@ void AsyncPanZoomController::NotifyLayer
   bool smoothScrollRequested = aLayerMetrics.GetDoSmoothScroll()
        && (aLayerMetrics.GetScrollGeneration() != Metrics().GetScrollGeneration());
 
   // TODO if we're in a drag and scrollOffsetUpdated is set then we want to
   // ignore it
 
   bool needContentRepaint = false;
   bool viewportUpdated = false;
-  if (FuzzyEqualsAdditive(aLayerMetrics.GetCompositionBounds().Width(), Metrics().GetCompositionBounds().Width()) &&
-      FuzzyEqualsAdditive(aLayerMetrics.GetCompositionBounds().Height(), Metrics().GetCompositionBounds().Height())) {
-    // Remote content has sync'd up to the composition geometry
-    // change, so we can accept the viewport it's calculated.
-    if (Metrics().GetViewport().Width() != aLayerMetrics.GetViewport().Width() ||
-        Metrics().GetViewport().Height() != aLayerMetrics.GetViewport().Height()) {
-      needContentRepaint = true;
-      viewportUpdated = true;
-    }
-    if (viewportUpdated || scrollOffsetUpdated) {
-      Metrics().SetViewport(aLayerMetrics.GetViewport());
-    }
+
+  if (Metrics().GetViewport().Width() != aLayerMetrics.GetViewport().Width() ||
+      Metrics().GetViewport().Height() != aLayerMetrics.GetViewport().Height()) {
+    needContentRepaint = true;
+    viewportUpdated = true;
+  }
+  if (viewportUpdated || scrollOffsetUpdated) {
+    Metrics().SetViewport(aLayerMetrics.GetViewport());
   }
 
 #if defined(MOZ_WIDGET_ANDROID)
   if (aLayerMetrics.IsRootContent()) {
     if (APZCTreeManager* manager = GetApzcTreeManager()) {
       AndroidDynamicToolbarAnimator* animator = manager->GetAndroidDynamicToolbarAnimator();
       MOZ_ASSERT(animator);
       animator->MaybeUpdateCompositionSizeAndRootFrameMetrics(aLayerMetrics);