OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CC_BLIMP_REMOTE_COMPOSITOR_BRIDGE_H_ | |
6 #define CC_BLIMP_REMOTE_COMPOSITOR_BRIDGE_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/memory/ref_counted.h" | |
10 #include "cc/base/cc_export.h" | |
11 | |
12 namespace base { | |
13 class SingleThreadTaskRunner; | |
14 } // namespace base | |
15 | |
16 namespace cc { | |
17 class CompositorProtoState; | |
18 class RemoteCompositorBridgeClient; | |
19 | |
20 // The RemoteCompositorBridge is the remote LTH's communication bridge to the | |
21 // compositor on the client that consumes the CompositorProtoState updates and | |
22 // performs the actual compositing work. It is responsible for scheduling | |
23 // when a state update should be sent to the client and providing back | |
24 // mutations made to the state on the client. | |
25 class CC_EXPORT RemoteCompositorBridge { | |
26 public: | |
27 RemoteCompositorBridge( | |
28 scoped_refptr<base::SingleThreadTaskRunner> compositor_main_task_runner); | |
29 | |
30 virtual ~RemoteCompositorBridge(); | |
31 | |
32 // Must be called exactly once before the RemoteCompositorBridge can be | |
33 // used. Once bound, the client is expected to outlive this class. | |
34 virtual void BindToClient(RemoteCompositorBridgeClient* client) = 0; | |
35 | |
36 // Notifies the bridge that a main frame update is required. | |
37 virtual void ScheduleMainFrame() = 0; | |
38 | |
39 // If a main frame update results in any mutations to the compositor state, | |
40 // the serialized compositor state is provided to the | |
41 // RemoteCompositorBridge. | |
42 virtual void ProcessCompositorStateUpdate( | |
43 std::unique_ptr<CompositorProtoState> compositor_proto_state) = 0; | |
44 | |
45 protected: | |
46 // The task runner for the compositor's main thread. The | |
47 // RemoteCompositorBridgeClient must be called on this task runner. | |
48 scoped_refptr<base::SingleThreadTaskRunner> compositor_main_task_runner_; | |
49 | |
50 private: | |
51 DISALLOW_COPY_AND_ASSIGN(RemoteCompositorBridge); | |
52 }; | |
53 | |
54 } // namespace cc | |
55 #endif // CC_BLIMP_REMOTE_COMPOSITOR_BRIDGE_H_ | |
OLD | NEW |