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

Unified Diff: cc/blimp/layer_tree_host_remote.cc

Issue 2375363002: cc/blimp: Set up the framework for state serialization. (Closed)
Patch Set: Created 4 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/blimp/layer_tree_host_remote.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « cc/blimp/layer_tree_host_remote.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698