| 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_info.h" | 8 #include "chrome/common/gpu_info.h" |
| 9 #include "chrome/common/dx_diag_node.h" | 9 #include "chrome/common/dx_diag_node.h" |
| 10 #include "gfx/rect.h" | 10 #include "gfx/rect.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 l->append(", "); | 122 l->append(", "); |
| 123 LogParam(p.surface_id, l); | 123 LogParam(p.surface_id, l); |
| 124 l->append(", "); | 124 l->append(", "); |
| 125 LogParam(p.route_id, l); | 125 LogParam(p.route_id, l); |
| 126 l->append(", "); | 126 l->append(", "); |
| 127 LogParam(p.swap_buffers_count, l); | 127 LogParam(p.swap_buffers_count, l); |
| 128 l->append(")"); | 128 l->append(")"); |
| 129 } | 129 } |
| 130 #endif // if defined(OS_MACOSX) | 130 #endif // if defined(OS_MACOSX) |
| 131 | 131 |
| 132 void ParamTraits<GpuFeatureFlags> ::Write(Message* m, const param_type& p) { |
| 133 WriteParam(m, p.is_accelerated_2d_canvas_blacklisted()); |
| 134 WriteParam(m, p.is_accelerated_compositing_blacklisted()); |
| 135 WriteParam(m, p.is_webgl_blacklisted()); |
| 136 } |
| 137 |
| 138 bool ParamTraits<GpuFeatureFlags> ::Read( |
| 139 const Message* m, void** iter, param_type* p) { |
| 140 bool is_accelerated_2d_canvas_blacklisted; |
| 141 bool is_accelerated_compositing_blacklisted; |
| 142 bool is_webgl_blacklisted; |
| 143 bool ret = ReadParam(m, iter, &is_accelerated_2d_canvas_blacklisted); |
| 144 ret = ret && ReadParam(m, iter, &is_accelerated_compositing_blacklisted); |
| 145 ret = ret && ReadParam(m, iter, &is_webgl_blacklisted); |
| 146 if (!ret) |
| 147 return false; |
| 148 p->SetFlags(is_accelerated_2d_canvas_blacklisted, |
| 149 is_accelerated_compositing_blacklisted, |
| 150 is_webgl_blacklisted); |
| 151 return true; |
| 152 } |
| 153 |
| 154 void ParamTraits<GpuFeatureFlags> ::Log(const param_type& p, std::string* l) { |
| 155 l->append(base::StringPrintf("<GpuFeatureFlags> %d %d %d", |
| 156 p.is_accelerated_2d_canvas_blacklisted(), |
| 157 p.is_accelerated_compositing_blacklisted(), |
| 158 p.is_webgl_blacklisted())); |
| 159 } |
| 160 |
| 132 void ParamTraits<GPUInfo> ::Write(Message* m, const param_type& p) { | 161 void ParamTraits<GPUInfo> ::Write(Message* m, const param_type& p) { |
| 133 WriteParam(m, static_cast<int32>(p.progress())); | 162 WriteParam(m, static_cast<int32>(p.progress())); |
| 134 WriteParam(m, p.initialization_time()); | 163 WriteParam(m, p.initialization_time()); |
| 135 WriteParam(m, p.vendor_id()); | 164 WriteParam(m, p.vendor_id()); |
| 136 WriteParam(m, p.device_id()); | 165 WriteParam(m, p.device_id()); |
| 137 WriteParam(m, p.driver_version()); | 166 WriteParam(m, p.driver_version()); |
| 138 WriteParam(m, p.pixel_shader_version()); | 167 WriteParam(m, p.pixel_shader_version()); |
| 139 WriteParam(m, p.vertex_shader_version()); | 168 WriteParam(m, p.vertex_shader_version()); |
| 140 WriteParam(m, p.gl_version()); | 169 WriteParam(m, p.gl_version()); |
| 141 WriteParam(m, p.can_lose_context()); | 170 WriteParam(m, p.can_lose_context()); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 289 } |
| 261 return true; | 290 return true; |
| 262 } | 291 } |
| 263 | 292 |
| 264 void ParamTraits<GPUCreateCommandBufferConfig> ::Log( | 293 void ParamTraits<GPUCreateCommandBufferConfig> ::Log( |
| 265 const param_type& p, std::string* l) { | 294 const param_type& p, std::string* l) { |
| 266 l->append("<GPUCreateCommandBufferConfig>"); | 295 l->append("<GPUCreateCommandBufferConfig>"); |
| 267 } | 296 } |
| 268 | 297 |
| 269 } // namespace IPC | 298 } // namespace IPC |
| OLD | NEW |