Chromium Code Reviews| Index: content/common/android/sync_compositor_messages.h |
| diff --git a/content/common/android/sync_compositor_messages.h b/content/common/android/sync_compositor_messages.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..64471ecd5c05d67609439d064592acc337c8afe6 |
| --- /dev/null |
| +++ b/content/common/android/sync_compositor_messages.h |
| @@ -0,0 +1,142 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "cc/output/begin_frame_args.h" |
| +#include "cc/output/compositor_frame.h" |
| +#include "cc/output/compositor_frame_ack.h" |
| +#include "content/common/content_export.h" |
| +#include "content/common/content_param_traits.h" |
| +#include "content/common/input/input_event_ack_state.h" |
| +#include "ipc/ipc_message_macros.h" |
| +#include "third_party/WebKit/public/web/WebInputEvent.h" |
| +#include "ui/gfx/geometry/scroll_offset.h" |
| + |
| +#ifndef CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ |
| +#define CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ |
| + |
| +namespace content { |
| + |
| +struct SyncCompositorCommonBrowserParams { |
| + SyncCompositorCommonBrowserParams(); |
| + SyncCompositorCommonBrowserParams( |
| + size_t bytes_limit, |
| + const gfx::ScrollOffset& root_scroll_offset); |
| + ~SyncCompositorCommonBrowserParams(); |
| + |
| + size_t bytes_limit; |
| + cc::CompositorFrameAck ack; |
| + gfx::ScrollOffset root_scroll_offset; |
| +}; |
| + |
| +struct SyncCompositorDemandDrawHwParams { |
| + SyncCompositorDemandDrawHwParams(); |
| + SyncCompositorDemandDrawHwParams( |
| + const gfx::Size& surface_size, |
| + const gfx::Transform& transform, |
| + const gfx::Rect& viewport, |
| + const gfx::Rect& clip, |
| + const gfx::Rect& viewport_rect_for_tile_priority, |
| + const gfx::Transform& transform_for_tile_priority); |
| + ~SyncCompositorDemandDrawHwParams(); |
| + |
| + gfx::Size surface_size; |
| + gfx::Transform transform; |
| + gfx::Rect viewport; |
| + gfx::Rect clip; |
| + gfx::Rect viewport_rect_for_tile_priority; |
| + gfx::Transform transform_for_tile_priority; |
| +}; |
| + |
| +struct SyncCompositorCommonRendererParams { |
| + SyncCompositorCommonRendererParams(); |
| + SyncCompositorCommonRendererParams( |
| + unsigned int version, |
| + const gfx::ScrollOffset& total_scroll_offset, |
| + const gfx::ScrollOffset& max_scroll_offset, |
| + const gfx::SizeF& scrollable_size, |
| + float page_scale_factor, |
| + float min_page_scale_factor, |
| + float max_page_scale_factor, |
| + bool need_animate_scroll, |
| + bool need_invalidate, |
| + bool need_begin_frame, |
| + bool did_activate_pending_tree); |
|
dcheng
2015/11/04 09:47:41
I'll leave it to your judgement, but one nice thin
boliu
2015/11/04 16:52:04
Done.
So the upside of having the constructor mea
|
| + ~SyncCompositorCommonRendererParams(); |
| + |
| + unsigned int version; |
|
dcheng
2015/11/04 09:47:41
Explicitly size to uint32_t (https://www.chromium.
boliu
2015/11/04 16:52:04
Done.
|
| + gfx::ScrollOffset total_scroll_offset; |
| + gfx::ScrollOffset max_scroll_offset; |
| + gfx::SizeF scrollable_size; |
| + float page_scale_factor; |
| + float min_page_scale_factor; |
| + float max_page_scale_factor; |
| + bool need_animate_scroll; |
| + bool need_invalidate; |
| + bool need_begin_frame; |
| + bool did_activate_pending_tree; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_COMMON_ANDROID_SYNC_COMPOSITOR_MESSAGES_H_ |
| + |
| +// Multiply-included message file, hence no include guard. |
| + |
| +#undef IPC_MESSAGE_EXPORT |
| +#define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| +#define IPC_MESSAGE_START SyncCompositorMsgStart |
| + |
| +IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorCommonBrowserParams) |
| + IPC_STRUCT_TRAITS_MEMBER(bytes_limit) |
| + IPC_STRUCT_TRAITS_MEMBER(ack) |
| + IPC_STRUCT_TRAITS_MEMBER(root_scroll_offset) |
| +IPC_STRUCT_TRAITS_END() |
| + |
| +IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorDemandDrawHwParams) |
| + IPC_STRUCT_TRAITS_MEMBER(surface_size) |
| + IPC_STRUCT_TRAITS_MEMBER(transform) |
| + IPC_STRUCT_TRAITS_MEMBER(viewport) |
| + IPC_STRUCT_TRAITS_MEMBER(clip) |
| + IPC_STRUCT_TRAITS_MEMBER(viewport_rect_for_tile_priority) |
| + IPC_STRUCT_TRAITS_MEMBER(transform_for_tile_priority) |
| +IPC_STRUCT_TRAITS_END() |
| + |
| +IPC_STRUCT_TRAITS_BEGIN(content::SyncCompositorCommonRendererParams) |
| + IPC_STRUCT_TRAITS_MEMBER(version) |
| + IPC_STRUCT_TRAITS_MEMBER(total_scroll_offset) |
| + IPC_STRUCT_TRAITS_MEMBER(max_scroll_offset) |
| + IPC_STRUCT_TRAITS_MEMBER(scrollable_size) |
| + IPC_STRUCT_TRAITS_MEMBER(page_scale_factor) |
| + IPC_STRUCT_TRAITS_MEMBER(min_page_scale_factor) |
| + IPC_STRUCT_TRAITS_MEMBER(max_page_scale_factor) |
| + IPC_STRUCT_TRAITS_MEMBER(need_animate_scroll) |
| + IPC_STRUCT_TRAITS_MEMBER(need_invalidate) |
| + IPC_STRUCT_TRAITS_MEMBER(need_begin_frame) |
| + IPC_STRUCT_TRAITS_MEMBER(did_activate_pending_tree) |
| +IPC_STRUCT_TRAITS_END() |
| + |
| +IPC_SYNC_MESSAGE_ROUTED2_2(SyncCompositorMsg_HandleInputEvent, |
| + content::SyncCompositorCommonBrowserParams, |
| + IPC::WebInputEventPointer, |
| + content::SyncCompositorCommonRendererParams, |
| + content::InputEventAckState); |
| + |
| +IPC_SYNC_MESSAGE_ROUTED2_1(SyncCompositorMsg_BeginFrame, |
| + content::SyncCompositorCommonBrowserParams, |
| + cc::BeginFrameArgs, |
| + content::SyncCompositorCommonRendererParams); |
| + |
| +IPC_SYNC_MESSAGE_ROUTED2_1(SyncCompositorMsg_ComputeScroll, |
| + content::SyncCompositorCommonBrowserParams, |
| + base::TimeTicks, |
| + content::SyncCompositorCommonRendererParams); |
| + |
| +IPC_SYNC_MESSAGE_ROUTED2_2(SyncCompositorMsg_DemandDrawHw, |
| + content::SyncCompositorCommonBrowserParams, |
| + content::SyncCompositorDemandDrawHwParams, |
| + content::SyncCompositorCommonRendererParams, |
| + cc::CompositorFrame); |
| + |
| +IPC_MESSAGE_ROUTED1(SyncCompositorHostMsg_UpdateState, |
| + content::SyncCompositorCommonRendererParams); |