Bug 813024. Restore mTemporarilyUseBasicLayerManager to the previous value instead of setting it to false when using an AutoUseBasicLayerManager object. r=roc
authorTimothy Nikkel <tnikkel@gmail.com>
Mon, 17 Dec 2012 00:35:39 -0600
changeset 125346 82d45d6f8964c7d095c2e19d226fc9b25ed5850a
parent 125345 9d6e95e7785580d4b3756ecbfa4c18725e9791cb
child 125347 a268b5d3166d77121dd3dd13f7af6a225368a0bc
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs813024
milestone20.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 813024. Restore mTemporarilyUseBasicLayerManager to the previous value instead of setting it to false when using an AutoUseBasicLayerManager object. r=roc
widget/xpwidgets/nsBaseWidget.cpp
widget/xpwidgets/nsBaseWidget.h
--- a/widget/xpwidgets/nsBaseWidget.cpp
+++ b/widget/xpwidgets/nsBaseWidget.cpp
@@ -756,22 +756,25 @@ nsBaseWidget::AutoLayerManagerSetup::~Au
     manager->SetDefaultTarget(nullptr);
     manager->SetDefaultTargetConfiguration(mozilla::layers::BUFFER_NONE, ROTATION_0);
   }
 }
 
 nsBaseWidget::AutoUseBasicLayerManager::AutoUseBasicLayerManager(nsBaseWidget* aWidget)
   : mWidget(aWidget)
 {
+  mPreviousTemporarilyUseBasicLayerManager =
+    mWidget->mTemporarilyUseBasicLayerManager;
   mWidget->mTemporarilyUseBasicLayerManager = true;
 }
 
 nsBaseWidget::AutoUseBasicLayerManager::~AutoUseBasicLayerManager()
 {
-  mWidget->mTemporarilyUseBasicLayerManager = false;
+  mWidget->mTemporarilyUseBasicLayerManager =
+    mPreviousTemporarilyUseBasicLayerManager;
 }
 
 bool
 nsBaseWidget::ComputeShouldAccelerate(bool aDefault)
 {
 #if defined(XP_WIN) || defined(ANDROID) || (MOZ_PLATFORM_MAEMO > 5) || \
     defined(MOZ_GL_PROVIDER) || defined(XP_MACOSX)
   bool accelerateByDefault = true;
--- a/widget/xpwidgets/nsBaseWidget.h
+++ b/widget/xpwidgets/nsBaseWidget.h
@@ -221,16 +221,17 @@ public:
   friend class AutoLayerManagerSetup;
 
   class AutoUseBasicLayerManager {
   public:
     AutoUseBasicLayerManager(nsBaseWidget* aWidget);
     ~AutoUseBasicLayerManager();
   private:
     nsBaseWidget* mWidget;
+    bool mPreviousTemporarilyUseBasicLayerManager;
   };
   friend class AutoUseBasicLayerManager;
 
   nsWindowType            GetWindowType() { return mWindowType; }
 
   virtual bool            UseOffMainThreadCompositing();
 
   static nsIRollupListener* GetActiveRollupListener();