Bug 1725145 - fixes in gfx for win in non unified env. r=emilio
authorAndi-Bogdan Postelnicu <andi@mozilla.com>
Wed, 25 Aug 2021 10:46:15 +0000
changeset 589871 33ee091a5201955ac4b10a190ad30f71ad33d7c8
parent 589870 3cd3ed5bd2695627f5468b17912d0e556840e69d
child 589872 1008e8b72ec3c513a64d3670cc15dc8e8e8e9742
push id38735
push usernbeleuzu@mozilla.com
push dateWed, 25 Aug 2021 15:39:54 +0000
treeherdermozilla-central@55a7e8179f28 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1725145
milestone93.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 1725145 - fixes in gfx for win in non unified env. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D123603
gfx/layers/D3D9SurfaceImage.cpp
gfx/tests/gtest/TextureHelper.h
gfx/vr/gfxVRMutex.h
--- a/gfx/layers/D3D9SurfaceImage.cpp
+++ b/gfx/layers/D3D9SurfaceImage.cpp
@@ -80,18 +80,19 @@ already_AddRefed<IDirect3DSurface9> DXGI
   return textureSurface.forget();
 }
 
 bool DXGID3D9TextureData::Serialize(SurfaceDescriptor& aOutDescriptor) {
   SurfaceDescriptorD3D10 desc((WindowsHandle)(mHandle), mFormat, GetSize(),
                               gfx::YUVColorSpace::Identity,
                               gfx::ColorRange::FULL);
   // In reality, with D3D9 we will only ever deal with RGBA textures.
-  bool isYUV = mFormat == SurfaceFormat::NV12 ||
-               mFormat == SurfaceFormat::P010 || mFormat == SurfaceFormat::P016;
+  bool isYUV = mFormat == gfx::SurfaceFormat::NV12 ||
+               mFormat == gfx::SurfaceFormat::P010 ||
+               mFormat == gfx::SurfaceFormat::P016;
   if (isYUV) {
     gfxCriticalError() << "Unexpected YUV format for DXGID3D9TextureData: "
                        << mFormat;
     desc.yUVColorSpace() = gfx::YUVColorSpace::BT601;
     desc.colorRange() = gfx::ColorRange::LIMITED;
   }
   aOutDescriptor = desc;
   return true;
--- a/gfx/tests/gtest/TextureHelper.h
+++ b/gfx/tests/gtest/TextureHelper.h
@@ -68,17 +68,18 @@ static already_AddRefed<TextureClient> C
     return TextureClient::CreateForYCbCr(
         nullptr, clientData.GetPictureRect(), clientData.mYSize,
         clientData.mYStride, clientData.mCbCrSize, clientData.mCbCrStride,
         StereoMode::MONO, gfx::ColorDepth::COLOR_8, gfx::YUVColorSpace::BT601,
         gfx::ColorRange::LIMITED, TextureFlags::DEALLOCATE_CLIENT);
   }
 
 #ifdef XP_WIN
-  RefPtr<ID3D11Device> device = DeviceManagerDx::Get()->GetImageDevice();
+  RefPtr<ID3D11Device> device =
+      mozilla::gfx::DeviceManagerDx::Get()->GetImageDevice();
 
   if (device && aLayersBackend == LayersBackend::LAYERS_D3D11) {
     DXGIYCbCrTextureAllocationHelper helper(clientData, TextureFlags::DEFAULT,
                                             device);
     RefPtr<TextureClient> texture = helper.Allocate(nullptr);
     return texture.forget();
   }
 #endif
--- a/gfx/vr/gfxVRMutex.h
+++ b/gfx/vr/gfxVRMutex.h
@@ -2,16 +2,20 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GFX_VR_MUTEX_H
 #define GFX_VR_MUTEX_H
 
+#if defined(XP_WIN)
+#  include "nsTString.h"
+#endif
+
 namespace mozilla {
 namespace gfx {
 
 #if defined(XP_WIN)
 class WaitForMutex {
  public:
   explicit WaitForMutex(HANDLE handle) : mHandle(handle), mStatus(false) {
     MOZ_ASSERT(mHandle);