blob: 0f3a6a3a250f7570d9a44b3da0252a2a3e424b32 [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_GL_GL_CONTEXT_GLX_H_
#define UI_GL_GL_CONTEXT_GLX_H_
#include "ui/gfx/x/connection.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_export.h"
namespace gl {
class GLSurface;
// Encapsulates a GLX OpenGL context.
class GL_EXPORT GLContextGLX : public GLContextReal {
public:
explicit GLContextGLX(GLShareGroup* share_group);
GLContextGLX(const GLContextGLX&) = delete;
GLContextGLX& operator=(const GLContextGLX&) = delete;
// Implement GLContext.
bool Initialize(GLSurface* compatible_surface,
const GLContextAttribs& attribs) override;
bool MakeCurrentImpl(GLSurface* surface) override;
void ReleaseCurrent(GLSurface* surface) override;
bool IsCurrent(GLSurface* surface) override;
void* GetHandle() override;
unsigned int CheckStickyGraphicsResetStatusImpl() override;
protected:
~GLContextGLX() override;
private:
void Destroy();
void* context_ = nullptr;
x11::Connection* connection_ = nullptr;
unsigned int graphics_reset_status_ = 0; // GL_NO_ERROR
};
} // namespace gl
#endif // UI_GL_GL_CONTEXT_GLX_H_