mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1101130: Make Direct2D 1.1 clean up its resources on shutdown. r=jrmuizel
This commit is contained in:
parent
3e8aa86ac8
commit
d648e9fd93
@ -850,6 +850,16 @@ DrawTargetD2D1::factory()
|
||||
return mFactory;
|
||||
}
|
||||
|
||||
void
|
||||
DrawTargetD2D1::CleanupD2D()
|
||||
{
|
||||
if (mFactory) {
|
||||
RadialGradientEffectD2D1::Unregister(mFactory);
|
||||
mFactory->Release();
|
||||
mFactory = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DrawTargetD2D1::MarkChanged()
|
||||
{
|
||||
|
@ -609,6 +609,11 @@ Factory::SetDirect3D11Device(ID3D11Device *aDevice)
|
||||
{
|
||||
mD3D11Device = aDevice;
|
||||
|
||||
if (mD2D1Device) {
|
||||
mD2D1Device->Release();
|
||||
mD2D1Device = nullptr;
|
||||
}
|
||||
|
||||
RefPtr<ID2D1Factory1> factory = D2DFactory1();
|
||||
|
||||
RefPtr<IDXGIDevice> device;
|
||||
@ -656,7 +661,12 @@ Factory::GetD2DVRAMUsageSourceSurface()
|
||||
void
|
||||
Factory::D2DCleanup()
|
||||
{
|
||||
if (mD2D1Device) {
|
||||
mD2D1Device->Release();
|
||||
mD2D1Device = nullptr;
|
||||
}
|
||||
DrawTargetD2D::CleanupD2D();
|
||||
DrawTargetD2D1::CleanupD2D();
|
||||
}
|
||||
|
||||
#endif // XP_WIN
|
||||
|
@ -284,6 +284,12 @@ RadialGradientEffectD2D1::Register(ID2D1Factory1 *aFactory)
|
||||
return hr;
|
||||
}
|
||||
|
||||
void
|
||||
RadialGradientEffectD2D1::Unregister(ID2D1Factory1 *aFactory)
|
||||
{
|
||||
aFactory->UnregisterEffect(CLSID_RadialGradientEffect);
|
||||
}
|
||||
|
||||
HRESULT __stdcall
|
||||
RadialGradientEffectD2D1::CreateEffect(IUnknown **aEffectImpl)
|
||||
{
|
||||
|
@ -72,6 +72,7 @@ public:
|
||||
IFACEMETHODIMP SetDrawInfo(ID2D1DrawInfo *pDrawInfo);
|
||||
|
||||
static HRESULT Register(ID2D1Factory1* aFactory);
|
||||
static void Unregister(ID2D1Factory1* aFactory);
|
||||
static HRESULT __stdcall CreateEffect(IUnknown** aEffectImpl);
|
||||
|
||||
HRESULT SetStopCollection(IUnknown *aStopCollection);
|
||||
|
Loading…
Reference in New Issue
Block a user