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