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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 std::vector<std::string> exts; | 94 std::vector<std::string> exts; |
95 GLint num_extensions = 0; | 95 GLint num_extensions = 0; |
96 glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions); | 96 glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions); |
97 for (GLint i = 0; i < num_extensions; ++i) { | 97 for (GLint i = 0; i < num_extensions; ++i) { |
98 const char* extension = reinterpret_cast<const char*>( | 98 const char* extension = reinterpret_cast<const char*>( |
99 glGetStringi(GL_EXTENSIONS, i)); | 99 glGetStringi(GL_EXTENSIONS, i)); |
100 DCHECK(extension != nullptr); | 100 DCHECK(extension != nullptr); |
101 exts.push_back(extension); | 101 exts.push_back(extension); |
102 } | 102 } |
103 return JoinString(exts, " "); | 103 return base::JoinString(exts, " "); |
104 } | 104 } |
105 | 105 |
106 std::string GLContext::GetGLVersion() { | 106 std::string GLContext::GetGLVersion() { |
107 DCHECK(IsCurrent(nullptr)); | 107 DCHECK(IsCurrent(nullptr)); |
108 const char *version = | 108 const char *version = |
109 reinterpret_cast<const char*>(glGetString(GL_VERSION)); | 109 reinterpret_cast<const char*>(glGetString(GL_VERSION)); |
110 return std::string(version ? version : ""); | 110 return std::string(version ? version : ""); |
111 } | 111 } |
112 | 112 |
113 std::string GLContext::GetGLRenderer() { | 113 std::string GLContext::GetGLRenderer() { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 265 } |
266 | 266 |
267 GLContextReal::~GLContextReal() {} | 267 GLContextReal::~GLContextReal() {} |
268 | 268 |
269 void GLContextReal::SetCurrent(GLSurface* surface) { | 269 void GLContextReal::SetCurrent(GLSurface* surface) { |
270 GLContext::SetCurrent(surface); | 270 GLContext::SetCurrent(surface); |
271 current_real_context_.Pointer()->Set(surface ? this : nullptr); | 271 current_real_context_.Pointer()->Set(surface ? this : nullptr); |
272 } | 272 } |
273 | 273 |
274 } // namespace gfx | 274 } // namespace gfx |
OLD | NEW |