[Test] Added tests for CUtil::SplitParams
[xbmc.git] / xbmc / windowing / X11 / GLContextEGL.h
blob441787b67197b01bad246d8623bee6f80b6f3959
1 /*
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.
7 */
9 #pragma once
11 #include "GLContext.h"
12 #include "system_egl.h"
13 #include "threads/CriticalSection.h"
15 #include <cstdint>
17 #include <EGL/eglext.h>
18 #ifdef HAVE_EGLEXTANGLE
19 #include <EGL/eglext_angle.h>
20 #else
21 #include <EGL/eglextchromium.h>
22 #endif
23 #include <X11/Xutil.h>
25 class CGLContextEGL : public CGLContext
27 public:
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;
44 protected:
45 bool SuitableCheck(EGLDisplay eglDisplay, EGLConfig config);
46 EGLConfig GetEGLConfig(EGLDisplay eglDisplay, XVisualInfo *vInfo);
47 PFNEGLGETSYNCVALUESCHROMIUMPROC m_eglGetSyncValuesCHROMIUM = nullptr;
48 PFNEGLGETPLATFORMDISPLAYEXTPROC m_eglGetPlatformDisplayEXT = nullptr;
50 struct Sync
52 uint64_t cont = 0;
53 uint64_t ust1 = 0;
54 uint64_t ust2 = 0;
55 uint64_t msc1 = 0;
56 uint64_t msc2 = 0;
57 uint64_t interval = 0;
58 } m_sync;
60 CCriticalSection m_syncLock;
62 bool m_usePB = false;