Bug 961289 - Log displayports on client side for APZ testing. r=kats
authorBotond Ballo <botond@mozilla.com>
Mon, 21 Apr 2014 17:09:30 -0400
changeset 195756 0289c6b78933e2a4c6f92509c35fbeff471584cc
parent 195755 24d6ed0f3d7eb2b7958b62c12827294dff915ba4
child 195757 d24910545fbe70f1a662eb686fe99336d1b7c818
push id5990
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:40:24 +0000
treeherdermozilla-aurora@0796197efbc9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs961289
milestone32.0a1
Bug 961289 - Log displayports on client side for APZ testing. r=kats
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -640,20 +640,23 @@ static void RecordFrameMetrics(nsIFrame*
   nsPresContext* presContext = aForFrame->PresContext();
   int32_t auPerDevPixel = presContext->AppUnitsPerDevPixel();
   LayoutDeviceToLayerScale resolution(aContainerParameters.mXScale, aContainerParameters.mYScale);
 
   nsIntRect visible = aVisibleRect.ScaleToNearestPixels(
     resolution.scale, resolution.scale, auPerDevPixel);
   aRoot->SetVisibleRegion(visible);
 
+  nsIPresShell* presShell = presContext->GetPresShell();
   FrameMetrics metrics;
   metrics.mViewport = CSSRect::FromAppUnits(aViewport);
   if (aDisplayPort) {
     metrics.mDisplayPort = CSSRect::FromAppUnits(*aDisplayPort);
+    nsLayoutUtils::LogTestDataForPaint(presShell, aScrollId, "displayport",
+        metrics.mDisplayPort);
     if (aCriticalDisplayPort) {
       metrics.mCriticalDisplayPort = CSSRect::FromAppUnits(*aCriticalDisplayPort);
     }
   }
 
   nsIScrollableFrame* scrollableFrame = nullptr;
   if (aScrollFrame)
     scrollableFrame = aScrollFrame->GetScrollTargetFrame();
@@ -674,17 +677,16 @@ static void RecordFrameMetrics(nsIFrame*
     }
   }
 
   metrics.SetScrollId(aScrollId);
   metrics.mIsRoot = aIsRoot;
 
   // Only the root scrollable frame for a given presShell should pick up
   // the presShell's resolution. All the other frames are 1.0.
-  nsIPresShell* presShell = presContext->GetPresShell();
   if (aScrollFrame == presShell->GetRootScrollFrame()) {
     metrics.mResolution = ParentLayerToLayerScale(presShell->GetXResolution(),
                                                   presShell->GetYResolution());
   } else {
     metrics.mResolution = ParentLayerToLayerScale(1.0f);
   }
 
   // For the cumulateive resolution, multiply the resolutions of all the