| 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..8d80311b98f489b587bebe112078ae47d3ca9c58 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,10 +34,9 @@ namespace proto {
|
| class CompositorMessage;
|
| } // namespace proto
|
|
|
| -class CompositorStateDeserializer;
|
| class ContextProvider;
|
| class Layer;
|
| -class LayerTreeHost;
|
| +class LayerTreeHostInProcess;
|
| class LayerTreeSettings;
|
| class LocalFrameid;
|
| class Surface;
|
| @@ -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 FlushClientState();
|
|
|
| // Set to true if we are using a LayerTreeHostInProcess to process frame
|
| // updates from the engine.
|
| @@ -199,7 +196,7 @@ class BlimpCompositor : public cc::LayerTreeHostClient,
|
|
|
| cc::FrameSinkId frame_sink_id_;
|
|
|
| - std::unique_ptr<cc::LayerTreeHost> host_;
|
| + std::unique_ptr<cc::LayerTreeHostInProcess> host_;
|
|
|
| // The SurfaceFactory is bound to the lifetime of the |proxy_client_|. When
|
| // detached, the surface factory will be destroyed.
|
| @@ -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_dirty_ = false;
|
| +
|
| + // 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);
|
|
|