| 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_BLIMP_REMOTE_COMPOSITOR_BRIDGE_CLIENT_H_ | 5 #ifndef CC_BLIMP_REMOTE_COMPOSITOR_BRIDGE_CLIENT_H_ |
| 6 #define CC_BLIMP_REMOTE_COMPOSITOR_BRIDGE_CLIENT_H_ | 6 #define CC_BLIMP_REMOTE_COMPOSITOR_BRIDGE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class SingleThreadTaskRunner; | 14 class SingleThreadTaskRunner; |
| 15 } // namespace base | 15 } // namespace base |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 class ScrollOffset; | 18 class ScrollOffset; |
| 19 } // namespace gfx | 19 } // namespace gfx |
| 20 | 20 |
| 21 namespace cc { | 21 namespace cc { |
| 22 namespace proto { |
| 23 class ClientStateUpdate; |
| 24 } // namespace proto |
| 22 class CompositorProtoState; | 25 class CompositorProtoState; |
| 23 | 26 |
| 24 class CC_EXPORT RemoteCompositorBridgeClient { | 27 class CC_EXPORT RemoteCompositorBridgeClient { |
| 25 public: | 28 public: |
| 26 using ScrollOffsetMap = std::unordered_map<int, gfx::ScrollOffset>; | 29 using ScrollOffsetMap = std::unordered_map<int, gfx::ScrollOffset>; |
| 27 | 30 |
| 28 virtual ~RemoteCompositorBridgeClient() {} | 31 virtual ~RemoteCompositorBridgeClient() {} |
| 29 | 32 |
| 30 // Called in response to a ScheduleMainFrame request made on the | 33 // Called in response to a ScheduleMainFrame request made on the |
| 31 // RemoteCompositorBridge. | 34 // RemoteCompositorBridge. |
| 32 // Note: The method should always be invoked asynchronously after the request | 35 // Note: The method should always be invoked asynchronously after the request |
| 33 // is made. | 36 // is made. |
| 34 virtual void BeginMainFrame() = 0; | 37 virtual void BeginMainFrame() = 0; |
| 35 | 38 |
| 36 // Provides an update from the mutations made on the client. Returns true if | 39 // Applied state updates reported from the client onto the main thread state |
| 37 // the update could be successfully applied to the engine state. This can | 40 // on the engine. |
| 38 // fail, for instance, if the layer present in the update was destroyed on the | 41 virtual void ApplyStateUpdateFromClient( |
| 39 // engine. | 42 const proto::ClientStateUpdate& client_state_update) = 0; |
| 40 virtual bool ApplyScrollAndScaleUpdateFromClient( | |
| 41 const ScrollOffsetMap& client_scroll_map, | |
| 42 float client_page_scale) = 0; | |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace cc | 45 } // namespace cc |
| 46 | 46 |
| 47 #endif // CC_BLIMP_REMOTE_COMPOSITOR_BRIDGE_CLIENT_H_ | 47 #endif // CC_BLIMP_REMOTE_COMPOSITOR_BRIDGE_CLIENT_H_ |
| OLD | NEW |