Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: content/common/cc_messages.cc

Issue 1152473006: cc: Remove DrawQuad::IterateResoruces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(p.IsCountValid());
815
816 size_t to_reserve = sizeof(p.count) + p.count * sizeof(p.ids[0]);
danakj 2015/05/28 23:00:15 space for this is already reserved in ReserveSizeF
vmpstr 2015/05/28 23:35:52 Hmm makes sense. Done.
817 m->Reserve(to_reserve);
818
819 WriteParam(m, p.count);
820 for (size_t i = 0; i < p.count; ++i)
821 WriteParam(m, p.ids[i]);
822 }
823
824 bool ParamTraits<cc::DrawQuad::Resources>::Read(const Message* m,
825 PickleIterator* iter,
826 param_type* p) {
827 if (!ReadParam(m, iter, &p->count))
828 return false;
829 if (!p->IsCountValid())
830 return false;
831 for (size_t i = 0; i < p->count; ++i) {
832 if (!ReadParam(m, iter, &p->ids[i]))
833 return false;
834 }
835 return true;
836 }
837
838 void ParamTraits<cc::DrawQuad::Resources>::Log(const param_type& p,
839 std::string* l) {
840 l->append("DrawQuad::Resources(");
841 LogParam(p.count, l);
842 l->append(", [");
843 for (size_t i = 0; i < p.count; ++i) {
844 LogParam(p.ids[i], l);
845 if (i < (p.count - 1))
846 l->append(", ");
847 }
848 l->append("])");
849 }
850
811 } // namespace IPC 851 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698