From 9a9aee2e789ab2cdb8c269c8ba5bc09168faca1d Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Tue, 9 Apr 2013 17:37:56 +0000 Subject: [PATCH] Bug 630197: Check for a removed device before presenting. r=jrmuizel --- gfx/layers/d3d10/LayerManagerD3D10.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gfx/layers/d3d10/LayerManagerD3D10.cpp b/gfx/layers/d3d10/LayerManagerD3D10.cpp index 8fe7a5a4961b..9fb4d69111b4 100644 --- a/gfx/layers/d3d10/LayerManagerD3D10.cpp +++ b/gfx/layers/d3d10/LayerManagerD3D10.cpp @@ -755,6 +755,17 @@ LayerManagerD3D10::Render(EndTransactionFlags aFlags) static_cast(mRoot->ImplData())->RenderLayer(); + // See bug 630197 - we have some reasons to believe if an earlier call + // returned an error, the upcoming present call may raise an exception. + // This will check if any of the calls done recently has returned an error + // and bails on composition. On the -next- frame we will then abandon + // hardware acceleration from gfxWindowsPlatform::VerifyD2DDevice. + // This might not be the 'optimal' solution but it will help us assert + // whether our thoughts of the causes of the issues are correct. + if (FAILED(mDevice->GetDeviceRemovedReason())) { + return; + } + if (mTarget) { PaintToTarget(); } else if (mBackBuffer) {