Chromium Code Reviews| Index: components/exo/buffer.h |
| diff --git a/components/exo/buffer.h b/components/exo/buffer.h |
| index e7b5b605c45e423e78ce5ce91cf92ee346110338..7dfb39de29df72689bfb7c12947388122f44c17c 100644 |
| --- a/components/exo/buffer.h |
| +++ b/components/exo/buffer.h |
| @@ -29,6 +29,8 @@ class GpuMemoryBuffer; |
| namespace exo { |
| +class CompositorFrameSinkHolder; |
| + |
| // This class provides the content for a Surface. The mechanism by which a |
| // client provides and updates the contents is the responsibility of the client |
| // and not defined as part of this class. |
| @@ -56,7 +58,8 @@ class Buffer : public base::SupportsWeakPtr<Buffer> { |
| std::unique_ptr<cc::SingleReleaseCallback> ProduceTextureMailbox( |
| cc::TextureMailbox* mailbox, |
| bool secure_output_only, |
| - bool client_usage); |
| + bool client_usage, |
| + scoped_refptr<CompositorFrameSinkHolder> compositor_frame_sink_holder); |
|
reveman
2016/12/22 17:00:53
nit: s/scoped_refptr<CompositorFrameSinkHolder>/Co
Alex Z.
2016/12/22 18:08:48
Done.
|
| // This should be called when the buffer is attached to a Surface. |
| void OnAttach(); |
| @@ -80,10 +83,24 @@ class Buffer : public base::SupportsWeakPtr<Buffer> { |
| // Runs the release callback if the buffer isn't attached or in use. |
| void CheckReleaseCallback(); |
| + // This is a wrapper function for ReleaseTexture. It holds onto a ref to |
| + // CompositorFrameSinkHolder to keep it alive and calls |
| + // ReleaseTexture(texture). |
| + void ReleaseTextureAndCompositorFrameSinkHolder( |
| + std::unique_ptr<Texture> texture, |
| + CompositorFrameSinkHolder* compositor_frame_sink_holder); |
| + |
| // This is used by ProduceTextureMailbox() to produce a release callback |
| // that releases a texture so it can be destroyed or reused. |
| void ReleaseTexture(std::unique_ptr<Texture> texture); |
| + // This is a wrapper function for ReleaseContentsTexture. It holds onto a ref |
| + // to CompositorFrameSinkHolder to keep it alive and calls |
| + // ReleaseTexture(texture). |
| + void ReleaseContentsTextureAndCompositorFrameSinkHolder( |
| + std::unique_ptr<Texture> texture, |
| + CompositorFrameSinkHolder* compositor_frame_sink_holder); |
| + |
| // This is used by ProduceTextureMailbox() to produce a release callback |
| // that releases the buffer contents referenced by a texture before the |
| // texture is destroyed or reused. |