| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/threading/thread_local.h" | 10 #include "base/threading/thread_local.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 return current_context_.Pointer()->Get(); | 93 return current_context_.Pointer()->Get(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 GLContext* GLContext::GetRealCurrent() { | 96 GLContext* GLContext::GetRealCurrent() { |
| 97 return current_real_context_.Pointer()->Get(); | 97 return current_real_context_.Pointer()->Get(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void GLContext::SetCurrent(GLSurface* surface) { | 100 void GLContext::SetCurrent(GLSurface* surface) { |
| 101 current_context_.Pointer()->Set(surface ? this : NULL); | 101 current_context_.Pointer()->Set(surface ? this : NULL); |
| 102 GLSurface::SetCurrent(surface); | 102 GLSurface::SetCurrent(surface); |
| 103 if (!surface) |
| 104 SetGLApi(NULL); |
| 103 } | 105 } |
| 104 | 106 |
| 105 GLStateRestorer* GLContext::GetGLStateRestorer() { | 107 GLStateRestorer* GLContext::GetGLStateRestorer() { |
| 106 return state_restorer_.get(); | 108 return state_restorer_.get(); |
| 107 } | 109 } |
| 108 | 110 |
| 109 void GLContext::SetGLStateRestorer(GLStateRestorer* state_restorer) { | 111 void GLContext::SetGLStateRestorer(GLStateRestorer* state_restorer) { |
| 110 state_restorer_ = make_scoped_ptr(state_restorer); | 112 state_restorer_ = make_scoped_ptr(state_restorer); |
| 111 } | 113 } |
| 112 | 114 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 : GLContext(share_group) {} | 153 : GLContext(share_group) {} |
| 152 | 154 |
| 153 GLContextReal::~GLContextReal() {} | 155 GLContextReal::~GLContextReal() {} |
| 154 | 156 |
| 155 void GLContextReal::SetCurrent(GLSurface* surface) { | 157 void GLContextReal::SetCurrent(GLSurface* surface) { |
| 156 GLContext::SetCurrent(surface); | 158 GLContext::SetCurrent(surface); |
| 157 current_real_context_.Pointer()->Set(surface ? this : NULL); | 159 current_real_context_.Pointer()->Set(surface ? this : NULL); |
| 158 } | 160 } |
| 159 | 161 |
| 160 } // namespace gfx | 162 } // namespace gfx |
| OLD | NEW |