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 "gpu/ipc/service/gpu_channel_manager.h" | 5 #include "gpu/ipc/service/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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 GpuChannelManager::GpuChannelManager( | 46 GpuChannelManager::GpuChannelManager( |
47 const GpuPreferences& gpu_preferences, | 47 const GpuPreferences& gpu_preferences, |
48 GpuChannelManagerDelegate* delegate, | 48 GpuChannelManagerDelegate* delegate, |
49 GpuWatchdogThread* watchdog, | 49 GpuWatchdogThread* watchdog, |
50 base::SingleThreadTaskRunner* task_runner, | 50 base::SingleThreadTaskRunner* task_runner, |
51 base::SingleThreadTaskRunner* io_task_runner, | 51 base::SingleThreadTaskRunner* io_task_runner, |
52 base::WaitableEvent* shutdown_event, | 52 base::WaitableEvent* shutdown_event, |
53 SyncPointManager* sync_point_manager, | 53 SyncPointManager* sync_point_manager, |
54 GpuMemoryBufferFactory* gpu_memory_buffer_factory) | 54 GpuMemoryBufferFactory* gpu_memory_buffer_factory, |
| 55 const GpuFeatureInfo& gpu_feature_info) |
55 : task_runner_(task_runner), | 56 : task_runner_(task_runner), |
56 io_task_runner_(io_task_runner), | 57 io_task_runner_(io_task_runner), |
57 gpu_preferences_(gpu_preferences), | 58 gpu_preferences_(gpu_preferences), |
58 gpu_driver_bug_workarounds_(base::CommandLine::ForCurrentProcess()), | 59 gpu_driver_bug_workarounds_(base::CommandLine::ForCurrentProcess()), |
59 delegate_(delegate), | 60 delegate_(delegate), |
60 watchdog_(watchdog), | 61 watchdog_(watchdog), |
61 shutdown_event_(shutdown_event), | 62 shutdown_event_(shutdown_event), |
62 share_group_(new gl::GLShareGroup()), | 63 share_group_(new gl::GLShareGroup()), |
63 mailbox_manager_(gles2::MailboxManager::Create(gpu_preferences)), | 64 mailbox_manager_(gles2::MailboxManager::Create(gpu_preferences)), |
64 gpu_memory_manager_(this), | 65 gpu_memory_manager_(this), |
65 sync_point_manager_(sync_point_manager), | 66 sync_point_manager_(sync_point_manager), |
66 sync_point_client_waiter_( | 67 sync_point_client_waiter_( |
67 sync_point_manager->CreateSyncPointClientWaiter()), | 68 sync_point_manager->CreateSyncPointClientWaiter()), |
68 gpu_memory_buffer_factory_(gpu_memory_buffer_factory), | 69 gpu_memory_buffer_factory_(gpu_memory_buffer_factory), |
| 70 gpu_feature_info_(gpu_feature_info), |
69 exiting_for_lost_context_(false), | 71 exiting_for_lost_context_(false), |
70 weak_factory_(this) { | 72 weak_factory_(this) { |
71 DCHECK(task_runner); | 73 DCHECK(task_runner); |
72 DCHECK(io_task_runner); | 74 DCHECK(io_task_runner); |
73 if (gpu_preferences_.ui_prioritize_in_gpu_process) | 75 if (gpu_preferences_.ui_prioritize_in_gpu_process) |
74 preemption_flag_ = new PreemptionFlag; | 76 preemption_flag_ = new PreemptionFlag; |
75 } | 77 } |
76 | 78 |
77 GpuChannelManager::~GpuChannelManager() { | 79 GpuChannelManager::~GpuChannelManager() { |
78 // Destroy channels before anything else because of dependencies. | 80 // Destroy channels before anything else because of dependencies. |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 287 } |
286 } | 288 } |
287 if (!stub || !stub->decoder()->MakeCurrent()) | 289 if (!stub || !stub->decoder()->MakeCurrent()) |
288 return; | 290 return; |
289 glFinish(); | 291 glFinish(); |
290 DidAccessGpu(); | 292 DidAccessGpu(); |
291 } | 293 } |
292 #endif | 294 #endif |
293 | 295 |
294 } // namespace gpu | 296 } // namespace gpu |
OLD | NEW |