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