Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: gpu/ipc/service/gpu_channel_manager.cc

Issue 2814583002: Service/ClientDiscardableManager (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/ipc/service/gpu_channel_manager.h ('k') | gpu/ipc/service/gpu_command_buffer_stub.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_channel_manager.h ('k') | gpu/ipc/service/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698