Bug 1289640 - Part 5: Delete the D3D11 image bridge device since it no longer has any callers. r=dvander

--HG--
extra : rebase_source : 8ed9418b70d889f8544e23cd624925835e62e9dd
This commit is contained in:
Matt Woodrow 2016-08-02 17:58:17 +12:00
parent 2c65f7fdb0
commit 2254f8e498
4 changed files with 0 additions and 92 deletions

View File

@ -17,7 +17,6 @@ struct DeviceInitData
// Windows only.
bool useD3D11;
bool useD3D11WARP;
bool useD3D11ImageBridge;
bool d3d11TextureSharingWorks;
bool useD2D1;
DxgiAdapterDesc adapter;

View File

@ -67,17 +67,6 @@ IsWARPStable()
return true;
}
bool
DeviceManagerD3D11::CanUseD3D11ImageBridge()
{
if (XRE_IsContentProcess()) {
if (!gfxPlatform::GetPlatform()->GetParentDevicePrefs().useD3D11ImageBridge()) {
return false;
}
}
return !mIsWARP;
}
void
DeviceManagerD3D11::CreateDevices()
{
@ -145,13 +134,6 @@ DeviceManagerD3D11::CreateDevices()
gfxPlatform::GetPlatform()->GetParentDevicePrefs().d3d11TextureSharingWorks();
}
if (CanUseD3D11ImageBridge()) {
if (AttemptD3D11ImageBridgeDeviceCreation() == FeatureStatus::CrashedInHandler) {
DisableD3D11AfterCrash();
return;
}
}
if (AttemptD3D11ContentDeviceCreation() == FeatureStatus::CrashedInHandler) {
DisableD3D11AfterCrash();
return;
@ -434,51 +416,6 @@ DeviceManagerD3D11::AttemptD3D11ContentDeviceCreation()
return FeatureStatus::Available;
}
bool
DeviceManagerD3D11::AttemptD3D11ImageBridgeDeviceCreationHelper(
IDXGIAdapter1* aAdapter,
HRESULT& aResOut)
{
MOZ_SEH_TRY {
aResOut =
sD3D11CreateDeviceFn(GetDXGIAdapter(), D3D_DRIVER_TYPE_UNKNOWN, nullptr,
D3D11_CREATE_DEVICE_BGRA_SUPPORT,
mFeatureLevels.Elements(), mFeatureLevels.Length(),
D3D11_SDK_VERSION, getter_AddRefs(mImageBridgeDevice), nullptr, nullptr);
} MOZ_SEH_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
return false;
}
return true;
}
FeatureStatus
DeviceManagerD3D11::AttemptD3D11ImageBridgeDeviceCreation()
{
HRESULT hr;
if (!AttemptD3D11ImageBridgeDeviceCreationHelper(GetDXGIAdapter(), hr)) {
gfxCriticalNote << "Recovered from crash while creating a D3D11 image bridge device";
gfxWindowsPlatform::RecordContentDeviceFailure(TelemetryDeviceCode::Image);
return FeatureStatus::CrashedInHandler;
}
if (FAILED(hr) || !mImageBridgeDevice) {
gfxCriticalNote << "Failed to create a content image bridge device: " << hexa(hr);
gfxWindowsPlatform::RecordContentDeviceFailure(TelemetryDeviceCode::Image);
return FeatureStatus::Failed;
}
mImageBridgeDevice->SetExceptionMode(0);
if (!D3D11Checks::DoesAlphaTextureSharingWork(mImageBridgeDevice)) {
mImageBridgeDevice = nullptr;
return FeatureStatus::Failed;
}
if (XRE_IsContentProcess()) {
ContentAdapterIsParentAdapter(mImageBridgeDevice);
}
return FeatureStatus::Available;
}
bool
DeviceManagerD3D11::CreateD3D11DecoderDeviceHelper(
IDXGIAdapter1* aAdapter, RefPtr<ID3D11Device>& aDevice, HRESULT& aResOut)
@ -534,7 +471,6 @@ DeviceManagerD3D11::ResetDevices()
mCompositorDevice = nullptr;
mContentDevice = nullptr;
mImageBridgeDevice = nullptr;
Factory::SetDirect3D11Device(nullptr);
}
@ -604,7 +540,6 @@ DeviceManagerD3D11::GetAnyDeviceRemovedReason(DeviceResetReason* aOutReason)
// Note: this can be called off the main thread, so we need to use
// our threadsafe getters.
if (DidDeviceReset(GetCompositorDevice(), aOutReason) ||
DidDeviceReset(GetImageBridgeDevice(), aOutReason) ||
DidDeviceReset(GetContentDevice(), aOutReason))
{
return true;
@ -629,13 +564,6 @@ DeviceManagerD3D11::GetCompositorDevice()
return mCompositorDevice;
}
RefPtr<ID3D11Device>
DeviceManagerD3D11::GetImageBridgeDevice()
{
MutexAutoLock lock(mDeviceLock);
return mImageBridgeDevice;
}
RefPtr<ID3D11Device>
DeviceManagerD3D11::GetContentDevice()
{
@ -643,15 +571,6 @@ DeviceManagerD3D11::GetContentDevice()
return mContentDevice;
}
RefPtr<ID3D11Device>
DeviceManagerD3D11::GetDeviceForCurrentThread()
{
if (NS_IsMainThread()) {
return GetContentDevice();
}
return GetCompositorDevice();
}
unsigned
DeviceManagerD3D11::GetD3D11Version() const
{

View File

@ -48,9 +48,7 @@ public:
}
RefPtr<ID3D11Device> GetCompositorDevice();
RefPtr<ID3D11Device> GetImageBridgeDevice();
RefPtr<ID3D11Device> GetContentDevice();
RefPtr<ID3D11Device> GetDeviceForCurrentThread();
RefPtr<ID3D11Device> CreateDecoderDevice();
unsigned GetD3D11Version() const;
@ -67,8 +65,6 @@ public:
private:
IDXGIAdapter1 *GetDXGIAdapter();
bool CanUseD3D11ImageBridge();
void DisableD3D11AfterCrash();
void AttemptD3D11DeviceCreation(mozilla::gfx::FeatureState& d3d11);
@ -83,10 +79,6 @@ private:
RefPtr<ID3D11Device>& aOutDevice,
HRESULT& aResOut);
bool AttemptD3D11ImageBridgeDeviceCreationHelper(
IDXGIAdapter1* aAdapter, HRESULT& aResOut);
mozilla::gfx::FeatureStatus AttemptD3D11ImageBridgeDeviceCreation();
mozilla::gfx::FeatureStatus AttemptD3D11ContentDeviceCreation();
bool AttemptD3D11ContentDeviceCreationHelper(
IDXGIAdapter1* aAdapter, HRESULT& aResOut);
@ -106,7 +98,6 @@ private:
RefPtr<IDXGIAdapter1> mAdapter;
RefPtr<ID3D11Device> mCompositorDevice;
RefPtr<ID3D11Device> mContentDevice;
RefPtr<ID3D11Device> mImageBridgeDevice;
mozilla::Atomic<bool> mIsWARP;
mozilla::Atomic<bool> mTextureSharingWorks;
};

View File

@ -2058,7 +2058,6 @@ gfxWindowsPlatform::GetDeviceInitData(DeviceInitData* aOut)
DeviceManagerD3D11* dm = DeviceManagerD3D11::Get();
aOut->useD3D11() = true;
aOut->useD3D11ImageBridge() = !!dm->GetImageBridgeDevice();
aOut->d3d11TextureSharingWorks() = dm->TextureSharingWorks();
aOut->useD3D11WARP() = dm->IsWARP();
aOut->useD2D1() = gfxConfig::IsEnabled(Feature::DIRECT2D);