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 "content/public/common/common_param_traits.h" | 10 #include "content/public/common/common_param_traits.h" |
10 #include "third_party/skia/include/core/SkData.h" | 11 #include "third_party/skia/include/core/SkData.h" |
11 #include "third_party/skia/include/core/SkFlattenableSerialization.h" | 12 #include "third_party/skia/include/core/SkFlattenableSerialization.h" |
12 #include "ui/gfx/transform.h" | 13 #include "ui/gfx/transform.h" |
13 | 14 |
14 namespace IPC { | 15 namespace IPC { |
15 | 16 |
16 void ParamTraits<cc::FilterOperation>::Write( | 17 void ParamTraits<cc::FilterOperation>::Write( |
17 Message* m, const param_type& p) { | 18 Message* m, const param_type& p) { |
18 WriteParam(m, p.type()); | 19 WriteParam(m, p.type()); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 | 382 |
382 static size_t ReserveSizeForRenderPassWrite(const cc::RenderPass& p) { | 383 static size_t ReserveSizeForRenderPassWrite(const cc::RenderPass& p) { |
383 size_t to_reserve = sizeof(cc::RenderPass); | 384 size_t to_reserve = sizeof(cc::RenderPass); |
384 | 385 |
385 to_reserve += p.shared_quad_state_list.size() * sizeof(cc::SharedQuadState); | 386 to_reserve += p.shared_quad_state_list.size() * sizeof(cc::SharedQuadState); |
386 | 387 |
387 // The shared_quad_state_index for each quad. | 388 // The shared_quad_state_index for each quad. |
388 to_reserve += p.quad_list.size() * sizeof(size_t); | 389 to_reserve += p.quad_list.size() * sizeof(size_t); |
389 | 390 |
390 // The largest quad type, verified by a unit test. | 391 // The largest quad type, verified by a unit test. |
391 to_reserve += p.quad_list.size() * sizeof(cc::RenderPassDrawQuad); | 392 to_reserve += p.quad_list.size() * sizeof(cc::kLargestDrawQuad); |
392 return to_reserve; | 393 return to_reserve; |
393 } | 394 } |
394 | 395 |
395 template<typename QuadType> | 396 template<typename QuadType> |
396 static scoped_ptr<cc::DrawQuad> ReadDrawQuad(const Message* m, | 397 static scoped_ptr<cc::DrawQuad> ReadDrawQuad(const Message* m, |
397 PickleIterator* iter) { | 398 PickleIterator* iter) { |
398 scoped_ptr<QuadType> quad(new QuadType); | 399 scoped_ptr<QuadType> quad(new QuadType); |
399 if (!ReadParam(m, iter, quad.get())) | 400 if (!ReadParam(m, iter, quad.get())) |
400 return scoped_ptr<QuadType>().template PassAs<cc::DrawQuad>(); | 401 return scoped_ptr<QuadType>().template PassAs<cc::DrawQuad>(); |
401 return quad.template PassAs<cc::DrawQuad>(); | 402 return quad.template PassAs<cc::DrawQuad>(); |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 l->append(", "); | 795 l->append(", "); |
795 LogParam(p.size, l); | 796 LogParam(p.size, l); |
796 l->append(", "); | 797 l->append(", "); |
797 LogParam(p.damage_rect, l); | 798 LogParam(p.damage_rect, l); |
798 l->append(", "); | 799 l->append(", "); |
799 LogParam(p.bitmap_id, l); | 800 LogParam(p.bitmap_id, l); |
800 l->append(")"); | 801 l->append(")"); |
801 } | 802 } |
802 | 803 |
803 } // namespace IPC | 804 } // namespace IPC |
OLD | NEW |