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