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