Chromium Code Reviews| Index: content/common/android/sync_compositor_messages.cc |
| diff --git a/content/common/android/sync_compositor_messages.cc b/content/common/android/sync_compositor_messages.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..012c392715f447d208429fc378c7f87a6f771a7a |
| --- /dev/null |
| +++ b/content/common/android/sync_compositor_messages.cc |
| @@ -0,0 +1,106 @@ |
| +// 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 "content/common/android/sync_compositor_messages.h" |
| + |
| +namespace IPC { |
| + |
| +void ParamTraits<gfx::ScrollOffset>::Write( |
|
dcheng
2015/10/27 21:06:58
It feels like maybe this should be in ui/gfx/ipc?
boliu
2015/10/28 02:07:06
Good call! Done
|
| + Message* m, const param_type& p) { |
| + m->WriteDouble(p.x()); |
| + m->WriteDouble(p.y()); |
| +} |
| + |
| +bool ParamTraits<gfx::ScrollOffset>::Read(const Message* m, |
| + base::PickleIterator* iter, |
|
dcheng
2015/10/27 21:06:58
Hmm, did clang-format do this? It looks funny.
boliu
2015/10/28 02:07:06
Nope. I just didn't clang-format this.
And clang-
|
| + param_type* r) { |
| + double x = 0.f; |
| + double y = 0.f; |
| + if (!iter->ReadDouble(&x)) |
| + return false; |
| + if (!iter->ReadDouble(&y)) |
| + return false; |
| + r->set_x(x); |
| + r->set_y(y); |
| + return true; |
| +} |
| + |
| +void ParamTraits<gfx::ScrollOffset>::Log( |
| + const param_type& p, std::string* l) { |
| + l->append("("); |
| + LogParam(p.x(), l); |
| + l->append(", "); |
| + LogParam(p.y(), l); |
| + l->append(")"); |
| +} |
| + |
| +} // namespace IPC |
| + |
| +namespace content { |
| + |
| +CommonBrowserParams::CommonBrowserParams() : bytes_limit(0u) {} |
| + |
| +CommonBrowserParams::CommonBrowserParams( |
| + size_t bytes_limit, |
| + const gfx::ScrollOffset& root_scroll_offset) |
| + : bytes_limit(bytes_limit), |
| + root_scroll_offset(root_scroll_offset) {} |
| + |
| +CommonBrowserParams::~CommonBrowserParams() {} |
| + |
| +DemandDrawHwParams::DemandDrawHwParams() {} |
| + |
| +DemandDrawHwParams::DemandDrawHwParams( |
| + 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) |
| + : surface_size(surface_size), |
| + transform(transform), |
| + viewport(viewport), |
| + clip(clip), |
| + viewport_rect_for_tile_priority(viewport_rect_for_tile_priority), |
| + transform_for_tile_priority(transform_for_tile_priority) {} |
| + |
| +DemandDrawHwParams::~DemandDrawHwParams() {} |
| + |
| +CommonRendererParams::CommonRendererParams() |
| + : version(0u), |
| + page_scale_factor(0.f), |
| + min_page_scale_factor(0.f), |
| + max_page_scale_factor(0.f), |
| + need_animate_scroll(false), |
| + need_invalidate(false), |
| + need_begin_frame(false), |
| + did_activate_pending_tree(false) {} |
| + |
| +CommonRendererParams::CommonRendererParams( |
| + 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) |
| + : version(version), |
| + total_scroll_offset(total_scroll_offset), |
| + max_scroll_offset(max_scroll_offset), |
| + scrollable_size(scrollable_size), |
| + page_scale_factor(page_scale_factor), |
| + min_page_scale_factor(min_page_scale_factor), |
| + max_page_scale_factor(max_page_scale_factor), |
| + need_animate_scroll(need_animate_scroll), |
| + need_invalidate(need_invalidate), |
| + need_begin_frame(need_begin_frame), |
| + did_activate_pending_tree(did_activate_pending_tree) {} |
| + |
| +CommonRendererParams::~CommonRendererParams() {} |
| + |
| +}; |