diff options
author | nyquist <nyquist@chromium.org> | 2016-01-14 09:40:36 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-14 17:42:27 +0000 |
commit | 4f5e8afdadf36c01a01467abb441be357db6d142 (patch) | |
tree | 22707f5ed1e788415b2991d52f0878edd0d4f73f /cc/trees/layer_tree_host.h | |
parent | 4f2151064444e40f0550f0cc312268550f25aa4b (diff) | |
download | chromium_src-4f5e8afdadf36c01a01467abb441be357db6d142.zip chromium_src-4f5e8afdadf36c01a01467abb441be357db6d142.tar.gz chromium_src-4f5e8afdadf36c01a01467abb441be357db6d142.tar.bz2 |
Add support for (de)serializing LayerTreeHost.
As part of the cc commit flow, we need to be able to serialize
the LayerTreeHost. Not all state is necessary to serialize to
be able to do a commit on the client side, so only some members
are included in the proto.
BUG=561210
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1519293002
Cr-Commit-Position: refs/heads/master@{#369450}
Diffstat (limited to 'cc/trees/layer_tree_host.h')
-rw-r--r-- | cc/trees/layer_tree_host.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index f7bd43368..9d196e1 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h @@ -72,6 +72,10 @@ struct PendingPageScaleAnimation; struct RenderingStats; struct ScrollAndScaleSet; +namespace proto { +class LayerTreeHost; +} + class CC_EXPORT LayerTreeHost : public MutatorHostClient { public: // TODO(sad): InitParams should be a movable type so that it can be @@ -366,6 +370,16 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient { bool HasAnyAnimation(const Layer* layer) const; bool HasActiveAnimation(const Layer* layer) const; + // Serializes the parts of this LayerTreeHost that is needed for a commit to a + // protobuf message. Not all members are serialized as they are not helpful + // for remote usage. + void ToProtobufForCommit(proto::LayerTreeHost* proto) const; + + // Deserializes the protobuf into this LayerTreeHost before a commit. The + // expected input is a serialized remote LayerTreeHost. After deserializing + // the protobuf, the normal commit-flow should continue. + void FromProtobufForCommit(const proto::LayerTreeHost& proto); + protected: LayerTreeHost(InitParams* params, CompositorMode mode); void InitializeThreaded( @@ -404,6 +418,8 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient { void RecordGpuRasterizationHistogram(); private: + friend class LayerTreeHostSerializationTest; + void InitializeProxy( scoped_ptr<Proxy> proxy, scoped_ptr<BeginFrameSource> external_begin_frame_source); |