diff options
author | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 00:26:04 +0000 |
---|---|---|
committer | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 00:26:04 +0000 |
commit | 3119a917f9b4bc9c298187e4960d313d7f7ba53b (patch) | |
tree | 2beaededffef44491ce92aab99a9f059e2f05f01 /content | |
parent | b7c1fa2b8f31c967dc432b9d5dd1b7f731e34c77 (diff) | |
download | chromium_src-3119a917f9b4bc9c298187e4960d313d7f7ba53b.zip chromium_src-3119a917f9b4bc9c298187e4960d313d7f7ba53b.tar.gz chromium_src-3119a917f9b4bc9c298187e4960d313d7f7ba53b.tar.bz2 |
Add command-line option to enable swiftshader
This adds --use-gl=swiftshader to force that swiftshader be used. --swiftshader-path specifies where to load the libraries from. These arguments will be used when the gpu is on the software rendering list.
BUG=
TEST=
Review URL: http://codereview.chromium.org/8431017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108596 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/gpu/gpu_child_thread.cc | 11 | ||||
-rw-r--r-- | content/gpu/gpu_info_collector_win.cc | 8 |
2 files changed, 15 insertions, 4 deletions
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc index 22d7831..0004357 100644 --- a/content/gpu/gpu_child_thread.cc +++ b/content/gpu/gpu_child_thread.cc @@ -102,10 +102,12 @@ void GpuChildThread::OnInitialize() { !CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)) logging::SetLogMessageHandler(GpuProcessLogMessageHandler); - gpu_info_collector::CollectGraphicsInfo(&gpu_info_); + bool succeeded = gpu_info_collector::CollectGraphicsInfo(&gpu_info_); - content::GetContentClient()->SetGpuInfo(gpu_info_); - LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo complete"; + if (succeeded) { + content::GetContentClient()->SetGpuInfo(gpu_info_); + LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo complete"; + } // Record initialization only after collecting the GPU info because that can // take a significant amount of time. @@ -154,7 +156,8 @@ void GpuChildThread::OnInitialize() { // Ensure the browser process receives the GPU info before a reply to any // subsequent IPC it might send. - Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_)); + if (succeeded) + Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_)); } void GpuChildThread::StopWatchdog() { diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc index 94fd093..aa902c5 100644 --- a/content/gpu/gpu_info_collector_win.cc +++ b/content/gpu/gpu_info_collector_win.cc @@ -8,6 +8,7 @@ #include <d3d9.h> #include <setupapi.h> +#include "base/command_line.h" #include "base/file_path.h" #include "base/logging.h" #include "base/scoped_native_library.h" @@ -63,6 +64,13 @@ namespace gpu_info_collector { bool CollectGraphicsInfo(content::GPUInfo* gpu_info) { DCHECK(gpu_info); + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) { + std::string requested_implementation_name = + CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kUseGL); + if (requested_implementation_name == "swiftshader") + return false; + } + if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { gpu_info->finalized = true; return CollectGraphicsInfoGL(gpu_info); |