Chromium Code Reviews| Index: content/common/gpu/gpu_channel_manager.cc |
| diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc |
| index 0359393f1ae0f1075585f4c21ffdf04b4248641a..42df9046f6ebf6dd8720f3721a6c9e060268bfc8 100644 |
| --- a/content/common/gpu/gpu_channel_manager.cc |
| +++ b/content/common/gpu/gpu_channel_manager.cc |
| @@ -107,7 +107,7 @@ void GpuChannelManager::RemoveRoute(int32 routing_id) { |
| router_.RemoveRoute(routing_id); |
| } |
| -GpuChannel* GpuChannelManager::LookupChannel(int32 client_id) { |
| +GpuChannel* GpuChannelManager::LookupChannel(int32 client_id) const { |
| const auto& it = gpu_channels_.find(client_id); |
| return it != gpu_channels_.end() ? it->second : nullptr; |
| } |
| @@ -251,7 +251,17 @@ void GpuChannelManager::OnLoadedShader(std::string program_proto) { |
| program_cache()->LoadProgram(program_proto); |
| } |
| -uint32_t GpuChannelManager::ProcessedOrderNumber() { |
| +uint32_t GpuChannelManager::GetNextUnprocessedOrderNum() { |
| + base::AutoLock lock(order_num_lock_); |
|
David Yen
2015/09/10 22:42:06
Is the new scheduler also going to use this? Seems
sunnyps
2015/09/10 23:38:36
On second thought I'm keeping this as is for now -
David Yen
2015/09/11 16:47:20
per your comment yesterday, I think you are right.
|
| + return ++unprocessed_order_num_; |
| +} |
| + |
| +uint32_t GpuChannelManager::GetCurrentUnprocessedOrderNum() const { |
| + base::AutoLock lock(order_num_lock_); |
| + return unprocessed_order_num_; |
| +} |
| + |
| +uint32_t GpuChannelManager::GetProcessedOrderNum() const { |
| uint32_t processed_order_num = 0; |
| for (auto& kv : gpu_channels_) { |
| processed_order_num = |
| @@ -260,15 +270,6 @@ uint32_t GpuChannelManager::ProcessedOrderNumber() { |
| return processed_order_num; |
| } |
| -uint32_t GpuChannelManager::UnprocessedOrderNumber() { |
| - uint32_t unprocessed_order_num = 0; |
| - for (auto& kv : gpu_channels_) { |
| - unprocessed_order_num = |
| - std::max(unprocessed_order_num, kv.second->GetUnprocessedOrderNum()); |
| - } |
| - return unprocessed_order_num; |
| -} |
| - |
| void GpuChannelManager::LoseAllContexts() { |
| for (auto& kv : gpu_channels_) { |
| kv.second->MarkAllContextsLost(); |