| 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_LAYER_TREE_HOST_CLIENT_H_ | 5 #ifndef CC_LAYER_TREE_HOST_CLIENT_H_ |
| 6 #define CC_LAYER_TREE_HOST_CLIENT_H_ | 6 #define CC_LAYER_TREE_HOST_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 9 | 10 |
| 10 namespace gfx { | 11 namespace gfx { |
| 11 class Vector2d; | 12 class Vector2d; |
| 12 } | 13 } |
| 13 | 14 |
| 14 namespace cc { | 15 namespace cc { |
| 16 class ContextProvider; |
| 15 class InputHandler; | 17 class InputHandler; |
| 16 class OutputSurface; | 18 class OutputSurface; |
| 17 | 19 |
| 18 class LayerTreeHostClient { | 20 class LayerTreeHostClient { |
| 19 public: | 21 public: |
| 20 virtual void willBeginFrame() = 0; | 22 virtual void willBeginFrame() = 0; |
| 21 // Marks finishing compositing-related tasks on the main thread. In threaded
mode, this corresponds to didCommit(). | 23 // Marks finishing compositing-related tasks on the main thread. In threaded
mode, this corresponds to didCommit(). |
| 22 virtual void didBeginFrame() = 0; | 24 virtual void didBeginFrame() = 0; |
| 23 virtual void animate(double frameBeginTime) = 0; | 25 virtual void animate(double frameBeginTime) = 0; |
| 24 virtual void layout() = 0; | 26 virtual void layout() = 0; |
| 25 virtual void applyScrollAndScale(gfx::Vector2d scrollDelta, float pageScale)
= 0; | 27 virtual void applyScrollAndScale(gfx::Vector2d scrollDelta, float pageScale)
= 0; |
| 26 virtual scoped_ptr<OutputSurface> createOutputSurface() = 0; | 28 virtual scoped_ptr<OutputSurface> createOutputSurface() = 0; |
| 27 virtual void didRecreateOutputSurface(bool success) = 0; | 29 virtual void didRecreateOutputSurface(bool success) = 0; |
| 28 virtual scoped_ptr<InputHandler> createInputHandler() = 0; | 30 virtual scoped_ptr<InputHandler> createInputHandler() = 0; |
| 29 virtual void willCommit() = 0; | 31 virtual void willCommit() = 0; |
| 30 virtual void didCommit() = 0; | 32 virtual void didCommit() = 0; |
| 31 virtual void didCommitAndDrawFrame() = 0; | 33 virtual void didCommitAndDrawFrame() = 0; |
| 32 virtual void didCompleteSwapBuffers() = 0; | 34 virtual void didCompleteSwapBuffers() = 0; |
| 33 | 35 |
| 34 // Used only in the single-threaded path. | 36 // Used only in the single-threaded path. |
| 35 virtual void scheduleComposite() = 0; | 37 virtual void scheduleComposite() = 0; |
| 36 | 38 |
| 39 // These must always return a valid ContextProvider. But the provider does n
ot need to be capable of creating contexts. |
| 40 virtual scoped_refptr<cc::ContextProvider> OffscreenContextProviderForMainTh
read() = 0; |
| 41 virtual scoped_refptr<cc::ContextProvider> OffscreenContextProviderForCompos
itorThread() = 0; |
| 42 |
| 43 // This hook is for testing. |
| 44 virtual void willRetryRecreateOutputSurface() {} |
| 45 |
| 37 protected: | 46 protected: |
| 38 virtual ~LayerTreeHostClient() { } | 47 virtual ~LayerTreeHostClient() { } |
| 39 }; | 48 }; |
| 40 | 49 |
| 41 } | 50 } |
| 42 | 51 |
| 43 #endif // CC_LAYER_TREE_HOST_CLIENT_H_ | 52 #endif // CC_LAYER_TREE_HOST_CLIENT_H_ |
| OLD | NEW |