Index: chrome/browser/gpu_process_host.cc |
diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc |
index 639d1006dfe3969952e4cc2ae51c7f7ca1e40365..f5f23c40a7e983906dd07d4d73b0275026ab5b7e 100644 |
--- a/chrome/browser/gpu_process_host.cc |
+++ b/chrome/browser/gpu_process_host.cc |
@@ -22,6 +22,8 @@ |
#include "media/base/media_switches.h" |
#if defined(OS_LINUX) |
+#include <gdk/gdkwindow.h> |
+#include <gdk/gdkx.h> |
#include "app/x11_util.h" |
#include "gfx/gtk_native_view_id_manager.h" |
#endif |
@@ -161,6 +163,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_DELAY_REPLY(GpuHostMsg_ResizeXID, OnResizeXID) |
#elif defined(OS_MACOSX) |
IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSetIOSurface, |
OnAcceleratedSurfaceSetIOSurface) |
@@ -214,7 +217,24 @@ void GetViewXIDDispatcher(gfx::NativeViewId id, IPC::Message* reply_msg) { |
NewRunnableFunction(&SendDelayedReply, reply_msg)); |
} |
-} // namespace |
+void ResizeXIDDispatcher(unsigned long xid, int32 width, int32 height, |
nduca
2010/11/23 16:59:49
same comments about in32
jonathan.backer
2010/11/23 21:00:19
Done.
|
+ IPC::Message *reply_msg) { |
+ GdkWindow* window = reinterpret_cast<GdkWindow*>(gdk_xid_table_lookup(xid)); |
+ if (window) { |
+ Display* display = GDK_WINDOW_XDISPLAY(window); |
+ gdk_window_resize(window, width, height); |
+ XSync(display, False); |
+ } |
+ |
+ GpuHostMsg_ResizeXID::WriteReplyParams(reply_msg, (window != NULL)); |
+ |
+ // Have to reply from IO thread. |
+ BrowserThread::PostTask( |
+ BrowserThread::IO, FROM_HERE, |
+ NewRunnableFunction(&SendDelayedReply, reply_msg)); |
+} |
+ |
+} // namespace |
void GpuProcessHost::OnGetViewXID(gfx::NativeViewId id, |
IPC::Message *reply_msg) { |
@@ -224,6 +244,14 @@ void GpuProcessHost::OnGetViewXID(gfx::NativeViewId id, |
NewRunnableFunction(&GetViewXIDDispatcher, id, reply_msg)); |
} |
nduca
2010/11/23 16:59:49
int32
jonathan.backer
2010/11/23 21:00:19
Done.
|
+void GpuProcessHost::OnResizeXID(unsigned long xid, int32 width, int32 height, |
+ IPC::Message *reply_msg) { |
+ // Have to resize the window from UI thread. |
+ BrowserThread::PostTask( |
+ BrowserThread::UI, FROM_HERE, |
+ NewRunnableFunction(&ResizeXIDDispatcher, xid, width, height, reply_msg)); |
+} |
+ |
#elif defined(OS_MACOSX) |
namespace { |