| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/memory/shared_memory_handle.h" | 7 #include "base/memory/shared_memory_handle.h" |
| 8 #include "cc/output/begin_frame_args.h" | 8 #include "cc/output/begin_frame_args.h" |
| 9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/common/content_param_traits.h" | 12 #include "content/common/content_param_traits.h" |
| 13 #include "content/common/input/did_overscroll_params.h" | 13 #include "content/common/input/did_overscroll_params.h" |
| 14 #include "content/common/input/input_event_ack_state.h" | 14 #include "content/common/input/input_event_ack_state.h" |
| 15 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" |
| 16 #include "third_party/WebKit/public/web/WebInputEvent.h" | 16 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 17 #include "ui/gfx/geometry/point.h" | 17 #include "ui/gfx/geometry/point.h" |
| 18 #include "ui/gfx/geometry/scroll_offset.h" | 18 #include "ui/gfx/geometry/scroll_offset.h" |
| 19 | 19 |
| 20 #ifndef CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ | 20 #ifndef CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ |
| 21 #define CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ | 21 #define CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 | 24 |
| 25 struct SyncCompositorCommonBrowserParams { | |
| 26 SyncCompositorCommonBrowserParams(); | |
| 27 ~SyncCompositorCommonBrowserParams(); | |
| 28 | |
| 29 bool begin_frame_source_paused; | |
| 30 }; | |
| 31 | |
| 32 struct SyncCompositorDemandDrawHwParams { | 25 struct SyncCompositorDemandDrawHwParams { |
| 33 SyncCompositorDemandDrawHwParams(); | 26 SyncCompositorDemandDrawHwParams(); |
| 34 SyncCompositorDemandDrawHwParams( | 27 SyncCompositorDemandDrawHwParams( |
| 35 const gfx::Size& surface_size, | 28 const gfx::Size& surface_size, |
| 36 const gfx::Transform& transform, | 29 const gfx::Transform& transform, |
| 37 const gfx::Rect& viewport, | 30 const gfx::Rect& viewport, |
| 38 const gfx::Rect& clip, | 31 const gfx::Rect& clip, |
| 39 const gfx::Rect& viewport_rect_for_tile_priority, | 32 const gfx::Rect& viewport_rect_for_tile_priority, |
| 40 const gfx::Transform& transform_for_tile_priority); | 33 const gfx::Transform& transform_for_tile_priority); |
| 41 ~SyncCompositorDemandDrawHwParams(); | 34 ~SyncCompositorDemandDrawHwParams(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 70 | 63 |
| 71 unsigned int version; | 64 unsigned int version; |
| 72 gfx::ScrollOffset total_scroll_offset; | 65 gfx::ScrollOffset total_scroll_offset; |
| 73 gfx::ScrollOffset max_scroll_offset; | 66 gfx::ScrollOffset max_scroll_offset; |
| 74 gfx::SizeF scrollable_size; | 67 gfx::SizeF scrollable_size; |
| 75 float page_scale_factor; | 68 float page_scale_factor; |
| 76 float min_page_scale_factor; | 69 float min_page_scale_factor; |
| 77 float max_page_scale_factor; | 70 float max_page_scale_factor; |
| 78 bool need_animate_scroll; | 71 bool need_animate_scroll; |
| 79 uint32_t need_invalidate_count; | 72 uint32_t need_invalidate_count; |
| 80 bool need_begin_frame; | |
| 81 uint32_t did_activate_pending_tree_count; | 73 uint32_t did_activate_pending_tree_count; |
| 82 }; | 74 }; |
| 83 | 75 |
| 84 } // namespace content | 76 } // namespace content |
| 85 | 77 |
| 86 #endif // CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ | 78 #endif // CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ |
| 87 | 79 |
| 88 // Multiply-included message file, hence no include guard. | 80 // Multiply-included message file, hence no include guard. |
| 89 | 81 |
| 90 #undef IPC_MESSAGE_EXPORT | 82 #undef IPC_MESSAGE_EXPORT |
| 91 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 83 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 92 #define IPC_MESSAGE_START SyncCompositorMsgStart | 84 #define IPC_MESSAGE_START SyncCompositorMsgStart |
| 93 | 85 |
| 94 IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorCommonBrowserParams) | |
| 95 IPC_STRUCT_TRAITS_MEMBER(begin_frame_source_paused) | |
| 96 IPC_STRUCT_TRAITS_END() | |
| 97 | |
| 98 IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorDemandDrawHwParams) | 86 IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorDemandDrawHwParams) |
| 99 IPC_STRUCT_TRAITS_MEMBER(surface_size) | 87 IPC_STRUCT_TRAITS_MEMBER(surface_size) |
| 100 IPC_STRUCT_TRAITS_MEMBER(transform) | 88 IPC_STRUCT_TRAITS_MEMBER(transform) |
| 101 IPC_STRUCT_TRAITS_MEMBER(viewport) | 89 IPC_STRUCT_TRAITS_MEMBER(viewport) |
| 102 IPC_STRUCT_TRAITS_MEMBER(clip) | 90 IPC_STRUCT_TRAITS_MEMBER(clip) |
| 103 IPC_STRUCT_TRAITS_MEMBER(viewport_rect_for_tile_priority) | 91 IPC_STRUCT_TRAITS_MEMBER(viewport_rect_for_tile_priority) |
| 104 IPC_STRUCT_TRAITS_MEMBER(transform_for_tile_priority) | 92 IPC_STRUCT_TRAITS_MEMBER(transform_for_tile_priority) |
| 105 IPC_STRUCT_TRAITS_END() | 93 IPC_STRUCT_TRAITS_END() |
| 106 | 94 |
| 107 IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorSetSharedMemoryParams) | 95 IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorSetSharedMemoryParams) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 118 IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorCommonRendererParams) | 106 IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorCommonRendererParams) |
| 119 IPC_STRUCT_TRAITS_MEMBER(version) | 107 IPC_STRUCT_TRAITS_MEMBER(version) |
| 120 IPC_STRUCT_TRAITS_MEMBER(total_scroll_offset) | 108 IPC_STRUCT_TRAITS_MEMBER(total_scroll_offset) |
| 121 IPC_STRUCT_TRAITS_MEMBER(max_scroll_offset) | 109 IPC_STRUCT_TRAITS_MEMBER(max_scroll_offset) |
| 122 IPC_STRUCT_TRAITS_MEMBER(scrollable_size) | 110 IPC_STRUCT_TRAITS_MEMBER(scrollable_size) |
| 123 IPC_STRUCT_TRAITS_MEMBER(page_scale_factor) | 111 IPC_STRUCT_TRAITS_MEMBER(page_scale_factor) |
| 124 IPC_STRUCT_TRAITS_MEMBER(min_page_scale_factor) | 112 IPC_STRUCT_TRAITS_MEMBER(min_page_scale_factor) |
| 125 IPC_STRUCT_TRAITS_MEMBER(max_page_scale_factor) | 113 IPC_STRUCT_TRAITS_MEMBER(max_page_scale_factor) |
| 126 IPC_STRUCT_TRAITS_MEMBER(need_animate_scroll) | 114 IPC_STRUCT_TRAITS_MEMBER(need_animate_scroll) |
| 127 IPC_STRUCT_TRAITS_MEMBER(need_invalidate_count) | 115 IPC_STRUCT_TRAITS_MEMBER(need_invalidate_count) |
| 128 IPC_STRUCT_TRAITS_MEMBER(need_begin_frame) | |
| 129 IPC_STRUCT_TRAITS_MEMBER(did_activate_pending_tree_count) | 116 IPC_STRUCT_TRAITS_MEMBER(did_activate_pending_tree_count) |
| 130 IPC_STRUCT_TRAITS_END() | 117 IPC_STRUCT_TRAITS_END() |
| 131 | 118 |
| 132 // Messages sent from the browser to the renderer. | 119 // Messages sent from the browser to the renderer. |
| 133 // Synchronous IPCs are allowed here to the renderer compositor thread. See | 120 // Synchronous IPCs are allowed here to the renderer compositor thread. See |
| 134 // design doc https://goo.gl/Tn81FW and crbug.com/526842 for details. | 121 // design doc https://goo.gl/Tn81FW and crbug.com/526842 for details. |
| 135 | 122 |
| 136 IPC_SYNC_MESSAGE_ROUTED2_2(SyncCompositorMsg_HandleInputEvent, | 123 IPC_SYNC_MESSAGE_ROUTED1_2(SyncCompositorMsg_HandleInputEvent, |
| 137 content::SyncCompositorCommonBrowserParams, | |
| 138 IPC::WebInputEventPointer, | 124 IPC::WebInputEventPointer, |
| 139 content::SyncCompositorCommonRendererParams, | 125 content::SyncCompositorCommonRendererParams, |
| 140 content::InputEventAckState) | 126 content::InputEventAckState) |
| 141 | 127 |
| 142 IPC_SYNC_MESSAGE_ROUTED2_1(SyncCompositorMsg_BeginFrame, | 128 IPC_SYNC_MESSAGE_ROUTED0_1(SyncCompositorMsg_SynchronizeRendererState, |
| 143 content::SyncCompositorCommonBrowserParams, | |
| 144 cc::BeginFrameArgs, | |
| 145 content::SyncCompositorCommonRendererParams) | 129 content::SyncCompositorCommonRendererParams) |
| 146 | 130 |
| 147 IPC_MESSAGE_ROUTED2(SyncCompositorMsg_ComputeScroll, | 131 IPC_MESSAGE_ROUTED1(SyncCompositorMsg_ComputeScroll, |
| 148 content::SyncCompositorCommonBrowserParams, | |
| 149 base::TimeTicks); | 132 base::TimeTicks); |
| 150 | 133 |
| 151 IPC_SYNC_MESSAGE_ROUTED2_3(SyncCompositorMsg_DemandDrawHw, | 134 IPC_SYNC_MESSAGE_ROUTED1_3(SyncCompositorMsg_DemandDrawHw, |
| 152 content::SyncCompositorCommonBrowserParams, | |
| 153 content::SyncCompositorDemandDrawHwParams, | 135 content::SyncCompositorDemandDrawHwParams, |
| 154 content::SyncCompositorCommonRendererParams, | 136 content::SyncCompositorCommonRendererParams, |
| 155 uint32_t /* output_surface_id */, | 137 uint32_t /* output_surface_id */, |
| 156 cc::CompositorFrame) | 138 cc::CompositorFrame) |
| 157 | 139 |
| 158 IPC_SYNC_MESSAGE_ROUTED2_2(SyncCompositorMsg_SetSharedMemory, | 140 IPC_SYNC_MESSAGE_ROUTED1_2(SyncCompositorMsg_SetSharedMemory, |
| 159 content::SyncCompositorCommonBrowserParams, | |
| 160 content::SyncCompositorSetSharedMemoryParams, | 141 content::SyncCompositorSetSharedMemoryParams, |
| 161 bool /* success */, | 142 bool /* success */, |
| 162 content::SyncCompositorCommonRendererParams); | 143 content::SyncCompositorCommonRendererParams); |
| 163 | 144 |
| 164 IPC_MESSAGE_ROUTED0(SyncCompositorMsg_ZeroSharedMemory); | 145 IPC_MESSAGE_ROUTED0(SyncCompositorMsg_ZeroSharedMemory); |
| 165 | 146 |
| 166 IPC_SYNC_MESSAGE_ROUTED2_3(SyncCompositorMsg_DemandDrawSw, | 147 IPC_SYNC_MESSAGE_ROUTED1_3(SyncCompositorMsg_DemandDrawSw, |
| 167 content::SyncCompositorCommonBrowserParams, | |
| 168 content::SyncCompositorDemandDrawSwParams, | 148 content::SyncCompositorDemandDrawSwParams, |
| 169 bool /* result */, | 149 bool /* result */, |
| 170 content::SyncCompositorCommonRendererParams, | 150 content::SyncCompositorCommonRendererParams, |
| 171 cc::CompositorFrame) | 151 cc::CompositorFrame) |
| 172 | 152 |
| 173 IPC_MESSAGE_ROUTED1(SyncCompositorMsg_UpdateState, | 153 IPC_SYNC_MESSAGE_ROUTED2_1(SyncCompositorMsg_ZoomBy, |
| 174 content::SyncCompositorCommonBrowserParams) | |
| 175 | |
| 176 IPC_SYNC_MESSAGE_ROUTED3_1(SyncCompositorMsg_ZoomBy, | |
| 177 content::SyncCompositorCommonBrowserParams, | |
| 178 float /* delta */, | 154 float /* delta */, |
| 179 gfx::Point /* anchor */, | 155 gfx::Point /* anchor */, |
| 180 content::SyncCompositorCommonRendererParams) | 156 content::SyncCompositorCommonRendererParams) |
| 181 | 157 |
| 182 IPC_MESSAGE_ROUTED1(SyncCompositorMsg_SetMemoryPolicy, | 158 IPC_MESSAGE_ROUTED1(SyncCompositorMsg_SetMemoryPolicy, |
| 183 uint32_t /* bytes_limit */); | 159 uint32_t /* bytes_limit */); |
| 184 | 160 |
| 185 IPC_MESSAGE_ROUTED2(SyncCompositorMsg_ReclaimResources, | 161 IPC_MESSAGE_ROUTED2(SyncCompositorMsg_ReclaimResources, |
| 186 uint32_t /* output_surface_id */, | 162 uint32_t /* output_surface_id */, |
| 187 cc::CompositorFrameAck); | 163 cc::CompositorFrameAck); |
| 188 | 164 |
| 189 IPC_MESSAGE_ROUTED1(SyncCompositorMsg_SetScroll, gfx::ScrollOffset); | 165 IPC_MESSAGE_ROUTED1(SyncCompositorMsg_SetScroll, gfx::ScrollOffset); |
| 190 | 166 |
| 191 // ----------------------------------------------------------------------------- | 167 // ----------------------------------------------------------------------------- |
| 192 // Messages sent from the renderer to the browser. | 168 // Messages sent from the renderer to the browser. |
| 193 | 169 |
| 194 IPC_MESSAGE_ROUTED0(SyncCompositorHostMsg_OutputSurfaceCreated); | 170 IPC_MESSAGE_ROUTED0(SyncCompositorHostMsg_OutputSurfaceCreated); |
| 195 | 171 |
| 196 IPC_MESSAGE_ROUTED1(SyncCompositorHostMsg_UpdateState, | 172 IPC_MESSAGE_ROUTED1(SyncCompositorHostMsg_UpdateState, |
| 197 content::SyncCompositorCommonRendererParams) | 173 content::SyncCompositorCommonRendererParams) |
| 198 | 174 |
| 199 IPC_MESSAGE_ROUTED2(SyncCompositorHostMsg_OverScroll, | 175 IPC_MESSAGE_ROUTED2(SyncCompositorHostMsg_OverScroll, |
| 200 content::SyncCompositorCommonRendererParams, | 176 content::SyncCompositorCommonRendererParams, |
| 201 content::DidOverscrollParams) | 177 content::DidOverscrollParams) |
| OLD | NEW |