| OLD | NEW |
| 1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2010 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 #ifndef CHROME_COMMON_GPU_INFO_H__ | 5 #ifndef CHROME_COMMON_GPU_INFO_H__ |
| 6 #define CHROME_COMMON_GPU_INFO_H__ | 6 #define CHROME_COMMON_GPU_INFO_H__ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 // Provides access to the GPU information for the system | 9 // Provides access to the GPU information for the system |
| 10 // on which chrome is currently running. | 10 // on which chrome is currently running. |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/scoped_ptr.h" | 15 #include "base/scoped_ptr.h" |
| 16 #include "base/time.h" | 16 #include "base/time.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "chrome/common/dx_diag_node.h" | 18 #include "chrome/common/dx_diag_node.h" |
| 19 | 19 |
| 20 class GPUInfo { | 20 class GPUInfo { |
| 21 public: | 21 public: |
| 22 GPUInfo(); | 22 GPUInfo(); |
| 23 ~GPUInfo() {} | 23 ~GPUInfo() {} |
| 24 | 24 |
| 25 enum Progress { | 25 enum Level { |
| 26 kUninitialized, | 26 kUninitialized, |
| 27 kPartial, | 27 kPartial, |
| 28 kCompleting, |
| 28 kComplete, | 29 kComplete, |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 // Returns whether this GPUInfo has been partially or fully initialized with | 32 // Returns whether this GPUInfo has been partially or fully initialized with |
| 32 // information. | 33 // information. |
| 33 Progress progress() const; | 34 Level level() const; |
| 34 | 35 |
| 35 // The amount of time taken to get from the process starting to the message | 36 // The amount of time taken to get from the process starting to the message |
| 36 // loop being pumped. | 37 // loop being pumped. |
| 37 base::TimeDelta initialization_time() const; | 38 base::TimeDelta initialization_time() const; |
| 38 | 39 |
| 39 // Return the DWORD (uint32) representing the graphics card vendor id. | 40 // Return the DWORD (uint32) representing the graphics card vendor id. |
| 40 uint32 vendor_id() const; | 41 uint32 vendor_id() const; |
| 41 | 42 |
| 42 // Return the DWORD (uint32) representing the graphics card device id. | 43 // Return the DWORD (uint32) representing the graphics card device id. |
| 43 // Device ids are unique to vendor, not to one another. | 44 // Device ids are unique to vendor, not to one another. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 std::string gl_renderer() const; | 81 std::string gl_renderer() const; |
| 81 | 82 |
| 82 // Return the GL_EXTENSIONS string. | 83 // Return the GL_EXTENSIONS string. |
| 83 // Return "" if we are not using OpenGL. | 84 // Return "" if we are not using OpenGL. |
| 84 std::string gl_extensions() const; | 85 std::string gl_extensions() const; |
| 85 | 86 |
| 86 // Return the device semantics, i.e. whether the Vista and Windows 7 specific | 87 // Return the device semantics, i.e. whether the Vista and Windows 7 specific |
| 87 // semantics are available. | 88 // semantics are available. |
| 88 bool can_lose_context() const; | 89 bool can_lose_context() const; |
| 89 | 90 |
| 90 void SetProgress(Progress progress); | 91 void SetLevel(Level level); |
| 91 | 92 |
| 92 void SetInitializationTime(const base::TimeDelta& initialization_time); | 93 void SetInitializationTime(const base::TimeDelta& initialization_time); |
| 93 | 94 |
| 94 void SetVideoCardInfo(uint32 vendor_id, uint32 device_id); | 95 void SetVideoCardInfo(uint32 vendor_id, uint32 device_id); |
| 95 | 96 |
| 96 void SetDriverInfo(const std::string& driver_vendor, | 97 void SetDriverInfo(const std::string& driver_vendor, |
| 97 const std::string& driver_version); | 98 const std::string& driver_version); |
| 98 | 99 |
| 99 void SetShaderVersion(uint32 pixel_shader_version, | 100 void SetShaderVersion(uint32 pixel_shader_version, |
| 100 uint32 vertex_shader_version); | 101 uint32 vertex_shader_version); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 112 void SetCanLoseContext(bool can_lose_context); | 113 void SetCanLoseContext(bool can_lose_context); |
| 113 | 114 |
| 114 #if defined(OS_WIN) | 115 #if defined(OS_WIN) |
| 115 // The information returned by the DirectX Diagnostics Tool. | 116 // The information returned by the DirectX Diagnostics Tool. |
| 116 const DxDiagNode& dx_diagnostics() const; | 117 const DxDiagNode& dx_diagnostics() const; |
| 117 | 118 |
| 118 void SetDxDiagnostics(const DxDiagNode& dx_diagnostics); | 119 void SetDxDiagnostics(const DxDiagNode& dx_diagnostics); |
| 119 #endif | 120 #endif |
| 120 | 121 |
| 121 private: | 122 private: |
| 122 Progress progress_; | 123 Level level_; |
| 123 base::TimeDelta initialization_time_; | 124 base::TimeDelta initialization_time_; |
| 124 uint32 vendor_id_; | 125 uint32 vendor_id_; |
| 125 uint32 device_id_; | 126 uint32 device_id_; |
| 126 std::string driver_vendor_; | 127 std::string driver_vendor_; |
| 127 std::string driver_version_; | 128 std::string driver_version_; |
| 128 uint32 pixel_shader_version_; | 129 uint32 pixel_shader_version_; |
| 129 uint32 vertex_shader_version_; | 130 uint32 vertex_shader_version_; |
| 130 uint32 gl_version_; | 131 uint32 gl_version_; |
| 131 std::string gl_version_string_; | 132 std::string gl_version_string_; |
| 132 std::string gl_vendor_; | 133 std::string gl_vendor_; |
| 133 std::string gl_renderer_; | 134 std::string gl_renderer_; |
| 134 std::string gl_extensions_; | 135 std::string gl_extensions_; |
| 135 bool can_lose_context_; | 136 bool can_lose_context_; |
| 136 | 137 |
| 137 #if defined(OS_WIN) | 138 #if defined(OS_WIN) |
| 138 DxDiagNode dx_diagnostics_; | 139 DxDiagNode dx_diagnostics_; |
| 139 #endif | 140 #endif |
| 140 }; | 141 }; |
| 141 | 142 |
| 142 #endif // CHROME_COMMON_GPU_INFO_H__ | 143 #endif // CHROME_COMMON_GPU_INFO_H__ |
| OLD | NEW |