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/child_thread.h" | 9 #include "content/common/child_thread.h" |
10 #include "content/common/gpu/gpu_channel.h" | 10 #include "content/common/gpu/gpu_channel.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 uint64 messages_processed = 0; | 271 uint64 messages_processed = 0; |
272 | 272 |
273 for (GpuChannelMap::iterator iter = gpu_channels_.begin(); | 273 for (GpuChannelMap::iterator iter = gpu_channels_.begin(); |
274 iter != gpu_channels_.end(); ++iter) { | 274 iter != gpu_channels_.end(); ++iter) { |
275 messages_processed += iter->second->messages_processed(); | 275 messages_processed += iter->second->messages_processed(); |
276 } | 276 } |
277 return messages_processed; | 277 return messages_processed; |
278 } | 278 } |
279 | 279 |
280 void GpuChannelManager::LoseAllContexts() { | 280 void GpuChannelManager::LoseAllContexts() { |
281 MessageLoop::current()->PostTask( | 281 base::MessageLoop::current()->PostTask( |
282 FROM_HERE, | 282 FROM_HERE, |
283 base::Bind(&GpuChannelManager::OnLoseAllContexts, | 283 base::Bind(&GpuChannelManager::OnLoseAllContexts, |
284 weak_factory_.GetWeakPtr())); | 284 weak_factory_.GetWeakPtr())); |
285 } | 285 } |
286 | 286 |
287 void GpuChannelManager::OnLoseAllContexts() { | 287 void GpuChannelManager::OnLoseAllContexts() { |
288 gpu_channels_.clear(); | 288 gpu_channels_.clear(); |
289 } | 289 } |
290 | 290 |
291 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { | 291 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { |
292 if (!default_offscreen_surface_) { | 292 if (!default_offscreen_surface_) { |
293 default_offscreen_surface_ = gfx::GLSurface::CreateOffscreenGLSurface( | 293 default_offscreen_surface_ = gfx::GLSurface::CreateOffscreenGLSurface( |
294 false, gfx::Size(1, 1)); | 294 false, gfx::Size(1, 1)); |
295 } | 295 } |
296 return default_offscreen_surface_.get(); | 296 return default_offscreen_surface_.get(); |
297 } | 297 } |
298 | 298 |
299 } // namespace content | 299 } // namespace content |
OLD | NEW |