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