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

Side by Side Diff: content/browser/gpu/gpu_process_host.cc

Issue 2056833002: WIP HW (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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
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 "content/browser/gpu/gpu_process_host.h" 5 #include "content/browser/gpu/gpu_process_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 #endif 78 #endif
79 79
80 #if defined(USE_X11) && !defined(OS_CHROMEOS) 80 #if defined(USE_X11) && !defined(OS_CHROMEOS)
81 #include "ui/gfx/x/x11_switches.h" // nogncheck 81 #include "ui/gfx/x/x11_switches.h" // nogncheck
82 #endif 82 #endif
83 83
84 #if defined(OS_MACOSX) || defined(OS_ANDROID) 84 #if defined(OS_MACOSX) || defined(OS_ANDROID)
85 #include "content/browser/gpu/gpu_surface_tracker.h" 85 #include "content/browser/gpu/gpu_surface_tracker.h"
86 #endif 86 #endif
87 87
88 #if defined(MOJO_SHELL_CLIENT)
89 #include "services/shell/runner/common/client_util.h"
90 #endif
91
88 namespace content { 92 namespace content {
89 93
90 bool GpuProcessHost::gpu_enabled_ = true; 94 bool GpuProcessHost::gpu_enabled_ = true;
91 bool GpuProcessHost::hardware_gpu_enabled_ = true; 95 bool GpuProcessHost::hardware_gpu_enabled_ = true;
92 int GpuProcessHost::gpu_crash_count_ = 0; 96 int GpuProcessHost::gpu_crash_count_ = 0;
93 int GpuProcessHost::gpu_recent_crash_count_ = 0; 97 int GpuProcessHost::gpu_recent_crash_count_ = 0;
94 bool GpuProcessHost::crashed_before_ = false; 98 bool GpuProcessHost::crashed_before_ = false;
95 int GpuProcessHost::swiftshader_crash_count_ = 0; 99 int GpuProcessHost::swiftshader_crash_count_ = 0;
96 100
97 namespace { 101 namespace {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 return true; 304 return true;
301 } 305 }
302 306
303 host->ForceShutdown(); 307 host->ForceShutdown();
304 return false; 308 return false;
305 } 309 }
306 310
307 // static 311 // static
308 GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind, 312 GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind,
309 CauseForGpuLaunch cause) { 313 CauseForGpuLaunch cause) {
314 #if defined(MOJO_SHELL_CLIENT)
315 DCHECK(!shell::ShellIsRemote());
316 #endif
310 DCHECK_CURRENTLY_ON(BrowserThread::IO); 317 DCHECK_CURRENTLY_ON(BrowserThread::IO);
311 318
312 // Don't grant further access to GPU if it is not allowed. 319 // Don't grant further access to GPU if it is not allowed.
313 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); 320 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
314 DCHECK(gpu_data_manager); 321 DCHECK(gpu_data_manager);
315 if (!gpu_data_manager->GpuAccessAllowed(NULL)) 322 if (!gpu_data_manager->GpuAccessAllowed(NULL))
316 return NULL; 323 return NULL;
317 324
318 if (g_gpu_process_hosts[kind] && ValidateHost(g_gpu_process_hosts[kind])) 325 if (g_gpu_process_hosts[kind] && ValidateHost(g_gpu_process_hosts[kind]))
319 return g_gpu_process_hosts[kind]; 326 return g_gpu_process_hosts[kind];
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1198 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1192 ClientIdToShaderCacheMap::iterator iter = 1199 ClientIdToShaderCacheMap::iterator iter =
1193 client_id_to_shader_cache_.find(client_id); 1200 client_id_to_shader_cache_.find(client_id);
1194 // If the cache doesn't exist then this is an off the record profile. 1201 // If the cache doesn't exist then this is an off the record profile.
1195 if (iter == client_id_to_shader_cache_.end()) 1202 if (iter == client_id_to_shader_cache_.end())
1196 return; 1203 return;
1197 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1204 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1198 } 1205 }
1199 1206
1200 } // namespace content 1207 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698