Chromium Code Reviews| Index: cc/blimp/layer_tree_host_remote.cc |
| diff --git a/cc/blimp/layer_tree_host_remote.cc b/cc/blimp/layer_tree_host_remote.cc |
| index 5f123e2b06867ec6ffb33cc2a4eb223d08be67e2..d0157256051303bc310e5429da5a9f5aad161ea9 100644 |
| --- a/cc/blimp/layer_tree_host_remote.cc |
| +++ b/cc/blimp/layer_tree_host_remote.cc |
| @@ -10,6 +10,8 @@ |
| #include "cc/blimp/compositor_proto_state_sink.h" |
| #include "cc/output/begin_frame_args.h" |
| #include "cc/output/compositor_frame_sink.h" |
| +#include "cc/proto/compositor_message.pb.h" |
| +#include "cc/proto/layer_tree_host.pb.h" |
| #include "cc/trees/layer_tree.h" |
| #include "cc/trees/layer_tree_host_client.h" |
| #include "cc/trees/layer_tree_host_common.h" |
| @@ -374,10 +376,13 @@ void LayerTreeHostRemote::BeginMainFrame() { |
| return; |
| } |
| - // TODO(khushalsagar): Serialize current state/reset dirty state tracking and |
| - // return the result to the state sink instead. |
| std::unique_ptr<CompositorProtoState> compositor_state = |
| base::MakeUnique<CompositorProtoState>(); |
| + compositor_state->swap_promises = swap_promise_manager_.TakeSwapPromises(); |
| + compositor_state->compositor_message = |
| + base::MakeUnique<proto::CompositorMessage>(); |
| + SerializeCurrentState( |
| + compositor_state->compositor_message->mutable_layer_tree_host()); |
| compositor_proto_state_sink_->ProcessCompositorStateUpdate( |
| std::move(compositor_state)); |
| @@ -415,4 +420,18 @@ void LayerTreeHostRemote::DispatchDrawAndSwapCallbacks() { |
| client_->DidCompleteSwapBuffers(); |
| } |
| +void LayerTreeHostRemote::SerializeCurrentState( |
| + proto::LayerTreeHost* layer_tree_host_proto) { |
| + // Serialize the LayerTree. |
| + layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(), true); |
|
ajuma
2016/09/29 20:55:33
Instead of passing |true| here, please create a va
Khushal
2016/10/04 09:11:50
Done.
|
| + |
| + // Serialize the dirty layers. |
| + for (auto* layer : layer_tree_->LayersThatShouldPushProperties()) |
| + layer->ToLayerPropertiesProto( |
| + layer_tree_host_proto->mutable_layer_updates(), true); |
| + layer_tree_->LayersThatShouldPushProperties().clear(); |
| + |
| + // TODO(khushalsagar): Deal with picture caching. |
| +} |
| + |
| } // namespace cc |