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(
return false;
}
if (in_process_gpu_)
return true;
if (card_blacklisted_) {
if (reason) {
*reason = "GPU access is disabled ";
......@@ -600,8 +603,7 @@ void GpuDataManagerImplPrivate::Initialize() {
gpu_driver_bug_list_string,
gpu_info);
if (command_line->HasSwitch(switches::kSingleProcess) ||
command_line->HasSwitch(switches::kInProcessGPU)) {
if (in_process_gpu_) {
command_line->AppendSwitch(switches::kDisableGpuWatchdog);
AppendGpuCommandLine(command_line, nullptr);
}
......@@ -1105,16 +1107,21 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(GpuDataManagerImpl* owner)
owner_(owner),
gpu_process_accessible_(true),
is_initialized_(false),
finalized_(false) {
finalized_(false),
in_process_gpu_(false) {
DCHECK(owner_);
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
swiftshader_path_ =
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
swiftshader_path_ = command_line->GetSwitchValuePath(
switches::kSwiftShaderPath);
if (ShouldDisableHardwareAcceleration())
DisableHardwareAcceleration();
if (command_line->HasSwitch(switches::kSingleProcess) ||
command_line->HasSwitch(switches::kInProcessGPU)) {
in_process_gpu_ = true;
}
#if defined(OS_MACOSX)
CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, owner_);
#endif // OS_MACOSX
......
......@@ -269,6 +269,9 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
// True if all future Initialize calls should be ignored.
bool finalized_;
// True if --single-process or --in-process-gpu is passed in.
bool in_process_gpu_;
std::string disabled_extensions_;
// 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