Index: gpu/command_buffer/service/context_group.h |
diff --git a/gpu/command_buffer/service/context_group.h b/gpu/command_buffer/service/context_group.h |
index c459c568960a1086fd060118c8879ee17eaef8f5..064e36f3fdeea25b46071f8d4c67723383bf3e76 100644 |
--- a/gpu/command_buffer/service/context_group.h |
+++ b/gpu/command_buffer/service/context_group.h |
@@ -6,11 +6,13 @@ |
#define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
#include <string> |
+#include <vector> |
#include "base/basictypes.h" |
#include "base/hash_tables.h" |
#include "base/memory/linked_ptr.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/memory/weak_ptr.h" |
#include "gpu/command_buffer/common/gles2_cmd_format.h" |
#include "gpu/command_buffer/service/gles2_cmd_validation.h" |
#include "gpu/command_buffer/service/feature_info.h" |
@@ -50,12 +52,14 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { |
// This should only be called by GLES2Decoder. This must be paired with a |
// call to destroy if it succeeds. |
- bool Initialize(const DisallowedFeatures& disallowed_features, |
- const char* allowed_features); |
+ bool Initialize( |
+ GLES2Decoder* decoder, |
+ const DisallowedFeatures& disallowed_features, |
+ const char* allowed_features); |
// Destroys all the resources when called for the last context in the group. |
// It should only be called by GLES2Decoder. |
- void Destroy(bool have_context); |
+ void Destroy(GLES2Decoder* decoder, bool have_context); |
MailboxManager* mailbox_manager() const { |
return mailbox_manager_.get(); |
@@ -145,6 +149,9 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { |
uint32 GetMemRepresented() const; |
+ // Loses all the context associated with this group. |
+ void LoseContexts(GLenum reset_status); |
+ |
private: |
friend class base::RefCounted<ContextGroup>; |
~ContextGroup(); |
@@ -153,14 +160,13 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { |
bool CheckGLFeatureU(GLint min_required, uint32* v); |
bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); |
bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); |
+ bool HaveContexts(); |
scoped_refptr<MailboxManager> mailbox_manager_; |
scoped_refptr<ImageManager> image_manager_; |
scoped_refptr<MemoryTracker> memory_tracker_; |
scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; |
- // Whether or not this context is initialized. |
- int num_contexts_; |
bool enforce_gl_minimums_; |
bool bind_generates_resource_; |
@@ -191,6 +197,8 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { |
FeatureInfo::Ref feature_info_; |
+ std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ContextGroup); |
}; |