[content shell] implement testRunner.overridePreference
[chromium-blink-merge.git] / content / common / cc_messages.h
blobdfe9ef61260f1be11ef1cf51d25fc747470be5fb
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.
7 #include "cc/checkerboard_draw_quad.h"
8 #include "cc/compositor_frame.h"
9 #include "cc/compositor_frame_ack.h"
10 #include "cc/debug_border_draw_quad.h"
11 #include "cc/draw_quad.h"
12 #include "cc/io_surface_draw_quad.h"
13 #include "cc/render_pass.h"
14 #include "cc/render_pass_draw_quad.h"
15 #include "cc/shared_quad_state.h"
16 #include "cc/solid_color_draw_quad.h"
17 #include "cc/stream_video_draw_quad.h"
18 #include "cc/texture_draw_quad.h"
19 #include "cc/tile_draw_quad.h"
20 #include "cc/transferable_resource.h"
21 #include "cc/video_layer_impl.h"
22 #include "cc/yuv_video_draw_quad.h"
23 #include "content/common/content_export.h"
24 #include "ipc/ipc_message_macros.h"
25 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperation.h"
27 #ifndef CONTENT_COMMON_CC_MESSAGES_H_
28 #define CONTENT_COMMON_CC_MESSAGES_H_
30 namespace cc {
31 class CompositorFrame;
34 namespace gfx {
35 class Transform;
38 namespace WebKit {
39 class WebData;
40 class WebFilterOperations;
43 namespace IPC {
45 template <>
46 struct ParamTraits<WebKit::WebFilterOperation> {
47 typedef WebKit::WebFilterOperation param_type;
48 static void Write(Message* m, const param_type& p);
49 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
50 static void Log(const param_type& p, std::string* l);
53 template <>
54 struct ParamTraits<WebKit::WebFilterOperations> {
55 typedef WebKit::WebFilterOperations param_type;
56 static void Write(Message* m, const param_type& p);
57 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
58 static void Log(const param_type& p, std::string* l);
61 template <>
62 struct ParamTraits<gfx::Transform> {
63 typedef gfx::Transform param_type;
64 static void Write(Message* m, const param_type& p);
65 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
66 static void Log(const param_type& p, std::string* l);
69 template <>
70 struct CONTENT_EXPORT ParamTraits<cc::RenderPass> {
71 typedef cc::RenderPass param_type;
72 static void Write(Message* m, const param_type& p);
73 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
74 static void Log(const param_type& p, std::string* l);
77 template<>
78 struct CONTENT_EXPORT ParamTraits<cc::Mailbox> {
79 typedef cc::Mailbox param_type;
80 static void Write(Message* m, const param_type& p);
81 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
82 static void Log(const param_type& p, std::string* l);
85 template<>
86 struct CONTENT_EXPORT ParamTraits<cc::CompositorFrame> {
87 typedef cc::CompositorFrame param_type;
88 static void Write(Message* m, const param_type& p);
89 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
90 static void Log(const param_type& p, std::string* l);
93 template<>
94 struct CONTENT_EXPORT ParamTraits<cc::DelegatedFrameData> {
95 typedef cc::DelegatedFrameData param_type;
96 static void Write(Message* m, const param_type& p);
97 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
98 static void Log(const param_type& p, std::string* l);
101 } // namespace IPC
103 #endif // CONTENT_COMMON_CC_MESSAGES_H_
105 // Multiply-included message file, hence no include guard.
107 #define IPC_MESSAGE_START CCMsgStart
108 #undef IPC_MESSAGE_EXPORT
109 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
111 IPC_ENUM_TRAITS(cc::DrawQuad::Material)
112 IPC_ENUM_TRAITS(cc::IOSurfaceDrawQuad::Orientation)
113 IPC_ENUM_TRAITS(WebKit::WebFilterOperation::FilterType)
115 IPC_STRUCT_TRAITS_BEGIN(cc::RenderPass::Id)
116 IPC_STRUCT_TRAITS_MEMBER(layer_id)
117 IPC_STRUCT_TRAITS_MEMBER(index)
118 IPC_STRUCT_TRAITS_END()
120 IPC_STRUCT_TRAITS_BEGIN(cc::VideoLayerImpl::FramePlane)
121 IPC_STRUCT_TRAITS_MEMBER(resourceId)
122 IPC_STRUCT_TRAITS_MEMBER(size)
123 IPC_STRUCT_TRAITS_MEMBER(format)
124 IPC_STRUCT_TRAITS_END()
126 IPC_STRUCT_TRAITS_BEGIN(cc::DrawQuad)
127 IPC_STRUCT_TRAITS_MEMBER(material)
128 IPC_STRUCT_TRAITS_MEMBER(rect)
129 IPC_STRUCT_TRAITS_MEMBER(opaque_rect)
130 IPC_STRUCT_TRAITS_MEMBER(visible_rect)
131 IPC_STRUCT_TRAITS_MEMBER(needs_blending)
132 IPC_STRUCT_TRAITS_END()
134 IPC_STRUCT_TRAITS_BEGIN(cc::CheckerboardDrawQuad)
135 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
136 IPC_STRUCT_TRAITS_MEMBER(color)
137 IPC_STRUCT_TRAITS_END()
139 IPC_STRUCT_TRAITS_BEGIN(cc::DebugBorderDrawQuad)
140 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
141 IPC_STRUCT_TRAITS_MEMBER(color)
142 IPC_STRUCT_TRAITS_MEMBER(width)
143 IPC_STRUCT_TRAITS_END()
145 IPC_STRUCT_TRAITS_BEGIN(cc::IOSurfaceDrawQuad)
146 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
147 IPC_STRUCT_TRAITS_MEMBER(io_surface_size)
148 IPC_STRUCT_TRAITS_MEMBER(io_surface_texture_id)
149 IPC_STRUCT_TRAITS_MEMBER(orientation)
150 IPC_STRUCT_TRAITS_END()
152 IPC_STRUCT_TRAITS_BEGIN(cc::RenderPassDrawQuad)
153 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
154 IPC_STRUCT_TRAITS_MEMBER(is_replica)
155 IPC_STRUCT_TRAITS_MEMBER(mask_resource_id)
156 IPC_STRUCT_TRAITS_MEMBER(contents_changed_since_last_frame)
157 IPC_STRUCT_TRAITS_MEMBER(mask_uv_rect)
158 IPC_STRUCT_TRAITS_END()
160 IPC_STRUCT_TRAITS_BEGIN(cc::SolidColorDrawQuad)
161 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
162 IPC_STRUCT_TRAITS_MEMBER(color)
163 IPC_STRUCT_TRAITS_END()
165 IPC_STRUCT_TRAITS_BEGIN(cc::StreamVideoDrawQuad)
166 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
167 IPC_STRUCT_TRAITS_MEMBER(texture_id)
168 IPC_STRUCT_TRAITS_MEMBER(matrix)
169 IPC_STRUCT_TRAITS_END()
171 IPC_STRUCT_TRAITS_BEGIN(cc::TextureDrawQuad)
172 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
173 IPC_STRUCT_TRAITS_MEMBER(resource_id)
174 IPC_STRUCT_TRAITS_MEMBER(premultiplied_alpha)
175 IPC_STRUCT_TRAITS_MEMBER(uv_rect)
176 IPC_STRUCT_TRAITS_MEMBER(flipped)
177 IPC_STRUCT_TRAITS_END()
179 IPC_STRUCT_TRAITS_BEGIN(cc::TileDrawQuad)
180 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
181 IPC_STRUCT_TRAITS_MEMBER(resource_id)
182 IPC_STRUCT_TRAITS_MEMBER(tex_coord_rect)
183 IPC_STRUCT_TRAITS_MEMBER(texture_size)
184 IPC_STRUCT_TRAITS_MEMBER(swizzle_contents)
185 IPC_STRUCT_TRAITS_MEMBER(left_edge_aa)
186 IPC_STRUCT_TRAITS_MEMBER(top_edge_aa)
187 IPC_STRUCT_TRAITS_MEMBER(right_edge_aa)
188 IPC_STRUCT_TRAITS_MEMBER(bottom_edge_aa)
189 IPC_STRUCT_TRAITS_END()
191 IPC_STRUCT_TRAITS_BEGIN(cc::YUVVideoDrawQuad)
192 IPC_STRUCT_TRAITS_PARENT(cc::DrawQuad)
193 IPC_STRUCT_TRAITS_MEMBER(tex_scale)
194 IPC_STRUCT_TRAITS_MEMBER(y_plane)
195 IPC_STRUCT_TRAITS_MEMBER(u_plane)
196 IPC_STRUCT_TRAITS_MEMBER(v_plane)
197 IPC_STRUCT_TRAITS_END()
199 IPC_STRUCT_TRAITS_BEGIN(cc::SharedQuadState)
200 IPC_STRUCT_TRAITS_MEMBER(content_to_target_transform)
201 IPC_STRUCT_TRAITS_MEMBER(visible_content_rect)
202 IPC_STRUCT_TRAITS_MEMBER(clipped_rect_in_target)
203 IPC_STRUCT_TRAITS_MEMBER(clip_rect)
204 IPC_STRUCT_TRAITS_MEMBER(is_clipped)
205 IPC_STRUCT_TRAITS_MEMBER(opacity)
206 IPC_STRUCT_TRAITS_END()
208 IPC_STRUCT_TRAITS_BEGIN(cc::TransferableResource)
209 IPC_STRUCT_TRAITS_MEMBER(id)
210 IPC_STRUCT_TRAITS_MEMBER(format)
211 IPC_STRUCT_TRAITS_MEMBER(size)
212 IPC_STRUCT_TRAITS_MEMBER(mailbox)
213 IPC_STRUCT_TRAITS_END()
215 IPC_STRUCT_TRAITS_BEGIN(cc::TransferableResourceList)
216 IPC_STRUCT_TRAITS_MEMBER(sync_point)
217 IPC_STRUCT_TRAITS_MEMBER(resources)
218 IPC_STRUCT_TRAITS_END()
220 IPC_STRUCT_TRAITS_BEGIN(cc::CompositorFrameAck)
221 IPC_STRUCT_TRAITS_MEMBER(resources)
222 IPC_STRUCT_TRAITS_END()
224 IPC_STRUCT_TRAITS_BEGIN(cc::CompositorFrameMetadata)
225 IPC_STRUCT_TRAITS_MEMBER(root_scroll_offset)
226 IPC_STRUCT_TRAITS_MEMBER(page_scale_factor)
227 IPC_STRUCT_TRAITS_MEMBER(viewport_size)
228 IPC_STRUCT_TRAITS_MEMBER(root_layer_size)
229 IPC_STRUCT_TRAITS_MEMBER(min_page_scale_factor)
230 IPC_STRUCT_TRAITS_MEMBER(max_page_scale_factor)
231 IPC_STRUCT_TRAITS_MEMBER(location_bar_offset)
232 IPC_STRUCT_TRAITS_END()
234 IPC_STRUCT_TRAITS_BEGIN(cc::GLFrameData)
235 IPC_STRUCT_TRAITS_MEMBER(mailbox)
236 IPC_STRUCT_TRAITS_MEMBER(sync_point)
237 IPC_STRUCT_TRAITS_END()