James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef UI_GL_GL_CONTEXT_STUB_WITH_EXTENSIONS_H_ |
| 6 | #define UI_GL_GL_CONTEXT_STUB_WITH_EXTENSIONS_H_ |
| 7 | |
| 8 | #include "ui/gl/gl_context_stub.h" |
| 9 | |
| 10 | namespace gfx { |
| 11 | |
| 12 | // Lightweight GLContext stub implementation that returns a constructed |
| 13 | // extensions string. We use this to create a context that we can use to |
| 14 | // initialize GL extensions with, without actually creating a platform context. |
| 15 | class GL_EXPORT GLContextStubWithExtensions : public gfx::GLContextStub { |
| 16 | public: |
| 17 | GLContextStubWithExtensions() {} |
James Robinson | e1b30cf | 2014-10-21 12:25:40 -0700 | [diff] [blame] | 18 | std::string GetExtensions() override; |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 19 | |
| 20 | void AddExtensionsString(const char* extensions); |
| 21 | void SetGLVersionString(const char* version_str); |
James Robinson | aa0657c | 2015-05-11 15:28:26 -0700 | [diff] [blame] | 22 | bool WasAllocatedUsingRobustnessExtension() override; |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 23 | |
| 24 | protected: |
James Robinson | e1b30cf | 2014-10-21 12:25:40 -0700 | [diff] [blame] | 25 | std::string GetGLVersion() override; |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 26 | |
James Robinson | e1b30cf | 2014-10-21 12:25:40 -0700 | [diff] [blame] | 27 | ~GLContextStubWithExtensions() override {} |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 28 | |
| 29 | private: |
| 30 | std::string extensions_; |
| 31 | std::string version_str_; |
| 32 | |
| 33 | DISALLOW_COPY_AND_ASSIGN(GLContextStubWithExtensions); |
| 34 | }; |
| 35 | |
| 36 | } // namespace gfx |
| 37 | |
| 38 | #endif // UI_GL_GL_CONTEXT_STUB_WITH_EXTENSIONS_H_ |