| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 FilePath exe_path = ChildProcessHost::GetChildPath(gpu_launcher.empty()); | 514 FilePath exe_path = ChildProcessHost::GetChildPath(gpu_launcher.empty()); |
| 515 if (exe_path.empty()) | 515 if (exe_path.empty()) |
| 516 return false; | 516 return false; |
| 517 | 517 |
| 518 CommandLine* cmd_line = new CommandLine(exe_path); | 518 CommandLine* cmd_line = new CommandLine(exe_path); |
| 519 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); | 519 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); |
| 520 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); | 520 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); |
| 521 | 521 |
| 522 // Propagate relevant command line switches. | 522 // Propagate relevant command line switches. |
| 523 static const char* const kSwitchNames[] = { | 523 static const char* const kSwitchNames[] = { |
| 524 switches::kUseGL, | 524 switches::kDisableGLMultisampling, |
| 525 switches::kDisableGpuSandbox, | 525 switches::kDisableGpuSandbox, |
| 526 switches::kDisableGpuVsync, | 526 switches::kDisableGpuVsync, |
| 527 switches::kDisableGpuWatchdog, | 527 switches::kDisableGpuWatchdog, |
| 528 switches::kDisableLogging, | 528 switches::kDisableLogging, |
| 529 switches::kEnableGPUServiceLogging, | 529 switches::kEnableGPUServiceLogging, |
| 530 switches::kEnableLogging, | 530 switches::kEnableLogging, |
| 531 #if defined(OS_MACOSX) | 531 #if defined(OS_MACOSX) |
| 532 switches::kEnableSandboxLogging, | 532 switches::kEnableSandboxLogging, |
| 533 #endif | 533 #endif |
| 534 switches::kGpuNoContextLost, |
| 534 switches::kGpuStartupDialog, | 535 switches::kGpuStartupDialog, |
| 535 switches::kLoggingLevel, | 536 switches::kLoggingLevel, |
| 536 switches::kNoSandbox, | 537 switches::kNoSandbox, |
| 537 switches::kDisableGLMultisampling, | 538 switches::kUseGL, |
| 538 }; | 539 }; |
| 539 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 540 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
| 540 arraysize(kSwitchNames)); | 541 arraysize(kSwitchNames)); |
| 541 | 542 |
| 542 GpuFeatureFlags flags = GpuDataManager::GetInstance()->GetGpuFeatureFlags(); | 543 GpuFeatureFlags flags = GpuDataManager::GetInstance()->GetGpuFeatureFlags(); |
| 543 if (flags.flags() & GpuFeatureFlags::kGpuFeatureMultisampling) | 544 if (flags.flags() & GpuFeatureFlags::kGpuFeatureMultisampling) |
| 544 cmd_line->AppendSwitch(switches::kDisableGLMultisampling); | 545 cmd_line->AppendSwitch(switches::kDisableGLMultisampling); |
| 545 | 546 |
| 546 // If specified, prepend a launcher program to the command line. | 547 // If specified, prepend a launcher program to the command line. |
| 547 if (!gpu_launcher.empty()) | 548 if (!gpu_launcher.empty()) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); | 582 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); |
| 582 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); | 583 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); |
| 583 } | 584 } |
| 584 | 585 |
| 585 void GpuProcessHost::CreateCommandBufferError( | 586 void GpuProcessHost::CreateCommandBufferError( |
| 586 CreateCommandBufferCallback* callback, int32 route_id) { | 587 CreateCommandBufferCallback* callback, int32 route_id) { |
| 587 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> | 588 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> |
| 588 wrapped_callback(callback); | 589 wrapped_callback(callback); |
| 589 callback->Run(route_id); | 590 callback->Run(route_id); |
| 590 } | 591 } |
| OLD | NEW |