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_AcceleratedSurfaceSuggestDiscard, |
| 220 OnAcceleratedSurfaceSuggestDiscard) |
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 | 389 |
388 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( | 390 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( |
389 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { | 391 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { |
390 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( | 392 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( |
391 params.surface_id); | 393 params.surface_id); |
392 if (!view) | 394 if (!view) |
393 return; | 395 return; |
394 view->AcceleratedSurfaceRelease(params.identifier); | 396 view->AcceleratedSurfaceRelease(params.identifier); |
395 } | 397 } |
396 | 398 |
| 399 void GpuProcessHostUIShim::OnAcceleratedSurfaceSuggestDiscard( |
| 400 const GpuHostMsg_AcceleratedSurfaceSuggestDiscard_Params& params) { |
| 401 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( |
| 402 params.surface_id); |
| 403 if (!view) |
| 404 return; |
| 405 view->AcceleratedSurfaceSuggestDiscard(params.identifier, |
| 406 params.route_id, |
| 407 host_id_); |
| 408 } |
| 409 |
397 #endif | 410 #endif |
OLD | NEW |