| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 void GpuChannelManager::OnCreateViewCommandBuffer( | 174 void GpuChannelManager::OnCreateViewCommandBuffer( |
| 175 const gfx::GLSurfaceHandle& window, | 175 const gfx::GLSurfaceHandle& window, |
| 176 int32 surface_id, | 176 int32 surface_id, |
| 177 int32 client_id, | 177 int32 client_id, |
| 178 const GPUCreateCommandBufferConfig& init_params, | 178 const GPUCreateCommandBufferConfig& init_params, |
| 179 int32 route_id) { | 179 int32 route_id) { |
| 180 DCHECK(surface_id); | 180 DCHECK(surface_id); |
| 181 bool succeeded = false; | 181 CreateCommandBufferResult result = CREATE_COMMAND_BUFFER_FAILED; |
| 182 | 182 |
| 183 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); | 183 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); |
| 184 if (iter != gpu_channels_.end()) { | 184 if (iter != gpu_channels_.end()) { |
| 185 succeeded = iter->second->CreateViewCommandBuffer( | 185 result = iter->second->CreateViewCommandBuffer( |
| 186 window, surface_id, init_params, route_id); | 186 window, surface_id, init_params, route_id); |
| 187 } | 187 } |
| 188 | 188 |
| 189 Send(new GpuHostMsg_CommandBufferCreated(succeeded)); | 189 Send(new GpuHostMsg_CommandBufferCreated(result)); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void GpuChannelManager::CreateImage( | 192 void GpuChannelManager::CreateImage( |
| 193 gfx::PluginWindowHandle window, int32 client_id, int32 image_id) { | 193 gfx::PluginWindowHandle window, int32 client_id, int32 image_id) { |
| 194 gfx::Size size; | 194 gfx::Size size; |
| 195 | 195 |
| 196 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); | 196 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); |
| 197 if (iter != gpu_channels_.end()) { | 197 if (iter != gpu_channels_.end()) { |
| 198 iter->second->CreateImage(window, image_id, &size); | 198 iter->second->CreateImage(window, image_id, &size); |
| 199 } | 199 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 318 |
| 319 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { | 319 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { |
| 320 if (!default_offscreen_surface_.get()) { | 320 if (!default_offscreen_surface_.get()) { |
| 321 default_offscreen_surface_ = | 321 default_offscreen_surface_ = |
| 322 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); | 322 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); |
| 323 } | 323 } |
| 324 return default_offscreen_surface_.get(); | 324 return default_offscreen_surface_.get(); |
| 325 } | 325 } |
| 326 | 326 |
| 327 } // namespace content | 327 } // namespace content |
| OLD | NEW |