| OLD | NEW |
| 1 // Copyright (c) 2006-2010 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 "chrome/gpu/gpu_info_collector.h" | 5 #include "content/gpu/gpu_info_collector.h" |
| 6 |
| 7 #include "app/gfx/gl/gl_bindings.h" |
| 8 #include "app/gfx/gl/gl_context.h" |
| 9 #include "app/gfx/gl/gl_implementation.h" |
| 10 #include "app/gfx/gl/gl_interface.h" |
| 6 #include "base/logging.h" | 11 #include "base/logging.h" |
| 7 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 8 #include "base/string_piece.h" | 13 #include "base/string_piece.h" |
| 9 #include "base/sys_string_conversions.h" | 14 #include "base/sys_string_conversions.h" |
| 10 #include "app/gfx/gl/gl_bindings.h" | |
| 11 #include "app/gfx/gl/gl_context.h" | |
| 12 #include "app/gfx/gl/gl_implementation.h" | |
| 13 #include "app/gfx/gl/gl_interface.h" | |
| 14 | 15 |
| 15 #import <Cocoa/Cocoa.h> | 16 #import <Cocoa/Cocoa.h> |
| 16 #import <Foundation/Foundation.h> | 17 #import <Foundation/Foundation.h> |
| 17 #import <IOKit/IOKitLib.h> | 18 #import <IOKit/IOKitLib.h> |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| 21 CFTypeRef SearchPortForProperty(io_registry_entry_t dspPort, | 22 CFTypeRef SearchPortForProperty(io_registry_entry_t dspPort, |
| 22 CFStringRef propertyName) { | 23 CFStringRef propertyName) { |
| 23 return IORegistryEntrySearchCFProperty(dspPort, | 24 return IORegistryEntrySearchCFProperty(dspPort, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // Use some jiggery-pokery to turn that utf8 string into a std::wstring. | 95 // Use some jiggery-pokery to turn that utf8 string into a std::wstring. |
| 95 std::string gl_version_string = gpu_info->gl_version_string; | 96 std::string gl_version_string = gpu_info->gl_version_string; |
| 96 size_t pos = gl_version_string.find_last_of('-'); | 97 size_t pos = gl_version_string.find_last_of('-'); |
| 97 if (pos == std::string::npos) | 98 if (pos == std::string::npos) |
| 98 return false; | 99 return false; |
| 99 gpu_info->driver_version = gl_version_string.substr(pos + 1); | 100 gpu_info->driver_version = gl_version_string.substr(pos + 1); |
| 100 return true; | 101 return true; |
| 101 } | 102 } |
| 102 | 103 |
| 103 } // namespace gpu_info_collector | 104 } // namespace gpu_info_collector |
| OLD | NEW |