Fix DXGITextureHostD3D11 not being able to lock without a compositor. (bug 1350247, r=mattwoodrow)

This commit is contained in:
David Anderson 2017-03-27 14:02:50 -07:00
parent 2c4840cca6
commit b048f397ca
2 changed files with 7 additions and 2 deletions

View File

@ -737,20 +737,21 @@ DXGITextureHostD3D11::GetDevice()
if (mFlags & TextureFlags::INVALID_COMPOSITOR) {
return nullptr;
}
return mProvider->GetD3D11Device();
return mDevice;
}
void
DXGITextureHostD3D11::SetTextureSourceProvider(TextureSourceProvider* aProvider)
{
if (!aProvider || !aProvider->GetD3D11Device()) {
mDevice = nullptr;
mProvider = nullptr;
mTextureSource = nullptr;
return;
}
mProvider = aProvider;
mDevice = aProvider->GetD3D11Device();
if (mTextureSource) {
mTextureSource->SetTextureSourceProvider(aProvider);
@ -776,6 +777,9 @@ DXGITextureHostD3D11::LockWithoutCompositor()
// Unlike the normal Lock() function, this function may be called when
// mCompositor is nullptr such as during WebVR frame submission. So, there is
// no 'mCompositor' checking here.
if (!mDevice) {
mDevice = DeviceManagerDx::Get()->GetCompositorDevice();
}
return LockInternal();
}

View File

@ -333,6 +333,7 @@ protected:
bool OpenSharedHandle();
RefPtr<ID3D11Device> mDevice;
RefPtr<ID3D11Texture2D> mTexture;
RefPtr<DataTextureSourceD3D11> mTextureSource;
gfx::IntSize mSize;