зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 09c2a214244b (bug 1072313) for Windows textureclient crashes CLOSED TREE
This commit is contained in:
Родитель
3d281ce639
Коммит
c6aa53d157
|
@ -557,7 +557,6 @@ TextureClient::KeepUntilFullDeallocation(UniquePtr<KeepAlive> aKeep, bool aMainT
|
|||
|
||||
void TextureClient::ForceRemove(bool sync)
|
||||
{
|
||||
FinalizeOnIPDLThread();
|
||||
if (mValid && mActor) {
|
||||
if (sync || GetFlags() & TextureFlags::DEALLOCATE_CLIENT) {
|
||||
MOZ_PERFORMANCE_WARNING("gfx", "TextureClient/Host pair requires synchronous deallocation");
|
||||
|
|
|
@ -408,8 +408,6 @@ public:
|
|||
* help avoid race conditions in some cases.
|
||||
* It's a temporary hack to ensure that DXGI textures don't get destroyed
|
||||
* between serialization and deserialization.
|
||||
*
|
||||
* This must not be called off the texture's IPDL thread.
|
||||
*/
|
||||
void KeepUntilFullDeallocation(UniquePtr<KeepAlive> aKeep, bool aMainThreadOnly = false);
|
||||
|
||||
|
@ -506,20 +504,13 @@ private:
|
|||
static void TextureClientRecycleCallback(TextureClient* aClient, void* aClosure);
|
||||
|
||||
/**
|
||||
* Called once, during the destruction of the Texture, on the thread in which
|
||||
* texture's reference count reaches 0 (could be any thread).
|
||||
* Called once, just before the destructor.
|
||||
*
|
||||
* Here goes the shut-down code that uses virtual methods.
|
||||
* Must only be called by Release().
|
||||
*/
|
||||
B2G_ACL_EXPORT void Finalize();
|
||||
|
||||
/**
|
||||
* Called once during the destruction of the texture on the IPDL thread, if
|
||||
* the texture is shared on the compositor (otherwise it is not called at all).
|
||||
*/
|
||||
virtual void FinalizeOnIPDLThread() {}
|
||||
|
||||
friend class AtomicRefCountedWithFinalize<TextureClient>;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -198,6 +198,13 @@ TextureClientD3D11::TextureClientD3D11(ISurfaceAllocator* aAllocator,
|
|||
|
||||
TextureClientD3D11::~TextureClientD3D11()
|
||||
{
|
||||
if (mActor) {
|
||||
if (mTexture) {
|
||||
KeepUntilFullDeallocation(MakeUnique<TKeepAlive<ID3D11Texture2D>>(mTexture));
|
||||
} else if (mTexture10) {
|
||||
KeepUntilFullDeallocation(MakeUnique<TKeepAlive<ID3D10Texture2D>>(mTexture10));
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
// An Azure DrawTarget needs to be locked when it gets nullptr'ed as this is
|
||||
// when it calls EndDraw. This EndDraw should not execute anything so it
|
||||
|
@ -221,18 +228,6 @@ TextureClientD3D11::~TextureClientD3D11()
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
TextureClientD3D11::FinalizeOnIPDLThread()
|
||||
{
|
||||
if (mActor) {
|
||||
if (mTexture) {
|
||||
KeepUntilFullDeallocation(MakeUnique<TKeepAlive<ID3D11Texture2D>>(mTexture));
|
||||
} else if (mTexture10) {
|
||||
KeepUntilFullDeallocation(MakeUnique<TKeepAlive<ID3D10Texture2D>>(mTexture10));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
already_AddRefed<TextureClientD3D11>
|
||||
TextureClientD3D11::Create(ISurfaceAllocator* aAllocator,
|
||||
|
@ -661,16 +656,11 @@ protected:
|
|||
};
|
||||
|
||||
DXGIYCbCrTextureClient::~DXGIYCbCrTextureClient()
|
||||
{
|
||||
MOZ_COUNT_DTOR(DXGIYCbCrTextureClient);
|
||||
}
|
||||
|
||||
void
|
||||
DXGIYCbCrTextureClient::FinalizeOnIPDLThread()
|
||||
{
|
||||
if (mHoldRefs[0] && mActor) {
|
||||
KeepUntilFullDeallocation(MakeUnique<YCbCrKeepAliveD3D11>(mHoldRefs), true);
|
||||
}
|
||||
MOZ_COUNT_DTOR(DXGIYCbCrTextureClient);
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -88,8 +88,6 @@ public:
|
|||
protected:
|
||||
bool AllocateD3D11Surface(ID3D11Device* aDevice, const gfx::IntSize& aSize);
|
||||
|
||||
virtual void FinalizeOnIPDLThread() override;
|
||||
|
||||
gfx::IntSize mSize;
|
||||
RefPtr<ID3D10Texture2D> mTexture10;
|
||||
RefPtr<ID3D11Texture2D> mTexture;
|
||||
|
@ -159,8 +157,6 @@ public:
|
|||
CreateSimilar(TextureFlags, TextureAllocationFlags) const override{ return nullptr; }
|
||||
|
||||
private:
|
||||
virtual void FinalizeOnIPDLThread() override;
|
||||
|
||||
RefPtr<IUnknown> mHoldRefs[3];
|
||||
HANDLE mHandles[3];
|
||||
gfx::IntSize mSize;
|
||||
|
|
|
@ -660,12 +660,6 @@ SharedTextureClientD3D9::SharedTextureClientD3D9(ISurfaceAllocator* aAllocator,
|
|||
}
|
||||
|
||||
SharedTextureClientD3D9::~SharedTextureClientD3D9()
|
||||
{
|
||||
MOZ_COUNT_DTOR(SharedTextureClientD3D9);
|
||||
}
|
||||
|
||||
void
|
||||
SharedTextureClientD3D9::FinalizeOnIPDLThread()
|
||||
{
|
||||
if (mTexture && mActor) {
|
||||
KeepUntilFullDeallocation(MakeUnique<TKeepAlive<IDirect3DTexture9>>(mTexture));
|
||||
|
@ -673,6 +667,7 @@ SharedTextureClientD3D9::FinalizeOnIPDLThread()
|
|||
if (mTexture) {
|
||||
gfxWindowsPlatform::sD3D9SharedTextureUsed -= mDesc.Width * mDesc.Height * 4;
|
||||
}
|
||||
MOZ_COUNT_DTOR(SharedTextureClientD3D9);
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -285,8 +285,6 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
virtual void FinalizeOnIPDLThread() override;
|
||||
|
||||
RefPtr<IDirect3DDevice9> mDevice;
|
||||
RefPtr<IDirect3DTexture9> mTexture;
|
||||
gfx::SurfaceFormat mFormat;
|
||||
|
|
|
@ -188,7 +188,7 @@ static void ImageBridgeShutdownStep1(ReentrantMonitor *aBarrier, bool *aDone)
|
|||
InfallibleTArray<PTextureChild*> textures;
|
||||
sImageBridgeChildSingleton->ManagedPTextureChild(textures);
|
||||
for (int i = textures.Length() - 1; i >= 0; --i) {
|
||||
RefPtr<TextureClient> client = TextureClient::AsTextureClient(textures[i]);
|
||||
TextureClient* client = TextureClient::AsTextureClient(textures[i]);
|
||||
if (client) {
|
||||
client->ForceRemove();
|
||||
}
|
||||
|
|
|
@ -16,11 +16,6 @@ MacIOSurfaceTextureClientOGL::MacIOSurfaceTextureClientOGL(ISurfaceAllocator* aA
|
|||
{}
|
||||
|
||||
MacIOSurfaceTextureClientOGL::~MacIOSurfaceTextureClientOGL()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
MacIOSurfaceTextureClientOGL::FinalizeOnIPDLThread()
|
||||
{
|
||||
if (mActor && mSurface) {
|
||||
KeepUntilFullDeallocation(MakeUnique<TKeepAlive<MacIOSurface>>(mSurface));
|
||||
|
|
|
@ -50,8 +50,6 @@ public:
|
|||
CreateSimilar(TextureFlags, TextureAllocationFlags) const override { return nullptr; }
|
||||
|
||||
protected:
|
||||
virtual void FinalizeOnIPDLThread() override;
|
||||
|
||||
RefPtr<MacIOSurface> mSurface;
|
||||
bool mIsLocked;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче