[Test] Added tests for CUtil::SplitParams
[xbmc.git] / xbmc / windowing / X11 / WinSystemX11GLContext.h
blobeda6772a4c652e447109010a2f94de44133d78a6
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 "WinSystemX11.h"
12 #include "rendering/gl/RenderSystemGL.h"
13 #include "system_egl.h"
15 #include <memory>
17 class CGLContext;
18 class CVideoReferenceClock;
20 namespace KODI
22 namespace WINDOWING
24 namespace X11
27 class CVaapiProxy;
29 class CWinSystemX11GLContext : public CWinSystemX11, public CRenderSystemGL
31 public:
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;
49 // videosync
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 protected:
62 bool SetWindow(int width, int height, bool fullscreen, const std::string &output, int *winstate = NULL) override;
63 void PresentRenderImpl(bool rendered) override;
64 void SetVSyncImpl(bool enable) override;
65 bool RefreshGLContext(bool force);
66 XVisualInfo* GetVisual() override;
68 CGLContext *m_pGLContext = nullptr;
69 bool m_newGlContext;
71 struct delete_CVaapiProxy
73 void operator()(CVaapiProxy *p) const;
75 std::unique_ptr<CVaapiProxy, delete_CVaapiProxy> m_vaapiProxy;