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

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

Issue 3104011: Add Mac GPU logging code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months 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
« no previous file with comments | « chrome/common/gpu_info.cc ('k') | chrome/common/gpu_messages_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_MESSAGES_H_ 5 #ifndef CHROME_COMMON_GPU_MESSAGES_H_
6 #define CHROME_COMMON_GPU_MESSAGES_H_ 6 #define CHROME_COMMON_GPU_MESSAGES_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/process.h" 10 #include "base/process.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 template <> 81 template <>
82 struct ParamTraits<GPUInfo> { 82 struct ParamTraits<GPUInfo> {
83 typedef GPUInfo param_type; 83 typedef GPUInfo param_type;
84 static void Write(Message* m, const param_type& p) { 84 static void Write(Message* m, const param_type& p) {
85 m->WriteUInt32(p.vendor_id()); 85 m->WriteUInt32(p.vendor_id());
86 m->WriteUInt32(p.device_id()); 86 m->WriteUInt32(p.device_id());
87 m->WriteWString(p.driver_version()); 87 m->WriteWString(p.driver_version());
88 m->WriteUInt32(p.pixel_shader_version()); 88 m->WriteUInt32(p.pixel_shader_version());
89 m->WriteUInt32(p.vertex_shader_version()); 89 m->WriteUInt32(p.vertex_shader_version());
90 m->WriteUInt32(p.gl_version());
90 } 91 }
91 static bool Read(const Message* m, void** iter, param_type* p) { 92 static bool Read(const Message* m, void** iter, param_type* p) {
92 uint32 vendor_id; 93 uint32 vendor_id;
93 uint32 device_id; 94 uint32 device_id;
94 std::wstring driver_version; 95 std::wstring driver_version;
95 uint32 pixel_shader_version; 96 uint32 pixel_shader_version;
96 uint32 vertex_shader_version; 97 uint32 vertex_shader_version;
98 uint32 gl_version;
97 bool ret = m->ReadUInt32(iter, &vendor_id); 99 bool ret = m->ReadUInt32(iter, &vendor_id);
98 ret = ret && m->ReadUInt32(iter, &device_id); 100 ret = ret && m->ReadUInt32(iter, &device_id);
99 ret = ret && m->ReadWString(iter, &driver_version); 101 ret = ret && m->ReadWString(iter, &driver_version);
100 ret = ret && m->ReadUInt32(iter, &pixel_shader_version); 102 ret = ret && m->ReadUInt32(iter, &pixel_shader_version);
101 ret = ret && m->ReadUInt32(iter, &vertex_shader_version); 103 ret = ret && m->ReadUInt32(iter, &vertex_shader_version);
104 ret = ret && m->ReadUInt32(iter, &gl_version);
102 p->SetGraphicsInfo(vendor_id, device_id, driver_version, 105 p->SetGraphicsInfo(vendor_id, device_id, driver_version,
103 pixel_shader_version, vertex_shader_version); 106 pixel_shader_version, vertex_shader_version,
107 gl_version);
104 return ret; 108 return ret;
105 } 109 }
106 static void Log(const param_type& p, std::string* l) { 110 static void Log(const param_type& p, std::string* l) {
107 l->append(StringPrintf("<GPUInfo> %x %x %ls", 111 l->append(StringPrintf("<GPUInfo> %x %x %ls",
108 p.vendor_id(), p.device_id(), p.driver_version().c_str())); 112 p.vendor_id(), p.device_id(), p.driver_version().c_str()));
109 } 113 }
110 }; 114 };
111 115
112 template <> 116 template <>
113 struct ParamTraits<gpu::CommandBuffer::State> { 117 struct ParamTraits<gpu::CommandBuffer::State> {
(...skipping 22 matching lines...) Expand all
136 l->append("<CommandBuffer::State>"); 140 l->append("<CommandBuffer::State>");
137 } 141 }
138 }; 142 };
139 } // namespace IPC 143 } // namespace IPC
140 144
141 #define MESSAGES_INTERNAL_FILE \ 145 #define MESSAGES_INTERNAL_FILE \
142 "chrome/common/gpu_messages_internal.h" 146 "chrome/common/gpu_messages_internal.h"
143 #include "ipc/ipc_message_macros.h" 147 #include "ipc/ipc_message_macros.h"
144 148
145 #endif // CHROME_COMMON_GPU_MESSAGES_H_ 149 #endif // CHROME_COMMON_GPU_MESSAGES_H_
OLDNEW
« no previous file with comments | « chrome/common/gpu_info.cc ('k') | chrome/common/gpu_messages_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698