summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authormaf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-21 01:07:08 +0000
committermaf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-21 01:07:08 +0000
commit910e3cf758a7e27aa1b06bee3fccb3d872ced7f3 (patch)
tree8710ef46d297ac38a8f8b7e934b8756b3b9a32f7 /chrome/common
parent14462f6f3b9066325c6725f43300178a34e7247e (diff)
downloadchromium_src-910e3cf758a7e27aa1b06bee3fccb3d872ced7f3.zip
chromium_src-910e3cf758a7e27aa1b06bee3fccb3d872ced7f3.tar.gz
chromium_src-910e3cf758a7e27aa1b06bee3fccb3d872ced7f3.tar.bz2
Add Mac GPU logging code.
Add separate GL version field. Review URL: http://codereview.chromium.org/3104011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56957 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/gpu_info.cc12
-rw-r--r--chrome/common/gpu_info.h11
-rw-r--r--chrome/common/gpu_messages.h6
-rw-r--r--chrome/common/gpu_messages_unittest.cc4
4 files changed, 28 insertions, 5 deletions
diff --git a/chrome/common/gpu_info.cc b/chrome/common/gpu_info.cc
index b1add77..6ba16d6 100644
--- a/chrome/common/gpu_info.cc
+++ b/chrome/common/gpu_info.cc
@@ -6,7 +6,8 @@
GPUInfo::GPUInfo()
: vendor_id_(0), device_id_(0), driver_version_(L""),
- pixel_shader_version_(0), vertex_shader_version_(0) {
+ pixel_shader_version_(0), vertex_shader_version_(0),
+ gl_version_(0) {
}
uint32 GPUInfo::vendor_id() const {
@@ -29,13 +30,20 @@ uint32 GPUInfo::vertex_shader_version() const {
return vertex_shader_version_;
}
+uint32 GPUInfo::gl_version() const {
+ return gl_version_;
+}
+
+
void GPUInfo::SetGraphicsInfo(uint32 vendor_id, uint32 device_id,
const std::wstring& driver_version,
uint32 pixel_shader_version,
- uint32 vertex_shader_version) {
+ uint32 vertex_shader_version,
+ uint32 gl_version) {
vendor_id_ = vendor_id;
device_id_ = device_id;
driver_version_ = driver_version;
pixel_shader_version_ = pixel_shader_version;
vertex_shader_version_ = vertex_shader_version;
+ gl_version_ = gl_version;
}
diff --git a/chrome/common/gpu_info.h b/chrome/common/gpu_info.h
index 0d512c1..1280a51 100644
--- a/chrome/common/gpu_info.h
+++ b/chrome/common/gpu_info.h
@@ -39,17 +39,26 @@ class GPUInfo {
// should be okay.
uint32 vertex_shader_version() const;
+ // Return the version of OpenGL we are using.
+ // Major version in the high word, minor in the low word, eg version 2.5
+ // would be 0x00020005.
+ // Returns 0 if we're not using OpenGL, say because we're going through
+ // D3D instead.
+ uint32 gl_version() const;
+
// Populate variables with passed in values
void SetGraphicsInfo(uint32 vendor_id, uint32 device_id,
const std::wstring& driver_version,
uint32 pixel_shader_version,
- uint32 vertex_shader_version);
+ uint32 vertex_shader_version,
+ uint32 gl_version);
private:
uint32 vendor_id_;
uint32 device_id_;
std::wstring driver_version_;
uint32 pixel_shader_version_;
uint32 vertex_shader_version_;
+ uint32 gl_version_;
};
#endif // CHROME_COMMON_GPU_INFO_H__
diff --git a/chrome/common/gpu_messages.h b/chrome/common/gpu_messages.h
index 63c864e..f044b2f 100644
--- a/chrome/common/gpu_messages.h
+++ b/chrome/common/gpu_messages.h
@@ -87,6 +87,7 @@ struct ParamTraits<GPUInfo> {
m->WriteWString(p.driver_version());
m->WriteUInt32(p.pixel_shader_version());
m->WriteUInt32(p.vertex_shader_version());
+ m->WriteUInt32(p.gl_version());
}
static bool Read(const Message* m, void** iter, param_type* p) {
uint32 vendor_id;
@@ -94,13 +95,16 @@ struct ParamTraits<GPUInfo> {
std::wstring driver_version;
uint32 pixel_shader_version;
uint32 vertex_shader_version;
+ uint32 gl_version;
bool ret = m->ReadUInt32(iter, &vendor_id);
ret = ret && m->ReadUInt32(iter, &device_id);
ret = ret && m->ReadWString(iter, &driver_version);
ret = ret && m->ReadUInt32(iter, &pixel_shader_version);
ret = ret && m->ReadUInt32(iter, &vertex_shader_version);
+ ret = ret && m->ReadUInt32(iter, &gl_version);
p->SetGraphicsInfo(vendor_id, device_id, driver_version,
- pixel_shader_version, vertex_shader_version);
+ pixel_shader_version, vertex_shader_version,
+ gl_version);
return ret;
}
static void Log(const param_type& p, std::string* l) {
diff --git a/chrome/common/gpu_messages_unittest.cc b/chrome/common/gpu_messages_unittest.cc
index a22112b..cf7408f 100644
--- a/chrome/common/gpu_messages_unittest.cc
+++ b/chrome/common/gpu_messages_unittest.cc
@@ -15,7 +15,8 @@ TEST(GPUIPCMessageTest, GPUInfo) {
GPUInfo input;
// Test variables taken from Lenovo T61
input.SetGraphicsInfo(0x10de, 0x429, L"6.14.11.7715",
- 0xffff0300, 0xfffe0300);
+ 0xffff0300, 0xfffe0300,
+ 0x00010005);
IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
IPC::WriteParam(&msg, input);
@@ -28,6 +29,7 @@ TEST(GPUIPCMessageTest, GPUInfo) {
EXPECT_EQ(input.driver_version(), output.driver_version());
EXPECT_EQ(input.pixel_shader_version(), output.pixel_shader_version());
EXPECT_EQ(input.vertex_shader_version(), output.vertex_shader_version());
+ EXPECT_EQ(input.gl_version(), output.gl_version());
std::string log_message;
IPC::LogParam(output, &log_message);