OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/proxy_common.h" | 5 #include "cc/trees/proxy_common.h" |
6 | 6 |
7 #include "cc/proto/begin_main_frame_and_commit_state.pb.h" | |
8 #include "cc/trees/layer_tree_host.h" | 7 #include "cc/trees/layer_tree_host.h" |
9 | 8 |
10 namespace cc { | 9 namespace cc { |
11 | 10 |
12 BeginMainFrameAndCommitState::BeginMainFrameAndCommitState() {} | 11 BeginMainFrameAndCommitState::BeginMainFrameAndCommitState() {} |
13 | 12 |
14 BeginMainFrameAndCommitState::~BeginMainFrameAndCommitState() {} | 13 BeginMainFrameAndCommitState::~BeginMainFrameAndCommitState() {} |
15 | 14 |
16 void BeginMainFrameAndCommitState::ToProtobuf( | |
17 proto::BeginMainFrameAndCommitState* proto) const { | |
18 proto->set_begin_frame_id(begin_frame_id); | |
19 begin_frame_args.ToProtobuf(proto->mutable_begin_frame_args()); | |
20 scroll_info->ToProtobuf(proto->mutable_scroll_info()); | |
21 proto->set_memory_allocation_limit_bytes(memory_allocation_limit_bytes); | |
22 proto->set_evicted_ui_resources(evicted_ui_resources); | |
23 } | |
24 | |
25 void BeginMainFrameAndCommitState::FromProtobuf( | |
26 const proto::BeginMainFrameAndCommitState& proto) { | |
27 begin_frame_id = proto.begin_frame_id(); | |
28 begin_frame_args.FromProtobuf(proto.begin_frame_args()); | |
29 scroll_info.reset(new ScrollAndScaleSet()); | |
30 scroll_info->FromProtobuf(proto.scroll_info()); | |
31 memory_allocation_limit_bytes = proto.memory_allocation_limit_bytes(); | |
32 evicted_ui_resources = proto.evicted_ui_resources(); | |
33 } | |
34 | |
35 } // namespace cc | 15 } // namespace cc |
OLD | NEW |