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 "WinSystemX11.h"
12 #include "rendering/gl/RenderSystemGL.h"
13 #include "system_egl.h"
18 class CVideoReferenceClock
;
29 class CWinSystemX11GLContext
: public CWinSystemX11
, public CRenderSystemGL
32 CWinSystemX11GLContext() = default;
33 ~CWinSystemX11GLContext() override
;
35 static void Register();
36 static std::unique_ptr
<CWinSystemBase
> CreateWinSystem();
38 // Implementation of CWinSystem via CWinSystemX11
39 CRenderSystemBase
*GetRenderSystem() override
{ return this; }
40 bool CreateNewWindow(const std::string
& name
, bool fullScreen
, RESOLUTION_INFO
& res
) override
;
41 bool ResizeWindow(int newWidth
, int newHeight
, int newLeft
, int newTop
) override
;
42 void FinishWindowResize(int newWidth
, int newHeight
) override
;
43 bool SetFullScreen(bool fullScreen
, RESOLUTION_INFO
& res
, bool blankOtherDisplays
) override
;
44 bool DestroyWindowSystem() override
;
45 bool DestroyWindow() override
;
47 bool IsExtSupported(const char* extension
) const override
;
50 std::unique_ptr
<CVideoSync
> GetVideoSync(CVideoReferenceClock
* clock
) override
;
51 float GetFrameLatencyAdjustment() override
;
52 uint64_t GetVblankTiming(uint64_t &msc
, uint64_t &interval
);
54 XID
GetWindow() const;
55 void* GetGlxContext() const;
56 EGLDisplay
GetEGLDisplay() const;
57 EGLSurface
GetEGLSurface() const;
58 EGLContext
GetEGLContext() const;
59 EGLConfig
GetEGLConfig() const;
61 bool BindTextureUploadContext() override
;
62 bool UnbindTextureUploadContext() override
;
63 bool HasContext() override
;
66 bool SetWindow(int width
, int height
, bool fullscreen
, const std::string
&output
, int *winstate
= NULL
) override
;
67 void PresentRenderImpl(bool rendered
) override
;
68 void SetVSyncImpl(bool enable
) override
;
69 bool RefreshGLContext(bool force
);
70 XVisualInfo
* GetVisual() override
;
72 CGLContext
*m_pGLContext
= nullptr;
75 struct delete_CVaapiProxy
77 void operator()(CVaapiProxy
*p
) const;
79 std::unique_ptr
<CVaapiProxy
, delete_CVaapiProxy
> m_vaapiProxy
;