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 <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 if (it->second->channel_id() == channel_handle.name) { | 192 if (it->second->channel_id() == channel_handle.name) { |
193 gpu_channels_.erase(it); | 193 gpu_channels_.erase(it); |
194 return; | 194 return; |
195 } | 195 } |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 void GpuChannelManager::OnCreateViewCommandBuffer( | 199 void GpuChannelManager::OnCreateViewCommandBuffer( |
200 const gfx::GLSurfaceHandle& window, | 200 const gfx::GLSurfaceHandle& window, |
201 int32_t client_id, | 201 int32_t client_id, |
202 const GPUCreateCommandBufferConfig& init_params, | 202 const GpuCreateCommandBufferConfig& init_params, |
203 int32_t route_id) { | 203 int32_t route_id) { |
204 CreateCommandBufferResult result = CREATE_COMMAND_BUFFER_FAILED; | 204 CreateCommandBufferResult result = CREATE_COMMAND_BUFFER_FAILED; |
205 | 205 |
206 auto it = gpu_channels_.find(client_id); | 206 auto it = gpu_channels_.find(client_id); |
207 if (it != gpu_channels_.end()) { | 207 if (it != gpu_channels_.end()) { |
208 result = it->second->CreateViewCommandBuffer(window, init_params, route_id); | 208 result = it->second->CreateViewCommandBuffer(window, init_params, route_id); |
209 } | 209 } |
210 | 210 |
211 Send(new GpuHostMsg_CommandBufferCreated(result)); | 211 Send(new GpuHostMsg_CommandBufferCreated(result)); |
212 } | 212 } |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 } | 340 } |
341 } | 341 } |
342 if (!stub || !stub->decoder()->MakeCurrent()) | 342 if (!stub || !stub->decoder()->MakeCurrent()) |
343 return; | 343 return; |
344 glFinish(); | 344 glFinish(); |
345 DidAccessGpu(); | 345 DidAccessGpu(); |
346 } | 346 } |
347 #endif | 347 #endif |
348 | 348 |
349 } // namespace content | 349 } // namespace content |
OLD | NEW |