Index: gpu/command_buffer/service/texture_manager.h |
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h |
index 1614c72a225d0fe0acff42a0d77e9f4f38ae8117..b6a446e5dbed2678e887c43f40727c9df0230545 100644 |
--- a/gpu/command_buffer/service/texture_manager.h |
+++ b/gpu/command_buffer/service/texture_manager.h |
@@ -65,6 +65,28 @@ class GPU_EXPORT TextureBase { |
MailboxManager* mailbox_manager_; |
}; |
+// A ref-counted version of the TextureBase class that deletes the texture after |
+// all references have been released. |
+class TexturePassthrough final : public TextureBase, |
+ public base::RefCounted<TexturePassthrough> { |
+ public: |
+ explicit TexturePassthrough(GLuint service_id); |
+ |
+ // Notify the texture that the context is lost and it shouldn't delete the |
+ // native GL texture in the destructor |
+ void MarkContextLost(); |
+ |
+ protected: |
+ ~TexturePassthrough() override; |
+ |
+ private: |
+ friend class base::RefCounted<TexturePassthrough>; |
+ |
+ bool have_context_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TexturePassthrough); |
+}; |
+ |
// Info about Textures currently in the system. |
// This class wraps a real GL texture, keeping track of its meta-data. It is |
// jointly owned by possibly multiple TextureRef. |