blob: d9da9d526177552f8d6e3d229246c31c71b81ebc [file] [log] [blame]
James Robinson646469d2014-10-03 15:33:28 -07001// 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
10namespace 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.
15class GL_EXPORT GLContextStubWithExtensions : public gfx::GLContextStub {
16 public:
17 GLContextStubWithExtensions() {}
James Robinsone1b30cf2014-10-21 12:25:40 -070018 std::string GetExtensions() override;
James Robinson646469d2014-10-03 15:33:28 -070019
20 void AddExtensionsString(const char* extensions);
21 void SetGLVersionString(const char* version_str);
James Robinsonaa0657c2015-05-11 15:28:26 -070022 bool WasAllocatedUsingRobustnessExtension() override;
James Robinson646469d2014-10-03 15:33:28 -070023
24 protected:
James Robinsone1b30cf2014-10-21 12:25:40 -070025 std::string GetGLVersion() override;
James Robinson646469d2014-10-03 15:33:28 -070026
James Robinsone1b30cf2014-10-21 12:25:40 -070027 ~GLContextStubWithExtensions() override {}
James Robinson646469d2014-10-03 15:33:28 -070028
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_