OLD | NEW |
---|---|
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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 success = base::HexStringToInt( | 89 success = base::HexStringToInt( |
90 command_line.GetSwitchValueASCII(switches::kGpuDeviceID), | 90 command_line.GetSwitchValueASCII(switches::kGpuDeviceID), |
91 reinterpret_cast<int*>(&(gpu_info.gpu.device_id))); | 91 reinterpret_cast<int*>(&(gpu_info.gpu.device_id))); |
92 DCHECK(success); | 92 DCHECK(success); |
93 gpu_info.driver_vendor = | 93 gpu_info.driver_vendor = |
94 command_line.GetSwitchValueASCII(switches::kGpuDriverVendor); | 94 command_line.GetSwitchValueASCII(switches::kGpuDriverVendor); |
95 gpu_info.driver_version = | 95 gpu_info.driver_version = |
96 command_line.GetSwitchValueASCII(switches::kGpuDriverVersion); | 96 command_line.GetSwitchValueASCII(switches::kGpuDriverVersion); |
97 content::GetContentClient()->SetGpuInfo(gpu_info); | 97 content::GetContentClient()->SetGpuInfo(gpu_info); |
98 | 98 |
99 #if defined(OS_CHROMEOS) | |
100 // On Chrome OS, we can now sandbox the GPU process using seccomp filter. | |
101 // This restricts calls to open(), so set the config line in /etc/drirc as | |
102 // an environment variable. | |
103 base::Environment::Create()->SetVar("force_s3tc_enable", "true"); | |
piman
2012/07/10 23:53:05
Sigh... that file may be used to do per-platform c
| |
104 #endif | |
105 | |
99 // Load and initialize the GL implementation and locate the GL entry points. | 106 // Load and initialize the GL implementation and locate the GL entry points. |
100 if (gfx::GLSurface::InitializeOneOff()) { | 107 if (gfx::GLSurface::InitializeOneOff()) { |
101 #if defined(OS_LINUX) | 108 #if defined(OS_LINUX) |
102 // We collect full GPU info on demand in Win/Mac, i.e., when about:gpu | 109 // We collect full GPU info on demand in Win/Mac, i.e., when about:gpu |
103 // page opens. This is because we can make blacklist decisions based on | 110 // page opens. This is because we can make blacklist decisions based on |
104 // preliminary GPU info. | 111 // preliminary GPU info. |
105 // However, on Linux, we may not have enough info for blacklisting. | 112 // However, on Linux, we may not have enough info for blacklisting. |
106 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id || | 113 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id || |
107 gpu_info.driver_vendor.empty() || gpu_info.driver_version.empty()) { | 114 gpu_info.driver_vendor.empty() || gpu_info.driver_version.empty()) { |
108 if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info)) | 115 if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info)) |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
219 | 226 |
220 { | 227 { |
221 TRACE_EVENT0("gpu", "Run Message Loop"); | 228 TRACE_EVENT0("gpu", "Run Message Loop"); |
222 main_message_loop.Run(); | 229 main_message_loop.Run(); |
223 } | 230 } |
224 | 231 |
225 child_thread->StopWatchdog(); | 232 child_thread->StopWatchdog(); |
226 | 233 |
227 return 0; | 234 return 0; |
228 } | 235 } |
OLD | NEW |