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

Unified Diff: chrome/browser/gpu_process_host.cc

Issue 4815001: Use inner HWND for accelerated rendering on windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' 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
Index: chrome/browser/gpu_process_host.cc
===================================================================
--- chrome/browser/gpu_process_host.cc (revision 66779)
+++ chrome/browser/gpu_process_host.cc (working copy)
@@ -202,6 +202,10 @@
OnAcceleratedSurfaceSetIOSurface)
IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
OnAcceleratedSurfaceBuffersSwapped)
+#elif defined(OS_WIN)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_CreateCompositorHostWindow,
+ OnCreateCompositorHostWindow)
+ IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite, OnScheduleComposite)
#endif
// If the IO thread does not handle the message then automatically route it
// to the UI thread. The UI thread will report an error if it does not
@@ -347,6 +351,58 @@
new BuffersSwappedDispatcher(
renderer_id, render_view_id, window, surface_id));
}
+
+#elif defined(OS_WIN)
+
+namespace {
+
+void SendDelayedReply(IPC::Message* reply_msg) {
+ GpuProcessHost::Get()->Send(reply_msg);
+}
+
+void CreateCompositorHostWindowDispatcher(
+ int renderer_id,
+ int render_view_id,
+ IPC::Message* reply_msg) {
+ RenderViewHost* host = RenderViewHost::FromID(renderer_id,
apatrick_chromium 2010/11/19 23:09:51 What if the renderer process has been destroyed or
nduca 2010/11/20 00:28:49 Done.
+ render_view_id);
+
+ RenderWidgetHostView* view = host->view();
+ gfx::PluginWindowHandle id = view->CreateCompositorHostWindow();
+
+
+ GpuHostMsg_CreateCompositorHostWindow::WriteReplyParams(reply_msg, id);
+ BrowserThread::PostTask(
apatrick_chromium 2010/11/19 23:09:51 If this is running on the UI thread it should be i
nduca 2010/11/20 00:28:49 Summarizing verbal conversation: the reason that t
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableFunction(&SendDelayedReply, reply_msg));
+}
+
+void ScheduleCompositeDispatcher(int renderer_id, int render_view_id) {
+ RenderViewHost* host = RenderViewHost::FromID(renderer_id,
+ render_view_id);
+ DCHECK(host);
apatrick_chromium 2010/11/19 23:09:51 See above about renderer process terminating.
nduca 2010/11/20 00:28:49 Done.
+
+
+ host->ScheduleComposite();
+}
+} // namespace
+
+void GpuProcessHost::OnCreateCompositorHostWindow(
+ int32 renderer_id,
+ int32 render_view_id,
+ IPC::Message* reply_message) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableFunction(&CreateCompositorHostWindowDispatcher,
+ renderer_id, render_view_id, reply_message));
+}
+
+void GpuProcessHost::OnScheduleComposite(int renderer_id, int render_view_id) {
apatrick_chromium 2010/11/19 23:09:51 Messages received by GpuProcessHost but not handle
nduca 2010/11/20 00:28:49 Done.
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableFunction(&ScheduleCompositeDispatcher,
+ renderer_id, render_view_id));
+}
#endif
void GpuProcessHost::SendEstablishChannelReply(

Powered by Google App Engine
This is Rietveld 408576698