| Index: components/exo/buffer.h
|
| diff --git a/components/exo/buffer.h b/components/exo/buffer.h
|
| index 6502cdfa2efae22697c71370cfbf7748e942be4f..5108c57cc86c3cbd08dd31b3675266a780b32646 100644
|
| --- a/components/exo/buffer.h
|
| +++ b/components/exo/buffer.h
|
| @@ -62,6 +62,12 @@ class Buffer : public base::SupportsWeakPtr<Buffer> {
|
| bool secure_output_only,
|
| bool client_usage);
|
|
|
| + // This should be called when the buffer is attached to a Surface.
|
| + void OnAttach();
|
| +
|
| + // This should be called when the buffer is detached from a surface.
|
| + void OnDetach();
|
| +
|
| // Returns the size of the buffer.
|
| gfx::Size GetSize() const;
|
|
|
| @@ -75,6 +81,9 @@ class Buffer : public base::SupportsWeakPtr<Buffer> {
|
| // as been released if it reached 0.
|
| void Release();
|
|
|
| + // Runs the release callback if the buffer isn't attached or in use.
|
| + void CheckReleaseCallback();
|
| +
|
| // 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);
|
| @@ -104,6 +113,9 @@ class Buffer : public base::SupportsWeakPtr<Buffer> {
|
| // notify the client that buffer has been released.
|
| unsigned use_count_;
|
|
|
| + // This keeps track of how many Surfaces the buffer is attached to.
|
| + unsigned attach_count_ = 0;
|
| +
|
| // The last used texture. ProduceTextureMailbox() will use this
|
| // instead of creating a new texture when possible.
|
| std::unique_ptr<Texture> texture_;
|
|
|