Debian Codegraph @

xbmc/windowing/wayland/WinSystemWaylandEGLContext.h

raw
1 /*
2 * Copyright (C) 2017-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9 #pragma once
10
11 #include "WinSystemWayland.h"
12 #ifdef TARGET_WEBOS
13 #include "WinSystemWaylandWebOS.h"
14 #endif
15 #include "utils/EGLUtils.h"
16 #include "windowing/linux/WinSystemEGL.h"
17
18 #include <wayland-egl.hpp>
19
20 namespace KODI
21 {
22 namespace WINDOWING
23 {
24 namespace WAYLAND
25 {
26
27 #ifdef TARGET_WEBOS
28 using CWinSystemWaylandImpl = CWinSystemWaylandWebOS;
29 #else
30 using CWinSystemWaylandImpl = CWinSystemWayland;
31 #endif
32
33 class CWinSystemWaylandEGLContext : public KODI::WINDOWING::LINUX::CWinSystemEGL,
34 public CWinSystemWaylandImpl
35 {
36 public:
37 CWinSystemWaylandEGLContext();
38 ~CWinSystemWaylandEGLContext() override = default;
39
40 bool CreateNewWindow(const std::string& name,
41 bool fullScreen,
42 RESOLUTION_INFO& res) override;
43 bool DestroyWindow() override;
44 bool DestroyWindowSystem() override;
45
46 protected:
47 /**
48 * Inheriting classes should override InitWindowSystem() without parameters
49 * and call this function there with appropriate parameters
50 */
51 bool InitWindowSystemEGL(EGLint renderableType, EGLint apiType);
52
53 CSizeInt GetNativeWindowAttachedSize();
54 void PresentFrame(bool rendered);
55 void SetContextSize(CSizeInt size) override;
56
57 virtual bool CreateContext() = 0;
58
59 wayland::egl_window_t m_nativeWindow;
60 };
61
62 }
63 }
64 }