summaryrefslogtreecommitdiffstats
path: root/chrome/common/gpu_messages.cc
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 18:03:21 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 18:03:21 +0000
commit81f85b378c9d8c7c3e23233a78d28da785c97a9a (patch)
treebd6a621b4eea4810e101bf5bf56ced34583573fe /chrome/common/gpu_messages.cc
parentd1fdc6f83a75e316aafef3ff0f84f30a132f08c3 (diff)
downloadchromium_src-81f85b378c9d8c7c3e23233a78d28da785c97a9a.zip
chromium_src-81f85b378c9d8c7c3e23233a78d28da785c97a9a.tar.gz
chromium_src-81f85b378c9d8c7c3e23233a78d28da785c97a9a.tar.bz2
Relanding 61904 with missing file this time.
Original description: Added DirectX Diagnostics information to about:gpu on Windows. This includes the name of the GPU hardware and the driver version and release date and some other information that might potentially also be valuable in the GPU stats. TEST=try BUG=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gpu_messages.cc')
-rw-r--r--chrome/common/gpu_messages.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/chrome/common/gpu_messages.cc b/chrome/common/gpu_messages.cc
index 34f051c..893f8c9 100644
--- a/chrome/common/gpu_messages.cc
+++ b/chrome/common/gpu_messages.cc
@@ -5,6 +5,7 @@
#include "chrome/common/gpu_messages.h"
#include "chrome/common/gpu_info.h"
+#include "chrome/common/dx_diag_node.h"
#include "gfx/rect.h"
#include "gfx/size.h"
#include "ipc/ipc_channel_handle.h"
@@ -85,6 +86,10 @@ void ParamTraits<GPUInfo> ::Write(Message* m, const param_type& p) {
m->WriteUInt32(p.vertex_shader_version());
m->WriteUInt32(p.gl_version());
m->WriteBool(p.can_lose_context());
+
+#if defined(OS_WIN)
+ ParamTraits<DxDiagNode> ::Write(m, p.dx_diagnostics());
+#endif
}
bool ParamTraits<GPUInfo> ::Read(const Message* m, void** iter, param_type* p) {
@@ -109,6 +114,13 @@ bool ParamTraits<GPUInfo> ::Read(const Message* m, void** iter, param_type* p) {
vertex_shader_version,
gl_version,
can_lose_context);
+
+#if defined(OS_WIN)
+ DxDiagNode dx_diagnostics;
+ ret = ret && ParamTraits<DxDiagNode> ::Read(m, iter, &dx_diagnostics);
+ p->SetDxDiagnostics(dx_diagnostics);
+#endif
+
return ret;
}
@@ -120,6 +132,29 @@ void ParamTraits<GPUInfo> ::Log(const param_type& p, std::string* l) {
p.can_lose_context()));
}
+void ParamTraits<DxDiagNode> ::Write(Message* m, const param_type& p) {
+ ParamTraits<std::map<std::string, std::string> >::Write(m, p.values);
+ ParamTraits<std::map<std::string, DxDiagNode> >::Write(m, p.children);
+}
+
+bool ParamTraits<DxDiagNode> ::Read(const Message* m,
+ void** iter,
+ param_type* p) {
+ bool ret = ParamTraits<std::map<std::string, std::string> >::Read(
+ m,
+ iter,
+ &p->values);
+ ret = ret && ParamTraits<std::map<std::string, DxDiagNode> >::Read(
+ m,
+ iter,
+ &p->children);
+ return ret;
+}
+
+void ParamTraits<DxDiagNode> ::Log(const param_type& p, std::string* l) {
+ l->append("<DxDiagNode>");
+}
+
void ParamTraits<gpu::CommandBuffer::State> ::Write(Message* m,
const param_type& p) {
m->WriteInt(p.num_entries);