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 "gpu/config/gpu_test_config.h" | 5 #include "gpu/config/gpu_test_config.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
9 #include "gpu/config/gpu_info.h" | 9 #include "gpu/config/gpu_info.h" |
10 #include "gpu/config/gpu_info_collector.h" | 10 #include "gpu/config/gpu_info_collector.h" |
(...skipping 19 matching lines...) Expand all Loading... | |
30 int32 minor_version = 0; | 30 int32 minor_version = 0; |
31 int32 bugfix_version = 0; | 31 int32 bugfix_version = 0; |
32 base::SysInfo::OperatingSystemVersionNumbers( | 32 base::SysInfo::OperatingSystemVersionNumbers( |
33 &major_version, &minor_version, &bugfix_version); | 33 &major_version, &minor_version, &bugfix_version); |
34 if (major_version == 5) | 34 if (major_version == 5) |
35 return GPUTestConfig::kOsWinXP; | 35 return GPUTestConfig::kOsWinXP; |
36 if (major_version == 6 && minor_version == 0) | 36 if (major_version == 6 && minor_version == 0) |
37 return GPUTestConfig::kOsWinVista; | 37 return GPUTestConfig::kOsWinVista; |
38 if (major_version == 6 && minor_version == 1) | 38 if (major_version == 6 && minor_version == 1) |
39 return GPUTestConfig::kOsWin7; | 39 return GPUTestConfig::kOsWin7; |
40 if (major_version == 6 && minor_version == 2) | 40 if (major_version == 6 && (minor_version == 2 || minor_version == 3)) |
41 return GPUTestConfig::kOsWin8; | 41 return GPUTestConfig::kOsWin8; |
Ken Russell (switch to Gerrit)
2014/05/23 02:37:58
We might need to add a win81 or win8_1 configurati
| |
42 #elif defined(OS_MACOSX) | 42 #elif defined(OS_MACOSX) |
43 int32 major_version = 0; | 43 int32 major_version = 0; |
44 int32 minor_version = 0; | 44 int32 minor_version = 0; |
45 int32 bugfix_version = 0; | 45 int32 bugfix_version = 0; |
46 base::SysInfo::OperatingSystemVersionNumbers( | 46 base::SysInfo::OperatingSystemVersionNumbers( |
47 &major_version, &minor_version, &bugfix_version); | 47 &major_version, &minor_version, &bugfix_version); |
48 if (major_version == 10) { | 48 if (major_version == 10) { |
49 switch (minor_version) { | 49 switch (minor_version) { |
50 case 5: | 50 case 5: |
51 return GPUTestConfig::kOsMacLeopard; | 51 return GPUTestConfig::kOsMacLeopard; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 } | 230 } |
231 | 231 |
232 bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) { | 232 bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) { |
233 bool rt; | 233 bool rt; |
234 if (gpu_info == NULL) { | 234 if (gpu_info == NULL) { |
235 GPUInfo my_gpu_info; | 235 GPUInfo my_gpu_info; |
236 GpuIDResult result; | 236 GpuIDResult result; |
237 result = CollectGpuID(&my_gpu_info.gpu.vendor_id, | 237 result = CollectGpuID(&my_gpu_info.gpu.vendor_id, |
238 &my_gpu_info.gpu.device_id); | 238 &my_gpu_info.gpu.device_id); |
239 if (result == kGpuIDNotSupported) { | 239 if (result == kGpuIDNotSupported) { |
240 LOG(ERROR) << "Fail to identify GPU"; | |
240 DisableGPUInfoValidation(); | 241 DisableGPUInfoValidation(); |
241 rt = true; | 242 rt = true; |
242 } else { | 243 } else { |
243 rt = SetGPUInfo(my_gpu_info); | 244 rt = SetGPUInfo(my_gpu_info); |
244 } | 245 } |
245 } else { | 246 } else { |
246 rt = SetGPUInfo(*gpu_info); | 247 rt = SetGPUInfo(*gpu_info); |
247 } | 248 } |
248 set_os(GetCurrentOS()); | 249 set_os(GetCurrentOS()); |
249 if (os() == kOsUnknown) | 250 if (os() == kOsUnknown) { |
251 LOG(ERROR) << "Unknown OS"; | |
250 rt = false; | 252 rt = false; |
253 } | |
251 #if defined(NDEBUG) | 254 #if defined(NDEBUG) |
252 set_build_type(kBuildTypeRelease); | 255 set_build_type(kBuildTypeRelease); |
253 #else | 256 #else |
254 set_build_type(kBuildTypeDebug); | 257 set_build_type(kBuildTypeDebug); |
255 #endif | 258 #endif |
256 return rt; | 259 return rt; |
257 } | 260 } |
258 | 261 |
259 // static | 262 // static |
260 bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) { | 263 bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) { |
(...skipping 27 matching lines...) Expand all Loading... | |
288 // Blacklist rule #79 disables all Gpu acceleration before Windows 7. | 291 // Blacklist rule #79 disables all Gpu acceleration before Windows 7. |
289 if (base::win::GetVersion() <= base::win::VERSION_VISTA) { | 292 if (base::win::GetVersion() <= base::win::VERSION_VISTA) { |
290 return true; | 293 return true; |
291 } | 294 } |
292 #endif | 295 #endif |
293 return false; | 296 return false; |
294 } | 297 } |
295 | 298 |
296 } // namespace gpu | 299 } // namespace gpu |
297 | 300 |
OLD | NEW |