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 "content/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
249 return false; | 249 return false; |
250 } | 250 } |
251 | 251 |
252 // static | 252 // static |
253 GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind, | 253 GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind, |
254 content::CauseForGpuLaunch cause) { | 254 content::CauseForGpuLaunch cause) { |
255 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 255 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
256 | 256 |
257 // Don't grant further access to GPU if it is not allowed. | 257 // Don't grant further access to GPU if it is not allowed. |
258 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 258 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
259 if (gpu_data_manager != NULL && !gpu_data_manager->GpuAccessAllowed()) | 259 if (gpu_data_manager != NULL && |
260 gpu_data_manager->GetGpuFeatureType() == content::GPU_FEATURE_TYPE_ALL) | |
Zhenyao Mo
2012/07/30 17:03:19
I think you should also keep the original !GpuAcce
Alexander Potapenko
2012/07/31 09:17:55
Done.
| |
260 return NULL; | 261 return NULL; |
261 | 262 |
262 if (g_gpu_process_hosts[kind] && HostIsValid(g_gpu_process_hosts[kind])) | 263 if (g_gpu_process_hosts[kind] && HostIsValid(g_gpu_process_hosts[kind])) |
263 return g_gpu_process_hosts[kind]; | 264 return g_gpu_process_hosts[kind]; |
264 | 265 |
265 if (cause == content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH) | 266 if (cause == content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH) |
266 return NULL; | 267 return NULL; |
267 | 268 |
268 int host_id; | 269 int host_id; |
269 host_id = ++g_last_host_id; | 270 host_id = ++g_last_host_id; |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
860 const IPC::ChannelHandle& channel_handle, | 861 const IPC::ChannelHandle& channel_handle, |
861 base::ProcessHandle renderer_process_for_gpu, | 862 base::ProcessHandle renderer_process_for_gpu, |
862 const content::GPUInfo& gpu_info) { | 863 const content::GPUInfo& gpu_info) { |
863 callback.Run(channel_handle, gpu_info); | 864 callback.Run(channel_handle, gpu_info); |
864 } | 865 } |
865 | 866 |
866 void GpuProcessHost::CreateCommandBufferError( | 867 void GpuProcessHost::CreateCommandBufferError( |
867 const CreateCommandBufferCallback& callback, int32 route_id) { | 868 const CreateCommandBufferCallback& callback, int32 route_id) { |
868 callback.Run(route_id); | 869 callback.Run(route_id); |
869 } | 870 } |
OLD | NEW |