Bug 1150376 - Do not try to use D3D11 for popup windows. r=jrmuizel, a=sledru
authorBas Schouten <bschouten@mozilla.com>
Wed, 08 Apr 2015 15:08:34 +0200
changeset 258535 746934eab883
parent 258534 eb5e2063637b
child 258536 4dc8d874746b
push id4691
push userryanvm@gmail.com
push date2015-04-20 17:16 +0000
treeherdermozilla-beta@72f1b4086067 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, sledru
bugs1150376
milestone38.0
Bug 1150376 - Do not try to use D3D11 for popup windows. r=jrmuizel, a=sledru
widget/windows/nsWindow.cpp
widget/windows/nsWindow.h
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -6543,16 +6543,22 @@ bool nsWindow::OnHotKey(WPARAM wParam, L
 
 // Can be overriden. Controls auto-erase of background.
 bool nsWindow::AutoErase(HDC dc)
 {
   return false;
 }
 
 bool
+nsWindow::IsPopup()
+{
+  return mWindowType == eWindowType_popup;
+}
+
++bool
 nsWindow::ShouldUseOffMainThreadCompositing()
 {
   // We don't currently support using an accelerated layer manager with
   // transparent windows so don't even try. I'm also not sure if we even
   // want to support this case. See bug 593471
   if (mTransparencyMode == eTransparencyTransparent) {
     return false;
   }
@@ -6565,17 +6571,21 @@ nsWindow::GetPreferredCompositorBackends
 {
   LayerManagerPrefs prefs;
   GetLayerManagerPrefs(&prefs);
 
   // We don't currently support using an accelerated layer manager with
   // transparent windows so don't even try. I'm also not sure if we even
   // want to support this case. See bug 593471
   if (!(prefs.mDisableAcceleration ||
-        mTransparencyMode == eTransparencyTransparent)) {
+        mTransparencyMode == eTransparencyTransparent ||
+        IsPopup())) {
+    // See bug 1150376, D3D11 composition can cause issues on some devices
+    // on windows 7 where presentation fails randomly for windows with drop
+    // shadows.
     if (prefs.mPreferOpenGL) {
       aHints.AppendElement(LayersBackend::LAYERS_OPENGL);
     }
 
     ID3D11Device* device = gfxWindowsPlatform::GetPlatform()->GetD3D11Device();
 
     if (!prefs.mPreferD3D9) {
       aHints.AppendElement(LayersBackend::LAYERS_D3D11);
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -268,16 +268,17 @@ public:
   // Open file picker tracking
   void                    PickerOpen();
   void                    PickerClosed();
 
   bool                    const DestroyCalled() { return mDestroyCalled; }
 
   virtual void GetPreferredCompositorBackends(nsTArray<mozilla::layers::LayersBackend>& aHints);
 
+  bool IsPopup();
   virtual bool ShouldUseOffMainThreadCompositing();
 
 protected:
   virtual ~nsWindow();
 
   virtual void WindowUsesOMTC() override;
 
   virtual nsresult NotifyIMEInternal(