| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 #endif | 209 #endif |
| 210 | 210 |
| 211 #if defined(USE_AURA) | 211 #if defined(USE_AURA) |
| 212 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceNew, | 212 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceNew, |
| 213 OnAcceleratedSurfaceNew) | 213 OnAcceleratedSurfaceNew) |
| 214 #endif | 214 #endif |
| 215 | 215 |
| 216 #if defined(USE_AURA) | 216 #if defined(USE_AURA) |
| 217 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceRelease, | 217 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceRelease, |
| 218 OnAcceleratedSurfaceRelease) | 218 OnAcceleratedSurfaceRelease) |
| 219 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceRequestReleaseFront, |
| 220 OnAcceleratedSurfaceRequestReleaseFront) |
| 219 #endif | 221 #endif |
| 220 | 222 |
| 221 IPC_MESSAGE_UNHANDLED_ERROR() | 223 IPC_MESSAGE_UNHANDLED_ERROR() |
| 222 IPC_END_MESSAGE_MAP() | 224 IPC_END_MESSAGE_MAP() |
| 223 | 225 |
| 224 return true; | 226 return true; |
| 225 } | 227 } |
| 226 | 228 |
| 227 void GpuProcessHostUIShim::OnLogMessage( | 229 void GpuProcessHostUIShim::OnLogMessage( |
| 228 int level, | 230 int level, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 304 |
| 303 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( | 305 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( |
| 304 params.surface_id); | 306 params.surface_id); |
| 305 if (!view) | 307 if (!view) |
| 306 return; | 308 return; |
| 307 | 309 |
| 308 uint64 surface_handle = params.surface_handle; | 310 uint64 surface_handle = params.surface_handle; |
| 309 TransportDIB::Handle shm_handle = TransportDIB::DefaultHandleValue(); | 311 TransportDIB::Handle shm_handle = TransportDIB::DefaultHandleValue(); |
| 310 | 312 |
| 311 view->AcceleratedSurfaceNew( | 313 view->AcceleratedSurfaceNew( |
| 312 params.width, params.height, &surface_handle, &shm_handle); | 314 params.width, params.height, &surface_handle, &shm_handle, |
| 315 params.route_id, host_id_); |
| 313 delayed_send.Cancel(); | 316 delayed_send.Cancel(); |
| 314 Send(new AcceleratedSurfaceMsg_NewACK( | 317 Send(new AcceleratedSurfaceMsg_NewACK( |
| 315 params.route_id, surface_handle, shm_handle)); | 318 params.route_id, surface_handle, shm_handle)); |
| 316 } | 319 } |
| 317 | 320 |
| 318 #endif | 321 #endif |
| 319 | 322 |
| 320 static base::TimeDelta GetSwapDelay() { | 323 static base::TimeDelta GetSwapDelay() { |
| 321 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 324 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 322 int delay = 0; | 325 int delay = 0; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 | 390 |
| 388 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( | 391 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( |
| 389 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { | 392 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { |
| 390 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( | 393 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( |
| 391 params.surface_id); | 394 params.surface_id); |
| 392 if (!view) | 395 if (!view) |
| 393 return; | 396 return; |
| 394 view->AcceleratedSurfaceRelease(params.identifier); | 397 view->AcceleratedSurfaceRelease(params.identifier); |
| 395 } | 398 } |
| 396 | 399 |
| 400 void GpuProcessHostUIShim::OnAcceleratedSurfaceRequestReleaseFront( |
| 401 const GpuHostMsg_AcceleratedSurfaceRequestReleaseFront_Params& params) { |
| 402 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( |
| 403 params.surface_id); |
| 404 if (!view) |
| 405 return; |
| 406 view->AcceleratedSurfaceRequestReleaseFront(params.identifier, |
| 407 params.request_id, |
| 408 params.retry_count, |
| 409 params.route_id, |
| 410 host_id_); |
| 411 } |
| 412 |
| 397 #endif | 413 #endif |
| OLD | NEW |