Bug 1034179 - Use the right resolution when generating a FrameMetrics object for GetOrMaybeCreateDisplayport. r=tn

This commit is contained in:
Kartikaya Gupta 2014-07-03 15:22:22 -04:00
parent 295ec84ea2
commit 88dfd9001c

View File

@ -2619,7 +2619,13 @@ CalculateFrameMetricsForDisplayPort(nsIFrame* aScrollFrame,
nsIPresShell* presShell = presContext->PresShell();
CSSToLayoutDeviceScale deviceScale(float(nsPresContext::AppUnitsPerCSSPixel())
/ presContext->AppUnitsPerDevPixel());
ParentLayerToLayerScale resolution(presShell->GetResolution().width);
ParentLayerToLayerScale resolution;
if (aScrollFrame == presShell->GetRootScrollFrame()) {
// Only the root scrollable frame for a given presShell should pick up
// the presShell's resolution. All the other frames are 1.0.
resolution = ParentLayerToLayerScale(presShell->GetXResolution(),
presShell->GetYResolution());
}
LayoutDeviceToLayerScale cumulativeResolution(presShell->GetCumulativeResolution().width);
metrics.mDevPixelsPerCSSPixel = deviceScale;