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_LAYERS_TEXTURE_LAYER_CLIENT_H_ | 5 #ifndef CC_LAYERS_TEXTURE_LAYER_CLIENT_H_ |
6 #define CC_LAYERS_TEXTURE_LAYER_CLIENT_H_ | 6 #define CC_LAYERS_TEXTURE_LAYER_CLIENT_H_ |
7 | 7 |
8 #include "cc/resources/single_release_callback.h" | 8 #include "cc/resources/single_release_callback.h" |
9 | 9 |
10 namespace WebKit { class WebGraphicsContext3D; } | 10 namespace WebKit { class WebGraphicsContext3D; } |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 class ResourceUpdateQueue; | 13 class ResourceUpdateQueue; |
14 class TextureMailbox; | 14 class TextureMailbox; |
15 | 15 |
16 class TextureLayerClient { | 16 class TextureLayerClient { |
17 public: | 17 public: |
18 // Called to prepare this layer's texture for compositing. | 18 // Called to prepare this layer's texture for compositing. |
19 // Returns the texture ID to be used for compositing. | 19 // Returns the texture ID to be used for compositing. |
20 virtual unsigned PrepareTexture() = 0; | 20 virtual unsigned PrepareTexture() = 0; |
21 | 21 |
22 // Returns the context that is providing the texture. Used for rate limiting | |
23 // and detecting lost context. | |
24 virtual WebKit::WebGraphicsContext3D* Context3d() = 0; | |
25 | |
26 // Returns true and provides a mailbox if a new frame is available. | 22 // Returns true and provides a mailbox if a new frame is available. |
27 // Returns false if no new data is available | 23 // Returns false if no new data is available |
28 // and the old mailbox is to be reused. | 24 // and the old mailbox is to be reused. |
29 virtual bool PrepareTextureMailbox( | 25 virtual bool PrepareTextureMailbox( |
30 TextureMailbox* mailbox, | 26 TextureMailbox* mailbox, |
31 scoped_ptr<SingleReleaseCallback>* release_callback, | 27 scoped_ptr<SingleReleaseCallback>* release_callback, |
32 bool use_shared_memory) = 0; | 28 bool use_shared_memory) = 0; |
33 | 29 |
34 protected: | 30 protected: |
35 virtual ~TextureLayerClient() {} | 31 virtual ~TextureLayerClient() {} |
36 }; | 32 }; |
37 | 33 |
38 } // namespace cc | 34 } // namespace cc |
39 | 35 |
40 #endif // CC_LAYERS_TEXTURE_LAYER_CLIENT_H_ | 36 #endif // CC_LAYERS_TEXTURE_LAYER_CLIENT_H_ |
OLD | NEW |