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

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
« no previous file with comments | « chrome/browser/gpu_process_host.h ('k') | chrome/browser/gpu_process_host_ui_shim.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
===================================================================
--- chrome/browser/gpu_process_host.cc (revision 67491)
+++ chrome/browser/gpu_process_host.cc (working copy)
@@ -177,6 +177,9 @@
OnAcceleratedSurfaceSetIOSurface)
IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
OnAcceleratedSurfaceBuffersSwapped)
+#elif defined(OS_WIN)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_CreateCompositorHostWindow,
+ OnCreateCompositorHostWindow)
#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
@@ -305,8 +308,8 @@
class BuffersSwappedDispatcher : public Task {
public:
BuffersSwappedDispatcher(
- int32 renderer_id,
- int32 render_view_id,
+ int renderer_id,
+ int render_view_id,
gfx::PluginWindowHandle window,
uint64 surface_id,
int32 route_id,
@@ -338,8 +341,8 @@
}
private:
- int32 renderer_id_;
- int32 render_view_id_;
+ int renderer_id_;
+ int render_view_id_;
gfx::PluginWindowHandle window_;
uint64 surface_id_;
int32 route_id_;
@@ -366,6 +369,47 @@
params.route_id,
params.swap_buffers_count));
}
+
+#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,
+ render_view_id);
+ if (!host) {
+ return;
+ }
+
+ RenderWidgetHostView* view = host->view();
+ gfx::PluginWindowHandle id = view->CreateCompositorHostWindow();
+
+
+ GpuHostMsg_CreateCompositorHostWindow::WriteReplyParams(reply_msg, id);
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableFunction(&SendDelayedReply, reply_msg));
+}
+
+} // namespace
+
+void GpuProcessHost::OnCreateCompositorHostWindow(
+ int renderer_id,
+ int render_view_id,
+ IPC::Message* reply_message) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableFunction(&CreateCompositorHostWindowDispatcher,
+ renderer_id, render_view_id, reply_message));
+}
+
#endif
void GpuProcessHost::SendEstablishChannelReply(
« no previous file with comments | « chrome/browser/gpu_process_host.h ('k') | chrome/browser/gpu_process_host_ui_shim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698