[go: nahoru, domu]

cc/blimp: Add synchronization for scroll/scale state.

Add the protocol messages and the primitives to synchronize mutations
to scroll and scale state on the engine and client. The protocol has
been kept largely consistent with the message passing between the main
and impl thread, as follows:

1) Both the engine and client can send an update to the other peer at
any time, but must wait for an ack from the other peer before sending
another update.

2) If the engine receives an update from the client, it must send the
resulting frame with the acknowledgement for this update. This is
consistent with the behaviour in the threaded compositor where the
main thread always responds with a BeginMainFrameAborted or commit
for deltas sent from the impl thread.

However, as opposed to the threaded compositor, the communication
between the engine and client is completely asynchronous. Enabling
this requires state tracking on the client to track the deltas
seen by the engine, when pushing the resulting frame update to
the impl thread, so the impl thread can apply those deltas
post-commit instead of expecting the main thread to reflect these
values. The change adds a SyncedPropertyRemote primitive, which acts
as the main thread equivalent of SyncedProperty, to perform this for
all state that can be modified on the engine or client.

BUG=648442
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2445093002
Cr-Commit-Position: refs/heads/master@{#429801}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index b8531674..2f48ba0 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -49,7 +49,6 @@
     "blimp/compositor_proto_state.h",
     "blimp/compositor_state_deserializer.cc",
     "blimp/compositor_state_deserializer.h",
-    "blimp/compositor_state_deserializer_client.h",
     "blimp/deserialized_content_layer_client.cc",
     "blimp/deserialized_content_layer_client.h",
     "blimp/engine_picture_cache.h",
@@ -64,6 +63,7 @@
     "blimp/remote_compositor_bridge.cc",
     "blimp/remote_compositor_bridge.h",
     "blimp/remote_compositor_bridge_client.h",
+    "blimp/synced_property_remote.h",
     "debug/benchmark_instrumentation.cc",
     "debug/benchmark_instrumentation.h",
     "debug/debug_colors.cc",
@@ -854,6 +854,7 @@
     "blimp/compositor_state_deserializer_unittest.cc",
     "blimp/layer_tree_host_remote_unittest.cc",
     "blimp/picture_data_conversions_unittest.cc",
+    "blimp/synced_property_remote_unittest.cc",
     "debug/layer_tree_debug_state_unittest.cc",
     "debug/micro_benchmark_controller_unittest.cc",
     "debug/rendering_stats_unittest.cc",