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

Side by Side Diff: cc/ipc/cc_param_traits.cc

Issue 2088273003: Video Color Managament (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: todo added Created 4 years, 4 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
« no previous file with comments | « cc/cc.gyp ('k') | cc/ipc/cc_param_traits_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "cc/ipc/cc_param_traits.h" 5 #include "cc/ipc/cc_param_traits.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 } 878 }
879 879
880 void ParamTraits<cc::YUVVideoDrawQuad>::GetSize(base::PickleSizer* s, 880 void ParamTraits<cc::YUVVideoDrawQuad>::GetSize(base::PickleSizer* s,
881 const param_type& p) { 881 const param_type& p) {
882 ParamTraits<cc::DrawQuad>::GetSize(s, p); 882 ParamTraits<cc::DrawQuad>::GetSize(s, p);
883 GetParamSize(s, p.ya_tex_coord_rect); 883 GetParamSize(s, p.ya_tex_coord_rect);
884 GetParamSize(s, p.uv_tex_coord_rect); 884 GetParamSize(s, p.uv_tex_coord_rect);
885 GetParamSize(s, p.ya_tex_size); 885 GetParamSize(s, p.ya_tex_size);
886 GetParamSize(s, p.uv_tex_size); 886 GetParamSize(s, p.uv_tex_size);
887 GetParamSize(s, p.color_space); 887 GetParamSize(s, p.color_space);
888 GetParamSize(s, p.video_color_space);
888 GetParamSize(s, p.resource_offset); 889 GetParamSize(s, p.resource_offset);
889 GetParamSize(s, p.resource_multiplier); 890 GetParamSize(s, p.resource_multiplier);
890 GetParamSize(s, p.bits_per_channel); 891 GetParamSize(s, p.bits_per_channel);
891 } 892 }
892 893
893 void ParamTraits<cc::YUVVideoDrawQuad>::Write(base::Pickle* m, 894 void ParamTraits<cc::YUVVideoDrawQuad>::Write(base::Pickle* m,
894 const param_type& p) { 895 const param_type& p) {
895 ParamTraits<cc::DrawQuad>::Write(m, p); 896 ParamTraits<cc::DrawQuad>::Write(m, p);
896 WriteParam(m, p.ya_tex_coord_rect); 897 WriteParam(m, p.ya_tex_coord_rect);
897 WriteParam(m, p.uv_tex_coord_rect); 898 WriteParam(m, p.uv_tex_coord_rect);
898 WriteParam(m, p.ya_tex_size); 899 WriteParam(m, p.ya_tex_size);
899 WriteParam(m, p.uv_tex_size); 900 WriteParam(m, p.uv_tex_size);
900 WriteParam(m, p.color_space); 901 WriteParam(m, p.color_space);
902 WriteParam(m, p.video_color_space);
901 WriteParam(m, p.resource_offset); 903 WriteParam(m, p.resource_offset);
902 WriteParam(m, p.resource_multiplier); 904 WriteParam(m, p.resource_multiplier);
903 WriteParam(m, p.bits_per_channel); 905 WriteParam(m, p.bits_per_channel);
904 } 906 }
905 907
906 bool ParamTraits<cc::YUVVideoDrawQuad>::Read(const base::Pickle* m, 908 bool ParamTraits<cc::YUVVideoDrawQuad>::Read(const base::Pickle* m,
907 base::PickleIterator* iter, 909 base::PickleIterator* iter,
908 param_type* p) { 910 param_type* p) {
909 return ParamTraits<cc::DrawQuad>::Read(m, iter, p) && 911 return ParamTraits<cc::DrawQuad>::Read(m, iter, p) &&
910 ReadParam(m, iter, &p->ya_tex_coord_rect) && 912 ReadParam(m, iter, &p->ya_tex_coord_rect) &&
911 ReadParam(m, iter, &p->uv_tex_coord_rect) && 913 ReadParam(m, iter, &p->uv_tex_coord_rect) &&
912 ReadParam(m, iter, &p->ya_tex_size) && 914 ReadParam(m, iter, &p->ya_tex_size) &&
913 ReadParam(m, iter, &p->uv_tex_size) && 915 ReadParam(m, iter, &p->uv_tex_size) &&
914 ReadParam(m, iter, &p->color_space) && 916 ReadParam(m, iter, &p->color_space) &&
917 ReadParam(m, iter, &p->video_color_space) &&
915 ReadParam(m, iter, &p->resource_offset) && 918 ReadParam(m, iter, &p->resource_offset) &&
916 ReadParam(m, iter, &p->resource_multiplier) && 919 ReadParam(m, iter, &p->resource_multiplier) &&
917 ReadParam(m, iter, &p->bits_per_channel) && 920 ReadParam(m, iter, &p->bits_per_channel) &&
918 p->bits_per_channel >= cc::YUVVideoDrawQuad::kMinBitsPerChannel && 921 p->bits_per_channel >= cc::YUVVideoDrawQuad::kMinBitsPerChannel &&
919 p->bits_per_channel <= cc::YUVVideoDrawQuad::kMaxBitsPerChannel; 922 p->bits_per_channel <= cc::YUVVideoDrawQuad::kMaxBitsPerChannel;
920 } 923 }
921 924
922 void ParamTraits<cc::YUVVideoDrawQuad>::Log(const param_type& p, 925 void ParamTraits<cc::YUVVideoDrawQuad>::Log(const param_type& p,
923 std::string* l) { 926 std::string* l) {
924 l->append("("); 927 l->append("(");
925 ParamTraits<cc::DrawQuad>::Log(p, l); 928 ParamTraits<cc::DrawQuad>::Log(p, l);
926 l->append(", "); 929 l->append(", ");
927 LogParam(p.ya_tex_coord_rect, l); 930 LogParam(p.ya_tex_coord_rect, l);
928 l->append(", "); 931 l->append(", ");
929 LogParam(p.uv_tex_coord_rect, l); 932 LogParam(p.uv_tex_coord_rect, l);
930 l->append(", "); 933 l->append(", ");
931 LogParam(p.ya_tex_size, l); 934 LogParam(p.ya_tex_size, l);
932 l->append(", "); 935 l->append(", ");
933 LogParam(p.uv_tex_size, l); 936 LogParam(p.uv_tex_size, l);
934 l->append(", "); 937 l->append(", ");
935 LogParam(p.color_space, l); 938 LogParam(p.color_space, l);
936 l->append(", "); 939 l->append(", ");
nasko 2016/08/08 21:15:21 Shouldn't we also be logging the new member here?
hubbe 2016/08/10 17:03:25 Done.
937 LogParam(p.resource_offset, l); 940 LogParam(p.resource_offset, l);
938 l->append(", "); 941 l->append(", ");
939 LogParam(p.resource_multiplier, l); 942 LogParam(p.resource_multiplier, l);
940 l->append(", "); 943 l->append(", ");
941 LogParam(p.bits_per_channel, l); 944 LogParam(p.bits_per_channel, l);
942 l->append("])"); 945 l->append("])");
943 } 946 }
944 947
945 } // namespace IPC 948 } // namespace IPC
946 949
(...skipping 17 matching lines...) Expand all
964 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 967 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
965 #include "cc/ipc/cc_param_traits_macros.h" 968 #include "cc/ipc/cc_param_traits_macros.h"
966 } // namespace IPC 969 } // namespace IPC
967 970
968 // Generate param traits log methods. 971 // Generate param traits log methods.
969 #include "ipc/param_traits_log_macros.h" 972 #include "ipc/param_traits_log_macros.h"
970 namespace IPC { 973 namespace IPC {
971 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 974 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
972 #include "cc/ipc/cc_param_traits_macros.h" 975 #include "cc/ipc/cc_param_traits_macros.h"
973 } // namespace IPC 976 } // namespace IPC
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/ipc/cc_param_traits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698