Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Side by Side Diff: content/common/android/sync_compositor_messages.cc

Issue 1408123005: Android Webview IPC-based sync compositing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 "content/common/android/sync_compositor_messages.h"
6
7 namespace IPC {
8
9 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
10 Message* m, const param_type& p) {
11 m->WriteDouble(p.x());
12 m->WriteDouble(p.y());
13 }
14
15 bool ParamTraits<gfx::ScrollOffset>::Read(const Message* m,
16 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-
17 param_type* r) {
18 double x = 0.f;
19 double y = 0.f;
20 if (!iter->ReadDouble(&x))
21 return false;
22 if (!iter->ReadDouble(&y))
23 return false;
24 r->set_x(x);
25 r->set_y(y);
26 return true;
27 }
28
29 void ParamTraits<gfx::ScrollOffset>::Log(
30 const param_type& p, std::string* l) {
31 l->append("(");
32 LogParam(p.x(), l);
33 l->append(", ");
34 LogParam(p.y(), l);
35 l->append(")");
36 }
37
38 } // namespace IPC
39
40 namespace content {
41
42 CommonBrowserParams::CommonBrowserParams() : bytes_limit(0u) {}
43
44 CommonBrowserParams::CommonBrowserParams(
45 size_t bytes_limit,
46 const gfx::ScrollOffset& root_scroll_offset)
47 : bytes_limit(bytes_limit),
48 root_scroll_offset(root_scroll_offset) {}
49
50 CommonBrowserParams::~CommonBrowserParams() {}
51
52 DemandDrawHwParams::DemandDrawHwParams() {}
53
54 DemandDrawHwParams::DemandDrawHwParams(
55 const gfx::Size& surface_size,
56 const gfx::Transform& transform,
57 const gfx::Rect& viewport,
58 const gfx::Rect& clip,
59 const gfx::Rect& viewport_rect_for_tile_priority,
60 const gfx::Transform& transform_for_tile_priority)
61 : surface_size(surface_size),
62 transform(transform),
63 viewport(viewport),
64 clip(clip),
65 viewport_rect_for_tile_priority(viewport_rect_for_tile_priority),
66 transform_for_tile_priority(transform_for_tile_priority) {}
67
68 DemandDrawHwParams::~DemandDrawHwParams() {}
69
70 CommonRendererParams::CommonRendererParams()
71 : version(0u),
72 page_scale_factor(0.f),
73 min_page_scale_factor(0.f),
74 max_page_scale_factor(0.f),
75 need_animate_scroll(false),
76 need_invalidate(false),
77 need_begin_frame(false),
78 did_activate_pending_tree(false) {}
79
80 CommonRendererParams::CommonRendererParams(
81 unsigned int version,
82 const gfx::ScrollOffset& total_scroll_offset,
83 const gfx::ScrollOffset& max_scroll_offset,
84 const gfx::SizeF& scrollable_size,
85 float page_scale_factor,
86 float min_page_scale_factor,
87 float max_page_scale_factor,
88 bool need_animate_scroll,
89 bool need_invalidate,
90 bool need_begin_frame,
91 bool did_activate_pending_tree)
92 : version(version),
93 total_scroll_offset(total_scroll_offset),
94 max_scroll_offset(max_scroll_offset),
95 scrollable_size(scrollable_size),
96 page_scale_factor(page_scale_factor),
97 min_page_scale_factor(min_page_scale_factor),
98 max_page_scale_factor(max_page_scale_factor),
99 need_animate_scroll(need_animate_scroll),
100 need_invalidate(need_invalidate),
101 need_begin_frame(need_begin_frame),
102 did_activate_pending_tree(did_activate_pending_tree) {}
103
104 CommonRendererParams::~CommonRendererParams() {}
105
106 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698