OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/gpu/gpu_channel_host.h" | 5 #include "content/renderer/gpu/gpu_channel_host.h" |
6 | 6 |
7 #include "content/common/child_process.h" | 7 #include "content/common/child_process.h" |
8 #include "content/common/gpu/gpu_messages.h" | 8 #include "content/common/gpu/gpu_messages.h" |
9 #include "content/renderer/gpu/command_buffer_proxy.h" | 9 #include "content/renderer/gpu/command_buffer_proxy.h" |
10 #include "content/renderer/gpu/gpu_surface_proxy.h" | 10 #include "content/renderer/gpu/gpu_surface_proxy.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (channel_.get()) | 98 if (channel_.get()) |
99 return channel_->Send(message); | 99 return channel_->Send(message); |
100 | 100 |
101 // Callee takes ownership of message, regardless of whether Send is | 101 // Callee takes ownership of message, regardless of whether Send is |
102 // successful. See IPC::Message::Sender. | 102 // successful. See IPC::Message::Sender. |
103 delete message; | 103 delete message; |
104 return false; | 104 return false; |
105 } | 105 } |
106 | 106 |
107 CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer( | 107 CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer( |
108 gfx::PluginWindowHandle compositing_surface, | |
109 int render_view_id, | 108 int render_view_id, |
110 const std::string& allowed_extensions, | 109 const std::string& allowed_extensions, |
111 const std::vector<int32>& attribs, | 110 const std::vector<int32>& attribs, |
112 const GURL& active_url) { | 111 const GURL& active_url) { |
113 #if defined(ENABLE_GPU) | 112 #if defined(ENABLE_GPU) |
114 // An error occurred. Need to get the host again to reinitialize it. | 113 // An error occurred. Need to get the host again to reinitialize it. |
115 if (!channel_.get()) | 114 if (!channel_.get()) |
116 return NULL; | 115 return NULL; |
117 | 116 |
118 GPUCreateCommandBufferConfig init_params; | 117 GPUCreateCommandBufferConfig init_params; |
119 init_params.allowed_extensions = allowed_extensions; | 118 init_params.allowed_extensions = allowed_extensions; |
120 init_params.attribs = attribs; | 119 init_params.attribs = attribs; |
121 init_params.active_url = active_url; | 120 init_params.active_url = active_url; |
122 int32 route_id; | 121 int32 route_id; |
123 if (!RenderThread::current()->Send( | 122 if (!RenderThread::current()->Send( |
124 new GpuHostMsg_CreateViewCommandBuffer( | 123 new GpuHostMsg_CreateViewCommandBuffer( |
125 compositing_surface, render_view_id, init_params, &route_id))) { | 124 render_view_id, init_params, &route_id))) { |
126 return NULL; | 125 return NULL; |
127 } | 126 } |
128 | 127 |
129 if (route_id == MSG_ROUTING_NONE) | 128 if (route_id == MSG_ROUTING_NONE) |
130 return NULL; | 129 return NULL; |
131 | 130 |
132 CommandBufferProxy* command_buffer = new CommandBufferProxy(this, route_id); | 131 CommandBufferProxy* command_buffer = new CommandBufferProxy(this, route_id); |
133 router_.AddRoute(route_id, command_buffer); | 132 router_.AddRoute(route_id, command_buffer); |
134 proxies_[route_id] = command_buffer; | 133 proxies_[route_id] = command_buffer; |
135 return command_buffer; | 134 return command_buffer; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 200 |
202 void GpuChannelHost::DestroySurface(GpuSurfaceProxy* surface) { | 201 void GpuChannelHost::DestroySurface(GpuSurfaceProxy* surface) { |
203 #if defined(ENABLE_GPU) | 202 #if defined(ENABLE_GPU) |
204 Send(new GpuChannelMsg_DestroySurface(surface->route_id())); | 203 Send(new GpuChannelMsg_DestroySurface(surface->route_id())); |
205 if (router_.ResolveRoute(surface->route_id())) | 204 if (router_.ResolveRoute(surface->route_id())) |
206 router_.RemoveRoute(surface->route_id()); | 205 router_.RemoveRoute(surface->route_id()); |
207 | 206 |
208 delete surface; | 207 delete surface; |
209 #endif | 208 #endif |
210 } | 209 } |
OLD | NEW |