Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: chrome/common/gpu_info.h

Issue 4860001: Collect DirectX diagnostic information asynchronously.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/time.h" 15 #include "base/time.h"
16 #include "build/build_config.h" 16 #include "build/build_config.h"
17 #include "chrome/common/dx_diag_node.h" 17 #include "chrome/common/dx_diag_node.h"
18 18
19 class GPUInfo { 19 class GPUInfo {
20 public: 20 public:
21 GPUInfo(); 21 GPUInfo();
22 ~GPUInfo() {} 22 ~GPUInfo() {}
23 23
24 // Returns whether this GPUInfo has been initialized with information 24 enum Progress {
25 bool initialized() const; 25 kUninitialized,
26 kPartial,
27 kComplete,
28 };
29
30 // Returns whether this GPUInfo has been partially or fully initialized with
31 // information.
32 Progress progress() const;
26 33
27 // The amount of time taken to get from the process starting to the message 34 // The amount of time taken to get from the process starting to the message
28 // loop being pumped. 35 // loop being pumped.
29 base::TimeDelta initialization_time() const; 36 base::TimeDelta initialization_time() const;
30 37
31 // Return the DWORD (uint32) representing the graphics card vendor id. 38 // Return the DWORD (uint32) representing the graphics card vendor id.
32 uint32 vendor_id() const; 39 uint32 vendor_id() const;
33 40
34 // Return the DWORD (uint32) representing the graphics card device id. 41 // Return the DWORD (uint32) representing the graphics card device id.
35 // Device ids are unique to vendor, not to one another. 42 // Device ids are unique to vendor, not to one another.
(...skipping 17 matching lines...) Expand all
53 // Major version in the high word, minor in the low word, eg version 2.5 60 // Major version in the high word, minor in the low word, eg version 2.5
54 // would be 0x00020005. 61 // would be 0x00020005.
55 // Returns 0 if we're not using OpenGL, say because we're going through 62 // Returns 0 if we're not using OpenGL, say because we're going through
56 // D3D instead. 63 // D3D instead.
57 uint32 gl_version() const; 64 uint32 gl_version() const;
58 65
59 // Return the device semantics, i.e. whether the Vista and Windows 7 specific 66 // Return the device semantics, i.e. whether the Vista and Windows 7 specific
60 // semantics are available. 67 // semantics are available.
61 bool can_lose_context() const; 68 bool can_lose_context() const;
62 69
70 void SetProgress(Progress progress);
71
63 void SetInitializationTime(const base::TimeDelta& initialization_time); 72 void SetInitializationTime(const base::TimeDelta& initialization_time);
64 73
65 // Populate variables with passed in values 74 // Populate variables with passed in values
66 void SetGraphicsInfo(uint32 vendor_id, uint32 device_id, 75 void SetGraphicsInfo(uint32 vendor_id, uint32 device_id,
67 const std::wstring& driver_version, 76 const std::wstring& driver_version,
68 uint32 pixel_shader_version, 77 uint32 pixel_shader_version,
69 uint32 vertex_shader_version, 78 uint32 vertex_shader_version,
70 uint32 gl_version, 79 uint32 gl_version,
71 bool can_lose_context); 80 bool can_lose_context);
72 81
73 #if defined(OS_WIN) 82 #if defined(OS_WIN)
74 // The information returned by the DirectX Diagnostics Tool. 83 // The information returned by the DirectX Diagnostics Tool.
75 const DxDiagNode& dx_diagnostics() const; 84 const DxDiagNode& dx_diagnostics() const;
76 85
77 void SetDxDiagnostics(const DxDiagNode& dx_diagnostics); 86 void SetDxDiagnostics(const DxDiagNode& dx_diagnostics);
78 #endif 87 #endif
79 88
80 private: 89 private:
81 bool initialized_; 90 Progress progress_;
82 base::TimeDelta initialization_time_; 91 base::TimeDelta initialization_time_;
83 uint32 vendor_id_; 92 uint32 vendor_id_;
84 uint32 device_id_; 93 uint32 device_id_;
85 std::wstring driver_version_; 94 std::wstring driver_version_;
86 uint32 pixel_shader_version_; 95 uint32 pixel_shader_version_;
87 uint32 vertex_shader_version_; 96 uint32 vertex_shader_version_;
88 uint32 gl_version_; 97 uint32 gl_version_;
89 bool can_lose_context_; 98 bool can_lose_context_;
90 99
91 #if defined(OS_WIN) 100 #if defined(OS_WIN)
92 DxDiagNode dx_diagnostics_; 101 DxDiagNode dx_diagnostics_;
93 #endif 102 #endif
94 }; 103 };
95 104
96 #endif // CHROME_COMMON_GPU_INFO_H__ 105 #endif // CHROME_COMMON_GPU_INFO_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698