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

Unified Diff: chrome/browser/gpu_process_host.cc

Issue 5275009: Defer window destruction until GPU finished drawing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now with reference counting. Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gpu_process_host.h ('k') | chrome/common/gpu_messages_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gpu_process_host.cc
diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc
index c321f9720c27c5b72822dfb86e326176b1c94449..eeb50bda6ba08ad2e4dcec4fcf0bc6ab4d642974 100644
--- a/chrome/browser/gpu_process_host.cc
+++ b/chrome/browser/gpu_process_host.cc
@@ -171,6 +171,7 @@ void GpuProcessHost::OnControlMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(GpuHostMsg_SynchronizeReply, OnSynchronizeReply)
#if defined(OS_LINUX)
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_GetViewXID, OnGetViewXID)
+ IPC_MESSAGE_HANDLER(GpuHostMsg_ReleaseXID, OnReleaseXID)
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_ResizeXID, OnResizeXID)
#elif defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSetIOSurface,
@@ -228,6 +229,11 @@ void GetViewXIDDispatcher(gfx::NativeViewId id, IPC::Message* reply_msg) {
NewRunnableFunction(&SendDelayedReply, reply_msg));
}
+void ReleaseXIDDispatcher(unsigned long xid) {
+ GtkNativeViewManager* manager = Singleton<GtkNativeViewManager>::get();
+ manager->ReleasePermanentXID(xid);
+}
+
void ResizeXIDDispatcher(unsigned long xid, gfx::Size size,
IPC::Message *reply_msg) {
GdkWindow* window = reinterpret_cast<GdkWindow*>(gdk_xid_table_lookup(xid));
@@ -255,6 +261,13 @@ void GpuProcessHost::OnGetViewXID(gfx::NativeViewId id,
NewRunnableFunction(&GetViewXIDDispatcher, id, reply_msg));
}
+void GpuProcessHost::OnReleaseXID(unsigned long xid) {
+ // Have to release a permanent XID from UI thread.
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableFunction(&ReleaseXIDDispatcher, xid));
+}
+
void GpuProcessHost::OnResizeXID(unsigned long xid, gfx::Size size,
IPC::Message *reply_msg) {
// Have to resize the window from UI thread.
« no previous file with comments | « chrome/browser/gpu_process_host.h ('k') | chrome/common/gpu_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698