Commit ef615945 by apatrick@chromium.org

Merge r2040 into chrome_m27 branch.

parent 91ed0ca8
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 2001 #define BUILD_REVISION 2042
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -916,34 +916,7 @@ bool Display::testDeviceLost() ...@@ -916,34 +916,7 @@ bool Display::testDeviceLost()
if (mDeviceEx) if (mDeviceEx)
{ {
HRESULT hr = mDeviceEx->CheckDeviceState(NULL); isLost = FAILED(mDeviceEx->CheckDeviceState(NULL));
if (hr == S_PRESENT_MODE_CHANGED)
{
// Reset the device so that D3D stops reporting S_PRESENT_MODE_CHANGED. Otherwise it will report
// it continuously, potentially masking a lost device. D3D resources are not lost on a mode change with WDDM.
D3DPRESENT_PARAMETERS presentParameters = getDefaultPresentParameters();
mDeviceEx->Reset(&presentParameters);
// Existing swap chains sometimes crash on the next present after a reset.
for (SurfaceSet::iterator it = mSurfaceSet.begin(); it != mSurfaceSet.end(); ++it)
{
(*it)->recreateAdditionalSwapChain();
}
// Reset will not always cause the device loss to be reported so issue a dummy present.
mDeviceEx->Present(NULL, NULL, NULL, NULL);
// Retest the device status to see if the mode change really indicated a lost device.
hr = mDeviceEx->CheckDeviceState(NULL);
}
else if (hr == S_PRESENT_OCCLUDED)
{
// CheckDeviceLost continuously returns S_PRESENT_OCCLUDED while the screen is locked. Calling Present
// unmasks the device lost error.
mDeviceEx->Present(NULL, NULL, NULL, NULL);
hr = mDeviceEx->CheckDeviceState(NULL);
}
isLost = FAILED(hr);
} }
else if (mDevice) else if (mDevice)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment