Chromium Code Reviews| 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/browser/gpu/gpu_process_host_ui_shim.h" | 5 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 DCHECK(CalledOnValidThread()); | 153 DCHECK(CalledOnValidThread()); |
| 154 | 154 |
| 155 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) | 155 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) |
| 156 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, | 156 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, |
| 157 OnLogMessage) | 157 OnLogMessage) |
| 158 #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) || defined(OS_WIN) | 158 #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) || defined(OS_WIN) |
| 159 IPC_MESSAGE_HANDLER(GpuHostMsg_ResizeView, OnResizeView) | 159 IPC_MESSAGE_HANDLER(GpuHostMsg_ResizeView, OnResizeView) |
| 160 #endif | 160 #endif |
| 161 | 161 |
| 162 #if defined(OS_MACOSX) || defined(TOUCH_UI) | 162 #if defined(OS_MACOSX) || defined(TOUCH_UI) |
| 163 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSetIOSurface, | 163 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceNew, |
| 164 OnAcceleratedSurfaceSetIOSurface) | 164 OnAcceleratedSurfaceNew) |
| 165 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, | 165 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, |
| 166 OnAcceleratedSurfaceBuffersSwapped) | 166 OnAcceleratedSurfaceBuffersSwapped) |
| 167 #endif | 167 #endif |
| 168 | 168 |
| 169 #if defined(TOUCH_UI) | 169 #if defined(TOUCH_UI) |
| 170 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceRelease, | 170 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceRelease, |
| 171 OnAcceleratedSurfaceRelease) | 171 OnAcceleratedSurfaceRelease) |
| 172 #endif | 172 #endif |
| 173 IPC_MESSAGE_UNHANDLED_ERROR() | 173 IPC_MESSAGE_UNHANDLED_ERROR() |
| 174 IPC_END_MESSAGE_MAP() | 174 IPC_END_MESSAGE_MAP() |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 // Always respond even if the window no longer exists. The GPU process cannot | 227 // Always respond even if the window no longer exists. The GPU process cannot |
| 228 // make progress on the resizing command buffer until it receives the | 228 // make progress on the resizing command buffer until it receives the |
| 229 // response. | 229 // response. |
| 230 Send(new GpuMsg_ResizeViewACK(renderer_id, command_buffer_route_id)); | 230 Send(new GpuMsg_ResizeViewACK(renderer_id, command_buffer_route_id)); |
| 231 } | 231 } |
| 232 | 232 |
| 233 #endif | 233 #endif |
| 234 | 234 |
| 235 #if defined(OS_MACOSX) || defined(TOUCH_UI) | 235 #if defined(OS_MACOSX) || defined(TOUCH_UI) |
| 236 | 236 |
| 237 void GpuProcessHostUIShim::OnAcceleratedSurfaceSetIOSurface( | 237 void GpuProcessHostUIShim::OnAcceleratedSurfaceNew( |
| 238 const GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params& params) { | 238 const GpuHostMsg_AcceleratedSurfaceNew_Params& params) { |
|
danakj
2011/09/21 20:58:20
This will have to be renamed back or duplicated fo
| |
| 239 RenderViewHost* host = RenderViewHost::FromID(params.renderer_id, | 239 RenderViewHost* host = RenderViewHost::FromID(params.renderer_id, |
| 240 params.render_view_id); | 240 params.render_view_id); |
| 241 if (!host) | 241 if (!host) |
| 242 return; | 242 return; |
| 243 RenderWidgetHostView* view = host->view(); | 243 RenderWidgetHostView* view = host->view(); |
| 244 if (!view) | 244 if (!view) |
| 245 return; | 245 return; |
| 246 #if defined(OS_MACOSX) | 246 #if defined(OS_MACOSX) |
| 247 view->AcceleratedSurfaceSetIOSurface(params.window, | 247 view->AcceleratedSurfaceSetIOSurface(params.window, |
|
jonathan.backer
2011/09/21 20:27:36
Renamed in one place (noted earlier), but not here
| |
| 248 params.width, | 248 params.width, |
| 249 params.height, | 249 params.height, |
| 250 params.identifier); | 250 params.identifier); |
| 251 #elif defined(TOUCH_UI) | 251 #elif defined(TOUCH_UI) |
| 252 view->AcceleratedSurfaceSetIOSurface( | 252 uint64 surface_id; |
| 253 params.width, params.height, params.identifier); | 253 TransportDIB::Handle surface_handle; |
| 254 Send(new AcceleratedSurfaceMsg_SetSurfaceACK( | 254 |
| 255 params.route_id, params.identifier)); | 255 surface_id = params.identifier; |
|
jonathan.backer
2011/09/21 20:27:36
nit: init on the decl?
danakj
2011/09/21 20:58:20
it's my C style background I guess. I like to decl
| |
| 256 view->AcceleratedSurfaceNew( | |
| 257 params.width, params.height, &surface_id, &surface_handle); | |
| 258 | |
| 259 Send(new AcceleratedSurfaceMsg_NewACK( | |
| 260 params.route_id, surface_id, surface_handle)); | |
| 256 #endif | 261 #endif |
| 257 } | 262 } |
| 258 | 263 |
| 259 void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped( | 264 void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped( |
| 260 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { | 265 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { |
| 261 TRACE_EVENT0("renderer", | 266 TRACE_EVENT0("renderer", |
| 262 "GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped"); | 267 "GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped"); |
| 263 RenderViewHost* host = RenderViewHost::FromID(params.renderer_id, | 268 RenderViewHost* host = RenderViewHost::FromID(params.renderer_id, |
| 264 params.render_view_id); | 269 params.render_view_id); |
| 265 if (!host) | 270 if (!host) |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 294 params.render_view_id); | 299 params.render_view_id); |
| 295 if (!host) | 300 if (!host) |
| 296 return; | 301 return; |
| 297 RenderWidgetHostView* view = host->view(); | 302 RenderWidgetHostView* view = host->view(); |
| 298 if (!view) | 303 if (!view) |
| 299 return; | 304 return; |
| 300 view->AcceleratedSurfaceRelease(params.identifier); | 305 view->AcceleratedSurfaceRelease(params.identifier); |
| 301 } | 306 } |
| 302 | 307 |
| 303 #endif | 308 #endif |
| OLD | NEW |