| 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/common/gpu/gpu_channel_manager.h" | 5 #include "content/common/gpu/gpu_channel_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 #include "content/common/gpu/gpu_memory_buffer_factory.h" | 10 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 IPC_BEGIN_MESSAGE_MAP(GpuChannelManagerMessageFilter, message) | 52 IPC_BEGIN_MESSAGE_MAP(GpuChannelManagerMessageFilter, message) |
| 53 IPC_MESSAGE_HANDLER(GpuMsg_CreateGpuMemoryBuffer, OnCreateGpuMemoryBuffer) | 53 IPC_MESSAGE_HANDLER(GpuMsg_CreateGpuMemoryBuffer, OnCreateGpuMemoryBuffer) |
| 54 IPC_MESSAGE_UNHANDLED(handled = false) | 54 IPC_MESSAGE_UNHANDLED(handled = false) |
| 55 IPC_END_MESSAGE_MAP() | 55 IPC_END_MESSAGE_MAP() |
| 56 return handled; | 56 return handled; |
| 57 } | 57 } |
| 58 | 58 |
| 59 protected: | 59 protected: |
| 60 ~GpuChannelManagerMessageFilter() override {} | 60 ~GpuChannelManagerMessageFilter() override {} |
| 61 | 61 |
| 62 // The UI thread in the browser compositor must remain fast at all times. |
| 63 // Bouncing off only GPU IO is the way to ensure that. |
| 62 void OnCreateGpuMemoryBuffer( | 64 void OnCreateGpuMemoryBuffer( |
| 63 const GpuMsg_CreateGpuMemoryBuffer_Params& params) { | 65 const GpuMsg_CreateGpuMemoryBuffer_Params& params) { |
| 64 TRACE_EVENT2("gpu", | 66 TRACE_EVENT2("gpu", |
| 65 "GpuChannelManagerMessageFilter::OnCreateGpuMemoryBuffer", | 67 "GpuChannelManagerMessageFilter::OnCreateGpuMemoryBuffer", |
| 66 "id", params.id, "client_id", params.client_id); | 68 "id", params.id, "client_id", params.client_id); |
| 67 sender_->Send(new GpuHostMsg_GpuMemoryBufferCreated( | 69 sender_->Send(new GpuHostMsg_GpuMemoryBufferCreated( |
| 68 gpu_memory_buffer_factory_->CreateGpuMemoryBuffer( | 70 gpu_memory_buffer_factory_->CreateGpuMemoryBuffer( |
| 69 params.id, params.size, params.format, params.usage, | 71 params.id, params.size, params.format, params.usage, |
| 70 params.client_id, params.surface_handle))); | 72 params.client_id, params.surface_handle))); |
| 71 } | 73 } |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 OnResourcesRelinquished(); | 365 OnResourcesRelinquished(); |
| 364 #endif | 366 #endif |
| 365 } | 367 } |
| 366 } | 368 } |
| 367 | 369 |
| 368 void GpuChannelManager::OnResourcesRelinquished() { | 370 void GpuChannelManager::OnResourcesRelinquished() { |
| 369 Send(new GpuHostMsg_ResourcesRelinquished()); | 371 Send(new GpuHostMsg_ResourcesRelinquished()); |
| 370 } | 372 } |
| 371 | 373 |
| 372 } // namespace content | 374 } // namespace content |
| OLD | NEW |