summaryrefslogtreecommitdiffstats
path: root/chrome/common/gpu_messages.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-24 20:29:02 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-24 20:29:02 +0000
commit939856a0f55cefee7a8dfb0746b1eb4455730d65 (patch)
treee8fe853f5c31ae7ea1244e25070618782cdb0a06 /chrome/common/gpu_messages.cc
parentd480a3ecadc882225c2b249346dae3759e3f8fce (diff)
downloadchromium_src-939856a0f55cefee7a8dfb0746b1eb4455730d65.zip
chromium_src-939856a0f55cefee7a8dfb0746b1eb4455730d65.tar.gz
chromium_src-939856a0f55cefee7a8dfb0746b1eb4455730d65.tar.bz2
FBTF: Move individual XXXMsg_Params structs to a new file.
The new file, render_messages_params.h, is included in 57 files, while render_messages.h is included in 176 files. Moving the Params structs to their own file allow pruning the included headers. (Part 2 of this cleanup will be sorting the individual structs into themes to further minimize header inclusion.) BUG=51411 TEST=compiles Review URL: http://codereview.chromium.org/3119035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gpu_messages.cc')
-rw-r--r--chrome/common/gpu_messages.cc44
1 files changed, 44 insertions, 0 deletions
diff --git a/chrome/common/gpu_messages.cc b/chrome/common/gpu_messages.cc
index 4ba5776..61920cc 100644
--- a/chrome/common/gpu_messages.cc
+++ b/chrome/common/gpu_messages.cc
@@ -4,6 +4,50 @@
#include "chrome/common/gpu_messages.h"
+#include "chrome/common/gpu_info.h"
+#include "gfx/rect.h"
+#include "gfx/size.h"
+#include "ipc/ipc_channel_handle.h"
+
#define MESSAGES_INTERNAL_IMPL_FILE \
"chrome/common/gpu_messages_internal.h"
#include "ipc/ipc_message_impl_macros.h"
+
+namespace IPC {
+
+void ParamTraits<GPUInfo>::Write(Message* m, const param_type& p) {
+ m->WriteUInt32(p.vendor_id());
+ m->WriteUInt32(p.device_id());
+ m->WriteWString(p.driver_version());
+ m->WriteUInt32(p.pixel_shader_version());
+ m->WriteUInt32(p.vertex_shader_version());
+ m->WriteUInt32(p.gl_version());
+}
+
+bool ParamTraits<GPUInfo>::Read(const Message* m, void** iter, param_type* p) {
+ uint32 vendor_id;
+ uint32 device_id;
+ 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,
+ gl_version);
+ return ret;
+}
+
+void ParamTraits<GPUInfo>::Log(const param_type& p, std::string* l) {
+ l->append(StringPrintf("<GPUInfo> %x %x %ls",
+ p.vendor_id(),
+ p.device_id(),
+ p.driver_version().c_str()));
+}
+
+} // namespace IPC