diff options
author | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-30 17:42:42 +0000 |
---|---|---|
committer | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-30 17:42:42 +0000 |
commit | dd10939ad6d4d54a9b222d31d68e2596bf588eac (patch) | |
tree | 7d820c3c61e1631acc2e3a470ded1e5a184601ef /chrome/gpu | |
parent | 7de8b59cd42e9bd59dd6cf541514ea79b1d2e70a (diff) | |
download | chromium_src-dd10939ad6d4d54a9b222d31d68e2596bf588eac.zip chromium_src-dd10939ad6d4d54a9b222d31d68e2596bf588eac.tar.gz chromium_src-dd10939ad6d4d54a9b222d31d68e2596bf588eac.tar.bz2 |
Defer window destruction until GPU finished drawing.
When a tab is closed, it takes a while before the GPU stops drawing into the window. Destroying the window before the GPU has flushed its drawing pipeline causes unsightly X11 errors. The custom widget class that we use for drawing
tab contents has a lock that is set when the GPU process is drawing to that widget. We use this lock to determine who should delete the associated window:
- if the lock is clear at the time of widget destruction, the widget destroys the window
- if the lock is set, the GPU process signals to the browser to destroy the widget (it has to be done in the browser process b/c the X window is wrapped in a GdkWindow that resides in the browser address space)
Most the management is done in GtkNativeViewManager. I've added another map from XID to GtkWidget to facilitate this management.
BUG=55158
TEST=Open two windows with http://webkit.org/blog-files/3d-transforms/poster-circle.html Close one of them. There should be no X11 errors generated.
Review URL: http://codereview.chromium.org/5275009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67719 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu')
-rw-r--r-- | chrome/gpu/gpu_command_buffer_stub.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/gpu/gpu_command_buffer_stub.cc b/chrome/gpu/gpu_command_buffer_stub.cc index 3c87c99..6112782 100644 --- a/chrome/gpu/gpu_command_buffer_stub.cc +++ b/chrome/gpu/gpu_command_buffer_stub.cc @@ -159,6 +159,10 @@ GpuCommandBufferStub::~GpuCommandBufferStub() { DestroyWindow(static_cast<HWND>(compositor_window_)); compositor_window_ = NULL; } +#elif defined(OS_LINUX) + ChildThread* gpu_thread = ChildThread::current(); + gpu_thread->Send( + new GpuHostMsg_ReleaseXID(handle_)); #endif } |