2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "GLContext.h"
12 #include "system_egl.h"
13 #include "threads/CriticalSection.h"
17 #include <EGL/eglext.h>
18 #ifdef HAVE_EGLEXTANGLE
19 #include <EGL/eglext_angle.h>
21 #include <EGL/eglextchromium.h>
23 #include <X11/Xutil.h>
25 class CGLContextEGL
: public CGLContext
28 explicit CGLContextEGL(Display
*dpy
, EGLint renderingApi
);
29 ~CGLContextEGL() override
;
30 bool Refresh(bool force
, int screen
, Window glWindow
, bool &newContext
) override
;
31 bool CreatePB() override
;
32 void Destroy() override
;
33 void Detach() override
;
34 void SetVSync(bool enable
) override
;
35 void SwapBuffers() override
;
36 void QueryExtensions() override
;
37 uint64_t GetVblankTiming(uint64_t &msc
, uint64_t &interval
) override
;
39 EGLint m_renderingApi
;
40 EGLDisplay m_eglDisplay
= EGL_NO_DISPLAY
;
41 EGLSurface m_eglSurface
= EGL_NO_SURFACE
;
42 EGLContext m_eglContext
= EGL_NO_CONTEXT
;
43 EGLConfig m_eglConfig
;
45 bool SuitableCheck(EGLDisplay eglDisplay
, EGLConfig config
);
46 EGLConfig
GetEGLConfig(EGLDisplay eglDisplay
, XVisualInfo
*vInfo
);
47 PFNEGLGETSYNCVALUESCHROMIUMPROC m_eglGetSyncValuesCHROMIUM
= nullptr;
48 PFNEGLGETPLATFORMDISPLAYEXTPROC m_eglGetPlatformDisplayEXT
= nullptr;
57 uint64_t interval
= 0;
60 CCriticalSection m_syncLock
;