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 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 float page_scale) = 0; | 29 float page_scale) = 0; |
30 // Creates an OutputSurface. If fallback is true, it should attempt to | 30 // Creates an OutputSurface. If fallback is true, it should attempt to |
31 // create an OutputSurface that is guaranteed to initialize correctly. | 31 // create an OutputSurface that is guaranteed to initialize correctly. |
32 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) = 0; | 32 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) = 0; |
33 virtual void DidInitializeOutputSurface(bool success) = 0; | 33 virtual void DidInitializeOutputSurface(bool success) = 0; |
34 virtual void WillCommit() = 0; | 34 virtual void WillCommit() = 0; |
35 virtual void DidCommit() = 0; | 35 virtual void DidCommit() = 0; |
36 virtual void DidCommitAndDrawFrame() = 0; | 36 virtual void DidCommitAndDrawFrame() = 0; |
37 virtual void DidCompleteSwapBuffers() = 0; | 37 virtual void DidCompleteSwapBuffers() = 0; |
38 | 38 |
39 // Used only in the single-threaded path. | |
40 virtual void ScheduleComposite() = 0; | |
41 | |
42 // If the client provides an OutputSurface bound to a 3d context for direct | 39 // If the client provides an OutputSurface bound to a 3d context for direct |
43 // rendering, this must return a provider that provides contexts usable from | 40 // rendering, this must return a provider that provides contexts usable from |
44 // the same thread as the OutputSurface's context. | 41 // the same thread as the OutputSurface's context. |
45 virtual scoped_refptr<cc::ContextProvider> OffscreenContextProvider() = 0; | 42 virtual scoped_refptr<cc::ContextProvider> OffscreenContextProvider() = 0; |
46 | 43 |
47 // Requests that the client insert a rate limiting token in the shared main | 44 // Requests that the client insert a rate limiting token in the shared main |
48 // thread context's command stream that will block if the context gets too far | 45 // thread context's command stream that will block if the context gets too far |
49 // ahead of the compositor's command stream. Only needed if the tree contains | 46 // ahead of the compositor's command stream. Only needed if the tree contains |
50 // a TextureLayer that calls SetRateLimitContext(true). | 47 // a TextureLayer that calls SetRateLimitContext(true). |
51 virtual void RateLimitSharedMainThreadContext() {} | 48 virtual void RateLimitSharedMainThreadContext() {} |
52 | 49 |
53 // This hook is for testing. | 50 // This hook is for testing. |
54 virtual void DidFailToInitializeOutputSurface() {} | 51 virtual void DidFailToInitializeOutputSurface() {} |
55 | 52 |
56 protected: | 53 protected: |
57 virtual ~LayerTreeHostClient() {} | 54 virtual ~LayerTreeHostClient() {} |
58 }; | 55 }; |
59 | 56 |
60 } // namespace cc | 57 } // namespace cc |
61 | 58 |
62 #endif // CC_TREES_LAYER_TREE_HOST_CLIENT_H_ | 59 #endif // CC_TREES_LAYER_TREE_HOST_CLIENT_H_ |
OLD | NEW |