| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 std::string delimited_name(name); | 99 std::string delimited_name(name); |
| 100 delimited_name += " "; | 100 delimited_name += " "; |
| 101 | 101 |
| 102 return extensions.find(delimited_name) != std::string::npos; | 102 return extensions.find(delimited_name) != std::string::npos; |
| 103 } | 103 } |
| 104 | 104 |
| 105 const GLVersionInfo* GLContext::GetVersionInfo() { | 105 const GLVersionInfo* GLContext::GetVersionInfo() { |
| 106 if(!version_info_) { | 106 if(!version_info_) { |
| 107 std::string version = GetGLVersion(); | 107 std::string version = GetGLVersion(); |
| 108 std::string renderer = GetGLRenderer(); | 108 std::string renderer = GetGLRenderer(); |
| 109 version_info_ = | 109 version_info_ = scoped_ptr<GLVersionInfo>( |
| 110 make_scoped_ptr(new GLVersionInfo(version.c_str(), renderer.c_str())); | 110 new GLVersionInfo(version.c_str(), renderer.c_str())); |
| 111 } | 111 } |
| 112 return version_info_.get(); | 112 return version_info_.get(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 GLShareGroup* GLContext::share_group() { | 115 GLShareGroup* GLContext::share_group() { |
| 116 return share_group_.get(); | 116 return share_group_.get(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool GLContext::LosesAllContextsOnContextLost() { | 119 bool GLContext::LosesAllContextsOnContextLost() { |
| 120 switch (GetGLImplementation()) { | 120 switch (GetGLImplementation()) { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 : GLContext(share_group) {} | 213 : GLContext(share_group) {} |
| 214 | 214 |
| 215 GLContextReal::~GLContextReal() {} | 215 GLContextReal::~GLContextReal() {} |
| 216 | 216 |
| 217 void GLContextReal::SetCurrent(GLSurface* surface) { | 217 void GLContextReal::SetCurrent(GLSurface* surface) { |
| 218 GLContext::SetCurrent(surface); | 218 GLContext::SetCurrent(surface); |
| 219 current_real_context_.Pointer()->Set(surface ? this : NULL); | 219 current_real_context_.Pointer()->Set(surface ? this : NULL); |
| 220 } | 220 } |
| 221 | 221 |
| 222 } // namespace gfx | 222 } // namespace gfx |
| OLD | NEW |