Bug 1470504 - Always log the high-resolution displayport to APZ test data. r=kats
authorBotond Ballo <botond@mozilla.com>
Wed, 12 Sep 2018 20:18:38 -0400
changeset 495308 8eac3912d00352712ab0f4145ae995e9ed9f17cf
parent 495307 a02b46f1567ed9dad5c294b862c9c5ec6d48bea8
child 495309 8a29d2de3f5b464fddb91ace8da288b05195196c
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
bugs1470504
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 1470504 - Always log the high-resolution displayport to APZ test data. r=kats Previously we would log the displayport and the critical displayport separately, which made it more difficult to write cross-platform APZ tests. Differential Revision: https://phabricator.services.mozilla.com/D7341
gfx/layers/apz/test/mochitest/helper_bug1280013.html
layout/base/nsLayoutUtils.cpp
--- a/gfx/layers/apz/test/mochitest/helper_bug1280013.html
+++ b/gfx/layers/apz/test/mochitest/helper_bug1280013.html
@@ -47,23 +47,23 @@ function* test(testDriver) {
   // get the displayport for the subframe
   var utils = SpecialPowers.getDOMWindowUtils(window);
   var contentPaints = utils.getContentAPZTestData().paints;
   var lastPaint = convertScrollFrameData(contentPaints[contentPaints.length - 1].scrollFrames);
   var foundIt = 0;
   for (var scrollId in lastPaint) {
     if (('contentDescription' in lastPaint[scrollId]) &&
         (lastPaint[scrollId]['contentDescription'].includes('tall_html'))) {
-      var dp = getPropertyAsRect(lastPaint, scrollId, 'criticalDisplayport');
-      ok(dp.y <= 0, 'The critical displayport top should be less than or equal to zero to cover the visible part of the subframe; it is ' + dp.y);
-      ok(dp.y + dp.h >= subframe.clientHeight, 'The critical displayport bottom should be greater than the clientHeight; it is ' + (dp.y + dp.h));
+      var dp = getPropertyAsRect(lastPaint, scrollId, 'displayport');
+      ok(dp.y <= 0, 'The displayport top should be less than or equal to zero to cover the visible part of the subframe; it is ' + dp.y);
+      ok(dp.y + dp.h >= subframe.clientHeight, 'The displayport bottom should be greater than the clientHeight; it is ' + (dp.y + dp.h));
       foundIt++;
     }
   }
-  is(foundIt, 1, "Found exactly one critical displayport for the subframe we were interested in.");
+  is(foundIt, 1, "Found exactly one displayport for the subframe we were interested in.");
 }
 
 waitUntilApzStable()
 .then(runContinuation(test))
 .then(subtestDone);
 
   </script>
 </head>
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -9081,28 +9081,30 @@ nsLayoutUtils::ComputeScrollMetadata(nsI
     if (void* paintRequestTime = aContent->GetProperty(nsGkAtoms::paintRequestTime)) {
       metrics.SetPaintRequestTime(*static_cast<TimeStamp*>(paintRequestTime));
       aContent->DeleteProperty(nsGkAtoms::paintRequestTime);
     }
     scrollId = nsLayoutUtils::FindOrCreateIDFor(aContent);
     nsRect dp;
     if (nsLayoutUtils::GetDisplayPort(aContent, &dp)) {
       metrics.SetDisplayPort(CSSRect::FromAppUnits(dp));
-      if (IsAPZTestLoggingEnabled()) {
-        LogTestDataForPaint(aLayerManager, scrollId, "displayport",
-                            metrics.GetDisplayPort());
-      }
     }
     if (nsLayoutUtils::GetCriticalDisplayPort(aContent, &dp)) {
       metrics.SetCriticalDisplayPort(CSSRect::FromAppUnits(dp));
-      if (IsAPZTestLoggingEnabled()) {
-        LogTestDataForPaint(aLayerManager, scrollId, "criticalDisplayport",
-                            metrics.GetCriticalDisplayPort());
-      }
-    }
+    }
+
+    // Log the high-resolution display port (which is either the displayport
+    // or the critical displayport) for test purposes.
+    if (IsAPZTestLoggingEnabled()) {
+      LogTestDataForPaint(aLayerManager, scrollId, "displayport",
+                          gfxPrefs::UseLowPrecisionBuffer()
+                        ? metrics.GetCriticalDisplayPort()
+                        : metrics.GetDisplayPort());
+    }
+
     DisplayPortMarginsPropertyData* marginsData =
         static_cast<DisplayPortMarginsPropertyData*>(aContent->GetProperty(nsGkAtoms::DisplayPortMargins));
     if (marginsData) {
       metrics.SetDisplayPortMargins(marginsData->mMargins);
     }
   }
 
   nsIScrollableFrame* scrollableFrame = nullptr;