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

Side by Side Diff: content/common/cc_messages.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 | « content/common/BUILD.gn ('k') | content/common/cc_messages.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4 //
5 // IPC Messages sent between compositor instances.
6
7 #include "cc/output/begin_frame_args.h"
8 #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/viewport_selection_bound.h"
12 #include "cc/quads/debug_border_draw_quad.h"
13 #include "cc/quads/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"
17 #include "cc/quads/render_pass_draw_quad.h"
18 #include "cc/quads/shared_quad_state.h"
19 #include "cc/quads/solid_color_draw_quad.h"
20 #include "cc/quads/stream_video_draw_quad.h"
21 #include "cc/quads/surface_draw_quad.h"
22 #include "cc/quads/texture_draw_quad.h"
23 #include "cc/quads/tile_draw_quad.h"
24 #include "cc/quads/yuv_video_draw_quad.h"
25 #include "cc/resources/resource_format.h"
26 #include "cc/resources/returned_resource.h"
27 #include "cc/resources/transferable_resource.h"
28 #include "cc/surfaces/surface_id.h"
29 #include "cc/surfaces/surface_sequence.h"
30 #include "content/common/content_export.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"
34 #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h"
35
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
163 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
164
165 IPC_ENUM_TRAITS_MAX_VALUE(cc::DrawQuad::Material, cc::DrawQuad::MATERIAL_LAST)
166 IPC_ENUM_TRAITS_MAX_VALUE(cc::IOSurfaceDrawQuad::Orientation,
167 cc::IOSurfaceDrawQuad::ORIENTATION_LAST)
168 IPC_ENUM_TRAITS_MAX_VALUE(cc::FilterOperation::FilterType,
169 cc::FilterOperation::FILTER_TYPE_LAST )
170 IPC_ENUM_TRAITS_MAX_VALUE(cc::ResourceFormat, cc::RESOURCE_FORMAT_MAX)
171 IPC_ENUM_TRAITS_MAX_VALUE(cc::SelectionBoundType, cc::SELECTION_BOUND_TYPE_LAST)
172 IPC_ENUM_TRAITS_MAX_VALUE(SkXfermode::Mode, SkXfermode::kLastMode)
173 IPC_ENUM_TRAITS_MAX_VALUE(cc::YUVVideoDrawQuad::ColorSpace,
174 cc::YUVVideoDrawQuad::COLOR_SPACE_LAST)
175
176 IPC_STRUCT_TRAITS_BEGIN(cc::RenderPassId)
177 IPC_STRUCT_TRAITS_MEMBER(layer_id)
178 IPC_STRUCT_TRAITS_MEMBER(index)
179 IPC_STRUCT_TRAITS_END()
180
181 IPC_STRUCT_TRAITS_BEGIN(cc::SurfaceId)
182 IPC_STRUCT_TRAITS_MEMBER(id)
183 IPC_STRUCT_TRAITS_END()
184
185 IPC_STRUCT_TRAITS_BEGIN(cc::SurfaceSequence)
186 IPC_STRUCT_TRAITS_MEMBER(id_namespace)
187 IPC_STRUCT_TRAITS_MEMBER(sequence)
188 IPC_STRUCT_TRAITS_END()
189
190 IPC_STRUCT_TRAITS_BEGIN(cc::DrawQuad)
191 IPC_STRUCT_TRAITS_MEMBER(material)
192 IPC_STRUCT_TRAITS_MEMBER(rect)
193 IPC_STRUCT_TRAITS_MEMBER(opaque_rect)
194 IPC_STRUCT_TRAITS_MEMBER(visible_rect)
195 IPC_STRUCT_TRAITS_MEMBER(needs_blending)
196 IPC_STRUCT_TRAITS_MEMBER(resources)
197 IPC_STRUCT_TRAITS_END()
198
199 IPC_STRUCT_TRAITS_BEGIN(cc::DebugBorderDrawQuad)
200 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
201 IPC_STRUCT_TRAITS_MEMBER(color)
202 IPC_STRUCT_TRAITS_MEMBER(width)
203 IPC_STRUCT_TRAITS_END()
204
205 IPC_STRUCT_TRAITS_BEGIN(cc::IOSurfaceDrawQuad)
206 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
207 IPC_STRUCT_TRAITS_MEMBER(io_surface_size)
208 IPC_STRUCT_TRAITS_MEMBER(orientation)
209 IPC_STRUCT_TRAITS_END()
210
211 IPC_STRUCT_TRAITS_BEGIN(cc::RenderPassDrawQuad)
212 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
213 IPC_STRUCT_TRAITS_MEMBER(render_pass_id)
214 IPC_STRUCT_TRAITS_MEMBER(mask_uv_scale)
215 IPC_STRUCT_TRAITS_MEMBER(mask_texture_size)
216 IPC_STRUCT_TRAITS_MEMBER(filters)
217 IPC_STRUCT_TRAITS_MEMBER(filters_scale)
218 IPC_STRUCT_TRAITS_MEMBER(background_filters)
219 IPC_STRUCT_TRAITS_END()
220
221 IPC_STRUCT_TRAITS_BEGIN(cc::SolidColorDrawQuad)
222 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
223 IPC_STRUCT_TRAITS_MEMBER(color)
224 IPC_STRUCT_TRAITS_MEMBER(force_anti_aliasing_off)
225 IPC_STRUCT_TRAITS_END()
226
227 IPC_STRUCT_TRAITS_BEGIN(cc::StreamVideoDrawQuad)
228 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
229 IPC_STRUCT_TRAITS_MEMBER(overlay_resources)
230 IPC_STRUCT_TRAITS_MEMBER(matrix)
231 IPC_STRUCT_TRAITS_END()
232
233 IPC_STRUCT_TRAITS_BEGIN(cc::SurfaceDrawQuad)
234 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
235 IPC_STRUCT_TRAITS_MEMBER(surface_id)
236 IPC_STRUCT_TRAITS_END()
237
238 IPC_STRUCT_TRAITS_BEGIN(cc::TextureDrawQuad)
239 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
240 IPC_STRUCT_TRAITS_MEMBER(overlay_resources)
241 IPC_STRUCT_TRAITS_MEMBER(premultiplied_alpha)
242 IPC_STRUCT_TRAITS_MEMBER(uv_top_left)
243 IPC_STRUCT_TRAITS_MEMBER(uv_bottom_right)
244 IPC_STRUCT_TRAITS_MEMBER(background_color)
245 IPC_STRUCT_TRAITS_MEMBER(vertex_opacity[0])
246 IPC_STRUCT_TRAITS_MEMBER(vertex_opacity[1])
247 IPC_STRUCT_TRAITS_MEMBER(vertex_opacity[2])
248 IPC_STRUCT_TRAITS_MEMBER(vertex_opacity[3])
249 IPC_STRUCT_TRAITS_MEMBER(y_flipped)
250 IPC_STRUCT_TRAITS_MEMBER(nearest_neighbor)
251 IPC_STRUCT_TRAITS_END()
252
253 IPC_STRUCT_TRAITS_BEGIN(cc::TileDrawQuad)
254 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
255 IPC_STRUCT_TRAITS_MEMBER(tex_coord_rect)
256 IPC_STRUCT_TRAITS_MEMBER(texture_size)
257 IPC_STRUCT_TRAITS_MEMBER(swizzle_contents)
258 IPC_STRUCT_TRAITS_MEMBER(nearest_neighbor)
259 IPC_STRUCT_TRAITS_END()
260
261 IPC_STRUCT_TRAITS_BEGIN(cc::YUVVideoDrawQuad)
262 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
263 IPC_STRUCT_TRAITS_MEMBER(ya_tex_coord_rect)
264 IPC_STRUCT_TRAITS_MEMBER(uv_tex_coord_rect)
265 IPC_STRUCT_TRAITS_MEMBER(ya_tex_size)
266 IPC_STRUCT_TRAITS_MEMBER(uv_tex_size)
267 IPC_STRUCT_TRAITS_MEMBER(color_space)
268 IPC_STRUCT_TRAITS_MEMBER(resource_offset)
269 IPC_STRUCT_TRAITS_MEMBER(resource_multiplier)
270 IPC_STRUCT_TRAITS_END()
271
272 IPC_STRUCT_TRAITS_BEGIN(cc::SharedQuadState)
273 IPC_STRUCT_TRAITS_MEMBER(quad_to_target_transform)
274 IPC_STRUCT_TRAITS_MEMBER(quad_layer_bounds)
275 IPC_STRUCT_TRAITS_MEMBER(visible_quad_layer_rect)
276 IPC_STRUCT_TRAITS_MEMBER(clip_rect)
277 IPC_STRUCT_TRAITS_MEMBER(is_clipped)
278 IPC_STRUCT_TRAITS_MEMBER(opacity)
279 IPC_STRUCT_TRAITS_MEMBER(blend_mode)
280 IPC_STRUCT_TRAITS_MEMBER(sorting_context_id)
281 IPC_STRUCT_TRAITS_END()
282
283 IPC_STRUCT_TRAITS_BEGIN(cc::TransferableResource)
284 IPC_STRUCT_TRAITS_MEMBER(id)
285 IPC_STRUCT_TRAITS_MEMBER(format)
286 IPC_STRUCT_TRAITS_MEMBER(filter)
287 IPC_STRUCT_TRAITS_MEMBER(size)
288 IPC_STRUCT_TRAITS_MEMBER(mailbox_holder)
289 IPC_STRUCT_TRAITS_MEMBER(read_lock_fences_enabled)
290 IPC_STRUCT_TRAITS_MEMBER(is_software)
291 IPC_STRUCT_TRAITS_MEMBER(gpu_memory_buffer_id)
292 IPC_STRUCT_TRAITS_MEMBER(is_overlay_candidate)
293 IPC_STRUCT_TRAITS_END()
294
295 IPC_STRUCT_TRAITS_BEGIN(cc::ReturnedResource)
296 IPC_STRUCT_TRAITS_MEMBER(id)
297 IPC_STRUCT_TRAITS_MEMBER(sync_token)
298 IPC_STRUCT_TRAITS_MEMBER(count)
299 IPC_STRUCT_TRAITS_MEMBER(lost)
300 IPC_STRUCT_TRAITS_END()
301
302 IPC_STRUCT_TRAITS_BEGIN(cc::ViewportSelectionBound)
303 IPC_STRUCT_TRAITS_MEMBER(type)
304 IPC_STRUCT_TRAITS_MEMBER(edge_top)
305 IPC_STRUCT_TRAITS_MEMBER(edge_bottom)
306 IPC_STRUCT_TRAITS_MEMBER(visible)
307 IPC_STRUCT_TRAITS_END()
308
309 IPC_STRUCT_TRAITS_BEGIN(cc::ViewportSelection)
310 IPC_STRUCT_TRAITS_MEMBER(start)
311 IPC_STRUCT_TRAITS_MEMBER(end)
312 IPC_STRUCT_TRAITS_MEMBER(is_editable)
313 IPC_STRUCT_TRAITS_MEMBER(is_empty_text_form_control)
314 IPC_STRUCT_TRAITS_END()
315
316 IPC_ENUM_TRAITS_MAX_VALUE( \
317 cc::BeginFrameArgs::BeginFrameArgsType, \
318 cc::BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX - 1)
319
320 IPC_STRUCT_TRAITS_BEGIN(cc::BeginFrameArgs)
321 IPC_STRUCT_TRAITS_MEMBER(frame_time)
322 IPC_STRUCT_TRAITS_MEMBER(deadline)
323 IPC_STRUCT_TRAITS_MEMBER(interval)
324 IPC_STRUCT_TRAITS_MEMBER(type)
325 IPC_STRUCT_TRAITS_END()
326
327 IPC_STRUCT_TRAITS_BEGIN(cc::CompositorFrameMetadata)
328 IPC_STRUCT_TRAITS_MEMBER(device_scale_factor)
329 IPC_STRUCT_TRAITS_MEMBER(root_scroll_offset)
330 IPC_STRUCT_TRAITS_MEMBER(page_scale_factor)
331 IPC_STRUCT_TRAITS_MEMBER(scrollable_viewport_size)
332 IPC_STRUCT_TRAITS_MEMBER(root_layer_size)
333 IPC_STRUCT_TRAITS_MEMBER(min_page_scale_factor)
334 IPC_STRUCT_TRAITS_MEMBER(max_page_scale_factor)
335 IPC_STRUCT_TRAITS_MEMBER(root_overflow_x_hidden)
336 IPC_STRUCT_TRAITS_MEMBER(root_overflow_y_hidden)
337 IPC_STRUCT_TRAITS_MEMBER(location_bar_offset)
338 IPC_STRUCT_TRAITS_MEMBER(location_bar_content_translation)
339 IPC_STRUCT_TRAITS_MEMBER(root_background_color)
340 IPC_STRUCT_TRAITS_MEMBER(selection)
341 IPC_STRUCT_TRAITS_MEMBER(latency_info)
342 IPC_STRUCT_TRAITS_MEMBER(satisfies_sequences)
343 IPC_STRUCT_TRAITS_MEMBER(referenced_surfaces)
344 IPC_STRUCT_TRAITS_END()
345
346 IPC_STRUCT_TRAITS_BEGIN(cc::GLFrameData)
347 IPC_STRUCT_TRAITS_MEMBER(mailbox)
348 IPC_STRUCT_TRAITS_MEMBER(sync_token)
349 IPC_STRUCT_TRAITS_MEMBER(size)
350 IPC_STRUCT_TRAITS_MEMBER(sub_buffer_rect)
351 IPC_STRUCT_TRAITS_END()
OLDNEW
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/cc_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698