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