| Index: ui/gl/gl_context.cc
|
| diff --git a/ui/gl/gl_context.cc b/ui/gl/gl_context.cc
|
| index 496ed964e5e0f4f491556d4fe97f20169c8b32af..1bc4d122d1c4c74973aefa428947c851c7ef2b3f 100644
|
| --- a/ui/gl/gl_context.cc
|
| +++ b/ui/gl/gl_context.cc
|
| @@ -20,6 +20,9 @@ namespace gfx {
|
| namespace {
|
| base::LazyInstance<base::ThreadLocalPointer<GLContext> >::Leaky
|
| current_context_ = LAZY_INSTANCE_INITIALIZER;
|
| +
|
| +base::LazyInstance<base::ThreadLocalPointer<GLContext> >::Leaky
|
| + current_real_context_ = LAZY_INSTANCE_INITIALIZER;
|
| } // namespace
|
|
|
| GLContext::GLContext(GLShareGroup* share_group) : share_group_(share_group) {
|
| @@ -32,7 +35,7 @@ GLContext::GLContext(GLShareGroup* share_group) : share_group_(share_group) {
|
| GLContext::~GLContext() {
|
| share_group_->RemoveContext(this);
|
| if (GetCurrent() == this) {
|
| - SetCurrent(NULL, NULL);
|
| + SetCurrent(NULL);
|
| }
|
| }
|
|
|
| @@ -90,8 +93,12 @@ GLContext* GLContext::GetCurrent() {
|
| return current_context_.Pointer()->Get();
|
| }
|
|
|
| -void GLContext::SetCurrent(GLContext* context, GLSurface* surface) {
|
| - current_context_.Pointer()->Set(context);
|
| +GLContext* GLContext::GetRealCurrent() {
|
| + return current_real_context_.Pointer()->Get();
|
| +}
|
| +
|
| +void GLContext::SetCurrent(GLSurface* surface) {
|
| + current_context_.Pointer()->Set(surface ? this : NULL);
|
| GLSurface::SetCurrent(surface);
|
| }
|
|
|
| @@ -140,4 +147,14 @@ void GLContext::SetRealGLApi() {
|
| SetGLToRealGLApi();
|
| }
|
|
|
| +GLContextReal::GLContextReal(GLShareGroup* share_group)
|
| + : GLContext(share_group) {}
|
| +
|
| +GLContextReal::~GLContextReal() {}
|
| +
|
| +void GLContextReal::SetCurrent(GLSurface* surface) {
|
| + GLContext::SetCurrent(surface);
|
| + current_real_context_.Pointer()->Set(surface ? this : NULL);
|
| +}
|
| +
|
| } // namespace gfx
|
|
|