| 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_manager.h" | 10 #include "content/common/gpu/gpu_memory_manager.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 } | 165 } |
| 166 | 166 |
| 167 void GpuChannelManager::OnCreateViewCommandBuffer( | 167 void GpuChannelManager::OnCreateViewCommandBuffer( |
| 168 const gfx::GLSurfaceHandle& window, | 168 const gfx::GLSurfaceHandle& window, |
| 169 int32 surface_id, | 169 int32 surface_id, |
| 170 int32 client_id, | 170 int32 client_id, |
| 171 const GPUCreateCommandBufferConfig& init_params, | 171 const GPUCreateCommandBufferConfig& init_params, |
| 172 int32 route_id) { | 172 int32 route_id) { |
| 173 DCHECK(surface_id); | 173 DCHECK(surface_id); |
| 174 bool succeeded = false; | 174 CreateCommandBufferResult result = CREATE_COMMAND_BUFFER_FAILED; |
| 175 | 175 |
| 176 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); | 176 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); |
| 177 if (iter != gpu_channels_.end()) { | 177 if (iter != gpu_channels_.end()) { |
| 178 succeeded = iter->second->CreateViewCommandBuffer( | 178 result = iter->second->CreateViewCommandBuffer( |
| 179 window, surface_id, init_params, route_id); | 179 window, surface_id, init_params, route_id); |
| 180 } | 180 } |
| 181 | 181 |
| 182 Send(new GpuHostMsg_CommandBufferCreated(succeeded)); | 182 Send(new GpuHostMsg_CommandBufferCreated(result)); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void GpuChannelManager::CreateImage( | 185 void GpuChannelManager::CreateImage( |
| 186 gfx::PluginWindowHandle window, int32 client_id, int32 image_id) { | 186 gfx::PluginWindowHandle window, int32 client_id, int32 image_id) { |
| 187 gfx::Size size; | 187 gfx::Size size; |
| 188 | 188 |
| 189 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); | 189 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); |
| 190 if (iter != gpu_channels_.end()) { | 190 if (iter != gpu_channels_.end()) { |
| 191 iter->second->CreateImage(window, image_id, &size); | 191 iter->second->CreateImage(window, image_id, &size); |
| 192 } | 192 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 311 |
| 312 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { | 312 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { |
| 313 if (!default_offscreen_surface_.get()) { | 313 if (!default_offscreen_surface_.get()) { |
| 314 default_offscreen_surface_ = | 314 default_offscreen_surface_ = |
| 315 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); | 315 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); |
| 316 } | 316 } |
| 317 return default_offscreen_surface_.get(); | 317 return default_offscreen_surface_.get(); |
| 318 } | 318 } |
| 319 | 319 |
| 320 } // namespace content | 320 } // namespace content |
| OLD | NEW |