| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_TREES_LAYER_TREE_HOST_CLIENT_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_CLIENT_H_ |
| 6 #define CC_TREES_LAYER_TREE_HOST_CLIENT_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Vector2d; | 13 class Vector2d; |
| 14 class Vector2dF; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace cc { | 17 namespace cc { |
| 17 class ContextProvider; | 18 class ContextProvider; |
| 18 class InputHandlerClient; | 19 class InputHandlerClient; |
| 19 class OutputSurface; | 20 class OutputSurface; |
| 20 struct BeginFrameArgs; | 21 struct BeginFrameArgs; |
| 21 | 22 |
| 22 class LayerTreeHostClient { | 23 class LayerTreeHostClient { |
| 23 public: | 24 public: |
| 24 virtual void WillBeginMainFrame(int frame_id) = 0; | 25 virtual void WillBeginMainFrame(int frame_id) = 0; |
| 25 // Marks finishing compositing-related tasks on the main thread. In threaded | 26 // Marks finishing compositing-related tasks on the main thread. In threaded |
| 26 // mode, this corresponds to DidCommit(). | 27 // mode, this corresponds to DidCommit(). |
| 27 virtual void BeginMainFrame(const BeginFrameArgs& args) = 0; | 28 virtual void BeginMainFrame(const BeginFrameArgs& args) = 0; |
| 28 virtual void DidBeginMainFrame() = 0; | 29 virtual void DidBeginMainFrame() = 0; |
| 29 virtual void Layout() = 0; | 30 virtual void Layout() = 0; |
| 30 virtual void ApplyViewportDeltas(const gfx::Vector2d& inner_delta, | 31 virtual void ApplyViewportDeltas( |
| 31 const gfx::Vector2d& outer_delta, | 32 const gfx::Vector2d& inner_delta, |
| 32 float page_scale, | 33 const gfx::Vector2d& outer_delta, |
| 33 float top_controls_delta) = 0; | 34 const gfx::Vector2dF& elastic_overscroll_delta, |
| 35 float page_scale, |
| 36 float top_controls_delta) = 0; |
| 34 virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, | 37 virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, |
| 35 float page_scale, | 38 float page_scale, |
| 36 float top_controls_delta) = 0; | 39 float top_controls_delta) = 0; |
| 37 // Request an OutputSurface from the client. When the client has one it should | 40 // Request an OutputSurface from the client. When the client has one it should |
| 38 // call LayerTreeHost::SetOutputSurface. If fallback is true, it should | 41 // call LayerTreeHost::SetOutputSurface. If fallback is true, it should |
| 39 // attempt to create an OutputSurface that is guaranteed to initialize | 42 // attempt to create an OutputSurface that is guaranteed to initialize |
| 40 // correctly. | 43 // correctly. |
| 41 virtual void RequestNewOutputSurface(bool fallback) = 0; | 44 virtual void RequestNewOutputSurface(bool fallback) = 0; |
| 42 virtual void DidInitializeOutputSurface() = 0; | 45 virtual void DidInitializeOutputSurface() = 0; |
| 43 virtual void WillCommit() = 0; | 46 virtual void WillCommit() = 0; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 58 // This hook is for testing. | 61 // This hook is for testing. |
| 59 virtual void DidFailToInitializeOutputSurface() {} | 62 virtual void DidFailToInitializeOutputSurface() {} |
| 60 | 63 |
| 61 protected: | 64 protected: |
| 62 virtual ~LayerTreeHostClient() {} | 65 virtual ~LayerTreeHostClient() {} |
| 63 }; | 66 }; |
| 64 | 67 |
| 65 } // namespace cc | 68 } // namespace cc |
| 66 | 69 |
| 67 #endif // CC_TREES_LAYER_TREE_HOST_CLIENT_H_ | 70 #endif // CC_TREES_LAYER_TREE_HOST_CLIENT_H_ |
| OLD | NEW |