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

Side by Side Diff: content/common/android/sync_compositor_messages.h

Issue 1408123005: Android Webview IPC-based sync compositing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright 2015 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 #include "cc/output/begin_frame_args.h"
6 #include "cc/output/compositor_frame.h"
7 #include "cc/resources/returned_resource.h"
8 #include "content/common/content_export.h"
9 #include "content/common/content_param_traits.h"
10 #include "content/common/input/input_event_ack_state.h"
11 #include "ipc/ipc_message_macros.h"
12 #include "third_party/WebKit/public/web/WebInputEvent.h"
13 #include "ui/gfx/geometry/scroll_offset.h"
14
15 #ifndef CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_
dcheng 2015/10/27 21:06:58 Does this include guard need to intentionally omit
boliu 2015/10/28 02:07:06 Only ipc/ipc_message_macros.h need to live outside
16 #define CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_
17
18 namespace IPC {
19
20 template <>
21 struct ParamTraits<gfx::ScrollOffset> {
22 typedef gfx::ScrollOffset param_type;
23 static void Write(Message* m, const param_type& p);
24 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
25 static void Log(const param_type& p, std::string* l);
26 };
27
28 } // namespace IPC
29
30 namespace content {
31
32 struct CommonBrowserParams {
33 CommonBrowserParams();
34 CommonBrowserParams(
35 size_t bytes_limit,
36 const gfx::ScrollOffset& root_scroll_offset);
37 ~CommonBrowserParams();
38
39 size_t bytes_limit;
40 cc::ReturnedResourceArray resources;
41 gfx::ScrollOffset root_scroll_offset;
42 };
43
44 struct DemandDrawHwParams {
45 DemandDrawHwParams();
46 DemandDrawHwParams(const gfx::Size& surface_size,
47 const gfx::Transform& transform,
48 const gfx::Rect& viewport,
49 const gfx::Rect& clip,
50 const gfx::Rect& viewport_rect_for_tile_priority,
51 const gfx::Transform& transform_for_tile_priority);
52 ~DemandDrawHwParams();
53
54 gfx::Size surface_size;
55 gfx::Transform transform;
56 gfx::Rect viewport;
57 gfx::Rect clip;
58 gfx::Rect viewport_rect_for_tile_priority;
59 gfx::Transform transform_for_tile_priority;
60 };
61
62 struct CommonRendererParams {
63 CommonRendererParams();
64 CommonRendererParams(
65 unsigned int version,
66 const gfx::ScrollOffset& total_scroll_offset,
67 const gfx::ScrollOffset& max_scroll_offset,
68 const gfx::SizeF& scrollable_size,
69 float page_scale_factor,
70 float min_page_scale_factor,
71 float max_page_scale_factor,
72 bool need_animate_scroll,
73 bool need_invalidate,
74 bool need_begin_frame,
75 bool did_activate_pending_tree);
76 ~CommonRendererParams();
77
78 unsigned int version;
79 gfx::ScrollOffset total_scroll_offset;
80 gfx::ScrollOffset max_scroll_offset;
81 gfx::SizeF scrollable_size;
82 float page_scale_factor;
83 float min_page_scale_factor;
84 float max_page_scale_factor;
85 bool need_animate_scroll;
86 bool need_invalidate;
87 bool need_begin_frame;
88 bool did_activate_pending_tree;
89 };
90
91 } // namespace content
92
93 #endif // CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_
94
95 // Multiply-included message file, hence no include guard.
96
97 #undef IPC_MESSAGE_EXPORT
98 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
99 #define IPC_MESSAGE_START SyncCompositorMsgStart
100
101 IPC_STRUCT_TRAITS_BEGIN(content::CommonBrowserParams)
102 IPC_STRUCT_TRAITS_MEMBER(bytes_limit)
103 IPC_STRUCT_TRAITS_MEMBER(resources)
104 IPC_STRUCT_TRAITS_MEMBER(root_scroll_offset)
105 IPC_STRUCT_TRAITS_END()
106
107 IPC_STRUCT_TRAITS_BEGIN(content::DemandDrawHwParams)
108 IPC_STRUCT_TRAITS_MEMBER(surface_size)
109 IPC_STRUCT_TRAITS_MEMBER(transform)
110 IPC_STRUCT_TRAITS_MEMBER(viewport)
111 IPC_STRUCT_TRAITS_MEMBER(clip)
112 IPC_STRUCT_TRAITS_MEMBER(viewport_rect_for_tile_priority)
113 IPC_STRUCT_TRAITS_MEMBER(transform_for_tile_priority)
114 IPC_STRUCT_TRAITS_END()
115
116 IPC_STRUCT_TRAITS_BEGIN(content::CommonRendererParams)
117 IPC_STRUCT_TRAITS_MEMBER(version)
118 IPC_STRUCT_TRAITS_MEMBER(total_scroll_offset)
119 IPC_STRUCT_TRAITS_MEMBER(max_scroll_offset)
120 IPC_STRUCT_TRAITS_MEMBER(scrollable_size)
121 IPC_STRUCT_TRAITS_MEMBER(page_scale_factor)
122 IPC_STRUCT_TRAITS_MEMBER(min_page_scale_factor)
123 IPC_STRUCT_TRAITS_MEMBER(max_page_scale_factor)
124 IPC_STRUCT_TRAITS_MEMBER(need_animate_scroll)
125 IPC_STRUCT_TRAITS_MEMBER(need_invalidate)
126 IPC_STRUCT_TRAITS_MEMBER(need_begin_frame)
127 IPC_STRUCT_TRAITS_MEMBER(did_activate_pending_tree)
128 IPC_STRUCT_TRAITS_END()
129
130 IPC_SYNC_MESSAGE_ROUTED2_2(SyncCompositorMsg_HandleInputEvent,
131 content::CommonBrowserParams,
132 IPC::WebInputEventPointer,
133 content::CommonRendererParams,
134 content::InputEventAckState);
135
136 IPC_SYNC_MESSAGE_ROUTED2_1(SyncCompositorMsg_BeginFrame,
137 content::CommonBrowserParams,
138 cc::BeginFrameArgs,
139 content::CommonRendererParams);
140
141 IPC_SYNC_MESSAGE_ROUTED2_1(SyncCompositorMsg_ComputeScroll,
142 content::CommonBrowserParams,
143 base::TimeTicks,
144 content::CommonRendererParams);
145
146 IPC_SYNC_MESSAGE_ROUTED2_2(SyncCompositorMsg_DemandDrawHw,
147 content::CommonBrowserParams,
148 content::DemandDrawHwParams,
149 content::CommonRendererParams,
150 cc::CompositorFrame);
151
152 IPC_MESSAGE_ROUTED1(SyncCompositorHostMsg_UpdateState,
153 content::CommonRendererParams);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698