mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Fix DXGITextureHostD3D11 not being able to lock without a compositor. (bug 1350247, r=mattwoodrow)
This commit is contained in:
parent
2c4840cca6
commit
b048f397ca
@ -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();
|
||||
}
|
||||
|
||||
|
@ -333,6 +333,7 @@ protected:
|
||||
|
||||
bool OpenSharedHandle();
|
||||
|
||||
RefPtr<ID3D11Device> mDevice;
|
||||
RefPtr<ID3D11Texture2D> mTexture;
|
||||
RefPtr<DataTextureSourceD3D11> mTextureSource;
|
||||
gfx::IntSize mSize;
|
||||
|
Loading…
Reference in New Issue
Block a user