| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/gl/gl_context_stub_with_extensions.h" | 5 #include "ui/gl/gl_context_stub_with_extensions.h" |
| 6 | 6 |
| 7 namespace gfx { | 7 namespace gfx { |
| 8 | 8 |
| 9 void GLContextStubWithExtensions::AddExtensionsString(const char* extensions) { | 9 void GLContextStubWithExtensions::AddExtensionsString(const char* extensions) { |
| 10 if (extensions == NULL) | 10 if (extensions == NULL) |
| 11 return; | 11 return; |
| 12 | 12 |
| 13 if (extensions_.size() != 0) | 13 if (extensions_.size() != 0) |
| 14 extensions_ += ' '; | 14 extensions_ += ' '; |
| 15 extensions_ += extensions; | 15 extensions_ += extensions; |
| 16 } | 16 } |
| 17 | 17 |
| 18 std::string GLContextStubWithExtensions::GetExtensions() { | 18 std::string GLContextStubWithExtensions::GetExtensions() { |
| 19 return extensions_; | 19 return extensions_; |
| 20 } | 20 } |
| 21 | 21 |
| 22 void GLContextStubWithExtensions::SetGLVersionString(const char* version_str) { | 22 void GLContextStubWithExtensions::SetGLVersionString(const char* version_str) { |
| 23 version_str_ = std::string(version_str ? version_str : ""); | 23 version_str_ = std::string(version_str ? version_str : ""); |
| 24 } | 24 } |
| 25 | 25 |
| 26 std::string GLContextStubWithExtensions::GetGLVersion() { | 26 std::string GLContextStubWithExtensions::GetGLVersion() { |
| 27 return version_str_; | 27 return version_str_; |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool GLContextStubWithExtensions::WasAllocatedUsingRobustnessExtension() { |
| 31 return HasExtension("GL_ARB_robustness") || |
| 32 HasExtension("GL_KHR_robustness") || |
| 33 HasExtension("GL_EXT_robustness"); |
| 34 } |
| 35 |
| 30 } // namespace gfx | 36 } // namespace gfx |
| OLD | NEW |