| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 const auto& it = gpu_channels_.find(client_id); | 120 const auto& it = gpu_channels_.find(client_id); |
| 121 return it != gpu_channels_.end() ? it->second : nullptr; | 121 return it != gpu_channels_.end() ? it->second : nullptr; |
| 122 } | 122 } |
| 123 | 123 |
| 124 std::unique_ptr<GpuChannel> GpuChannelManager::CreateGpuChannel( | 124 std::unique_ptr<GpuChannel> GpuChannelManager::CreateGpuChannel( |
| 125 int client_id, | 125 int client_id, |
| 126 uint64_t client_tracing_id, | 126 uint64_t client_tracing_id, |
| 127 bool preempts, | 127 bool preempts, |
| 128 bool allow_view_command_buffers, | 128 bool allow_view_command_buffers, |
| 129 bool allow_real_time_streams) { | 129 bool allow_real_time_streams) { |
| 130 return base::WrapUnique( | 130 return base::MakeUnique<GpuChannel>( |
| 131 new GpuChannel(this, sync_point_manager(), watchdog_, share_group(), | 131 this, sync_point_manager(), watchdog_, share_group(), mailbox_manager(), |
| 132 mailbox_manager(), preempts ? preemption_flag() : nullptr, | 132 preempts ? preemption_flag() : nullptr, |
| 133 preempts ? nullptr : preemption_flag(), task_runner_.get(), | 133 preempts ? nullptr : preemption_flag(), task_runner_.get(), |
| 134 io_task_runner_.get(), client_id, client_tracing_id, | 134 io_task_runner_.get(), client_id, client_tracing_id, |
| 135 allow_view_command_buffers, allow_real_time_streams)); | 135 allow_view_command_buffers, allow_real_time_streams); |
| 136 } | 136 } |
| 137 | 137 |
| 138 IPC::ChannelHandle GpuChannelManager::EstablishChannel( | 138 IPC::ChannelHandle GpuChannelManager::EstablishChannel( |
| 139 int client_id, | 139 int client_id, |
| 140 uint64_t client_tracing_id, | 140 uint64_t client_tracing_id, |
| 141 bool preempts, | 141 bool preempts, |
| 142 bool allow_view_command_buffers, | 142 bool allow_view_command_buffers, |
| 143 bool allow_real_time_streams) { | 143 bool allow_real_time_streams) { |
| 144 std::unique_ptr<GpuChannel> channel( | 144 std::unique_ptr<GpuChannel> channel( |
| 145 CreateGpuChannel(client_id, client_tracing_id, preempts, | 145 CreateGpuChannel(client_id, client_tracing_id, preempts, |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 if (!stub || !stub->decoder()->MakeCurrent()) | 283 if (!stub || !stub->decoder()->MakeCurrent()) |
| 284 return; | 284 return; |
| 285 glFinish(); | 285 glFinish(); |
| 286 DidAccessGpu(); | 286 DidAccessGpu(); |
| 287 } | 287 } |
| 288 #endif | 288 #endif |
| 289 | 289 |
| 290 } // namespace gpu | 290 } // namespace gpu |
| OLD | NEW |