diff options
Diffstat (limited to 'ui/gfx/gl/gl_context.cc')
-rw-r--r-- | ui/gfx/gl/gl_context.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ui/gfx/gl/gl_context.cc b/ui/gfx/gl/gl_context.cc index 9cf1e40..c19741f 100644 --- a/ui/gfx/gl/gl_context.cc +++ b/ui/gfx/gl/gl_context.cc @@ -13,10 +13,15 @@ namespace gfx { -GLContext::GLContext() { +GLContext::GLContext(GLShareGroup* share_group) : share_group_(share_group) { + if (!share_group_.get()) + share_group_ = new GLShareGroup; + + share_group_->AddContext(this); } GLContext::~GLContext() { + share_group_->RemoveContext(this); } std::string GLContext::GetExtensions() { @@ -35,6 +40,10 @@ bool GLContext::HasExtension(const char* name) { return extensions.find(delimited_name) != std::string::npos; } +GLShareGroup* GLContext::share_group() { + return share_group_.get(); +} + bool GLContext::LosesAllContextsOnContextLost() { switch (GetGLImplementation()) { |