Bug 744063 - Pass Y' texture size rather than picture size to Nv3DV. r=bas a=akeybl
authorMatthew Gregan <kinetik@flim.org>
Fri, 25 May 2012 12:12:50 +1200
changeset 92240 986ab7634e2245fd1b912178e3141ec981adcd99
parent 92239 7bff206f5c75491e2d4dbe5effadb2eba7d6d22e
child 92241 cecfcccccd9d11db1c9b4e0edb07da323740b092
push id867
push usermgregan@mozilla.com
push dateFri, 25 May 2012 00:13:31 +0000
treeherdermozilla-beta@986ab7634e22 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas, akeybl
bugs744063
milestone13.0
Bug 744063 - Pass Y' texture size rather than picture size to Nv3DV. r=bas a=akeybl
gfx/layers/d3d10/ImageLayerD3D10.cpp
gfx/layers/d3d9/Nv3DVUtils.cpp
--- a/gfx/layers/d3d10/ImageLayerD3D10.cpp
+++ b/gfx/layers/d3d10/ImageLayerD3D10.cpp
@@ -271,18 +271,18 @@ ImageLayerD3D10::RenderLayer()
         break;
       }
       
       // Send control data even in mono case so driver knows to leave stereo mode.
       GetNv3DVUtils()->SendNv3DVControl(mode, true, FIREFOX_3DV_APP_HANDLE);
 
       if (yuvImage->mData.mStereoMode != STEREO_MODE_MONO) {
         // Dst resource is optional
-        GetNv3DVUtils()->SendNv3DVMetaData((unsigned int)yuvImage->mSize.width, 
-                                           (unsigned int)yuvImage->mSize.height, (HANDLE)(data->mYTexture), (HANDLE)(NULL));
+        GetNv3DVUtils()->SendNv3DVMetaData((unsigned int)yuvImage->mData.mYSize.width, 
+                                           (unsigned int)yuvImage->mData.mYSize.height, (HANDLE)(data->mYTexture), (HANDLE)(NULL));
       }
     }
 
     effect()->GetVariableByName("vLayerQuad")->AsVector()->SetFloatVector(
       ShaderConstantRectD3D10(
         (float)0,
         (float)0,
         (float)size.width,
--- a/gfx/layers/d3d9/Nv3DVUtils.cpp
+++ b/gfx/layers/d3d9/Nv3DVUtils.cpp
@@ -121,49 +121,48 @@ Nv3DVUtils::SetDeviceInfo(IUnknown *devU
     NS_WARNING("D3D Device Pointer (IUnknown) is NULL.\n");
     return;
   }
 
   if (!m3DVStreaming) {
       return;
   }
 
-  bool rv = false;
-  rv = m3DVStreaming->Nv3DVSetDevice(devUnknown);
-  if (rv) {
+  bool rv = m3DVStreaming->Nv3DVSetDevice(devUnknown);
+  if (!rv) {
       NS_WARNING("Nv3DVStreaming Nv3DVControl failed!");
       return;
   }
 
   rv = m3DVStreaming->Nv3DVControl(NV_STEREO_MODE_RIGHT_LEFT, true, FIREFOX_3DV_APP_HANDLE);
-  NS_WARN_IF_FALSE(!rv, "Nv3DVStreaming Nv3DVControl failed!");
+  NS_WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVControl failed!");
 }
 
 /*
  * Send Stereo Control Information. Used mainly to re-route 
  * calls from ImageLayerD3D9 to the 3DV COM object
  */
 void 
 Nv3DVUtils::SendNv3DVControl(Nv_Stereo_Mode eStereoMode, bool bEnableStereo, DWORD dw3DVAppHandle)
 {
   if (!m3DVStreaming)
       return;
 
   DebugOnly<bool> rv = m3DVStreaming->Nv3DVControl(eStereoMode, bEnableStereo, dw3DVAppHandle);
-  NS_WARN_IF_FALSE(!rv, "Nv3DVStreaming Nv3DVControl failed!");
+  NS_WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVControl failed!");
 }
 
 /*
  * Send Stereo Metadata. Used mainly to re-route calls 
  * from ImageLayerD3D9 to the 3DV COM object
  */
 void 
 Nv3DVUtils::SendNv3DVMetaData(unsigned int dwWidth, unsigned int dwHeight, HANDLE hSrcLuma, HANDLE hDst)
 {
   if (!m3DVStreaming)
       return;
 
   DebugOnly<bool> rv = m3DVStreaming->Nv3DVMetaData((DWORD)dwWidth, (DWORD)dwHeight, hSrcLuma, hDst);
-  NS_WARN_IF_FALSE(!rv, "Nv3DVStreaming Nv3DVMetaData failed!");
+  NS_WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVMetaData failed!");
 }
 
 } /* namespace layers */
 } /* namespace mozilla */