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 "content/gpu/gpu_info_collector.h" | 5 #include "content/gpu/gpu_info_collector.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/string_piece.h" | 12 #include "base/string_piece.h" |
13 #include "base/sys_string_conversions.h" | 13 #include "base/sys_string_conversions.h" |
14 #include "ui/gfx/gl/gl_bindings.h" | 14 #include "ui/gl/gl_bindings.h" |
15 #include "ui/gfx/gl/gl_context.h" | 15 #include "ui/gl/gl_context.h" |
16 #include "ui/gfx/gl/gl_implementation.h" | 16 #include "ui/gl/gl_implementation.h" |
17 #include "ui/gfx/gl/gl_interface.h" | 17 #include "ui/gl/gl_interface.h" |
18 | 18 |
19 #import <Cocoa/Cocoa.h> | 19 #import <Cocoa/Cocoa.h> |
20 #import <Foundation/Foundation.h> | 20 #import <Foundation/Foundation.h> |
21 #import <IOKit/IOKitLib.h> | 21 #import <IOKit/IOKitLib.h> |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 struct VideoCardInfo { | 25 struct VideoCardInfo { |
26 UInt32 vendor_id; | 26 UInt32 vendor_id; |
27 UInt32 device_id; | 27 UInt32 device_id; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // Use some jiggery-pokery to turn that utf8 string into a std::wstring. | 171 // Use some jiggery-pokery to turn that utf8 string into a std::wstring. |
172 std::string gl_version_string = gpu_info->gl_version_string; | 172 std::string gl_version_string = gpu_info->gl_version_string; |
173 size_t pos = gl_version_string.find_last_of('-'); | 173 size_t pos = gl_version_string.find_last_of('-'); |
174 if (pos == std::string::npos) | 174 if (pos == std::string::npos) |
175 return false; | 175 return false; |
176 gpu_info->driver_version = gl_version_string.substr(pos + 1); | 176 gpu_info->driver_version = gl_version_string.substr(pos + 1); |
177 return true; | 177 return true; |
178 } | 178 } |
179 | 179 |
180 } // namespace gpu_info_collector | 180 } // namespace gpu_info_collector |
OLD | NEW |