forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgl_context_glx.h
47 lines (35 loc) · 1.28 KB
/
gl_context_glx.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// 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 "base/memory/raw_ptr.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();
raw_ptr<void> context_ = nullptr;
raw_ptr<x11::Connection> connection_ = nullptr;
unsigned int graphics_reset_status_ = 0; // GL_NO_ERROR
};
} // namespace gl
#endif // UI_GL_GL_CONTEXT_GLX_H_