Bug 793719 - Fix for D2D error on shutdown with VS2012. r=bas

This commit is contained in:
Brian R. Bondy 2012-11-25 14:00:31 -05:00
parent 0e97b98462
commit 6247c94cd0
5 changed files with 19 additions and 0 deletions

View File

@ -926,6 +926,7 @@ public:
static uint64_t GetD2DVRAMUsageDrawTarget();
static uint64_t GetD2DVRAMUsageSourceSurface();
static void D2DCleanup();
private:
static ID3D10Device1 *mD3D10Device;

View File

@ -2686,6 +2686,15 @@ DrawTargetD2D::factory()
return mFactory;
}
void
DrawTargetD2D::CleanupD2D()
{
if (mFactory) {
mFactory->Release();
mFactory = nullptr;
}
}
IDWriteFactory*
DrawTargetD2D::GetDWriteFactory()
{

View File

@ -128,6 +128,7 @@ public:
void PopCachedLayer(ID2D1RenderTarget *aRT);
static ID2D1Factory *factory();
static void CleanupD2D();
static TemporaryRef<ID2D1StrokeStyle> CreateStrokeStyleForOptions(const StrokeOptions &aStrokeOptions);
static IDWriteFactory *GetDWriteFactory();

View File

@ -441,6 +441,12 @@ Factory::GetD2DVRAMUsageSourceSurface()
return DrawTargetD2D::mVRAMUsageSS;
}
void
Factory::D2DCleanup()
{
DrawTargetD2D::CleanupD2D();
}
#endif // XP_WIN
TemporaryRef<DrawTarget>

View File

@ -385,6 +385,8 @@ gfxWindowsPlatform::~gfxWindowsPlatform()
}
#endif
mozilla::gfx::Factory::D2DCleanup();
/*
* Uninitialize COM
*/