| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 DCHECK(CalledOnValidThread()); | 180 DCHECK(CalledOnValidThread()); |
| 181 | 181 |
| 182 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) | 182 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) |
| 183 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, | 183 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, |
| 184 OnLogMessage) | 184 OnLogMessage) |
| 185 | 185 |
| 186 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, | 186 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, |
| 187 OnAcceleratedSurfaceBuffersSwapped) | 187 OnAcceleratedSurfaceBuffersSwapped) |
| 188 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfacePostSubBuffer, | 188 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfacePostSubBuffer, |
| 189 OnAcceleratedSurfacePostSubBuffer) | 189 OnAcceleratedSurfacePostSubBuffer) |
| 190 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSuspend, |
| 191 OnAcceleratedSurfaceSuspend) |
| 190 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, | 192 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, |
| 191 OnGraphicsInfoCollected) | 193 OnGraphicsInfoCollected) |
| 192 | 194 |
| 193 #if defined(TOOLKIT_USES_GTK) || defined(OS_WIN) | 195 #if defined(TOOLKIT_USES_GTK) || defined(OS_WIN) |
| 194 IPC_MESSAGE_HANDLER(GpuHostMsg_ResizeView, OnResizeView) | 196 IPC_MESSAGE_HANDLER(GpuHostMsg_ResizeView, OnResizeView) |
| 195 #endif | 197 #endif |
| 196 | 198 |
| 197 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 199 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
| 198 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceNew, | 200 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceNew, |
| 199 OnAcceleratedSurfaceNew) | 201 OnAcceleratedSurfaceNew) |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 params.surface_id); | 366 params.surface_id); |
| 365 if (!view) | 367 if (!view) |
| 366 return; | 368 return; |
| 367 | 369 |
| 368 delayed_send.Cancel(); | 370 delayed_send.Cancel(); |
| 369 | 371 |
| 370 // View must send ACK message after next composite. | 372 // View must send ACK message after next composite. |
| 371 view->AcceleratedSurfacePostSubBuffer(params, host_id_); | 373 view->AcceleratedSurfacePostSubBuffer(params, host_id_); |
| 372 } | 374 } |
| 373 | 375 |
| 376 void GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend(int32 surface_id) { |
| 377 TRACE_EVENT0("renderer", |
| 378 "GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend"); |
| 379 |
| 380 RenderWidgetHostView* view = GetRenderWidgetHostViewFromSurfaceID(surface_id); |
| 381 if (!view) |
| 382 return; |
| 383 |
| 384 view->AcceleratedSurfaceSuspend(); |
| 385 } |
| 386 |
| 374 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 387 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
| 375 | 388 |
| 376 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( | 389 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( |
| 377 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { | 390 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { |
| 378 RenderWidgetHostView* view = GetRenderWidgetHostViewFromSurfaceID( | 391 RenderWidgetHostView* view = GetRenderWidgetHostViewFromSurfaceID( |
| 379 params.surface_id); | 392 params.surface_id); |
| 380 if (!view) | 393 if (!view) |
| 381 return; | 394 return; |
| 382 view->AcceleratedSurfaceRelease(params.identifier); | 395 view->AcceleratedSurfaceRelease(params.identifier); |
| 383 } | 396 } |
| 384 | 397 |
| 385 #endif | 398 #endif |
| OLD | NEW |