Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Side by Side Diff: cc/test/layer_tree_host_remote_for_testing.h

Issue 2445093002: cc/blimp: Add synchronization for scroll/scale state. (Closed)
Patch Set: fix rebase upload Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 TaskGraphRunner* task_graph_runner, 72 TaskGraphRunner* task_graph_runner,
75 const LayerTreeSettings& settings, 73 const LayerTreeSettings& settings,
76 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 74 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
77 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); 75 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner);
78 76
79 private: 77 private:
80 class LayerTreeHostInProcessClient; 78 class LayerTreeHostInProcessClient;
81 class RemoteCompositorBridgeImpl; 79 class RemoteCompositorBridgeImpl;
82 80
83 // CompositorStateDeserializerClient implementation. 81 // CompositorStateDeserializerClient implementation.
84 bool ShouldRetainClientScroll(int engine_layer_id, 82 void DidUpdateLocalState() override;
85 const gfx::ScrollOffset& new_offset) override;
86 bool ShouldRetainClientPageScale(float new_page_scale) override;
87 83
88 // LayerTreeHostRemote interface. 84 // LayerTreeHostRemote interface.
89 void DispatchDrawAndSubmitCallbacks() override; 85 void DispatchDrawAndSubmitCallbacks() override;
90 86
91 void LayerDidScroll(int engine_layer_id); 87 void BeginRemoteMainFrame();
92 void ApplyUpdatesFromInProcessHost();
93 88
94 void RemoteHostNeedsMainFrame(); 89 void RemoteHostNeedsMainFrame();
95 void ProcessRemoteCompositorUpdate( 90 void ProcessRemoteCompositorUpdate(
96 std::unique_ptr<CompositorProtoState> compositor_proto_state); 91 std::unique_ptr<CompositorProtoState> compositor_proto_state);
97 92
98 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host_in_process_; 93 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host_in_process_;
99 std::unique_ptr<CompositorStateDeserializer> compositor_state_deserializer_; 94 std::unique_ptr<CompositorStateDeserializer> compositor_state_deserializer_;
100 95
101 ScrollOffsetMap layers_scrolled_; 96 bool client_state_dirty_ = false;
102 97
103 std::unique_ptr<LayerTreeHostInProcessClient> 98 std::unique_ptr<LayerTreeHostInProcessClient>
104 layer_tree_host_in_process_client_; 99 layer_tree_host_in_process_client_;
105 100
106 std::unique_ptr<FakeImageSerializationProcessor> 101 std::unique_ptr<FakeImageSerializationProcessor>
107 image_serialization_processor_; 102 image_serialization_processor_;
108 103
109 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostRemoteForTesting); 104 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostRemoteForTesting);
110 }; 105 };
111 106
112 } // namespace cc 107 } // namespace cc
113 108
114 #endif // CC_TEST_LAYER_TREE_HOST_REMOTE_FOR_TESTING_H_ 109 #endif // CC_TEST_LAYER_TREE_HOST_REMOTE_FOR_TESTING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698