summaryrefslogtreecommitdiffstats
path: root/ui/surface/accelerated_surface_win.h
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-16 18:14:34 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-16 18:14:34 +0000
commitbde6bc5d302dba589b8e9a20dea48e98e25c47e3 (patch)
tree9a6635636d288e94c6ae50f486cd7f8737a32244 /ui/surface/accelerated_surface_win.h
parente4a6eed6218d2e1c510507a07c54f3f305aaf9ee (diff)
downloadchromium_src-bde6bc5d302dba589b8e9a20dea48e98e25c47e3.zip
chromium_src-bde6bc5d302dba589b8e9a20dea48e98e25c47e3.tar.gz
chromium_src-bde6bc5d302dba589b8e9a20dea48e98e25c47e3.tar.bz2
Windows: fix failure to recover from device lost in AcceleratedSurface.
When device lost is detected, null out or recreate all the resources and shaders used by the old device. They will not work on the new device. The old shaders created by the AcceleratedSurfaceTransformer need to be recreated. It should also recreate the shared texture and swap chain because they won't otherwise get recreated without window resizing and / or tab switching. I moved the lock from AcceleratedPresenter to PresentThread so that one AcceratedPresenter can destroy resources of others that use the same D3D device without risking deadlock. Check for device lost while polling the event query. Sometimes GetData does not seem to report the loss of the device. Also, treat S_PRESENT_MODE_CHANGED as a lost device because sometimes CheckDeviceState returns that after a GPU hang. I backed out the change to terminate the GPU process on any D3D errors in DoPresentAndAcknowledge. I don't think that was the real issue. BUG=170767,170875 Review URL: https://chromiumcodereview.appspot.com/12252053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/surface/accelerated_surface_win.h')
-rw-r--r--ui/surface/accelerated_surface_win.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/ui/surface/accelerated_surface_win.h b/ui/surface/accelerated_surface_win.h
index eebaf1a..454f9f5d 100644
--- a/ui/surface/accelerated_surface_win.h
+++ b/ui/surface/accelerated_surface_win.h
@@ -76,6 +76,10 @@ class SURFACE_EXPORT AcceleratedPresenter
const base::Callback<void(bool)>& callback);
void Invalidate();
+ // Destroy any D3D resources owned by the given present thread. Called on
+ // the given present thread.
+ void ResetPresentThread(PresentThread* present_thread);
+
#if defined(USE_AURA)
// TODO(scottmg): This is a temporary hack until we have a two-worlds ash/aura
// separation.
@@ -127,11 +131,6 @@ class SURFACE_EXPORT AcceleratedPresenter
// The window that is presented to.
gfx::PluginWindowHandle window_;
- // The lock is taken while any thread is calling the object, except those that
- // simply post from the main thread to the present thread via the immutable
- // present_thread_ member.
- base::Lock lock_;
-
// UI thread can wait on this event to ensure a present is finished.
base::WaitableEvent event_;