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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 size_t to_reserve = sizeof(cc::RenderPass); | 372 size_t to_reserve = sizeof(cc::RenderPass); |
373 | 373 |
374 // Whether the quad points to a new shared quad state for each quad. | 374 // Whether the quad points to a new shared quad state for each quad. |
375 to_reserve += p.quad_list.size() * sizeof(bool); | 375 to_reserve += p.quad_list.size() * sizeof(bool); |
376 | 376 |
377 // Shared quad state is only written when a quad contains a shared quad state | 377 // Shared quad state is only written when a quad contains a shared quad state |
378 // that has not been written. | 378 // that has not been written. |
379 to_reserve += p.shared_quad_state_list.size() * sizeof(cc::SharedQuadState); | 379 to_reserve += p.shared_quad_state_list.size() * sizeof(cc::SharedQuadState); |
380 | 380 |
381 // The largest quad type, verified by a unit test. | 381 // The largest quad type, verified by a unit test. |
382 to_reserve += p.quad_list.size() * sizeof(cc::kLargestDrawQuad); | 382 to_reserve += p.quad_list.size() * cc::LargestDrawQuadSize(); |
383 return to_reserve; | 383 return to_reserve; |
384 } | 384 } |
385 | 385 |
386 template <typename QuadType> | 386 template <typename QuadType> |
387 static cc::DrawQuad* ReadDrawQuad(const Message* m, | 387 static cc::DrawQuad* ReadDrawQuad(const Message* m, |
388 PickleIterator* iter, | 388 PickleIterator* iter, |
389 cc::RenderPass* render_pass) { | 389 cc::RenderPass* render_pass) { |
390 QuadType* quad = render_pass->CreateAndAppendDrawQuad<QuadType>(); | 390 QuadType* quad = render_pass->CreateAndAppendDrawQuad<QuadType>(); |
391 if (!ReadParam(m, iter, quad)) | 391 if (!ReadParam(m, iter, quad)) |
392 return NULL; | 392 return NULL; |
(...skipping 395 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 |