Chromium Code Reviews| Index: blimp/client/core/compositor/blimp_compositor.h |
| diff --git a/blimp/client/core/compositor/blimp_compositor.h b/blimp/client/core/compositor/blimp_compositor.h |
| index cf14c64cfae17b9ba522bb774b7ffebf771c1e44..844ee72650c0ba372220b1ef7e8d532a31b4a9e1 100644 |
| --- a/blimp/client/core/compositor/blimp_compositor.h |
| +++ b/blimp/client/core/compositor/blimp_compositor.h |
| @@ -13,7 +13,7 @@ |
| #include "base/threading/thread_checker.h" |
| #include "blimp/client/core/compositor/blimp_compositor_frame_sink_proxy.h" |
| #include "blimp/client/public/compositor/compositor_dependencies.h" |
| -#include "cc/blimp/compositor_state_deserializer_client.h" |
| +#include "cc/blimp/compositor_state_deserializer.h" |
| #include "cc/surfaces/surface_factory_client.h" |
| #include "cc/trees/layer_tree_host.h" |
| #include "cc/trees/layer_tree_host_client.h" |
| @@ -34,7 +34,6 @@ namespace proto { |
| class CompositorMessage; |
| } // namespace proto |
| -class CompositorStateDeserializer; |
| class ContextProvider; |
| class Layer; |
| class LayerTreeHost; |
| @@ -120,7 +119,7 @@ class BlimpCompositor : public cc::LayerTreeHostClient, |
| const gfx::Vector2dF& outer_delta, |
| const gfx::Vector2dF& elastic_overscroll_delta, |
| float page_scale, |
| - float top_controls_delta) override {} |
| + float top_controls_delta) override; |
| void RequestNewCompositorFrameSink() override; |
| void DidInitializeCompositorFrameSink() override; |
| // TODO(khushalsagar): Need to handle context initialization failures. |
| @@ -146,9 +145,7 @@ class BlimpCompositor : public cc::LayerTreeHostClient, |
| void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override {} |
| // CompositorStateDeserializerClient implementation. |
| - bool ShouldRetainClientScroll(int engine_layer_id, |
| - const gfx::ScrollOffset& new_offset) override; |
| - bool ShouldRetainClientPageScale(float new_page_scale) override; |
| + void DidUpdateLocalState() override; |
| void HandleCompositorMessageToImpl( |
| std::unique_ptr<cc::proto::CompositorMessage> message); |
| @@ -185,9 +182,9 @@ class BlimpCompositor : public cc::LayerTreeHostClient, |
| // frame should be started. |
| void SubmitCompositorFrameAck(); |
| - // Called when the local copy of the layer with |engine_layer_id| on the |
| - // engine was scrolled on the compositor thread. |
| - void LayerScrolled(int engine_layer_id); |
| + // Sends an update to the engine if the state on the client was modified and |
| + // an ack for a previous update sent is not pending. |
| + void SendClientStateUpdateIfPossible(); |
| // Set to true if we are using a LayerTreeHostInProcess to process frame |
| // updates from the engine. |
| @@ -245,6 +242,14 @@ class BlimpCompositor : public cc::LayerTreeHostClient, |
| std::unique_ptr<cc::CompositorStateDeserializer> |
| compositor_state_deserializer_; |
| + // Set to true if the compositor state on the client was modified on the impl |
| + // thread and an update needs to be sent to the engine. |
| + bool client_state_modified_ = false; |
|
aelias_OOO_until_Jul13
2016/10/26 04:04:12
"dirty" is the jargon for this, so I suggest "clie
Khushal
2016/10/26 19:02:35
Done.
|
| + |
| + // Set to true if a client state update was sent to the engine and an ack for |
| + // this update from the engine is pending. |
| + bool client_state_update_ack_pending_ = false; |
| + |
| base::WeakPtrFactory<BlimpCompositor> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(BlimpCompositor); |