| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_TEST_LAYER_TREE_HOST_REMOTE_FOR_TESTING_H_ | 5 #ifndef CC_TEST_LAYER_TREE_HOST_REMOTE_FOR_TESTING_H_ |
| 6 #define CC_TEST_LAYER_TREE_HOST_REMOTE_FOR_TESTING_H_ | 6 #define CC_TEST_LAYER_TREE_HOST_REMOTE_FOR_TESTING_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "cc/blimp/compositor_state_deserializer_client.h" | 9 #include "cc/blimp/compositor_state_deserializer.h" |
| 10 #include "cc/blimp/layer_tree_host_remote.h" | 10 #include "cc/blimp/layer_tree_host_remote.h" |
| 11 #include "ui/gfx/geometry/scroll_offset.h" | |
| 12 | 11 |
| 13 namespace gpu { | 12 namespace gpu { |
| 14 class GpuMemoryBufferManager; | 13 class GpuMemoryBufferManager; |
| 15 } // namespace gpu | 14 } // namespace gpu |
| 16 | 15 |
| 17 namespace cc { | 16 namespace cc { |
| 18 class CompositorStateDeserializer; | |
| 19 class FakeImageSerializationProcessor; | 17 class FakeImageSerializationProcessor; |
| 20 class LayerTreeHostInProcess; | 18 class LayerTreeHostInProcess; |
| 21 class SharedBitmapManager; | 19 class SharedBitmapManager; |
| 22 class TaskGraphRunner; | 20 class TaskGraphRunner; |
| 23 | 21 |
| 24 // This is a version of LayerTreeHostRemote meant to be used for tests that want | 22 // This is a version of LayerTreeHostRemote meant to be used for tests that want |
| 25 // to inspect the CompositorFrame produced when state updates from the remote | 23 // to inspect the CompositorFrame produced when state updates from the remote |
| 26 // host are used by a compositor on the client. | 24 // host are used by a compositor on the client. |
| 27 class LayerTreeHostRemoteForTesting : public LayerTreeHostRemote, | 25 class LayerTreeHostRemoteForTesting : public LayerTreeHostRemote, |
| 28 public CompositorStateDeserializerClient { | 26 public CompositorStateDeserializerClient { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 TaskGraphRunner* task_graph_runner, | 66 TaskGraphRunner* task_graph_runner, |
| 69 const LayerTreeSettings& settings, | 67 const LayerTreeSettings& settings, |
| 70 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 68 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 71 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 69 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
| 72 | 70 |
| 73 private: | 71 private: |
| 74 class LayerTreeHostInProcessClient; | 72 class LayerTreeHostInProcessClient; |
| 75 class RemoteCompositorBridgeImpl; | 73 class RemoteCompositorBridgeImpl; |
| 76 | 74 |
| 77 // CompositorStateDeserializerClient implementation. | 75 // CompositorStateDeserializerClient implementation. |
| 78 bool ShouldRetainClientScroll(int engine_layer_id, | 76 void DidUpdateLocalState() override; |
| 79 const gfx::ScrollOffset& new_offset) override; | |
| 80 bool ShouldRetainClientPageScale(float new_page_scale) override; | |
| 81 | 77 |
| 82 // LayerTreeHostRemote interface. | 78 // LayerTreeHostRemote interface. |
| 83 void DispatchDrawAndSubmitCallbacks() override; | 79 void DispatchDrawAndSubmitCallbacks() override; |
| 84 | 80 |
| 85 void LayerDidScroll(int engine_layer_id); | 81 void BeginRemoteMainFrame(); |
| 86 void ApplyUpdatesFromInProcessHost(); | |
| 87 | 82 |
| 88 void RemoteHostNeedsMainFrame(); | 83 void RemoteHostNeedsMainFrame(); |
| 89 void ProcessRemoteCompositorUpdate( | 84 void ProcessRemoteCompositorUpdate( |
| 90 std::unique_ptr<CompositorProtoState> compositor_proto_state); | 85 std::unique_ptr<CompositorProtoState> compositor_proto_state); |
| 91 | 86 |
| 92 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host_in_process_; | 87 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host_in_process_; |
| 93 std::unique_ptr<CompositorStateDeserializer> compositor_state_deserializer_; | 88 std::unique_ptr<CompositorStateDeserializer> compositor_state_deserializer_; |
| 94 | 89 |
| 95 ScrollOffsetMap layers_scrolled_; | 90 bool client_state_dirty_ = false; |
| 96 | 91 |
| 97 std::unique_ptr<LayerTreeHostInProcessClient> | 92 std::unique_ptr<LayerTreeHostInProcessClient> |
| 98 layer_tree_host_in_process_client_; | 93 layer_tree_host_in_process_client_; |
| 99 | 94 |
| 100 std::unique_ptr<FakeImageSerializationProcessor> | 95 std::unique_ptr<FakeImageSerializationProcessor> |
| 101 image_serialization_processor_; | 96 image_serialization_processor_; |
| 102 | 97 |
| 103 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostRemoteForTesting); | 98 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostRemoteForTesting); |
| 104 }; | 99 }; |
| 105 | 100 |
| 106 } // namespace cc | 101 } // namespace cc |
| 107 | 102 |
| 108 #endif // CC_TEST_LAYER_TREE_HOST_REMOTE_FOR_TESTING_H_ | 103 #endif // CC_TEST_LAYER_TREE_HOST_REMOTE_FOR_TESTING_H_ |
| OLD | NEW |