Commit 66731ee5 authored by zmo's avatar zmo Committed by Commit bot

Don't block GPU process access in single-process mode.

BUG=664488
TEST=content_unittests,gpu is enabled in win/NVidia
R=kbr@chromium.org,kkinnunen@nvidia.com

Review-Url: https://codereview.chromium.org/2569413002
Cr-Commit-Position: refs/heads/master@{#438612}
parent d5a5b2c6
...@@ -337,6 +337,9 @@ bool GpuDataManagerImplPrivate::GpuAccessAllowed( ...@@ -337,6 +337,9 @@ bool GpuDataManagerImplPrivate::GpuAccessAllowed(
return false; return false;
} }
if (in_process_gpu_)
return true;
if (card_blacklisted_) { if (card_blacklisted_) {
if (reason) { if (reason) {
*reason = "GPU access is disabled "; *reason = "GPU access is disabled ";
...@@ -600,8 +603,7 @@ void GpuDataManagerImplPrivate::Initialize() { ...@@ -600,8 +603,7 @@ void GpuDataManagerImplPrivate::Initialize() {
gpu_driver_bug_list_string, gpu_driver_bug_list_string,
gpu_info); gpu_info);
if (command_line->HasSwitch(switches::kSingleProcess) || if (in_process_gpu_) {
command_line->HasSwitch(switches::kInProcessGPU)) {
command_line->AppendSwitch(switches::kDisableGpuWatchdog); command_line->AppendSwitch(switches::kDisableGpuWatchdog);
AppendGpuCommandLine(command_line, nullptr); AppendGpuCommandLine(command_line, nullptr);
} }
...@@ -1105,16 +1107,21 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(GpuDataManagerImpl* owner) ...@@ -1105,16 +1107,21 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(GpuDataManagerImpl* owner)
owner_(owner), owner_(owner),
gpu_process_accessible_(true), gpu_process_accessible_(true),
is_initialized_(false), is_initialized_(false),
finalized_(false) { finalized_(false),
in_process_gpu_(false) {
DCHECK(owner_); DCHECK(owner_);
const base::CommandLine* command_line = const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess(); base::CommandLine::ForCurrentProcess();
swiftshader_path_ = swiftshader_path_ = command_line->GetSwitchValuePath(
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( switches::kSwiftShaderPath);
switches::kSwiftShaderPath);
if (ShouldDisableHardwareAcceleration()) if (ShouldDisableHardwareAcceleration())
DisableHardwareAcceleration(); DisableHardwareAcceleration();
if (command_line->HasSwitch(switches::kSingleProcess) ||
command_line->HasSwitch(switches::kInProcessGPU)) {
in_process_gpu_ = true;
}
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, owner_); CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, owner_);
#endif // OS_MACOSX #endif // OS_MACOSX
......
...@@ -269,6 +269,9 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { ...@@ -269,6 +269,9 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
// True if all future Initialize calls should be ignored. // True if all future Initialize calls should be ignored.
bool finalized_; bool finalized_;
// True if --single-process or --in-process-gpu is passed in.
bool in_process_gpu_;
std::string disabled_extensions_; std::string disabled_extensions_;
// If one tries to call a member before initialization then it is defered // If one tries to call a member before initialization then it is defered
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment