Bug 1264365 - Disable hardware acceleration for small popup widgets. r=dvander
☠☠ backed out by 1c10754af667 ☠ ☠
authorNicolas Silva <nsilva@mozilla.com>
Thu, 21 Apr 2016 12:20:31 +0200
changeset 332143 b8372d58243bfe6773766f3ae7ba9070cfef6695
parent 332142 72615136e898b1dd36fe23e069288fd43feb2e02
child 332144 6a407cbfffb0a76b20a856bb4883b608d9ea99b2
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs1264365
milestone48.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 1264365 - Disable hardware acceleration for small popup widgets. r=dvander
widget/nsBaseWidget.cpp
widget/nsBaseWidget.h
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -917,20 +917,26 @@ nsBaseWidget::AutoLayerManagerSetup::~Au
   if (mLayerManager) {
     NS_ASSERTION(mLayerManager->GetBackendType() == LayersBackend::LAYERS_BASIC,
       "AutoLayerManagerSetup instantiated for non-basic layer backend!");
     mLayerManager->SetDefaultTarget(nullptr);
     mLayerManager->SetDefaultTargetConfiguration(mozilla::layers::BufferMode::BUFFER_NONE, ROTATION_0);
   }
 }
 
+bool nsBaseWidget::IsSmallPopup() const
+{
+  return mWindowType == eWindowType_popup || mPopupType == ePopupTypePanel;
+}
+
 bool
 nsBaseWidget::ComputeShouldAccelerate()
 {
-  return gfxPlatform::GetPlatform()->ShouldUseLayersAcceleration();
+  return !IsSmallPopup() &&
+         gfxPlatform::GetPlatform()->ShouldUseLayersAcceleration();
 }
 
 CompositorBridgeParent* nsBaseWidget::NewCompositorBridgeParent(int aSurfaceWidth,
                                                     int aSurfaceHeight)
 {
   return new CompositorBridgeParent(this, false, aSurfaceWidth, aSurfaceHeight);
 }
 
--- a/widget/nsBaseWidget.h
+++ b/widget/nsBaseWidget.h
@@ -294,16 +294,20 @@ public:
   void NotifyUIStateChanged(UIStateChangeType aShowAccelerators,
                             UIStateChangeType aShowFocusRings);
 
 #ifdef ACCESSIBILITY
   // Get the accessible for the window.
   mozilla::a11y::Accessible* GetRootAccessible();
 #endif
 
+  // Return true if this is a simple widget (that is typically not worth
+  // accelerating)
+  bool IsSmallPopup() const;
+
   nsPopupLevel PopupLevel() { return mPopupLevel; }
 
   virtual LayoutDeviceIntSize
   ClientToWindowSize(const LayoutDeviceIntSize& aClientSize) override
   {
     return aClientSize;
   }