| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Vector2dF; | 13 class Vector2dF; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 class CompositorFrameSink; | 17 class CompositorFrameSink; |
| 18 struct BeginFrameArgs; | 18 struct BeginFrameArgs; |
| 19 | 19 |
| 20 class LayerTreeHostClient { | 20 class LayerTreeHostClient { |
| 21 public: | 21 public: |
| 22 virtual void WillBeginMainFrame() = 0; | 22 virtual void WillBeginMainFrame() = 0; |
| 23 // Marks finishing compositing-related tasks on the main thread. In threaded | 23 // Marks finishing compositing-related tasks on the main thread. In threaded |
| 24 // mode, this corresponds to DidCommit(). | 24 // mode, this corresponds to DidCommit(). |
| 25 virtual void BeginMainFrame(const BeginFrameArgs& args) = 0; | 25 virtual void BeginMainFrame(const BeginFrameArgs& args) = 0; |
| 26 virtual void BeginMainFrameNotExpectedSoon() = 0; | 26 virtual void BeginMainFrameNotExpectedSoon() = 0; |
| 27 virtual void DoShortIdleWork(const BeginFrameArgs& args) = 0; |
| 27 virtual void DidBeginMainFrame() = 0; | 28 virtual void DidBeginMainFrame() = 0; |
| 28 // A LayerTreeHost is bound to a LayerTreeHostClient. Visual frame-based | 29 // A LayerTreeHost is bound to a LayerTreeHostClient. Visual frame-based |
| 29 // updates to the state of the LayerTreeHost are expected to happen only in | 30 // updates to the state of the LayerTreeHost are expected to happen only in |
| 30 // calls to LayerTreeHostClient::UpdateLayerTreeHost, which should | 31 // calls to LayerTreeHostClient::UpdateLayerTreeHost, which should |
| 31 // mutate/invalidate the layer tree or other page parameters as appropriate. | 32 // mutate/invalidate the layer tree or other page parameters as appropriate. |
| 32 // | 33 // |
| 33 // An example of a LayerTreeHostClient is (via additional indirections) Blink, | 34 // An example of a LayerTreeHostClient is (via additional indirections) Blink, |
| 34 // which inside of LayerTreeHostClient::UpdateLayerTreeHost will update | 35 // which inside of LayerTreeHostClient::UpdateLayerTreeHost will update |
| 35 // (Blink's notions of) style, layout, paint invalidation and compositing | 36 // (Blink's notions of) style, layout, paint invalidation and compositing |
| 36 // state. (The "compositing state" will result in a mutated layer tree on the | 37 // state. (The "compositing state" will result in a mutated layer tree on the |
| (...skipping 19 matching lines...) Expand all Loading... |
| 56 virtual void DidReceiveCompositorFrameAck() = 0; | 57 virtual void DidReceiveCompositorFrameAck() = 0; |
| 57 virtual void DidCompletePageScaleAnimation() = 0; | 58 virtual void DidCompletePageScaleAnimation() = 0; |
| 58 | 59 |
| 59 protected: | 60 protected: |
| 60 virtual ~LayerTreeHostClient() {} | 61 virtual ~LayerTreeHostClient() {} |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 } // namespace cc | 64 } // namespace cc |
| 64 | 65 |
| 65 #endif // CC_TREES_LAYER_TREE_HOST_CLIENT_H_ | 66 #endif // CC_TREES_LAYER_TREE_HOST_CLIENT_H_ |
| OLD | NEW |