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 267132 5eb9e61c69118ed29724e5bec7f1d86227f404ab
parent 267131 5ab6348ad96ea26ebb837d530abb114d70f0d1f8
child 267133 a4e7361a2b5dc6053896b5b2f21723d4a09c55da
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, sledru
bugs1150376
milestone39.0a2
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
@@ -6547,16 +6547,22 @@ nsWindow::ClearCompositor(nsWindow* aWin
 {
   if (aWindow->mLayerManager) {
     aWindow->mLayerManager = nullptr;
     aWindow->DestroyCompositor();
   }
 }
 
 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;
   }
@@ -6569,17 +6575,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);
     }
 
     if (!prefs.mPreferD3D9) {
       aHints.AppendElement(LayersBackend::LAYERS_D3D11);
     }
     if (prefs.mPreferD3D9 || !mozilla::IsVistaOrLater()) {
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -271,16 +271,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 void ConfigureAPZCTreeManager() override;
   void RegisterTouchWindow();