diff options
author | nyquist <nyquist@chromium.org> | 2015-12-18 15:18:25 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-18 23:19:05 +0000 |
commit | be6c29c514beca0a3d18158d4fbef28b26d6fa53 (patch) | |
tree | 966ce47b80d25402516269bbcfaf1b62db05c56d /cc/input/layer_selection_bound.cc | |
parent | 4da4f9927a55fe884e362cccff1dab01475f11c1 (diff) | |
download | chromium_src-be6c29c514beca0a3d18158d4fbef28b26d6fa53.zip chromium_src-be6c29c514beca0a3d18158d4fbef28b26d6fa53.tar.gz chromium_src-be6c29c514beca0a3d18158d4fbef28b26d6fa53.tar.bz2 |
Add support for (de)serializing LayerSelection.
As part of serializing cc::LayerTreeHost, we also need to
serialize the Selection<LayerSelectionBound>, which is
typedef'ed to LayerSelection.
We only support this type of the templated Selection for now,
so the code lives together with the LayerSelectionBound.
BUG=561210
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1531413002
Cr-Commit-Position: refs/heads/master@{#366202}
Diffstat (limited to 'cc/input/layer_selection_bound.cc')
-rw-r--r-- | cc/input/layer_selection_bound.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cc/input/layer_selection_bound.cc b/cc/input/layer_selection_bound.cc index 7abd9e0..a5146dc 100644 --- a/cc/input/layer_selection_bound.cc +++ b/cc/input/layer_selection_bound.cc @@ -77,4 +77,20 @@ void LayerSelectionBound::FromProtobuf( layer_id = proto.layer_id(); } +void LayerSelectionToProtobuf(const LayerSelection& selection, + proto::LayerSelection* proto) { + selection.start.ToProtobuf(proto->mutable_start()); + selection.end.ToProtobuf(proto->mutable_end()); + proto->set_is_editable(selection.is_editable); + proto->set_is_empty_text_form_control(selection.is_empty_text_form_control); +} + +void LayerSelectionFromProtobuf(LayerSelection* selection, + const proto::LayerSelection& proto) { + selection->start.FromProtobuf(proto.start()); + selection->end.FromProtobuf(proto.end()); + selection->is_editable = proto.is_editable(); + selection->is_empty_text_form_control = proto.is_empty_text_form_control(); +} + } // namespace cc |