summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/context_group.cc
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-19 06:44:39 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-19 06:44:39 +0000
commita3ded6d49e31e7b03926e30ee04bdb74a622ca9a (patch)
treec785c8cac83b0e7c30e50dbd24ed650397c59adf /gpu/command_buffer/service/context_group.cc
parent10156ef03d6985f8c0a9def13b02ad6fc3cee7f9 (diff)
downloadchromium_src-a3ded6d49e31e7b03926e30ee04bdb74a622ca9a.zip
chromium_src-a3ded6d49e31e7b03926e30ee04bdb74a622ca9a.tar.gz
chromium_src-a3ded6d49e31e7b03926e30ee04bdb74a622ca9a.tar.bz2
Add Ability to pass in allowed extensions to GPU contexts.
Questions: 1) Is WebGraphicsContext3D only used for WebGL? Currently this patch makes that assumption. 2) I started by adding const char* allowed_extensions to a bunch of functions. Then, at the IPC level added GPUInitParams. Should I use GPUInitParams everywhere? 3) Is the path for gpu_init_params.h ok? TEST=unit tests, manually tested WebGL BUG=none Review URL: http://codereview.chromium.org/3775014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/context_group.cc')
-rw-r--r--gpu/command_buffer/service/context_group.cc25
1 files changed, 9 insertions, 16 deletions
diff --git a/gpu/command_buffer/service/context_group.cc b/gpu/command_buffer/service/context_group.cc
index c2c9c1f..07583c0 100644
--- a/gpu/command_buffer/service/context_group.cc
+++ b/gpu/command_buffer/service/context_group.cc
@@ -18,6 +18,7 @@ namespace gles2 {
ContextGroup::ContextGroup()
: initialized_(false),
+ have_context_(true),
max_vertex_attribs_(0u),
max_texture_units_(0u),
max_texture_image_units_(0u),
@@ -28,13 +29,7 @@ ContextGroup::ContextGroup()
}
ContextGroup::~ContextGroup() {
- // Check that Destroy has been called.
- DCHECK(buffer_manager_ == NULL);
- DCHECK(framebuffer_manager_ == NULL);
- DCHECK(renderbuffer_manager_ == NULL);
- DCHECK(texture_manager_ == NULL);
- DCHECK(program_manager_ == NULL);
- DCHECK(shader_manager_ == NULL);
+ Destroy();
}
static void GetIntegerv(GLenum pname, uint32* var) {
@@ -43,8 +38,6 @@ static void GetIntegerv(GLenum pname, uint32* var) {
*var = value;
}
-
-
bool ContextGroup::Initialize(const char* allowed_features) {
if (initialized_) {
return true;
@@ -115,34 +108,34 @@ bool ContextGroup::Initialize(const char* allowed_features) {
return true;
}
-void ContextGroup::Destroy(bool have_context) {
+void ContextGroup::Destroy() {
if (buffer_manager_ != NULL) {
- buffer_manager_->Destroy(have_context);
+ buffer_manager_->Destroy(have_context_);
buffer_manager_.reset();
}
if (framebuffer_manager_ != NULL) {
- framebuffer_manager_->Destroy(have_context);
+ framebuffer_manager_->Destroy(have_context_);
framebuffer_manager_.reset();
}
if (renderbuffer_manager_ != NULL) {
- renderbuffer_manager_->Destroy(have_context);
+ renderbuffer_manager_->Destroy(have_context_);
renderbuffer_manager_.reset();
}
if (texture_manager_ != NULL) {
- texture_manager_->Destroy(have_context);
+ texture_manager_->Destroy(have_context_);
texture_manager_.reset();
}
if (program_manager_ != NULL) {
- program_manager_->Destroy(have_context);
+ program_manager_->Destroy(have_context_);
program_manager_.reset();
}
if (shader_manager_ != NULL) {
- shader_manager_->Destroy(have_context);
+ shader_manager_->Destroy(have_context_);
shader_manager_.reset();
}
}