Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Unified Diff: gpu/command_buffer/service/context_group.h

Issue 11568029: Add a command to lose the context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add docs, lose parent and children, fix typo Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h ('k') | gpu/command_buffer/service/context_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698