Bug 1228602 - Ensure that we pick up the presShell resolution from the layer if there isn't a metrics. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 09 Dec 2015 17:29:03 -0500
changeset 310158 f6bdd322412546677d539ec064b68214fd9fc1a6
parent 310157 e716d9ac93d7099a167dacccbae3e2a1c0664cd5
child 310159 fbe3bbb6b859a390d57193c0e8943381b1030c34
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1228602
milestone45.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 1228602 - Ensure that we pick up the presShell resolution from the layer if there isn't a metrics. r=botond
gfx/layers/LayerMetricsWrapper.h
gfx/layers/client/ClientTiledPaintedLayer.cpp
--- a/gfx/layers/LayerMetricsWrapper.h
+++ b/gfx/layers/LayerMetricsWrapper.h
@@ -363,16 +363,27 @@ public:
 
     if (AtBottomLayer()) {
       return mLayer->GetClipRect();
     }
 
     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());
 
     if (mLayer->AsContainerLayer()) {
       return mLayer->AsContainerLayer()->GetEventRegionsOverride();
     }
     return EventRegionsOverride::NoOverride;
--- a/gfx/layers/client/ClientTiledPaintedLayer.cpp
+++ b/gfx/layers/client/ClientTiledPaintedLayer.cpp
@@ -79,18 +79,18 @@ GetTransformToAncestorsParentLayer(Layer
       // 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.GetPresShellResolution(), metrics.GetPresShellResolution(), 1.f);
+      float presShellResolution = iter.GetPresShellResolution();
+      transform.PostScale(presShellResolution, presShellResolution, 1.0f);
     }
   }
   return ViewAs<LayerToParentLayerMatrix4x4>(transform);
 }
 
 void
 ClientTiledPaintedLayer::GetAncestorLayers(LayerMetricsWrapper* aOutScrollAncestor,
                                            LayerMetricsWrapper* aOutDisplayPortAncestor,