Bug 909887 - Initialize mLastMetrics.mDevPixelsPerCSSPixel to a sane value. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 13 Sep 2013 00:05:34 -0400
changeset 146980 b56ae6533034867fa712d26f255a8d699b90ba14
parent 146920 b9029b1de41096eebd6808f169464a5ee38215a4
child 146981 2e0c4ada66fec096b05e01d684582880d45768cb
push id25281
push useremorley@mozilla.com
push dateFri, 13 Sep 2013 14:07:20 +0000
treeherdermozilla-central@87c4a21ed158 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs909887
milestone26.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 909887 - Initialize mLastMetrics.mDevPixelsPerCSSPixel to a sane value. r=botond
dom/ipc/TabChild.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -420,16 +420,17 @@ TabChild::Observe(nsISupports *aSubject,
         SetCSSViewport(kDefaultViewportSize);
 
         // Calculate a really simple resolution that we probably won't
         // be keeping, as well as putting the scroll offset back to
         // the top-left of the page.
         mLastMetrics.mViewport = CSSRect(CSSPoint(), kDefaultViewportSize);
         mLastMetrics.mCompositionBounds = ScreenIntRect(ScreenIntPoint(), mInnerSize);
         mLastMetrics.mZoom = mLastMetrics.CalculateIntrinsicScale();
+        mLastMetrics.mDevPixelsPerCSSPixel = CSSToLayoutDeviceScale(mWidget->GetDefaultScale());
         // We use ScreenToLayerScale(1) below in order to turn the
         // async zoom amount into the gecko zoom amount.
         mLastMetrics.mCumulativeResolution =
           mLastMetrics.mZoom / mLastMetrics.mDevPixelsPerCSSPixel * ScreenToLayerScale(1);
         // This is the root layer, so the cumulative resolution is the same
         // as the resolution.
         mLastMetrics.mResolution = mLastMetrics.mCumulativeResolution / LayoutDeviceToParentLayerScale(1);
         mLastMetrics.mScrollOffset = CSSPoint(0, 0);