OLD | NEW |
---|---|
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 #include "chrome/common/gpu_messages.h" | 5 #include "chrome/common/gpu_messages.h" |
6 | 6 |
7 #include "chrome/common/gpu_create_command_buffer_config.h" | 7 #include "chrome/common/gpu_create_command_buffer_config.h" |
8 #include "chrome/common/gpu_feature_flags.h" | |
8 #include "chrome/common/gpu_info.h" | 9 #include "chrome/common/gpu_info.h" |
9 #include "chrome/common/dx_diag_node.h" | 10 #include "chrome/common/dx_diag_node.h" |
10 #include "gfx/rect.h" | 11 #include "gfx/rect.h" |
11 #include "gfx/size.h" | 12 #include "gfx/size.h" |
12 #include "ipc/ipc_channel_handle.h" | 13 #include "ipc/ipc_channel_handle.h" |
13 #include "ipc/ipc_message_utils.h" | 14 #include "ipc/ipc_message_utils.h" |
14 | 15 |
15 #define MESSAGES_INTERNAL_IMPL_FILE \ | 16 #define MESSAGES_INTERNAL_IMPL_FILE \ |
16 "chrome/common/gpu_messages_internal.h" | 17 "chrome/common/gpu_messages_internal.h" |
17 #include "ipc/ipc_message_impl_macros.h" | 18 #include "ipc/ipc_message_impl_macros.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 l->append(", "); | 123 l->append(", "); |
123 LogParam(p.surface_id, l); | 124 LogParam(p.surface_id, l); |
124 l->append(", "); | 125 l->append(", "); |
125 LogParam(p.route_id, l); | 126 LogParam(p.route_id, l); |
126 l->append(", "); | 127 l->append(", "); |
127 LogParam(p.swap_buffers_count, l); | 128 LogParam(p.swap_buffers_count, l); |
128 l->append(")"); | 129 l->append(")"); |
129 } | 130 } |
130 #endif // if defined(OS_MACOSX) | 131 #endif // if defined(OS_MACOSX) |
131 | 132 |
133 void ParamTraits<GpuFeatureFlags> ::Write(Message* m, const param_type& p) { | |
134 WriteParam(m, p.is_accelerated_2d_canvas_blacklisted()); | |
135 WriteParam(m, p.is_accelerated_compositing_blacklisted()); | |
136 WriteParam(m, p.is_webgl_blacklisted()); | |
137 } | |
138 | |
139 bool ParamTraits<GpuFeatureFlags> ::Read( | |
140 const Message* m, void** iter, param_type* p) { | |
141 bool is_accelerated_2d_canvas_blacklisted; | |
142 bool is_accelerated_compositing_blacklisted; | |
143 bool is_webgl_blacklisted; | |
144 bool ret = ReadParam(m, iter, &is_accelerated_2d_canvas_blacklisted); | |
145 ret = ret && ReadParam(m, iter, &is_accelerated_compositing_blacklisted); | |
vangelis
2010/12/08 00:17:38
nit: combine all three in a single statement that
Zhenyao Mo
2010/12/09 00:06:06
Done.
| |
146 ret = ret && ReadParam(m, iter, &is_webgl_blacklisted); | |
147 if (!ret) | |
148 return false; | |
149 p->SetFlags(is_accelerated_2d_canvas_blacklisted, | |
150 is_accelerated_compositing_blacklisted, | |
151 is_webgl_blacklisted); | |
152 return true; | |
153 } | |
154 | |
155 void ParamTraits<GpuFeatureFlags> ::Log(const param_type& p, std::string* l) { | |
156 l->append(base::StringPrintf("<GpuFeatureFlags> %d %d %d", | |
157 p.is_accelerated_2d_canvas_blacklisted(), | |
158 p.is_accelerated_compositing_blacklisted(), | |
159 p.is_webgl_blacklisted())); | |
160 } | |
161 | |
132 void ParamTraits<GPUInfo> ::Write(Message* m, const param_type& p) { | 162 void ParamTraits<GPUInfo> ::Write(Message* m, const param_type& p) { |
133 WriteParam(m, static_cast<int32>(p.progress())); | 163 WriteParam(m, static_cast<int32>(p.progress())); |
134 WriteParam(m, p.initialization_time()); | 164 WriteParam(m, p.initialization_time()); |
135 WriteParam(m, p.vendor_id()); | 165 WriteParam(m, p.vendor_id()); |
136 WriteParam(m, p.device_id()); | 166 WriteParam(m, p.device_id()); |
137 WriteParam(m, p.driver_version()); | 167 WriteParam(m, p.driver_version()); |
138 WriteParam(m, p.pixel_shader_version()); | 168 WriteParam(m, p.pixel_shader_version()); |
139 WriteParam(m, p.vertex_shader_version()); | 169 WriteParam(m, p.vertex_shader_version()); |
140 WriteParam(m, p.gl_version()); | 170 WriteParam(m, p.gl_version()); |
141 WriteParam(m, p.can_lose_context()); | 171 WriteParam(m, p.can_lose_context()); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 } | 290 } |
261 return true; | 291 return true; |
262 } | 292 } |
263 | 293 |
264 void ParamTraits<GPUCreateCommandBufferConfig> ::Log( | 294 void ParamTraits<GPUCreateCommandBufferConfig> ::Log( |
265 const param_type& p, std::string* l) { | 295 const param_type& p, std::string* l) { |
266 l->append("<GPUCreateCommandBufferConfig>"); | 296 l->append("<GPUCreateCommandBufferConfig>"); |
267 } | 297 } |
268 | 298 |
269 } // namespace IPC | 299 } // namespace IPC |
OLD | NEW |