Bug 1228602 - Ensure that we pick up the presShell resolution from the layer if there isn't a metrics. r=botond

This commit is contained in:
Kartikaya Gupta 2015-12-09 17:29:03 -05:00
parent 17069590f6
commit f15ce579ad
2 changed files with 13 additions and 2 deletions

View File

@ -368,6 +368,17 @@ public:
return sNoClipRect;
}
float GetPresShellResolution() const
{
MOZ_ASSERT(IsValid());
if (AtTopLayer() && mLayer->AsContainerLayer()) {
return mLayer->AsContainerLayer()->GetPresShellResolution();
}
return 1.0f;
}
EventRegionsOverride GetEventRegionsOverride() const
{
MOZ_ASSERT(IsValid());

View File

@ -84,8 +84,8 @@ GetTransformToAncestorsParentLayer(Layer* aStart, const LayerMetricsWrapper& aAn
// With containerless scrolling, the offending post-scale is on the
// parent layer of the displayport-ancestor, which we don't reach in this
// loop, so we don't need to worry about it.
const FrameMetrics& metrics = iter.Metrics();
transform.PostScale(metrics.GetPresShellResolution(), metrics.GetPresShellResolution(), 1.f);
float presShellResolution = iter.GetPresShellResolution();
transform.PostScale(presShellResolution, presShellResolution, 1.0f);
}
}
return ViewAs<LayerToParentLayerMatrix4x4>(transform);