| 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 "content/common/child_thread.h" | 8 #include "content/common/child_thread.h" |
| 9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 #include "content/common/gpu/gpu_messages.h" | 10 #include "content/common/gpu/gpu_messages.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 iter != gpu_channels_.end(); ++iter) { | 109 iter != gpu_channels_.end(); ++iter) { |
| 110 if (iter->second->GetChannelName() == channel_handle.name) { | 110 if (iter->second->GetChannelName() == channel_handle.name) { |
| 111 gpu_channels_.erase(iter); | 111 gpu_channels_.erase(iter); |
| 112 return; | 112 return; |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 void GpuChannelManager::OnCreateViewCommandBuffer( | 117 void GpuChannelManager::OnCreateViewCommandBuffer( |
| 118 gfx::PluginWindowHandle window, | 118 gfx::PluginWindowHandle window, |
| 119 int32 render_view_id, | 119 int32 surface_id, |
| 120 int32 client_id, | 120 int32 client_id, |
| 121 const GPUCreateCommandBufferConfig& init_params) { | 121 const GPUCreateCommandBufferConfig& init_params) { |
| 122 DCHECK(render_view_id); | 122 DCHECK(surface_id); |
| 123 int32 route_id = MSG_ROUTING_NONE; | 123 int32 route_id = MSG_ROUTING_NONE; |
| 124 | 124 |
| 125 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); | 125 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); |
| 126 if (iter != gpu_channels_.end()) { | 126 if (iter != gpu_channels_.end()) { |
| 127 iter->second->CreateViewCommandBuffer( | 127 iter->second->CreateViewCommandBuffer( |
| 128 window, render_view_id, init_params, &route_id); | 128 window, surface_id, init_params, &route_id); |
| 129 } | 129 } |
| 130 | 130 |
| 131 Send(new GpuHostMsg_CommandBufferCreated(route_id)); | 131 Send(new GpuHostMsg_CommandBufferCreated(route_id)); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void GpuChannelManager::LoseAllContexts() { | 134 void GpuChannelManager::LoseAllContexts() { |
| 135 MessageLoop::current()->PostTask( | 135 MessageLoop::current()->PostTask( |
| 136 FROM_HERE, | 136 FROM_HERE, |
| 137 base::Bind(&GpuChannelManager::OnLoseAllContexts, | 137 base::Bind(&GpuChannelManager::OnLoseAllContexts, |
| 138 weak_factory_.GetWeakPtr())); | 138 weak_factory_.GetWeakPtr())); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void GpuChannelManager::OnLoseAllContexts() { | 141 void GpuChannelManager::OnLoseAllContexts() { |
| 142 gpu_channels_.clear(); | 142 gpu_channels_.clear(); |
| 143 } | 143 } |
| OLD | NEW |