Chromium Code Reviews| 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/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_ | |
| 16 #define CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ | |
| 17 | |
| 18 namespace content { | |
| 19 | |
| 20 struct CommonBrowserParams { | |
|
no sievers
2015/10/29 01:37:00
nit: this name seems a bit generic
Do all these s
boliu
2015/10/29 04:24:43
They have to be in common because both renderer an
| |
| 21 CommonBrowserParams(); | |
| 22 CommonBrowserParams(size_t bytes_limit, | |
| 23 const gfx::ScrollOffset& root_scroll_offset); | |
| 24 ~CommonBrowserParams(); | |
| 25 | |
| 26 size_t bytes_limit; | |
| 27 cc::ReturnedResourceArray resources; | |
| 28 gfx::ScrollOffset root_scroll_offset; | |
| 29 }; | |
| 30 | |
| 31 struct DemandDrawHwParams { | |
| 32 DemandDrawHwParams(); | |
| 33 DemandDrawHwParams(const gfx::Size& surface_size, | |
| 34 const gfx::Transform& transform, | |
| 35 const gfx::Rect& viewport, | |
| 36 const gfx::Rect& clip, | |
| 37 const gfx::Rect& viewport_rect_for_tile_priority, | |
| 38 const gfx::Transform& transform_for_tile_priority); | |
| 39 ~DemandDrawHwParams(); | |
| 40 | |
| 41 gfx::Size surface_size; | |
| 42 gfx::Transform transform; | |
| 43 gfx::Rect viewport; | |
| 44 gfx::Rect clip; | |
| 45 gfx::Rect viewport_rect_for_tile_priority; | |
| 46 gfx::Transform transform_for_tile_priority; | |
| 47 }; | |
| 48 | |
| 49 struct CommonRendererParams { | |
| 50 CommonRendererParams(); | |
| 51 CommonRendererParams(unsigned int version, | |
| 52 const gfx::ScrollOffset& total_scroll_offset, | |
| 53 const gfx::ScrollOffset& max_scroll_offset, | |
| 54 const gfx::SizeF& scrollable_size, | |
| 55 float page_scale_factor, | |
| 56 float min_page_scale_factor, | |
| 57 float max_page_scale_factor, | |
| 58 bool need_animate_scroll, | |
| 59 bool need_invalidate, | |
| 60 bool need_begin_frame, | |
| 61 bool did_activate_pending_tree); | |
| 62 ~CommonRendererParams(); | |
| 63 | |
| 64 unsigned int version; | |
| 65 gfx::ScrollOffset total_scroll_offset; | |
| 66 gfx::ScrollOffset max_scroll_offset; | |
| 67 gfx::SizeF scrollable_size; | |
| 68 float page_scale_factor; | |
| 69 float min_page_scale_factor; | |
| 70 float max_page_scale_factor; | |
| 71 bool need_animate_scroll; | |
| 72 bool need_invalidate; | |
| 73 bool need_begin_frame; | |
| 74 bool did_activate_pending_tree; | |
| 75 }; | |
| 76 | |
| 77 } // namespace content | |
| 78 | |
| 79 #endif // CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ | |
| 80 | |
| 81 // Multiply-included message file, hence no include guard. | |
| 82 | |
| 83 #undef IPC_MESSAGE_EXPORT | |
| 84 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | |
| 85 #define IPC_MESSAGE_START SyncCompositorMsgStart | |
| 86 | |
| 87 IPC_STRUCT_TRAITS_BEGIN(content::CommonBrowserParams) | |
| 88 IPC_STRUCT_TRAITS_MEMBER(bytes_limit) | |
| 89 IPC_STRUCT_TRAITS_MEMBER(resources) | |
| 90 IPC_STRUCT_TRAITS_MEMBER(root_scroll_offset) | |
| 91 IPC_STRUCT_TRAITS_END() | |
| 92 | |
| 93 IPC_STRUCT_TRAITS_BEGIN(content::DemandDrawHwParams) | |
| 94 IPC_STRUCT_TRAITS_MEMBER(surface_size) | |
| 95 IPC_STRUCT_TRAITS_MEMBER(transform) | |
| 96 IPC_STRUCT_TRAITS_MEMBER(viewport) | |
| 97 IPC_STRUCT_TRAITS_MEMBER(clip) | |
| 98 IPC_STRUCT_TRAITS_MEMBER(viewport_rect_for_tile_priority) | |
| 99 IPC_STRUCT_TRAITS_MEMBER(transform_for_tile_priority) | |
| 100 IPC_STRUCT_TRAITS_END() | |
| 101 | |
| 102 IPC_STRUCT_TRAITS_BEGIN(content::CommonRendererParams) | |
| 103 IPC_STRUCT_TRAITS_MEMBER(version) | |
| 104 IPC_STRUCT_TRAITS_MEMBER(total_scroll_offset) | |
| 105 IPC_STRUCT_TRAITS_MEMBER(max_scroll_offset) | |
| 106 IPC_STRUCT_TRAITS_MEMBER(scrollable_size) | |
| 107 IPC_STRUCT_TRAITS_MEMBER(page_scale_factor) | |
| 108 IPC_STRUCT_TRAITS_MEMBER(min_page_scale_factor) | |
| 109 IPC_STRUCT_TRAITS_MEMBER(max_page_scale_factor) | |
| 110 IPC_STRUCT_TRAITS_MEMBER(need_animate_scroll) | |
| 111 IPC_STRUCT_TRAITS_MEMBER(need_invalidate) | |
| 112 IPC_STRUCT_TRAITS_MEMBER(need_begin_frame) | |
| 113 IPC_STRUCT_TRAITS_MEMBER(did_activate_pending_tree) | |
| 114 IPC_STRUCT_TRAITS_END() | |
| 115 | |
| 116 IPC_SYNC_MESSAGE_ROUTED2_2(SyncCompositorMsg_HandleInputEvent, | |
| 117 content::CommonBrowserParams, | |
| 118 IPC::WebInputEventPointer, | |
| 119 content::CommonRendererParams, | |
| 120 content::InputEventAckState); | |
| 121 | |
| 122 IPC_SYNC_MESSAGE_ROUTED2_1(SyncCompositorMsg_BeginFrame, | |
| 123 content::CommonBrowserParams, | |
| 124 cc::BeginFrameArgs, | |
| 125 content::CommonRendererParams); | |
| 126 | |
| 127 IPC_SYNC_MESSAGE_ROUTED2_1(SyncCompositorMsg_ComputeScroll, | |
| 128 content::CommonBrowserParams, | |
| 129 base::TimeTicks, | |
| 130 content::CommonRendererParams); | |
| 131 | |
| 132 IPC_SYNC_MESSAGE_ROUTED2_2(SyncCompositorMsg_DemandDrawHw, | |
| 133 content::CommonBrowserParams, | |
| 134 content::DemandDrawHwParams, | |
| 135 content::CommonRendererParams, | |
| 136 cc::CompositorFrame); | |
| 137 | |
| 138 IPC_MESSAGE_ROUTED1(SyncCompositorHostMsg_UpdateState, | |
| 139 content::CommonRendererParams); | |
| OLD | NEW |