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/draw_quad.h" | |
9 #include "cc/quads/largest_draw_quad.h" | 10 #include "cc/quads/largest_draw_quad.h" |
10 #include "cc/quads/render_pass_id.h" | 11 #include "cc/quads/render_pass_id.h" |
11 #include "content/public/common/common_param_traits.h" | 12 #include "content/public/common/common_param_traits.h" |
12 #include "third_party/skia/include/core/SkData.h" | 13 #include "third_party/skia/include/core/SkData.h" |
13 #include "third_party/skia/include/core/SkFlattenableSerialization.h" | 14 #include "third_party/skia/include/core/SkFlattenableSerialization.h" |
14 #include "ui/gfx/transform.h" | 15 #include "ui/gfx/transform.h" |
15 | 16 |
16 namespace IPC { | 17 namespace IPC { |
17 | 18 |
18 void ParamTraits<cc::FilterOperation>::Write( | 19 void ParamTraits<cc::FilterOperation>::Write( |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
801 LogParam(p.id, l); | 802 LogParam(p.id, l); |
802 l->append(", "); | 803 l->append(", "); |
803 LogParam(p.size, l); | 804 LogParam(p.size, l); |
804 l->append(", "); | 805 l->append(", "); |
805 LogParam(p.damage_rect, l); | 806 LogParam(p.damage_rect, l); |
806 l->append(", "); | 807 l->append(", "); |
807 LogParam(p.bitmap_id, l); | 808 LogParam(p.bitmap_id, l); |
808 l->append(")"); | 809 l->append(")"); |
809 } | 810 } |
810 | 811 |
812 void ParamTraits<cc::DrawQuad::Resources>::Write(Message* m, | |
813 const param_type& p) { | |
814 DCHECK_LE(p.count, cc::DrawQuad::Resources::kMaxResourceIdCount); | |
815 WriteParam(m, p.count); | |
816 for (size_t i = 0; i < p.count; ++i) | |
817 WriteParam(m, p.ids[i]); | |
818 } | |
819 | |
820 bool ParamTraits<cc::DrawQuad::Resources>::Read(const Message* m, | |
821 PickleIterator* iter, | |
822 param_type* p) { | |
823 if (!ReadParam(m, iter, &p->count)) | |
824 return false; | |
825 if (p->count > cc::DrawQuad::Resources::kMaxResourceIdCount) | |
826 return false; | |
827 for (size_t i = 0; i < p->count; ++i) { | |
828 if (!ReadParam(m, iter, &p->ids[i])) | |
829 return false; | |
830 } | |
831 return true; | |
832 } | |
833 | |
834 void ParamTraits<cc::DrawQuad::Resources>::Log(const param_type& p, | |
835 std::string* l) { | |
836 l->append("DrawQuad::Resources("); | |
837 LogParam(p.count, l); | |
838 l->append(", ["); | |
839 for (size_t i = 0; i < p.count; ++i) { | |
Mike West
2015/06/02 04:37:19
Please check the size of `p.count` here as well.
vmpstr
2015/06/02 17:19:22
Done.
| |
840 LogParam(p.ids[i], l); | |
841 if (i < (p.count - 1)) | |
842 l->append(", "); | |
843 } | |
844 l->append("])"); | |
845 } | |
846 | |
811 } // namespace IPC | 847 } // namespace IPC |
OLD | NEW |