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/child/child_thread.h" | 9 #include "content/child/child_thread.h" |
10 #include "content/common/gpu/gpu_channel.h" | 10 #include "content/common/gpu/gpu_channel.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 GpuChannelManager::GpuChannelManager(ChildThread* gpu_child_thread, | 32 GpuChannelManager::GpuChannelManager(ChildThread* gpu_child_thread, |
33 GpuWatchdog* watchdog, | 33 GpuWatchdog* watchdog, |
34 base::MessageLoopProxy* io_message_loop, | 34 base::MessageLoopProxy* io_message_loop, |
35 base::WaitableEvent* shutdown_event) | 35 base::WaitableEvent* shutdown_event) |
36 : weak_factory_(this), | 36 : weak_factory_(this), |
37 io_message_loop_(io_message_loop), | 37 io_message_loop_(io_message_loop), |
38 shutdown_event_(shutdown_event), | 38 shutdown_event_(shutdown_event), |
39 gpu_child_thread_(gpu_child_thread), | 39 gpu_child_thread_(gpu_child_thread), |
40 gpu_memory_manager_( | 40 gpu_memory_manager_( |
41 this, GpuMemoryManager::kDefaultMaxSurfacesWithFrontbufferSoftLimit), | 41 this, |
| 42 GpuMemoryManager::kDefaultMaxSurfacesWithFrontbufferSoftLimit), |
42 watchdog_(watchdog), | 43 watchdog_(watchdog), |
43 sync_point_manager_(new SyncPointManager), | 44 sync_point_manager_(new SyncPointManager) { |
44 program_cache_(NULL) { | |
45 DCHECK(gpu_child_thread); | 45 DCHECK(gpu_child_thread); |
46 DCHECK(io_message_loop); | 46 DCHECK(io_message_loop); |
47 DCHECK(shutdown_event); | 47 DCHECK(shutdown_event); |
48 } | 48 } |
49 | 49 |
50 GpuChannelManager::~GpuChannelManager() { | 50 GpuChannelManager::~GpuChannelManager() { |
51 gpu_channels_.clear(); | 51 gpu_channels_.clear(); |
52 if (default_offscreen_surface_.get()) { | 52 if (default_offscreen_surface_.get()) { |
53 default_offscreen_surface_->Destroy(); | 53 default_offscreen_surface_->Destroy(); |
54 default_offscreen_surface_ = NULL; | 54 default_offscreen_surface_ = NULL; |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 290 |
291 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { | 291 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { |
292 if (!default_offscreen_surface_.get()) { | 292 if (!default_offscreen_surface_.get()) { |
293 default_offscreen_surface_ = | 293 default_offscreen_surface_ = |
294 gfx::GLSurface::CreateOffscreenGLSurface(false, gfx::Size(1, 1)); | 294 gfx::GLSurface::CreateOffscreenGLSurface(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 |