From 448bb8b7ea6085dc57f2606104b25cd5f8541120 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 14 Jan 2015 14:19:59 -0800 Subject: [PATCH] Fix tiling computing the wrong displayport size when using containerless scrolling. (bug 1121108, r=botond) --HG-- extra : rebase_source : a2c4071e13cd4c7917ee0876e9b1f2b61dd760d7 --- gfx/layers/client/ClientTiledPaintedLayer.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/gfx/layers/client/ClientTiledPaintedLayer.cpp b/gfx/layers/client/ClientTiledPaintedLayer.cpp index c354d9b1ebe7..da803a4d09d5 100644 --- a/gfx/layers/client/ClientTiledPaintedLayer.cpp +++ b/gfx/layers/client/ClientTiledPaintedLayer.cpp @@ -70,10 +70,21 @@ GetTransformToAncestorsParentLayer(Layer* aStart, const LayerMetricsWrapper& aAn ancestorParent ? iter != ancestorParent : iter.IsValid(); iter = iter.GetParent()) { transform = transform * iter.GetTransform(); - // If the layer has a pres shell resolution, the compositor will apply - // a scale to scale to this transform. Apply it here too. - const FrameMetrics& metrics = iter.Metrics(); - transform.PostScale(metrics.mPresShellResolution, metrics.mPresShellResolution, 1.f); + + if (gfxPrefs::LayoutUseContainersForRootFrames()) { + // When scrolling containers, layout adds a post-scale into the transform + // of the displayport-ancestor (which we pick up in GetTransform() above) + // to cancel out the pres shell resolution (for historical reasons). The + // compositor in turn cancels out this post-scale (i.e., scales by the + // pres shell resolution), and to get correct calculations, we need to do + // so here, too. + // + // 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.mPresShellResolution, metrics.mPresShellResolution, 1.f); + } } return transform; }