[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / windowing / X11 / GLContextEGL.h
blob7c38f812519c4429e2daaee630be4a5f82d9de13
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 "threads/CriticalSection.h"
14 #include <cstdint>
16 #include "system_egl.h"
18 #include <EGL/eglext.h>
19 #ifdef HAVE_EGLEXTANGLE
20 #include <EGL/eglext_angle.h>
21 #else
22 #include <EGL/eglextchromium.h>
23 #endif
24 #include <X11/Xutil.h>
26 class CGLContextEGL : public CGLContext
28 public:
29 explicit CGLContextEGL(Display *dpy, EGLint renderingApi);
30 ~CGLContextEGL() override;
31 bool Refresh(bool force, int screen, Window glWindow, bool &newContext) override;
32 bool CreatePB() override;
33 void Destroy() override;
34 void Detach() override;
35 void SetVSync(bool enable) override;
36 void SwapBuffers() override;
37 void QueryExtensions() override;
38 uint64_t GetVblankTiming(uint64_t &msc, uint64_t &interval) override;
40 bool BindTextureUploadContext();
41 bool UnbindTextureUploadContext();
42 bool HasContext();
44 EGLint m_renderingApi;
45 EGLDisplay m_eglDisplay = EGL_NO_DISPLAY;
46 EGLSurface m_eglSurface = EGL_NO_SURFACE;
47 EGLContext m_eglContext = EGL_NO_CONTEXT;
48 EGLConfig m_eglConfig;
49 protected:
50 bool SuitableCheck(EGLDisplay eglDisplay, EGLConfig config);
51 EGLConfig GetEGLConfig(EGLDisplay eglDisplay, XVisualInfo *vInfo);
52 PFNEGLGETSYNCVALUESCHROMIUMPROC m_eglGetSyncValuesCHROMIUM = nullptr;
53 PFNEGLGETPLATFORMDISPLAYEXTPROC m_eglGetPlatformDisplayEXT = nullptr;
55 struct Sync
57 uint64_t cont = 0;
58 uint64_t ust1 = 0;
59 uint64_t ust2 = 0;
60 uint64_t msc1 = 0;
61 uint64_t msc2 = 0;
62 uint64_t interval = 0;
63 } m_sync;
65 CCriticalSection m_syncLock;
67 bool m_usePB = false;
69 EGLContext m_eglUploadContext = EGL_NO_CONTEXT;
70 mutable CCriticalSection m_textureUploadLock;