Chromium Code Reviews| 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" | 11 #include "ui/gfx/geometry/scroll_offset.h" |
|
kuzminruslan
2016/10/30 13:18:41
Perhaps not needed header
Khushal
2016/10/31 23:00:27
Done.
| |
| 12 | 12 |
| 13 namespace gpu { | 13 namespace gpu { |
| 14 class GpuMemoryBufferManager; | 14 class GpuMemoryBufferManager; |
| 15 } // namespace gpu | 15 } // namespace gpu |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 class CompositorStateDeserializer; | |
| 19 class FakeImageSerializationProcessor; | 18 class FakeImageSerializationProcessor; |
| 20 class LayerTreeHostInProcess; | 19 class LayerTreeHostInProcess; |
| 21 class SharedBitmapManager; | 20 class SharedBitmapManager; |
| 22 class TaskGraphRunner; | 21 class TaskGraphRunner; |
| 23 | 22 |
| 24 // This is a version of LayerTreeHostRemote meant to be used for tests that want | 23 // 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 | 24 // to inspect the CompositorFrame produced when state updates from the remote |
| 26 // host are used by a compositor on the client. | 25 // host are used by a compositor on the client. |
| 27 class LayerTreeHostRemoteForTesting : public LayerTreeHostRemote, | 26 class LayerTreeHostRemoteForTesting : public LayerTreeHostRemote, |
| 28 public CompositorStateDeserializerClient { | 27 public CompositorStateDeserializerClient { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 TaskGraphRunner* task_graph_runner, | 73 TaskGraphRunner* task_graph_runner, |
| 75 const LayerTreeSettings& settings, | 74 const LayerTreeSettings& settings, |
| 76 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 75 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 77 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 76 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
| 78 | 77 |
| 79 private: | 78 private: |
| 80 class LayerTreeHostInProcessClient; | 79 class LayerTreeHostInProcessClient; |
| 81 class RemoteCompositorBridgeImpl; | 80 class RemoteCompositorBridgeImpl; |
| 82 | 81 |
| 83 // CompositorStateDeserializerClient implementation. | 82 // CompositorStateDeserializerClient implementation. |
| 84 bool ShouldRetainClientScroll(int engine_layer_id, | 83 void DidUpdateLocalState() override; |
| 85 const gfx::ScrollOffset& new_offset) override; | |
| 86 bool ShouldRetainClientPageScale(float new_page_scale) override; | |
| 87 | 84 |
| 88 // LayerTreeHostRemote interface. | 85 // LayerTreeHostRemote interface. |
| 89 void DispatchDrawAndSubmitCallbacks() override; | 86 void DispatchDrawAndSubmitCallbacks() override; |
| 90 | 87 |
| 91 void LayerDidScroll(int engine_layer_id); | 88 void BeginRemoteMainFrame(); |
| 92 void ApplyUpdatesFromInProcessHost(); | |
| 93 | 89 |
| 94 void RemoteHostNeedsMainFrame(); | 90 void RemoteHostNeedsMainFrame(); |
| 95 void ProcessRemoteCompositorUpdate( | 91 void ProcessRemoteCompositorUpdate( |
| 96 std::unique_ptr<CompositorProtoState> compositor_proto_state); | 92 std::unique_ptr<CompositorProtoState> compositor_proto_state); |
| 97 | 93 |
| 98 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host_in_process_; | 94 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host_in_process_; |
| 99 std::unique_ptr<CompositorStateDeserializer> compositor_state_deserializer_; | 95 std::unique_ptr<CompositorStateDeserializer> compositor_state_deserializer_; |
| 100 | 96 |
| 101 ScrollOffsetMap layers_scrolled_; | 97 bool client_state_dirty_ = false; |
| 102 | 98 |
| 103 std::unique_ptr<LayerTreeHostInProcessClient> | 99 std::unique_ptr<LayerTreeHostInProcessClient> |
| 104 layer_tree_host_in_process_client_; | 100 layer_tree_host_in_process_client_; |
| 105 | 101 |
| 106 std::unique_ptr<FakeImageSerializationProcessor> | 102 std::unique_ptr<FakeImageSerializationProcessor> |
| 107 image_serialization_processor_; | 103 image_serialization_processor_; |
| 108 | 104 |
| 109 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostRemoteForTesting); | 105 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostRemoteForTesting); |
| 110 }; | 106 }; |
| 111 | 107 |
| 112 } // namespace cc | 108 } // namespace cc |
| 113 | 109 |
| 114 #endif // CC_TEST_LAYER_TREE_HOST_REMOTE_FOR_TESTING_H_ | 110 #endif // CC_TEST_LAYER_TREE_HOST_REMOTE_FOR_TESTING_H_ |
| OLD | NEW |