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

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: mkwst review 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_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 if (p.count > cc::DrawQuad::Resources::kMaxResourceIdCount) {
840 l->append("])");
841 return;
842 }
843
844 for (size_t i = 0; i < p.count; ++i) {
845 LogParam(p.ids[i], l);
846 if (i < (p.count - 1))
847 l->append(", ");
848 }
849 l->append("])");
850 }
851
811 } // namespace IPC 852 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698