Bug 613790: Use GDI compatible flag for our swap chains. r=jrmuizel a=blocking-final
authorBas Schouten <bschouten@mozilla.com>
Thu, 16 Dec 2010 01:35:44 +0000
changeset 59294 e435c98128557fa4743fe1afe87a2c73bed33ada
parent 59293 14303443b88cef5a225daef830f4990090b65357
child 59392 cd62a8afc52e1059521525d9ac5adb40a7659edf
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersjrmuizel, blocking-final
bugs613790
milestone2.0b9pre
Bug 613790: Use GDI compatible flag for our swap chains. r=jrmuizel a=blocking-final
gfx/layers/d3d10/LayerManagerD3D10.cpp
--- a/gfx/layers/d3d10/LayerManagerD3D10.cpp
+++ b/gfx/layers/d3d10/LayerManagerD3D10.cpp
@@ -177,16 +177,20 @@ LayerManagerD3D10::Initialize()
   swapDesc.BufferDesc.Height = 0;
   swapDesc.BufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
   swapDesc.BufferDesc.RefreshRate.Numerator = 60;
   swapDesc.BufferDesc.RefreshRate.Denominator = 1;
   swapDesc.SampleDesc.Count = 1;
   swapDesc.SampleDesc.Quality = 0;
   swapDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
   swapDesc.BufferCount = 1;
+  // We don't really need this flag, however it seems on some NVidia hardware
+  // smaller windows do not present properly without this flag. This flag
+  // should have no negative consequences by itsself. See bug 613790.
+  swapDesc.Flags = DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE;
   swapDesc.OutputWindow = (HWND)mWidget->GetNativeData(NS_NATIVE_WINDOW);
   swapDesc.Windowed = TRUE;
 
   /**
    * Create a swap chain, this swap chain will contain the backbuffer for
    * the window we draw to. The front buffer is the full screen front
    * buffer.
    */
@@ -428,17 +432,18 @@ LayerManagerD3D10::VerifyBufferSize()
 
   if (swapDesc.BufferDesc.Width == rect.width &&
       swapDesc.BufferDesc.Height == rect.height) {
     return;
   }
 
   mRTView = nsnull;
   mSwapChain->ResizeBuffers(1, rect.width, rect.height,
-                            DXGI_FORMAT_B8G8R8A8_UNORM, 0);
+                            DXGI_FORMAT_B8G8R8A8_UNORM,
+                            DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE);
 
 }
 
 void
 LayerManagerD3D10::Render()
 {
   if (mRoot) {
     static_cast<LayerD3D10*>(mRoot->ImplData())->Validate();