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.
5 // IPC Messages sent between compositor instances.
7 #include "cc/debug/latency_info.h"
8 #include "cc/output/compositor_frame.h"
9 #include "cc/output/compositor_frame_ack.h"
10 #include "cc/quads/checkerboard_draw_quad.h"
11 #include "cc/quads/debug_border_draw_quad.h"
12 #include "cc/quads/draw_quad.h"
13 #include "cc/quads/io_surface_draw_quad.h"
14 #include "cc/quads/picture_draw_quad.h"
15 #include "cc/quads/render_pass.h"
16 #include "cc/quads/render_pass_draw_quad.h"
17 #include "cc/quads/shared_quad_state.h"
18 #include "cc/quads/solid_color_draw_quad.h"
19 #include "cc/quads/stream_video_draw_quad.h"
20 #include "cc/quads/texture_draw_quad.h"
21 #include "cc/quads/tile_draw_quad.h"
22 #include "cc/quads/yuv_video_draw_quad.h"
23 #include "cc/resources/transferable_resource.h"
24 #include "content/common/content_export.h"
25 #include "gpu/ipc/gpu_command_buffer_traits.h"
26 #include "ipc/ipc_message_macros.h"
27 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperation.h"
29 #ifndef CONTENT_COMMON_CC_MESSAGES_H_
30 #define CONTENT_COMMON_CC_MESSAGES_H_
38 class WebFilterOperations
;
44 struct ParamTraits
<WebKit::WebFilterOperation
> {
45 typedef WebKit::WebFilterOperation param_type
;
46 static void Write(Message
* m
, const param_type
& p
);
47 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
48 static void Log(const param_type
& p
, std::string
* l
);
52 struct ParamTraits
<WebKit::WebFilterOperations
> {
53 typedef WebKit::WebFilterOperations param_type
;
54 static void Write(Message
* m
, const param_type
& p
);
55 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
56 static void Log(const param_type
& p
, std::string
* l
);
60 struct ParamTraits
<gfx::Transform
> {
61 typedef gfx::Transform param_type
;
62 static void Write(Message
* m
, const param_type
& p
);
63 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
64 static void Log(const param_type
& p
, std::string
* l
);
68 struct CONTENT_EXPORT ParamTraits
<cc::RenderPass
> {
69 typedef cc::RenderPass param_type
;
70 static void Write(Message
* m
, const param_type
& p
);
71 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
72 static void Log(const param_type
& p
, std::string
* l
);
76 struct CONTENT_EXPORT ParamTraits
<cc::CompositorFrame
> {
77 typedef cc::CompositorFrame param_type
;
78 static void Write(Message
* m
, const param_type
& p
);
79 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* p
);
80 static void Log(const param_type
& p
, std::string
* l
);
84 struct CONTENT_EXPORT ParamTraits
<cc::CompositorFrameAck
> {
85 typedef cc::CompositorFrameAck param_type
;
86 static void Write(Message
* m
, const param_type
& p
);
87 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* p
);
88 static void Log(const param_type
& p
, std::string
* l
);
92 struct CONTENT_EXPORT ParamTraits
<cc::DelegatedFrameData
> {
93 typedef cc::DelegatedFrameData param_type
;
94 static void Write(Message
* m
, const param_type
& p
);
95 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* p
);
96 static void Log(const param_type
& p
, std::string
* l
);
101 #endif // CONTENT_COMMON_CC_MESSAGES_H_
103 // Multiply-included message file, hence no include guard.
105 #define IPC_MESSAGE_START CCMsgStart
106 #undef IPC_MESSAGE_EXPORT
107 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
109 IPC_ENUM_TRAITS(cc::DrawQuad::Material
)
110 IPC_ENUM_TRAITS(cc::IOSurfaceDrawQuad::Orientation
)
111 IPC_ENUM_TRAITS(WebKit::WebFilterOperation::FilterType
)
113 IPC_STRUCT_TRAITS_BEGIN(cc::RenderPass::Id
)
114 IPC_STRUCT_TRAITS_MEMBER(layer_id
)
115 IPC_STRUCT_TRAITS_MEMBER(index
)
116 IPC_STRUCT_TRAITS_END()
118 IPC_STRUCT_TRAITS_BEGIN(cc::DrawQuad
)
119 IPC_STRUCT_TRAITS_MEMBER(material
)
120 IPC_STRUCT_TRAITS_MEMBER(rect
)
121 IPC_STRUCT_TRAITS_MEMBER(opaque_rect
)
122 IPC_STRUCT_TRAITS_MEMBER(visible_rect
)
123 IPC_STRUCT_TRAITS_MEMBER(needs_blending
)
124 IPC_STRUCT_TRAITS_END()
126 IPC_STRUCT_TRAITS_BEGIN(cc::CheckerboardDrawQuad
)
127 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad
)
128 IPC_STRUCT_TRAITS_MEMBER(color
)
129 IPC_STRUCT_TRAITS_END()
131 IPC_STRUCT_TRAITS_BEGIN(cc::DebugBorderDrawQuad
)
132 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad
)
133 IPC_STRUCT_TRAITS_MEMBER(color
)
134 IPC_STRUCT_TRAITS_MEMBER(width
)
135 IPC_STRUCT_TRAITS_END()
137 IPC_STRUCT_TRAITS_BEGIN(cc::IOSurfaceDrawQuad
)
138 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad
)
139 IPC_STRUCT_TRAITS_MEMBER(io_surface_size
)
140 IPC_STRUCT_TRAITS_MEMBER(io_surface_resource_id
)
141 IPC_STRUCT_TRAITS_MEMBER(orientation
)
142 IPC_STRUCT_TRAITS_END()
144 IPC_STRUCT_TRAITS_BEGIN(cc::RenderPassDrawQuad
)
145 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad
)
146 IPC_STRUCT_TRAITS_MEMBER(is_replica
)
147 IPC_STRUCT_TRAITS_MEMBER(mask_resource_id
)
148 IPC_STRUCT_TRAITS_MEMBER(contents_changed_since_last_frame
)
149 IPC_STRUCT_TRAITS_MEMBER(mask_uv_rect
)
150 IPC_STRUCT_TRAITS_MEMBER(filters
)
151 // TODO(piman): filter isn't being serialized.
152 // IPC_STRUCT_TRAITS_MEMBER(filter)
153 IPC_STRUCT_TRAITS_MEMBER(background_filters
)
154 IPC_STRUCT_TRAITS_END()
156 IPC_STRUCT_TRAITS_BEGIN(cc::SolidColorDrawQuad
)
157 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad
)
158 IPC_STRUCT_TRAITS_MEMBER(color
)
159 IPC_STRUCT_TRAITS_END()
161 IPC_STRUCT_TRAITS_BEGIN(cc::StreamVideoDrawQuad
)
162 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad
)
163 IPC_STRUCT_TRAITS_MEMBER(resource_id
)
164 IPC_STRUCT_TRAITS_MEMBER(matrix
)
165 IPC_STRUCT_TRAITS_END()
167 IPC_STRUCT_TRAITS_BEGIN(cc::TextureDrawQuad
)
168 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad
)
169 IPC_STRUCT_TRAITS_MEMBER(resource_id
)
170 IPC_STRUCT_TRAITS_MEMBER(premultiplied_alpha
)
171 IPC_STRUCT_TRAITS_MEMBER(uv_top_left
)
172 IPC_STRUCT_TRAITS_MEMBER(uv_bottom_right
)
173 IPC_STRUCT_TRAITS_MEMBER(vertex_opacity
[0])
174 IPC_STRUCT_TRAITS_MEMBER(vertex_opacity
[1])
175 IPC_STRUCT_TRAITS_MEMBER(vertex_opacity
[2])
176 IPC_STRUCT_TRAITS_MEMBER(vertex_opacity
[3])
177 IPC_STRUCT_TRAITS_MEMBER(flipped
)
178 IPC_STRUCT_TRAITS_END()
180 IPC_STRUCT_TRAITS_BEGIN(cc::TileDrawQuad
)
181 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad
)
182 IPC_STRUCT_TRAITS_MEMBER(resource_id
)
183 IPC_STRUCT_TRAITS_MEMBER(tex_coord_rect
)
184 IPC_STRUCT_TRAITS_MEMBER(texture_size
)
185 IPC_STRUCT_TRAITS_MEMBER(swizzle_contents
)
186 IPC_STRUCT_TRAITS_END()
188 IPC_STRUCT_TRAITS_BEGIN(cc::YUVVideoDrawQuad
)
189 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad
)
190 IPC_STRUCT_TRAITS_MEMBER(tex_scale
)
191 IPC_STRUCT_TRAITS_MEMBER(y_plane_resource_id
)
192 IPC_STRUCT_TRAITS_MEMBER(u_plane_resource_id
)
193 IPC_STRUCT_TRAITS_MEMBER(v_plane_resource_id
)
194 IPC_STRUCT_TRAITS_END()
196 IPC_STRUCT_TRAITS_BEGIN(cc::SharedQuadState
)
197 IPC_STRUCT_TRAITS_MEMBER(content_to_target_transform
)
198 IPC_STRUCT_TRAITS_MEMBER(content_bounds
)
199 IPC_STRUCT_TRAITS_MEMBER(visible_content_rect
)
200 IPC_STRUCT_TRAITS_MEMBER(clip_rect
)
201 IPC_STRUCT_TRAITS_MEMBER(is_clipped
)
202 IPC_STRUCT_TRAITS_MEMBER(opacity
)
203 IPC_STRUCT_TRAITS_END()
205 IPC_STRUCT_TRAITS_BEGIN(cc::TransferableResource
)
206 IPC_STRUCT_TRAITS_MEMBER(id
)
207 IPC_STRUCT_TRAITS_MEMBER(sync_point
)
208 IPC_STRUCT_TRAITS_MEMBER(format
)
209 IPC_STRUCT_TRAITS_MEMBER(filter
)
210 IPC_STRUCT_TRAITS_MEMBER(size
)
211 IPC_STRUCT_TRAITS_MEMBER(mailbox
)
212 IPC_STRUCT_TRAITS_END()
214 IPC_STRUCT_TRAITS_BEGIN(cc::LatencyInfo
)
215 IPC_STRUCT_TRAITS_MEMBER(renderer_main_frame_number
)
216 IPC_STRUCT_TRAITS_MEMBER(renderer_impl_frame_number
)
217 IPC_STRUCT_TRAITS_MEMBER(browser_main_frame_number
)
218 IPC_STRUCT_TRAITS_MEMBER(browser_impl_frame_number
)
219 IPC_STRUCT_TRAITS_MEMBER(swap_timestamp
)
220 IPC_STRUCT_TRAITS_END()
222 IPC_STRUCT_TRAITS_BEGIN(cc::CompositorFrameMetadata
)
223 IPC_STRUCT_TRAITS_MEMBER(device_scale_factor
)
224 IPC_STRUCT_TRAITS_MEMBER(root_scroll_offset
)
225 IPC_STRUCT_TRAITS_MEMBER(page_scale_factor
)
226 IPC_STRUCT_TRAITS_MEMBER(viewport_size
)
227 IPC_STRUCT_TRAITS_MEMBER(root_layer_size
)
228 IPC_STRUCT_TRAITS_MEMBER(min_page_scale_factor
)
229 IPC_STRUCT_TRAITS_MEMBER(max_page_scale_factor
)
230 IPC_STRUCT_TRAITS_MEMBER(location_bar_offset
)
231 IPC_STRUCT_TRAITS_MEMBER(location_bar_content_translation
)
232 IPC_STRUCT_TRAITS_MEMBER(overdraw_bottom_height
)
233 IPC_STRUCT_TRAITS_END()
235 IPC_STRUCT_TRAITS_BEGIN(cc::GLFrameData
)
236 IPC_STRUCT_TRAITS_MEMBER(mailbox
)
237 IPC_STRUCT_TRAITS_MEMBER(sync_point
)
238 IPC_STRUCT_TRAITS_MEMBER(size
)
239 IPC_STRUCT_TRAITS_END()
241 IPC_STRUCT_TRAITS_BEGIN(cc::SoftwareFrameData
)
242 IPC_STRUCT_TRAITS_MEMBER(size
)
243 IPC_STRUCT_TRAITS_MEMBER(damage_rect
)
244 IPC_STRUCT_TRAITS_MEMBER(dib_id
)
245 IPC_STRUCT_TRAITS_END()