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

Side by Side Diff: cc/ipc/cc_param_traits_macros.h

Issue 1978053002: Move cc ParamTraits to cc/ipc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ignore size_t warnings Created 4 years, 7 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/ipc/cc_param_traits.cc ('k') | content/common/BUILD.gn » ('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 2016 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 //
5 // IPC Messages sent between compositor instances.
6 4
5 #ifndef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
6 #define CC_IPC_CC_PARAM_TRAITS_MACROS_H_
7
8 #include "cc/input/selection_bound_type.h"
7 #include "cc/output/begin_frame_args.h" 9 #include "cc/output/begin_frame_args.h"
8 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
9 #include "cc/output/compositor_frame_ack.h"
10 #include "cc/output/filter_operation.h" 11 #include "cc/output/filter_operation.h"
11 #include "cc/output/viewport_selection_bound.h"
12 #include "cc/quads/debug_border_draw_quad.h" 12 #include "cc/quads/debug_border_draw_quad.h"
13 #include "cc/quads/draw_quad.h" 13 #include "cc/quads/draw_quad.h"
14 #include "cc/quads/io_surface_draw_quad.h" 14 #include "cc/quads/io_surface_draw_quad.h"
15 #include "cc/quads/picture_draw_quad.h"
16 #include "cc/quads/render_pass.h" 15 #include "cc/quads/render_pass.h"
17 #include "cc/quads/render_pass_draw_quad.h" 16 #include "cc/quads/render_pass_id.h"
18 #include "cc/quads/shared_quad_state.h" 17 #include "cc/quads/shared_quad_state.h"
19 #include "cc/quads/solid_color_draw_quad.h" 18 #include "cc/quads/solid_color_draw_quad.h"
20 #include "cc/quads/stream_video_draw_quad.h" 19 #include "cc/quads/stream_video_draw_quad.h"
21 #include "cc/quads/surface_draw_quad.h" 20 #include "cc/quads/surface_draw_quad.h"
22 #include "cc/quads/texture_draw_quad.h" 21 #include "cc/quads/texture_draw_quad.h"
23 #include "cc/quads/tile_draw_quad.h" 22 #include "cc/quads/tile_draw_quad.h"
24 #include "cc/quads/yuv_video_draw_quad.h" 23 #include "cc/quads/yuv_video_draw_quad.h"
25 #include "cc/resources/resource_format.h" 24 #include "cc/resources/resource_format.h"
26 #include "cc/resources/returned_resource.h" 25 #include "cc/resources/returned_resource.h"
27 #include "cc/resources/transferable_resource.h" 26 #include "cc/resources/transferable_resource.h"
28 #include "cc/surfaces/surface_id.h" 27 #include "cc/surfaces/surface_id.h"
29 #include "cc/surfaces/surface_sequence.h" 28 #include "cc/surfaces/surface_sequence.h"
30 #include "content/common/content_export.h" 29 #include "ui/events/ipc/latency_info_param_traits.h"
31 #include "gpu/ipc/common/gpu_command_buffer_traits.h"
32 #include "ipc/ipc_message_macros.h"
33 #include "ui/gfx/ipc/gfx_param_traits.h" 30 #include "ui/gfx/ipc/gfx_param_traits.h"
34 #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" 31 #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h"
35 32
36 #ifndef CONTENT_COMMON_CC_MESSAGES_H_
37 #define CONTENT_COMMON_CC_MESSAGES_H_
38
39 namespace gfx {
40 class Transform;
41 }
42
43 namespace cc {
44 class FilterOperations;
45 }
46
47 namespace IPC {
48
49 template <>
50 struct ParamTraits<cc::FilterOperation> {
51 typedef cc::FilterOperation param_type;
52 static void GetSize(base::PickleSizer* s, const param_type& p);
53 static void Write(base::Pickle* m, const param_type& p);
54 static bool Read(const base::Pickle* m,
55 base::PickleIterator* iter,
56 param_type* r);
57 static void Log(const param_type& p, std::string* l);
58 };
59
60 template <>
61 struct ParamTraits<cc::FilterOperations> {
62 typedef cc::FilterOperations param_type;
63 static void GetSize(base::PickleSizer* s, const param_type& p);
64 static void Write(base::Pickle* m, const param_type& p);
65 static bool Read(const base::Pickle* m,
66 base::PickleIterator* iter,
67 param_type* r);
68 static void Log(const param_type& p, std::string* l);
69 };
70
71 template <>
72 struct ParamTraits<sk_sp<SkImageFilter> > {
73 typedef sk_sp<SkImageFilter> param_type;
74 static void GetSize(base::PickleSizer* s, const param_type& p);
75 static void Write(base::Pickle* m, const param_type& p);
76 static bool Read(const base::Pickle* m,
77 base::PickleIterator* iter,
78 param_type* r);
79 static void Log(const param_type& p, std::string* l);
80 };
81
82 template <>
83 struct CONTENT_EXPORT ParamTraits<cc::RenderPass> {
84 typedef cc::RenderPass param_type;
85 static void Write(base::Pickle* m, const param_type& p);
86 static bool Read(const base::Pickle* m,
87 base::PickleIterator* iter,
88 param_type* r);
89 static void Log(const param_type& p, std::string* l);
90 };
91
92 template<>
93 struct CONTENT_EXPORT ParamTraits<cc::CompositorFrame> {
94 typedef cc::CompositorFrame param_type;
95 static void Write(base::Pickle* m, const param_type& p);
96 static bool Read(const base::Pickle* m,
97 base::PickleIterator* iter,
98 param_type* p);
99 static void Log(const param_type& p, std::string* l);
100 };
101
102 template<>
103 struct CONTENT_EXPORT ParamTraits<cc::CompositorFrameAck> {
104 typedef cc::CompositorFrameAck param_type;
105 static void Write(base::Pickle* m, const param_type& p);
106 static bool Read(const base::Pickle* m,
107 base::PickleIterator* iter,
108 param_type* p);
109 static void Log(const param_type& p, std::string* l);
110 };
111
112 template<>
113 struct CONTENT_EXPORT ParamTraits<cc::DelegatedFrameData> {
114 typedef cc::DelegatedFrameData param_type;
115 static void Write(base::Pickle* m, const param_type& p);
116 static bool Read(const base::Pickle* m,
117 base::PickleIterator* iter,
118 param_type* p);
119 static void Log(const param_type& p, std::string* l);
120 };
121
122 template <>
123 struct CONTENT_EXPORT ParamTraits<cc::DrawQuad::Resources> {
124 typedef cc::DrawQuad::Resources param_type;
125 static void GetSize(base::PickleSizer* s, const param_type& p);
126 static void Write(base::Pickle* m, const param_type& p);
127 static bool Read(const base::Pickle* m,
128 base::PickleIterator* iter,
129 param_type* p);
130 static void Log(const param_type& p, std::string* l);
131 };
132
133 template <>
134 struct CONTENT_EXPORT ParamTraits<cc::StreamVideoDrawQuad::OverlayResources> {
135 typedef cc::StreamVideoDrawQuad::OverlayResources param_type;
136 static void GetSize(base::PickleSizer* s, const param_type& p);
137 static void Write(base::Pickle* m, const param_type& p);
138 static bool Read(const base::Pickle* m,
139 base::PickleIterator* iter,
140 param_type* p);
141 static void Log(const param_type& p, std::string* l);
142 };
143
144 template <>
145 struct CONTENT_EXPORT ParamTraits<cc::TextureDrawQuad::OverlayResources> {
146 typedef cc::TextureDrawQuad::OverlayResources param_type;
147 static void GetSize(base::PickleSizer* s, const param_type& p);
148 static void Write(base::Pickle* m, const param_type& p);
149 static bool Read(const base::Pickle* m,
150 base::PickleIterator* iter,
151 param_type* p);
152 static void Log(const param_type& p, std::string* l);
153 };
154
155 } // namespace IPC
156
157 #endif // CONTENT_COMMON_CC_MESSAGES_H_
158
159 // Multiply-included message file, hence no include guard.
160
161 #define IPC_MESSAGE_START CCMsgStart
162 #undef IPC_MESSAGE_EXPORT 33 #undef IPC_MESSAGE_EXPORT
163 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT 34 #define IPC_MESSAGE_EXPORT CC_IPC_EXPORT
164 35
165 IPC_ENUM_TRAITS_MAX_VALUE(cc::DrawQuad::Material, cc::DrawQuad::MATERIAL_LAST) 36 IPC_ENUM_TRAITS_MAX_VALUE(cc::DrawQuad::Material, cc::DrawQuad::MATERIAL_LAST)
166 IPC_ENUM_TRAITS_MAX_VALUE(cc::IOSurfaceDrawQuad::Orientation, 37 IPC_ENUM_TRAITS_MAX_VALUE(cc::IOSurfaceDrawQuad::Orientation,
167 cc::IOSurfaceDrawQuad::ORIENTATION_LAST) 38 cc::IOSurfaceDrawQuad::ORIENTATION_LAST)
168 IPC_ENUM_TRAITS_MAX_VALUE(cc::FilterOperation::FilterType, 39 IPC_ENUM_TRAITS_MAX_VALUE(cc::FilterOperation::FilterType,
169 cc::FilterOperation::FILTER_TYPE_LAST ) 40 cc::FilterOperation::FILTER_TYPE_LAST)
170 IPC_ENUM_TRAITS_MAX_VALUE(cc::ResourceFormat, cc::RESOURCE_FORMAT_MAX) 41 IPC_ENUM_TRAITS_MAX_VALUE(cc::ResourceFormat, cc::RESOURCE_FORMAT_MAX)
171 IPC_ENUM_TRAITS_MAX_VALUE(cc::SelectionBoundType, cc::SELECTION_BOUND_TYPE_LAST) 42 IPC_ENUM_TRAITS_MAX_VALUE(cc::SelectionBoundType, cc::SELECTION_BOUND_TYPE_LAST)
43
44 // TODO(fsamuel): This trait belongs with skia code.
172 IPC_ENUM_TRAITS_MAX_VALUE(SkXfermode::Mode, SkXfermode::kLastMode) 45 IPC_ENUM_TRAITS_MAX_VALUE(SkXfermode::Mode, SkXfermode::kLastMode)
173 IPC_ENUM_TRAITS_MAX_VALUE(cc::YUVVideoDrawQuad::ColorSpace, 46 IPC_ENUM_TRAITS_MAX_VALUE(cc::YUVVideoDrawQuad::ColorSpace,
174 cc::YUVVideoDrawQuad::COLOR_SPACE_LAST) 47 cc::YUVVideoDrawQuad::COLOR_SPACE_LAST)
175 48
176 IPC_STRUCT_TRAITS_BEGIN(cc::RenderPassId) 49 IPC_STRUCT_TRAITS_BEGIN(cc::RenderPassId)
177 IPC_STRUCT_TRAITS_MEMBER(layer_id) 50 IPC_STRUCT_TRAITS_MEMBER(layer_id)
178 IPC_STRUCT_TRAITS_MEMBER(index) 51 IPC_STRUCT_TRAITS_MEMBER(index)
179 IPC_STRUCT_TRAITS_END() 52 IPC_STRUCT_TRAITS_END()
180 53
181 IPC_STRUCT_TRAITS_BEGIN(cc::SurfaceId) 54 IPC_STRUCT_TRAITS_BEGIN(cc::SurfaceId)
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 IPC_STRUCT_TRAITS_MEMBER(ya_tex_coord_rect) 136 IPC_STRUCT_TRAITS_MEMBER(ya_tex_coord_rect)
264 IPC_STRUCT_TRAITS_MEMBER(uv_tex_coord_rect) 137 IPC_STRUCT_TRAITS_MEMBER(uv_tex_coord_rect)
265 IPC_STRUCT_TRAITS_MEMBER(ya_tex_size) 138 IPC_STRUCT_TRAITS_MEMBER(ya_tex_size)
266 IPC_STRUCT_TRAITS_MEMBER(uv_tex_size) 139 IPC_STRUCT_TRAITS_MEMBER(uv_tex_size)
267 IPC_STRUCT_TRAITS_MEMBER(color_space) 140 IPC_STRUCT_TRAITS_MEMBER(color_space)
268 IPC_STRUCT_TRAITS_MEMBER(resource_offset) 141 IPC_STRUCT_TRAITS_MEMBER(resource_offset)
269 IPC_STRUCT_TRAITS_MEMBER(resource_multiplier) 142 IPC_STRUCT_TRAITS_MEMBER(resource_multiplier)
270 IPC_STRUCT_TRAITS_END() 143 IPC_STRUCT_TRAITS_END()
271 144
272 IPC_STRUCT_TRAITS_BEGIN(cc::SharedQuadState) 145 IPC_STRUCT_TRAITS_BEGIN(cc::SharedQuadState)
273 IPC_STRUCT_TRAITS_MEMBER(quad_to_target_transform) 146 IPC_STRUCT_TRAITS_MEMBER(quad_to_target_transform)
274 IPC_STRUCT_TRAITS_MEMBER(quad_layer_bounds) 147 IPC_STRUCT_TRAITS_MEMBER(quad_layer_bounds)
275 IPC_STRUCT_TRAITS_MEMBER(visible_quad_layer_rect) 148 IPC_STRUCT_TRAITS_MEMBER(visible_quad_layer_rect)
276 IPC_STRUCT_TRAITS_MEMBER(clip_rect) 149 IPC_STRUCT_TRAITS_MEMBER(clip_rect)
277 IPC_STRUCT_TRAITS_MEMBER(is_clipped) 150 IPC_STRUCT_TRAITS_MEMBER(is_clipped)
278 IPC_STRUCT_TRAITS_MEMBER(opacity) 151 IPC_STRUCT_TRAITS_MEMBER(opacity)
279 IPC_STRUCT_TRAITS_MEMBER(blend_mode) 152 IPC_STRUCT_TRAITS_MEMBER(blend_mode)
280 IPC_STRUCT_TRAITS_MEMBER(sorting_context_id) 153 IPC_STRUCT_TRAITS_MEMBER(sorting_context_id)
281 IPC_STRUCT_TRAITS_END() 154 IPC_STRUCT_TRAITS_END()
282 155
283 IPC_STRUCT_TRAITS_BEGIN(cc::TransferableResource) 156 IPC_STRUCT_TRAITS_BEGIN(cc::TransferableResource)
284 IPC_STRUCT_TRAITS_MEMBER(id) 157 IPC_STRUCT_TRAITS_MEMBER(id)
285 IPC_STRUCT_TRAITS_MEMBER(format) 158 IPC_STRUCT_TRAITS_MEMBER(format)
(...skipping 20 matching lines...) Expand all
306 IPC_STRUCT_TRAITS_MEMBER(visible) 179 IPC_STRUCT_TRAITS_MEMBER(visible)
307 IPC_STRUCT_TRAITS_END() 180 IPC_STRUCT_TRAITS_END()
308 181
309 IPC_STRUCT_TRAITS_BEGIN(cc::ViewportSelection) 182 IPC_STRUCT_TRAITS_BEGIN(cc::ViewportSelection)
310 IPC_STRUCT_TRAITS_MEMBER(start) 183 IPC_STRUCT_TRAITS_MEMBER(start)
311 IPC_STRUCT_TRAITS_MEMBER(end) 184 IPC_STRUCT_TRAITS_MEMBER(end)
312 IPC_STRUCT_TRAITS_MEMBER(is_editable) 185 IPC_STRUCT_TRAITS_MEMBER(is_editable)
313 IPC_STRUCT_TRAITS_MEMBER(is_empty_text_form_control) 186 IPC_STRUCT_TRAITS_MEMBER(is_empty_text_form_control)
314 IPC_STRUCT_TRAITS_END() 187 IPC_STRUCT_TRAITS_END()
315 188
316 IPC_ENUM_TRAITS_MAX_VALUE( \ 189 IPC_ENUM_TRAITS_MAX_VALUE(cc::BeginFrameArgs::BeginFrameArgsType,
317 cc::BeginFrameArgs::BeginFrameArgsType, \ 190 cc::BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX - 1)
318 cc::BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX - 1)
319 191
320 IPC_STRUCT_TRAITS_BEGIN(cc::BeginFrameArgs) 192 IPC_STRUCT_TRAITS_BEGIN(cc::BeginFrameArgs)
321 IPC_STRUCT_TRAITS_MEMBER(frame_time) 193 IPC_STRUCT_TRAITS_MEMBER(frame_time)
322 IPC_STRUCT_TRAITS_MEMBER(deadline) 194 IPC_STRUCT_TRAITS_MEMBER(deadline)
323 IPC_STRUCT_TRAITS_MEMBER(interval) 195 IPC_STRUCT_TRAITS_MEMBER(interval)
324 IPC_STRUCT_TRAITS_MEMBER(type) 196 IPC_STRUCT_TRAITS_MEMBER(type)
325 IPC_STRUCT_TRAITS_END() 197 IPC_STRUCT_TRAITS_END()
326 198
327 IPC_STRUCT_TRAITS_BEGIN(cc::CompositorFrameMetadata) 199 IPC_STRUCT_TRAITS_BEGIN(cc::CompositorFrameMetadata)
328 IPC_STRUCT_TRAITS_MEMBER(device_scale_factor) 200 IPC_STRUCT_TRAITS_MEMBER(device_scale_factor)
(...skipping 13 matching lines...) Expand all
342 IPC_STRUCT_TRAITS_MEMBER(satisfies_sequences) 214 IPC_STRUCT_TRAITS_MEMBER(satisfies_sequences)
343 IPC_STRUCT_TRAITS_MEMBER(referenced_surfaces) 215 IPC_STRUCT_TRAITS_MEMBER(referenced_surfaces)
344 IPC_STRUCT_TRAITS_END() 216 IPC_STRUCT_TRAITS_END()
345 217
346 IPC_STRUCT_TRAITS_BEGIN(cc::GLFrameData) 218 IPC_STRUCT_TRAITS_BEGIN(cc::GLFrameData)
347 IPC_STRUCT_TRAITS_MEMBER(mailbox) 219 IPC_STRUCT_TRAITS_MEMBER(mailbox)
348 IPC_STRUCT_TRAITS_MEMBER(sync_token) 220 IPC_STRUCT_TRAITS_MEMBER(sync_token)
349 IPC_STRUCT_TRAITS_MEMBER(size) 221 IPC_STRUCT_TRAITS_MEMBER(size)
350 IPC_STRUCT_TRAITS_MEMBER(sub_buffer_rect) 222 IPC_STRUCT_TRAITS_MEMBER(sub_buffer_rect)
351 IPC_STRUCT_TRAITS_END() 223 IPC_STRUCT_TRAITS_END()
224
225 #endif // CC_IPC_CC_PARAM_TRAITS_MACROS_H_
OLDNEW
« no previous file with comments | « cc/ipc/cc_param_traits.cc ('k') | content/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698