Backed out changeset 02dd0a2e01e8 (bug 1015718) for bustage a=sheriffduty

This commit is contained in:
Carsten "Tomcat" Book 2014-07-22 11:52:44 +02:00
parent 644f644aca
commit 83fc5c8e0a
2 changed files with 9 additions and 12 deletions

View File

@ -310,19 +310,12 @@ DXGITextureHostD3D11::DXGITextureHostD3D11(TextureFlags aFlags,
, mHandle(aDescriptor.handle())
, mFormat(aDescriptor.format())
, mIsLocked(false)
{
HRESULT hr = GetDevice()->OpenSharedResource((HANDLE)mHandle,
__uuidof(ID3D11Texture2D),
(void**)(ID3D11Texture2D**)byRef(mTexture));
if (FAILED(hr)) {
NS_WARNING("Failed to open shared texture");
}
}
{}
ID3D11Device*
DXGITextureHostD3D11::GetDevice()
{
return gfxWindowsPlatform::GetPlatform()->GetD3D11Device();
return mCompositor ? mCompositor->GetDevice() : nullptr;
}
void
@ -339,11 +332,16 @@ DXGITextureHostD3D11::Lock()
return false;
}
if (!mTextureSource) {
if (!mTexture) {
RefPtr<ID3D11Texture2D> tex;
HRESULT hr = GetDevice()->OpenSharedResource((HANDLE)mHandle,
__uuidof(ID3D11Texture2D),
(void**)(ID3D11Texture2D**)byRef(tex));
if (FAILED(hr)) {
NS_WARNING("Failed to open shared texture");
return false;
}
mTextureSource = new DataTextureSourceD3D11(mFormat, mCompositor, mTexture);
mTextureSource = new DataTextureSourceD3D11(mFormat, mCompositor, tex);
D3D11_TEXTURE2D_DESC desc;
tex->GetDesc(&desc);
mSize = IntSize(desc.Width, desc.Height);

View File

@ -193,7 +193,6 @@ public:
protected:
ID3D11Device* GetDevice();
RefPtr<ID3D11Texture2D> mTexture;
RefPtr<DataTextureSourceD3D11> mTextureSource;
RefPtr<CompositorD3D11> mCompositor;
gfx::IntSize mSize;