bug 817454 - ensure PresContext's cached mAppUnitsPerDevPixel value is updated when backing resolution changes. r=roc
authorJonathan Kew <jkew@mozilla.com>
Thu, 07 Feb 2013 00:19:01 +0000
changeset 130984 c2f402470a4995cf887ccb01add47727ece5fa00
parent 130983 c8fb438a48cb9f9bf83941473faa8f606672c1c6
child 130985 8fb95df6311584352ed219f9a49a44bf2f21b2a3
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs817454
milestone21.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 817454 - ensure PresContext's cached mAppUnitsPerDevPixel value is updated when backing resolution changes. r=roc
layout/base/nsPresContext.cpp
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -806,16 +806,18 @@ nsPresContext::AppUnitsPerDevPixelChange
   InvalidateThebesLayers();
 
   mDeviceContext->FlushFontCache();
 
   if (HasCachedStyleData()) {
     // All cached style data must be recomputed.
     MediaFeatureValuesChanged(eAlwaysRebuildStyle, NS_STYLE_HINT_REFLOW);
   }
+
+  mCurAppUnitsPerDevPixel = AppUnitsPerDevPixel();
 }
 
 void
 nsPresContext::PreferenceChanged(const char* aPrefName)
 {
   nsDependentCString prefName(aPrefName);
   if (prefName.EqualsLiteral("layout.css.dpi") ||
       prefName.EqualsLiteral("layout.css.devPixelsPerPx")) {
@@ -1398,18 +1400,16 @@ nsPresContext::SetFullZoom(float aZoom)
   mFullZoom = aZoom;
   mShell->GetViewManager()->
     SetWindowDimensions(NSToCoordRound(oldWidthDevPixels * AppUnitsPerDevPixel()),
                         NSToCoordRound(oldHeightDevPixels * AppUnitsPerDevPixel()));
 
   AppUnitsPerDevPixelChanged();
 
   mSupressResizeReflow = false;
-
-  mCurAppUnitsPerDevPixel = AppUnitsPerDevPixel();
 }
 
 float
 nsPresContext::ScreenWidthInchesForFontInflation(bool* aChanged)
 {
   if (aChanged) {
     *aChanged = false;
   }