| OLD | NEW |
| (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/output/compositor_frame_ack.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_ |
| 16 #define CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ |
| 17 |
| 18 namespace content { |
| 19 |
| 20 struct SyncCompositorCommonBrowserParams { |
| 21 SyncCompositorCommonBrowserParams(); |
| 22 ~SyncCompositorCommonBrowserParams(); |
| 23 |
| 24 size_t bytes_limit; |
| 25 cc::CompositorFrameAck ack; |
| 26 gfx::ScrollOffset root_scroll_offset; |
| 27 }; |
| 28 |
| 29 struct SyncCompositorDemandDrawHwParams { |
| 30 SyncCompositorDemandDrawHwParams(); |
| 31 SyncCompositorDemandDrawHwParams( |
| 32 const gfx::Size& surface_size, |
| 33 const gfx::Transform& transform, |
| 34 const gfx::Rect& viewport, |
| 35 const gfx::Rect& clip, |
| 36 const gfx::Rect& viewport_rect_for_tile_priority, |
| 37 const gfx::Transform& transform_for_tile_priority); |
| 38 ~SyncCompositorDemandDrawHwParams(); |
| 39 |
| 40 gfx::Size surface_size; |
| 41 gfx::Transform transform; |
| 42 gfx::Rect viewport; |
| 43 gfx::Rect clip; |
| 44 gfx::Rect viewport_rect_for_tile_priority; |
| 45 gfx::Transform transform_for_tile_priority; |
| 46 }; |
| 47 |
| 48 struct SyncCompositorCommonRendererParams { |
| 49 SyncCompositorCommonRendererParams(); |
| 50 ~SyncCompositorCommonRendererParams(); |
| 51 |
| 52 unsigned int version; |
| 53 gfx::ScrollOffset total_scroll_offset; |
| 54 gfx::ScrollOffset max_scroll_offset; |
| 55 gfx::SizeF scrollable_size; |
| 56 float page_scale_factor; |
| 57 float min_page_scale_factor; |
| 58 float max_page_scale_factor; |
| 59 bool need_animate_scroll; |
| 60 bool need_invalidate; |
| 61 bool need_begin_frame; |
| 62 bool did_activate_pending_tree; |
| 63 }; |
| 64 |
| 65 } // namespace content |
| 66 |
| 67 #endif // CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ |
| 68 |
| 69 // Multiply-included message file, hence no include guard. |
| 70 |
| 71 #undef IPC_MESSAGE_EXPORT |
| 72 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 73 #define IPC_MESSAGE_START SyncCompositorMsgStart |
| 74 |
| 75 IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorCommonBrowserParams) |
| 76 IPC_STRUCT_TRAITS_MEMBER(bytes_limit) |
| 77 IPC_STRUCT_TRAITS_MEMBER(ack) |
| 78 IPC_STRUCT_TRAITS_MEMBER(root_scroll_offset) |
| 79 IPC_STRUCT_TRAITS_END() |
| 80 |
| 81 IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorDemandDrawHwParams) |
| 82 IPC_STRUCT_TRAITS_MEMBER(surface_size) |
| 83 IPC_STRUCT_TRAITS_MEMBER(transform) |
| 84 IPC_STRUCT_TRAITS_MEMBER(viewport) |
| 85 IPC_STRUCT_TRAITS_MEMBER(clip) |
| 86 IPC_STRUCT_TRAITS_MEMBER(viewport_rect_for_tile_priority) |
| 87 IPC_STRUCT_TRAITS_MEMBER(transform_for_tile_priority) |
| 88 IPC_STRUCT_TRAITS_END() |
| 89 |
| 90 IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorCommonRendererParams) |
| 91 IPC_STRUCT_TRAITS_MEMBER(version) |
| 92 IPC_STRUCT_TRAITS_MEMBER(total_scroll_offset) |
| 93 IPC_STRUCT_TRAITS_MEMBER(max_scroll_offset) |
| 94 IPC_STRUCT_TRAITS_MEMBER(scrollable_size) |
| 95 IPC_STRUCT_TRAITS_MEMBER(page_scale_factor) |
| 96 IPC_STRUCT_TRAITS_MEMBER(min_page_scale_factor) |
| 97 IPC_STRUCT_TRAITS_MEMBER(max_page_scale_factor) |
| 98 IPC_STRUCT_TRAITS_MEMBER(need_animate_scroll) |
| 99 IPC_STRUCT_TRAITS_MEMBER(need_invalidate) |
| 100 IPC_STRUCT_TRAITS_MEMBER(need_begin_frame) |
| 101 IPC_STRUCT_TRAITS_MEMBER(did_activate_pending_tree) |
| 102 IPC_STRUCT_TRAITS_END() |
| 103 |
| 104 IPC_SYNC_MESSAGE_ROUTED2_2(SyncCompositorMsg_HandleInputEvent, |
| 105 content::SyncCompositorCommonBrowserParams, |
| 106 IPC::WebInputEventPointer, |
| 107 content::SyncCompositorCommonRendererParams, |
| 108 content::InputEventAckState); |
| 109 |
| 110 IPC_SYNC_MESSAGE_ROUTED2_1(SyncCompositorMsg_BeginFrame, |
| 111 content::SyncCompositorCommonBrowserParams, |
| 112 cc::BeginFrameArgs, |
| 113 content::SyncCompositorCommonRendererParams); |
| 114 |
| 115 IPC_SYNC_MESSAGE_ROUTED2_1(SyncCompositorMsg_ComputeScroll, |
| 116 content::SyncCompositorCommonBrowserParams, |
| 117 base::TimeTicks, |
| 118 content::SyncCompositorCommonRendererParams); |
| 119 |
| 120 IPC_SYNC_MESSAGE_ROUTED2_2(SyncCompositorMsg_DemandDrawHw, |
| 121 content::SyncCompositorCommonBrowserParams, |
| 122 content::SyncCompositorDemandDrawHwParams, |
| 123 content::SyncCompositorCommonRendererParams, |
| 124 cc::CompositorFrame); |
| 125 |
| 126 IPC_MESSAGE_ROUTED1(SyncCompositorHostMsg_UpdateState, |
| 127 content::SyncCompositorCommonRendererParams); |
| OLD | NEW |