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

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

Issue 10065025: Make it so you can add GPU switches by editing 2 files instead of 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | gpu/command_buffer/service/gpu_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 700
701 CommandLine* cmd_line = new CommandLine(exe_path); 701 CommandLine* cmd_line = new CommandLine(exe_path);
702 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); 702 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess);
703 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); 703 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
704 704
705 if (kind_ == GPU_PROCESS_KIND_UNSANDBOXED) 705 if (kind_ == GPU_PROCESS_KIND_UNSANDBOXED)
706 cmd_line->AppendSwitch(switches::kDisableGpuSandbox); 706 cmd_line->AppendSwitch(switches::kDisableGpuSandbox);
707 707
708 // Propagate relevant command line switches. 708 // Propagate relevant command line switches.
709 static const char* const kSwitchNames[] = { 709 static const char* const kSwitchNames[] = {
710 switches::kCompileShaderAlwaysSucceeds,
711 switches::kDisableBreakpad, 710 switches::kDisableBreakpad,
712 switches::kDisableGLMultisampling, 711 switches::kDisableGLMultisampling,
713 switches::kDisableGpuDriverBugWorkarounds, 712 switches::kDisableGpuDriverBugWorkarounds,
714 switches::kDisableGpuSandbox, 713 switches::kDisableGpuSandbox,
715 switches::kReduceGpuSandbox, 714 switches::kReduceGpuSandbox,
716 switches::kDisableGLSLTranslator,
717 switches::kDisableGpuVsync, 715 switches::kDisableGpuVsync,
718 switches::kDisableGpuWatchdog, 716 switches::kDisableGpuWatchdog,
719 switches::kDisableImageTransportSurface, 717 switches::kDisableImageTransportSurface,
720 switches::kDisableLogging, 718 switches::kDisableLogging,
721 switches::kEnableGPUCommandLogging,
722 switches::kEnableGPUDebugging,
723 switches::kEnableGPUServiceLogging,
724 switches::kEnableLogging, 719 switches::kEnableLogging,
725 #if defined(OS_MACOSX) 720 #if defined(OS_MACOSX)
726 switches::kEnableSandboxLogging, 721 switches::kEnableSandboxLogging,
727 #endif 722 #endif
728 switches::kGpuNoContextLost, 723 switches::kGpuNoContextLost,
729 switches::kGpuStartupDialog, 724 switches::kGpuStartupDialog,
730 switches::kLoggingLevel, 725 switches::kLoggingLevel,
731 switches::kNoSandbox, 726 switches::kNoSandbox,
732 switches::kTestGLLib, 727 switches::kTestGLLib,
733 switches::kTraceStartup, 728 switches::kTraceStartup,
734 switches::kV, 729 switches::kV,
735 switches::kVModule, 730 switches::kVModule,
736 }; 731 };
737 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, 732 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
738 arraysize(kSwitchNames)); 733 arraysize(kSwitchNames));
734 cmd_line->CopySwitchesFrom(
735 browser_command_line, switches::kGpuSwitches, switches::kNumGpuSwitches);
739 736
740 content::GetContentClient()->browser()->AppendExtraCommandLineSwitches( 737 content::GetContentClient()->browser()->AppendExtraCommandLineSwitches(
741 cmd_line, process_->GetData().id); 738 cmd_line, process_->GetData().id);
742 739
743 GpuDataManagerImpl::GetInstance()->AppendGpuCommandLine(cmd_line); 740 GpuDataManagerImpl::GetInstance()->AppendGpuCommandLine(cmd_line);
744 741
745 if (cmd_line->HasSwitch(switches::kUseGL)) 742 if (cmd_line->HasSwitch(switches::kUseGL))
746 software_rendering_ = 743 software_rendering_ =
747 (cmd_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); 744 (cmd_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader");
748 745
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 const IPC::ChannelHandle& channel_handle, 781 const IPC::ChannelHandle& channel_handle,
785 base::ProcessHandle renderer_process_for_gpu, 782 base::ProcessHandle renderer_process_for_gpu,
786 const content::GPUInfo& gpu_info) { 783 const content::GPUInfo& gpu_info) {
787 callback.Run(channel_handle, renderer_process_for_gpu, gpu_info); 784 callback.Run(channel_handle, renderer_process_for_gpu, gpu_info);
788 } 785 }
789 786
790 void GpuProcessHost::CreateCommandBufferError( 787 void GpuProcessHost::CreateCommandBufferError(
791 const CreateCommandBufferCallback& callback, int32 route_id) { 788 const CreateCommandBufferCallback& callback, int32 route_id) {
792 callback.Run(route_id); 789 callback.Run(route_id);
793 } 790 }
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gpu_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698