Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(830)

Issue 5275009: Defer window destruction until GPU finished drawing. (Closed)

Created:
10 years ago by jonathan.backer
Modified:
9 years, 7 months ago
CC:
chromium-reviews, apatrick_chromium, ben+cc_chromium.org, nduca
Visibility:
Public.

Description

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. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=67719

Patch Set 1 #

Total comments: 9

Patch Set 2 : Response to piman's review. #

Patch Set 3 : Now with reference counting. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+110 lines, -7 lines) Patch
M chrome/browser/gpu_process_host.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/gpu_process_host.cc View 3 chunks +13 lines, -0 lines 0 comments Download
M chrome/common/gpu_messages_internal.h View 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/gpu/gpu_command_buffer_stub.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M gfx/gtk_native_view_id_manager.h View 1 2 3 chunks +29 lines, -0 lines 0 comments Download
M gfx/gtk_native_view_id_manager.cc View 1 2 4 chunks +51 lines, -6 lines 0 comments Download
M gfx/gtk_preserve_window.cc View 1 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
jonathan.backer
Fixes a long standing bug. We may want this for M9 (it's a P2). Nat ...
10 years ago (2010-11-29 18:26:55 UTC) #1
Evan Martin
+man who designed some of this stuff FYI
10 years ago (2010-11-29 18:28:34 UTC) #2
agl
Oh man. I know so little about what's going on here these days... No red ...
10 years ago (2010-11-29 18:58:55 UTC) #3
piman
Overall this looks pretty good modulo some comments. However I have a question: do we ...
10 years ago (2010-11-29 21:59:01 UTC) #4
jonathan.backer
I am working on reference counting the calls to GetPermanentXIDForID and ReleasePermanentXID. Expect another patch ...
10 years ago (2010-11-30 13:09:31 UTC) #5
jonathan.backer
As suggested by Antoine, I've implemented reference counting on permanent XIDs. This led me to ...
10 years ago (2010-11-30 14:36:53 UTC) #6
Antoine Labour
10 years ago (2010-11-30 17:05:55 UTC) #7
LGTM !

Powered by Google App Engine
This is Rietveld 408576698