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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 GpuChannel* GpuChannelManager::LookupChannel(int32_t client_id) const { | 125 GpuChannel* GpuChannelManager::LookupChannel(int32_t client_id) const { |
126 const auto& it = gpu_channels_.find(client_id); | 126 const auto& it = gpu_channels_.find(client_id); |
127 return it != gpu_channels_.end() ? it->second.get() : nullptr; | 127 return it != gpu_channels_.end() ? it->second.get() : nullptr; |
128 } | 128 } |
129 | 129 |
130 GpuChannel* GpuChannelManager::EstablishChannel(int client_id, | 130 GpuChannel* GpuChannelManager::EstablishChannel(int client_id, |
131 uint64_t client_tracing_id, | 131 uint64_t client_tracing_id, |
132 bool is_gpu_host) { | 132 bool is_gpu_host) { |
133 std::unique_ptr<GpuChannel> gpu_channel = base::MakeUnique<GpuChannel>( | 133 std::unique_ptr<GpuChannel> gpu_channel = base::MakeUnique<GpuChannel>( |
134 this, scheduler_, sync_point_manager_, watchdog_, share_group_, | 134 this, scheduler_, sync_point_manager_, watchdog_, share_group_, |
135 mailbox_manager_, is_gpu_host ? preemption_flag_ : nullptr, | 135 mailbox_manager_, &discardable_manager_, |
| 136 is_gpu_host ? preemption_flag_ : nullptr, |
136 is_gpu_host ? nullptr : preemption_flag_, task_runner_, io_task_runner_, | 137 is_gpu_host ? nullptr : preemption_flag_, task_runner_, io_task_runner_, |
137 client_id, client_tracing_id, is_gpu_host); | 138 client_id, client_tracing_id, is_gpu_host); |
138 | 139 |
139 GpuChannel* gpu_channel_ptr = gpu_channel.get(); | 140 GpuChannel* gpu_channel_ptr = gpu_channel.get(); |
140 gpu_channels_[client_id] = std::move(gpu_channel); | 141 gpu_channels_[client_id] = std::move(gpu_channel); |
141 return gpu_channel_ptr; | 142 return gpu_channel_ptr; |
142 } | 143 } |
143 | 144 |
144 void GpuChannelManager::InternalDestroyGpuMemoryBuffer( | 145 void GpuChannelManager::InternalDestroyGpuMemoryBuffer( |
145 gfx::GpuMemoryBufferId id, | 146 gfx::GpuMemoryBufferId id, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 } | 247 } |
247 } | 248 } |
248 if (!stub || !stub->decoder()->MakeCurrent()) | 249 if (!stub || !stub->decoder()->MakeCurrent()) |
249 return; | 250 return; |
250 glFinish(); | 251 glFinish(); |
251 DidAccessGpu(); | 252 DidAccessGpu(); |
252 } | 253 } |
253 #endif | 254 #endif |
254 | 255 |
255 } // namespace gpu | 256 } // namespace gpu |
OLD | NEW |