| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/common/cc_messages.h" | 5 #include "content/common/cc_messages.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/output/filter_operations.h" | 8 #include "cc/output/filter_operations.h" |
| 9 #include "cc/quads/largest_draw_quad.h" | 9 #include "cc/quads/largest_draw_quad.h" |
| 10 #include "content/public/common/common_param_traits.h" | 10 #include "content/public/common/common_param_traits.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 m->WriteData(static_cast<const char*>(data->data()), data->size()); | 221 m->WriteData(static_cast<const char*>(data->data()), data->size()); |
| 222 } else { | 222 } else { |
| 223 m->WriteData(0, 0); | 223 m->WriteData(0, 0); |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 | 226 |
| 227 bool ParamTraits<skia::RefPtr<SkImageFilter> >::Read( | 227 bool ParamTraits<skia::RefPtr<SkImageFilter> >::Read( |
| 228 const Message* m, PickleIterator* iter, param_type* r) { | 228 const Message* m, PickleIterator* iter, param_type* r) { |
| 229 const char* data = 0; | 229 const char* data = 0; |
| 230 int length = 0; | 230 int length = 0; |
| 231 if (!iter->ReadData(&data, &length)) | 231 if (!m->ReadData(iter, &data, &length)) |
| 232 return false; | 232 return false; |
| 233 if (length > 0) { | 233 if (length > 0) { |
| 234 SkFlattenable* flattenable = SkValidatingDeserializeFlattenable( | 234 SkFlattenable* flattenable = SkValidatingDeserializeFlattenable( |
| 235 data, length, SkImageFilter::GetFlattenableType()); | 235 data, length, SkImageFilter::GetFlattenableType()); |
| 236 *r = skia::AdoptRef(static_cast<SkImageFilter*>(flattenable)); | 236 *r = skia::AdoptRef(static_cast<SkImageFilter*>(flattenable)); |
| 237 } else { | 237 } else { |
| 238 r->clear(); | 238 r->clear(); |
| 239 } | 239 } |
| 240 return true; | 240 return true; |
| 241 } | 241 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 255 #else | 255 #else |
| 256 double column_major_data[16]; | 256 double column_major_data[16]; |
| 257 p.matrix().asColMajord(column_major_data); | 257 p.matrix().asColMajord(column_major_data); |
| 258 #endif | 258 #endif |
| 259 m->WriteBytes(&column_major_data, sizeof(SkMScalar) * 16); | 259 m->WriteBytes(&column_major_data, sizeof(SkMScalar) * 16); |
| 260 } | 260 } |
| 261 | 261 |
| 262 bool ParamTraits<gfx::Transform>::Read( | 262 bool ParamTraits<gfx::Transform>::Read( |
| 263 const Message* m, PickleIterator* iter, param_type* r) { | 263 const Message* m, PickleIterator* iter, param_type* r) { |
| 264 const char* column_major_data; | 264 const char* column_major_data; |
| 265 if (!iter->ReadBytes(&column_major_data, sizeof(SkMScalar) * 16)) | 265 if (!m->ReadBytes(iter, &column_major_data, sizeof(SkMScalar) * 16)) |
| 266 return false; | 266 return false; |
| 267 r->matrix().setColMajor( | 267 r->matrix().setColMajor( |
| 268 reinterpret_cast<const SkMScalar*>(column_major_data)); | 268 reinterpret_cast<const SkMScalar*>(column_major_data)); |
| 269 return true; | 269 return true; |
| 270 } | 270 } |
| 271 | 271 |
| 272 void ParamTraits<gfx::Transform>::Log( | 272 void ParamTraits<gfx::Transform>::Log( |
| 273 const param_type& p, std::string* l) { | 273 const param_type& p, std::string* l) { |
| 274 #ifdef SK_MSCALAR_IS_FLOAT | 274 #ifdef SK_MSCALAR_IS_FLOAT |
| 275 float row_major_data[16]; | 275 float row_major_data[16]; |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 l->append(", "); | 788 l->append(", "); |
| 789 LogParam(p.size, l); | 789 LogParam(p.size, l); |
| 790 l->append(", "); | 790 l->append(", "); |
| 791 LogParam(p.damage_rect, l); | 791 LogParam(p.damage_rect, l); |
| 792 l->append(", "); | 792 l->append(", "); |
| 793 LogParam(p.bitmap_id, l); | 793 LogParam(p.bitmap_id, l); |
| 794 l->append(")"); | 794 l->append(")"); |
| 795 } | 795 } |
| 796 | 796 |
| 797 } // namespace IPC | 797 } // namespace IPC |
| OLD | NEW |