diff options
author | h.udo <hudokkow@gmail.com> | 2018-07-15 18:15:03 +0100 |
---|---|---|
committer | h.udo <hudokkow@gmail.com> | 2018-07-16 23:09:31 +0100 |
commit | 2346d51433f9a119de7330d83dc5566a6085f50b (patch) | |
tree | ab34c885f78eb086c593e6c640aead9768018d44 | |
parent | c1baaddbd528f7a20c7d397cedd83fe809b42927 (diff) |
[mir] Drop platform
-rw-r--r-- | cmake/modules/FindMir.cmake | 33 | ||||
-rw-r--r-- | cmake/platform/linux/mir.cmake | 2 | ||||
-rw-r--r-- | cmake/scripts/linux/ArchSetup.cmake | 4 | ||||
-rw-r--r-- | cmake/treedata/optional/common/mir.txt | 1 | ||||
-rw-r--r-- | tools/depends/configure.ac | 2 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt | 1 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt | 1 | ||||
-rw-r--r-- | xbmc/windowing/mir/CMakeLists.txt | 15 | ||||
-rw-r--r-- | xbmc/windowing/mir/GLContextEGL.cpp | 192 | ||||
-rw-r--r-- | xbmc/windowing/mir/GLContextEGL.h | 50 | ||||
-rw-r--r-- | xbmc/windowing/mir/WinEventsMir.cpp | 369 | ||||
-rw-r--r-- | xbmc/windowing/mir/WinEventsMir.h | 43 | ||||
-rw-r--r-- | xbmc/windowing/mir/WinSystemMir.cpp | 189 | ||||
-rw-r--r-- | xbmc/windowing/mir/WinSystemMir.h | 62 | ||||
-rw-r--r-- | xbmc/windowing/mir/WinSystemMirGLContext.cpp | 102 | ||||
-rw-r--r-- | xbmc/windowing/mir/WinSystemMirGLContext.h | 54 | ||||
-rw-r--r-- | xbmc/windowing/mir/WinSystemMirGLESContext.cpp | 103 | ||||
-rw-r--r-- | xbmc/windowing/mir/WinSystemMirGLESContext.h | 54 |
18 files changed, 2 insertions, 1275 deletions
diff --git a/cmake/modules/FindMir.cmake b/cmake/modules/FindMir.cmake deleted file mode 100644 index abfcc72e6a..0000000000 --- a/cmake/modules/FindMir.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# FindMir -# ------- -# Finds the Mir library -# -# This will define the following variables:: -# -# MIR_FOUND - the system has Mir -# MIR_INCLUDE_DIRS - the Mir include directory -# MIR_LIBRARIES - the Mir libraries -# MIR_DEFINITIONS - the Mir definitions - - -if(PKG_CONFIG_FOUND) - pkg_check_modules (PC_MIR mirclient>=0.26.2 QUIET) -endif() - -find_path(MIR_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h - PATHS ${PC_MIR_INCLUDE_DIRS}) - -find_library(MIR_LIBRARY NAMES mirclient - PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS}) - -include (FindPackageHandleStandardArgs) -find_package_handle_standard_args (Mir - REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR) - -if (MIR_FOUND) - set(MIR_LIBRARIES ${MIR_LIBRARY}) - set(MIR_INCLUDE_DIRS ${PC_MIR_INCLUDE_DIRS}) - set(MIR_DEFINITIONS -DHAVE_MIR=1) -endif() - -mark_as_advanced (MIR_LIBRARY MIR_INCLUDE_DIR) diff --git a/cmake/platform/linux/mir.cmake b/cmake/platform/linux/mir.cmake index 0e672a9b16..f04738ce05 100644 --- a/cmake/platform/linux/mir.cmake +++ b/cmake/platform/linux/mir.cmake @@ -1,3 +1,3 @@ -set(PLATFORM_REQUIRED_DEPS OpenGl EGL Mir LibDRM) +set(PLATFORM_REQUIRED_DEPS OpenGl EGL LibDRM) set(PLATFORM_OPTIONAL_DEPS VAAPI OpenGLES) set(APP_RENDER_SYSTEM gl) diff --git a/cmake/scripts/linux/ArchSetup.cmake b/cmake/scripts/linux/ArchSetup.cmake index fcee675f3a..624edf626d 100644 --- a/cmake/scripts/linux/ArchSetup.cmake +++ b/cmake/scripts/linux/ArchSetup.cmake @@ -108,10 +108,6 @@ if(CMAKE_BUILD_TYPE STREQUAL Coverage) set(COVERAGE_EXCLUDES */test/* lib/* */lib/*) endif() -if(ENABLE_MIR) - set(ENABLE_VDPAU OFF CACHE BOOL "Disabling VDPAU since no Mir support" FORCE) -endif() - if(ENABLE_GBM) set(ENABLE_VDPAU OFF CACHE BOOL "Disabling VDPAU" FORCE) endif() diff --git a/cmake/treedata/optional/common/mir.txt b/cmake/treedata/optional/common/mir.txt deleted file mode 100644 index d681e8b5ae..0000000000 --- a/cmake/treedata/optional/common/mir.txt +++ /dev/null @@ -1 +0,0 @@ -xbmc/windowing/mir windowing/mir # MIR diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac index b7beed09b7..d3d862a9cb 100644 --- a/tools/depends/configure.ac +++ b/tools/depends/configure.ac @@ -382,7 +382,7 @@ case $host in esac case $use_platform in - aml|gbm|mir|wayland) + aml|gbm|wayland) if test "$platform_os" != "linux"; then AC_MSG_ERROR([$use_platform is only supported on the Linux platform]) fi diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt b/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt index d3bff8bd7b..ee9a10191f 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt +++ b/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt @@ -46,7 +46,6 @@ if(OPENGLES_FOUND AND (CORE_PLATFORM_NAME_LC STREQUAL android OR CORE_PLATFORM_NAME_LC STREQUAL ios OR CORE_PLATFORM_NAME_LC STREQUAL aml OR CORE_PLATFORM_NAME_LC STREQUAL gbm OR - CORE_PLATFORM_NAME_LC STREQUAL mir OR CORE_PLATFORM_NAME_LC STREQUAL wayland)) list(APPEND SOURCES LinuxRendererGLES.cpp FrameBufferObject.cpp) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt index 62f1cc1ecc..c2d9e814a0 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt @@ -26,7 +26,6 @@ if(OPENGLES_FOUND AND (CORE_PLATFORM_NAME_LC STREQUAL android OR CORE_PLATFORM_NAME_LC STREQUAL ios OR CORE_PLATFORM_NAME_LC STREQUAL aml OR CORE_PLATFORM_NAME_LC STREQUAL gbm OR - CORE_PLATFORM_NAME_LC STREQUAL mir OR CORE_PLATFORM_NAME_LC STREQUAL wayland)) list(APPEND SOURCES VideoFilterShaderGLES.cpp YUVMatrix.cpp diff --git a/xbmc/windowing/mir/CMakeLists.txt b/xbmc/windowing/mir/CMakeLists.txt deleted file mode 100644 index c9ab086ff7..0000000000 --- a/xbmc/windowing/mir/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(SOURCES GLContextEGL.cpp - WinEventsMir.cpp - WinSystemMir.cpp) - -set(HEADERS WinSystemMir.h) - -if(OPENGL_FOUND) - list(APPEND SOURCES WinSystemMirGLContext.cpp) - list(APPEND HEADERS WinSystemMirGLContext.h) -elseif(OPENGLES_FOUND) - list(APPEND SOURCES WinSystemMirGLESContext.cpp) - list(APPEND HEADERS WinSystemMirGLESContext.h) -endif() - -core_add_library(windowing_MIR) diff --git a/xbmc/windowing/mir/GLContextEGL.cpp b/xbmc/windowing/mir/GLContextEGL.cpp deleted file mode 100644 index f618f4348d..0000000000 --- a/xbmc/windowing/mir/GLContextEGL.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (C) 2016 Canonical Ltd. - * brandon.schaefer@canonical.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - - -#include "GLContextEGL.h" - -#include "utils/log.h" - -CGLContextEGL::CGLContextEGL() : - m_eglDisplay(EGL_NO_DISPLAY), - m_eglSurface(EGL_NO_SURFACE), - m_eglContext(EGL_NO_CONTEXT), - m_eglConfig (0) -{ -} - -CGLContextEGL::~CGLContextEGL() -{ - Destroy(); -} - -bool CGLContextEGL::CreateDisplay(MirConnection* connection, - EGLint renderable_type, - EGLint rendering_api) -{ - EGLint neglconfigs = 0; - int major, minor; - - EGLint attribs[] = - { - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, renderable_type, - EGL_RED_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_BLUE_SIZE, 8, - EGL_NONE, - }; - - if (m_eglDisplay == EGL_NO_DISPLAY) - { - m_eglDisplay = eglGetDisplay(static_cast<EGLNativeDisplayType>( - mir_connection_get_egl_native_display(connection))); - } - - if (m_eglDisplay == EGL_NO_DISPLAY) - { - CLog::Log(LOGERROR, "failed to get EGL display\n"); - return false; - } - - if (!eglInitialize(m_eglDisplay, &major, &minor)) - { - CLog::Log(LOGERROR, "failed to initialize EGL display\n"); - return false; - } - - eglBindAPI(rendering_api); - - if (!eglChooseConfig(m_eglDisplay, attribs, - &m_eglConfig, 1, &neglconfigs)) - { - CLog::Log(LOGERROR, "Failed to query number of EGL configs"); - return false; - } - - if (neglconfigs <= 0) - { - CLog::Log(LOGERROR, "No suitable EGL configs found"); - return false; - } - - return true; -} - -bool CGLContextEGL::CreateContext() -{ - int client_version = 2; - - const EGLint context_atrribs[] = { - EGL_CONTEXT_CLIENT_VERSION, client_version, EGL_NONE - }; - - m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, - EGL_NO_CONTEXT, context_atrribs); - - if (m_eglContext == EGL_NO_CONTEXT) - { - CLog::Log(LOGERROR, "failed to create EGL context\n"); - return false; - } - - if (!eglMakeCurrent(m_eglDisplay, m_eglSurface, - m_eglSurface, m_eglContext)) - { - CLog::Log(LOGERROR, "Failed to make context current %p %p %p\n", - m_eglDisplay, m_eglSurface, m_eglContext); - return false; - } - - return true; -} - -bool CGLContextEGL::CreateSurface(MirWindow* window) -{ - EGLNativeWindowType egl_nwin = (EGLNativeWindowType) - mir_buffer_stream_get_egl_native_window( - mir_window_get_buffer_stream(window)); - - m_eglSurface = eglCreateWindowSurface(m_eglDisplay, - m_eglConfig, - egl_nwin, nullptr); - - if (m_eglSurface == EGL_NO_SURFACE) - { - CLog::Log(LOGERROR, "failed to create EGL window surface %d\n", eglGetError()); - return false; - } - - return true; -} - -void CGLContextEGL::Destroy() -{ - if (m_eglContext != EGL_NO_CONTEXT) - { - eglDestroyContext(m_eglDisplay, m_eglContext); - eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - m_eglContext = EGL_NO_CONTEXT; - } - - if (m_eglSurface != EGL_NO_SURFACE) - { - eglDestroySurface(m_eglDisplay, m_eglSurface); - m_eglSurface = EGL_NO_SURFACE; - } - - if (m_eglDisplay != EGL_NO_DISPLAY) - { - eglTerminate(m_eglDisplay); - m_eglDisplay = EGL_NO_DISPLAY; - } -} - -void CGLContextEGL::Detach() -{ - if (m_eglContext != EGL_NO_CONTEXT) - { - eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - m_eglContext = EGL_NO_CONTEXT; - } - - if (m_eglSurface != EGL_NO_SURFACE) - { - eglDestroySurface(m_eglDisplay, m_eglSurface); - m_eglSurface = EGL_NO_SURFACE; - } -} - -void CGLContextEGL::SetVSync(bool enable) -{ - eglSwapInterval(m_eglDisplay, enable); -} - -void CGLContextEGL::SwapBuffers() -{ - if (m_eglDisplay == EGL_NO_DISPLAY || m_eglSurface == EGL_NO_SURFACE) - return; - - eglSwapBuffers(m_eglDisplay, m_eglSurface); -} - -// TODO -void CGLContextEGL::QueryExtensions() -{ -} diff --git a/xbmc/windowing/mir/GLContextEGL.h b/xbmc/windowing/mir/GLContextEGL.h deleted file mode 100644 index fe9d769172..0000000000 --- a/xbmc/windowing/mir/GLContextEGL.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2016 Canonical Ltd. - * brandon.schaefer@canonical.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#pragma once - -#include <mir_toolkit/mir_client_library.h> -#include "EGL/egl.h" - -class CGLContextEGL -{ -public: - CGLContextEGL(); - virtual ~CGLContextEGL(); - - bool CreateDisplay(MirConnection* connection, - EGLint renderable_type, - EGLint rendering_api); - - bool CreateSurface(MirWindow* window); - bool CreateContext(); - void Destroy(); - void Detach(); - void SetVSync(bool enable); - void SwapBuffers(); - void QueryExtensions(); - - //bool IsExtSupported(const char* extension) const; - - EGLDisplay m_eglDisplay; - EGLSurface m_eglSurface; - EGLContext m_eglContext; - EGLConfig m_eglConfig; -}; diff --git a/xbmc/windowing/mir/WinEventsMir.cpp b/xbmc/windowing/mir/WinEventsMir.cpp deleted file mode 100644 index 521980b0b3..0000000000 --- a/xbmc/windowing/mir/WinEventsMir.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Copyright (C) 2016 Canonical Ltd. - * brandon.schaefer@canonical.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - - -#include "WinEventsMir.h" - -#include <unordered_map> -#include <mir_toolkit/mir_client_library.h> -#include <xkbcommon/xkbcommon-keysyms.h> - -#include "AppInboundProtocol.h" -#include "ServiceBroker.h" -#include "input/mouse/MouseStat.h" -#include "input/Key.h" - -namespace -{ - -// XkbCommon keysym to xkbmc -std::unordered_map<uint32_t, uint32_t> sym_mapping_xkb = -{ - {XKB_KEY_BackSpace, XBMCK_BACKSPACE} -, {XKB_KEY_Tab, XBMCK_TAB} -, {XKB_KEY_Clear, XBMCK_CLEAR} -, {XKB_KEY_Return, XBMCK_RETURN} -, {XKB_KEY_Pause, XBMCK_PAUSE} -, {XKB_KEY_Escape, XBMCK_ESCAPE} -, {XKB_KEY_Delete, XBMCK_DELETE} -// multi-media keys -, {XKB_KEY_XF86Back, XBMCK_BROWSER_BACK} -, {XKB_KEY_XF86Forward, XBMCK_BROWSER_FORWARD} -, {XKB_KEY_XF86Refresh, XBMCK_BROWSER_REFRESH} -, {XKB_KEY_XF86Stop, XBMCK_BROWSER_STOP} -, {XKB_KEY_XF86Search, XBMCK_BROWSER_SEARCH} -, {XKB_KEY_XF86Favorites, XBMCK_BROWSER_FAVORITES} -, {XKB_KEY_XF86HomePage, XBMCK_BROWSER_HOME} -, {XKB_KEY_XF86AudioMute, XBMCK_VOLUME_MUTE} -, {XKB_KEY_XF86AudioLowerVolume, XBMCK_VOLUME_DOWN} -, {XKB_KEY_XF86AudioRaiseVolume, XBMCK_VOLUME_UP} -, {XKB_KEY_XF86AudioNext, XBMCK_MEDIA_NEXT_TRACK} -, {XKB_KEY_XF86AudioPrev, XBMCK_MEDIA_PREV_TRACK} -, {XKB_KEY_XF86AudioStop, XBMCK_MEDIA_STOP} -, {XKB_KEY_XF86AudioPause, XBMCK_MEDIA_PLAY_PAUSE} -, {XKB_KEY_XF86Mail, XBMCK_LAUNCH_MAIL} -, {XKB_KEY_XF86Select, XBMCK_LAUNCH_MEDIA_SELECT} -, {XKB_KEY_XF86Launch0, XBMCK_LAUNCH_APP1} -, {XKB_KEY_XF86Launch1, XBMCK_LAUNCH_APP2} -, {XKB_KEY_XF86WWW, XBMCK_LAUNCH_FILE_BROWSER} -, {XKB_KEY_XF86AudioMedia, XBMCK_LAUNCH_MEDIA_CENTER } - // Numeric keypad -, {XKB_KEY_KP_0, XBMCK_KP0} -, {XKB_KEY_KP_1, XBMCK_KP1} -, {XKB_KEY_KP_2, XBMCK_KP2} -, {XKB_KEY_KP_3, XBMCK_KP3} -, {XKB_KEY_KP_4, XBMCK_KP4} -, {XKB_KEY_KP_5, XBMCK_KP5} -, {XKB_KEY_KP_6, XBMCK_KP6} -, {XKB_KEY_KP_7, XBMCK_KP7} -, {XKB_KEY_KP_8, XBMCK_KP8} -, {XKB_KEY_KP_9, XBMCK_KP9} -, {XKB_KEY_KP_Decimal, XBMCK_KP_PERIOD} -, {XKB_KEY_KP_Divide, XBMCK_KP_DIVIDE} -, {XKB_KEY_KP_Multiply, XBMCK_KP_MULTIPLY} -, {XKB_KEY_KP_Subtract, XBMCK_KP_MINUS} -, {XKB_KEY_KP_Add, XBMCK_KP_PLUS} -, {XKB_KEY_KP_Enter, XBMCK_KP_ENTER} -, {XKB_KEY_KP_Equal, XBMCK_KP_EQUALS} - // Arrows + Home/End pad -, {XKB_KEY_Up, XBMCK_UP} -, {XKB_KEY_Down, XBMCK_DOWN} -, {XKB_KEY_Right, XBMCK_RIGHT} -, {XKB_KEY_Left, XBMCK_LEFT} -, {XKB_KEY_Insert, XBMCK_INSERT} -, {XKB_KEY_Home, XBMCK_HOME} -, {XKB_KEY_End, XBMCK_END} -, {XKB_KEY_Page_Up, XBMCK_PAGEUP} -, {XKB_KEY_Page_Down, XBMCK_PAGEDOWN} - // Function keys -, {XKB_KEY_F1, XBMCK_F1} -, {XKB_KEY_F2, XBMCK_F2} -, {XKB_KEY_F3, XBMCK_F3} -, {XKB_KEY_F4, XBMCK_F4} -, {XKB_KEY_F5, XBMCK_F5} -, {XKB_KEY_F6, XBMCK_F6} -, {XKB_KEY_F7, XBMCK_F7} -, {XKB_KEY_F8, XBMCK_F8} -, {XKB_KEY_F9, XBMCK_F9} -, {XKB_KEY_F10, XBMCK_F10} -, {XKB_KEY_F11, XBMCK_F11} -, {XKB_KEY_F12, XBMCK_F12} -, {XKB_KEY_F13, XBMCK_F13} -, {XKB_KEY_F14, XBMCK_F14} -, {XKB_KEY_F15, XBMCK_F15} - // Key state modifier keys -, {XKB_KEY_Num_Lock, XBMCK_NUMLOCK} -, {XKB_KEY_Caps_Lock, XBMCK_CAPSLOCK} -, {XKB_KEY_Scroll_Lock, XBMCK_SCROLLOCK} -, {XKB_KEY_Shift_R, XBMCK_RSHIFT} -, {XKB_KEY_Shift_L, XBMCK_LSHIFT} -, {XKB_KEY_Control_R, XBMCK_RCTRL} -, {XKB_KEY_Control_L, XBMCK_LCTRL} -, {XKB_KEY_Alt_R, XBMCK_RALT} -, {XKB_KEY_Alt_L, XBMCK_LALT} -, {XKB_KEY_Meta_R, XBMCK_RMETA} -, {XKB_KEY_Meta_L, XBMCK_LMETA} -, {XKB_KEY_Super_L, XBMCK_LSUPER} -, {XKB_KEY_Super_R, XBMCK_RSUPER} -, {XKB_KEY_Mode_switch, XBMCK_MODE} -, {XKB_KEY_Multi_key, XBMCK_COMPOSE} - // Miscellaneous function keys -, {XKB_KEY_Help, XBMCK_HELP} -, {XKB_KEY_Print, XBMCK_PRINT} - //, {0, XBMCK_SYSREQ} -, {XKB_KEY_Break, XBMCK_BREAK} -, {XKB_KEY_Menu, XBMCK_MENU} -, {XKB_KEY_XF86PowerOff, XBMCK_POWER} -, {XKB_KEY_XF86Sleep, XBMCK_SLEEP} -, {XKB_KEY_EcuSign, XBMCK_EURO} -, {XKB_KEY_Undo, XBMCK_UNDO} - // Media keys -, {XKB_KEY_XF86Eject, XBMCK_EJECT} -, {XKB_KEY_XF86Stop, XBMCK_STOP} -, {XKB_KEY_XF86AudioRecord, XBMCK_RECORD} -, {XKB_KEY_XF86AudioRewind, XBMCK_REWIND} -, {XKB_KEY_XF86Phone, XBMCK_PHONE} -, {XKB_KEY_XF86AudioPlay, XBMCK_PLAY} -, {XKB_KEY_XF86AudioRandomPlay, XBMCK_SHUFFLE} -, {XKB_KEY_XF86AudioForward, XBMCK_FASTFORWARD} -}; - -void MirHandlePointerButton(MirPointerEvent const* pev, unsigned char type) -{ - auto x = mir_pointer_event_axis_value(pev, mir_pointer_axis_x); - auto y = mir_pointer_event_axis_value(pev, mir_pointer_axis_y); - - MirPointerButton button_state = mir_pointer_button_primary; - static uint32_t old_button_states = 0; - uint32_t new_button_states = mir_pointer_event_buttons(pev); - unsigned char xbmc_button = XBMC_BUTTON_LEFT; - - button_state = MirPointerButton(new_button_states ^ old_button_states); - - switch (button_state) - { - case mir_pointer_button_primary: - xbmc_button = XBMC_BUTTON_LEFT; - break; - case mir_pointer_button_secondary: - xbmc_button = XBMC_BUTTON_RIGHT; - break; - case mir_pointer_button_tertiary: - xbmc_button = XBMC_BUTTON_MIDDLE; - break; - case mir_pointer_button_forward: - xbmc_button = XBMC_BUTTON_X1; - break; - case mir_pointer_button_back: - xbmc_button = XBMC_BUTTON_X2; - break; - default: - break; - } - - old_button_states = new_button_states; - - XBMC_Event new_event; - memset(&new_event, 0, sizeof(new_event)); - - new_event.button.button = xbmc_button; - new_event.button.x = x; - new_event.button.y = y; - - CWinEvents::MessagePush(&new_event); -} - -void MirHandlePointerEvent(MirPointerEvent const* pev) -{ - switch (mir_pointer_event_action(pev)) - { - case mir_pointer_action_button_down: - MirHandlePointerButton(pev, XBMC_MOUSEBUTTONDOWN); - break; - case mir_pointer_action_button_up: - MirHandlePointerButton(pev, XBMC_MOUSEBUTTONUP); - break; - case mir_pointer_action_motion: - { - XBMC_Event new_event; - memset(&new_event, 0, sizeof(new_event)); - - auto x = mir_pointer_event_axis_value(pev, mir_pointer_axis_x); - auto y = mir_pointer_event_axis_value(pev, mir_pointer_axis_y); - - new_event.type = XBMC_MOUSEMOTION; - new_event.motion.x = x; - new_event.motion.y = y; - - CWinEvents::MessagePush(&new_event); - break; - } - default: - break; - } -} - -XBMCMod MirModToXBMCMode(MirInputEventModifiers mir_mod) -{ - int mod = XBMCKMOD_NONE; - - if (mir_mod & mir_input_event_modifier_shift_left) - mod |= XBMCKMOD_LSHIFT; - if (mir_mod & mir_input_event_modifier_shift_right) - mod |= XBMCKMOD_RSHIFT; - if (mir_mod & mir_input_event_modifier_meta_left) - mod |= XBMCKMOD_LSUPER; - if (mir_mod & mir_input_event_modifier_meta_right) - mod |= XBMCKMOD_RSUPER; - if (mir_mod & mir_input_event_modifier_ctrl_left) - mod |= XBMCKMOD_LCTRL; - if (mir_mod & mir_input_event_modifier_ctrl_right) - mod |= XBMCKMOD_RCTRL; - if (mir_mod & mir_input_event_modifier_alt_left) - mod |= XBMCKMOD_LALT; - if (mir_mod & mir_input_event_modifier_alt_right) - mod |= XBMCKMOD_RALT; - if (mir_mod & mir_input_event_modifier_num_lock) - mod |= XBMCKMOD_NUM; - if (mir_mod & mir_input_event_modifier_caps_lock) - mod |= XBMCKMOD_CAPS; - - return XBMCMod(mod); -} - -void MirHandleKeyboardEvent(MirKeyboardEvent const* kev) -{ - auto action = mir_keyboard_event_action(kev); - - XBMC_Event new_event; - memset(&new_event, 0, sizeof(new_event)); - - if (action == mir_keyboard_action_down) - { - new_event.type = XBMC_KEYDOWN; - } - else - { - new_event.type = XBMC_KEYUP; - } - - auto keysym = mir_keyboard_event_key_code(kev); - auto xkb_keysym = sym_mapping_xkb.find(keysym); - if (xkb_keysym != sym_mapping_xkb.end()) - { - keysym = xkb_keysym->second; - } - - new_event.key.keysym.sym = XBMCKey(keysym); - new_event.key.keysym.mod = MirModToXBMCMode(mir_keyboard_event_modifiers(kev)); - new_event.key.keysym.scancode = mir_keyboard_event_scan_code(kev); - - CWinEvents::MessagePush(&new_event); -} - -// Lets just handle a tap on an action up -void MirHandleTouchEvent(MirTouchEvent const* tev) -{ - XBMC_Event new_event; - memset(&new_event, 0, sizeof(new_event)); - new_event.type = XBMC_TOUCH; - - auto pointer_count = mir_touch_event_point_count(tev); - auto action = mir_touch_event_action(tev, 0); - - if (action == mir_touch_action_up) - { - // FIXME Need to test this... since reading - // the input manager it just turns this tap into a mouse motion? - // Does this send a up/down? - new_event.touch.action = ACTION_TOUCH_TAP; - - new_event.touch.x = mir_touch_event_axis_value(tev, 0, mir_touch_axis_x); - new_event.touch.y = mir_touch_event_axis_value(tev, 0, mir_touch_axis_y); - - new_event.touch.pointers = pointer_count; - CWinEvents::MessagePush(&new_event); - } -} - -void MirHandleInput(MirInputEvent const* iev) -{ - switch (mir_input_event_get_type(iev)) - { - case mir_input_event_type_key: - MirHandleKeyboardEvent(mir_input_event_get_keyboard_event(iev)); - break; - case mir_input_event_type_pointer: - MirHandlePointerEvent(mir_input_event_get_pointer_event(iev)); - break; - case mir_input_event_type_touch: - MirHandleTouchEvent(mir_input_event_get_touch_event(iev)); - break; - default: - break; - } -} -} - -void MirHandleEvent(MirWindow* window, MirEvent const* ev, void* context) -{ - MirEventType event_type = mir_event_get_type(ev); - switch (event_type) - { - case mir_event_type_input: - MirHandleInput(mir_event_get_input_event(ev)); - break; - default: - break; - } -} - -bool CWinEventsMir::MessagePump() -{ - auto ret = GetQueueSize(); - std::shared_ptr<CAppInboundProtocol> appPort = CServiceBroker::GetAppPort(); - - while (GetQueueSize()) - { - XBMC_Event e; - { - std::lock_guard<decltype(m_mutex)> event_lock(m_mutex); - e = m_events.front(); - m_events.pop(); - } - - if (appPort) - appPort->OnEvent(newEvent); - } - - return ret; -} - -size_t CWinEventsMir::GetQueueSize() -{ - std::lock_guard<decltype(m_mutex)> event_lock(m_mutex); - return m_events.size(); -} - -void CWinEventsMir::MessagePush(XBMC_Event* ev) -{ - std::lock_guard<decltype(m_mutex)> event_lock(m_mutex); - m_events.push(*ev); -} diff --git a/xbmc/windowing/mir/WinEventsMir.h b/xbmc/windowing/mir/WinEventsMir.h deleted file mode 100644 index 7cc9f88f88..0000000000 --- a/xbmc/windowing/mir/WinEventsMir.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2016 Canonical Ltd. - * brandon.schaefer@canonical.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#pragma once - -#include <mutex> -#include <queue> -#include <mir_toolkit/mir_client_library.h> - -#include "../WinEvents.h" - -extern void MirHandleEvent(MirWindow* window, MirEvent const* ev, void* context); - -class CWinEventsMir : public IWinEvents -{ -public: - virtual ~CWinEventsMir() {}; - bool MessagePump() override; - void MessagePush(XBMC_Event* ev); - -private: - size_t GetQueueSize(); - - std::queue<XBMC_Event> m_events; - std::mutex m_mutex; -}; diff --git a/xbmc/windowing/mir/WinSystemMir.cpp b/xbmc/windowing/mir/WinSystemMir.cpp deleted file mode 100644 index 47a64e5a37..0000000000 --- a/xbmc/windowing/mir/WinSystemMir.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (C) 2016 Canonical Ltd. - * brandon.schaefer@canonical.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - - -#include "WinSystemMir.h" - -#include <string.h> - -#include "windowing/GraphicContext.h" -#include "platform/linux/powermanagement/LinuxPowerSyscall.h" -#include "settings/DisplaySettings.h" -#include "utils/log.h" -#include "WinEventsMir.h" - -CWinSystemMir::CWinSystemMir() : - m_connection(nullptr), - m_window(nullptr), - m_pixel_format(mir_pixel_format_invalid) -{ - m_eWindowSystem = WINDOW_SYSTEM_MIR; - m_winEvents.reset(new CWinEventsMir()); - CLinuxPowerSyscall::Register(); -} - -bool CWinSystemMir::InitWindowSystem() -{ - m_connection = mir_connect_sync(nullptr, __PRETTY_FUNCTION__); - if (!mir_connection_is_valid(m_connection)) - { - CLog::Log(LOGERROR, "WinSystemMir::InitWindowSystem - %s", - mir_connection_get_error_message(m_connection)); - - return false; - } - - return CWinSystemBase::InitWindowSystem(); -} - -bool CWinSystemMir::DestroyWindowSystem() -{ - mir_connection_release(m_connection); - - return true; -} - -bool CWinSystemMir::CreateNewWindow(const std::string& name, - bool fullScreen, - RESOLUTION_INFO& res) -{ - if (m_pixel_format == mir_pixel_format_invalid) - { - CLog::Log(LOGERROR, "WinSystemMir::CreateNewWindow - invalid pixel format"); - return false; - } - - auto spec = mir_create_normal_window_spec(m_connection, res.iWidth, res.iHeight); - - mir_window_spec_set_pixel_format(spec, m_pixel_format); - mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware); - mir_window_spec_set_event_handler(spec, MirHandleEvent, nullptr); - mir_window_spec_set_name(spec, name.c_str()); - - m_window = mir_create_window_sync(spec); - mir_window_spec_release(spec); - - if (!mir_window_is_valid(m_window)) - { - CLog::Log(LOGERROR, "WinSystemMir::CreateNewWindow - %s", - mir_window_get_error_message(m_window)); - - return false; - } - - // Hide the cursor - mir_window_configure_cursor(m_window, nullptr); - - return true; -} - -bool CWinSystemMir::DestroyWindow() -{ - mir_window_release_sync(m_window); - - return true; -} - -void CWinSystemMir::UpdateResolutions() -{ - CWinSystemBase::UpdateResolutions(); - - auto display_config = mir_connection_create_display_configuration(m_connection); - uint32_t num_outputs = mir_display_config_get_num_outputs(display_config); - - for (uint32_t d = 0; d < num_outputs; d++) - { - auto output = mir_display_config_get_output(display_config, d); - auto state = mir_output_get_connection_state(output); - bool enabled = mir_output_is_enabled(output); - - if (enabled && state == mir_output_connection_state_connected) - { - auto mode = mir_output_get_mode(output, d); - auto width = mir_output_mode_get_width(mode); - auto height = mir_output_mode_get_height(mode); - auto refresh_rate = mir_output_mode_get_refresh_rate(mode); - - UpdateDesktopResolution(CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP), 0, width, height, refresh_rate); - CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP).strId = std::to_string(d); - SetWindowResolution(width, height); - } - } - CDisplaySettings::GetInstance().ClearCustomResolutions(); - CDisplaySettings::GetInstance().ApplyCalibrations(); -} - -bool CWinSystemMir::ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) -{ - auto spec = mir_create_window_spec(m_connection); - mir_window_spec_set_width (spec, newWidth); - mir_window_spec_set_height(spec, newHeight); - - mir_window_apply_spec(m_window, spec); - mir_window_spec_release(spec); - - return true; -} - -bool CWinSystemMir::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) -{ - auto state = mir_window_state_fullscreen; - if (!fullScreen) - { - state = mir_window_state_restored; - } - - auto spec = mir_create_window_spec(m_connection); - mir_window_spec_set_state(spec, state); - - mir_window_apply_spec(m_window, spec); - mir_window_spec_release(spec); - - m_nWidth = res.iWidth; - m_nHeight = res.iHeight; - m_bFullScreen = fullScreen; - - ResizeWindow(res.iWidth, res.iHeight, 0, 0); - - return true; -} - -bool CWinSystemMir::Hide() -{ - return false; -} - -bool CWinSystemMir::Show(bool raise) -{ - return true; -} - -void CWinSystemMir::Register(IDispResource * /*resource*/) -{ -} - -void CWinSystemMir::Unregister(IDispResource * /*resource*/) -{ -} - -bool CWinSystemMir::MessagePump() -{ - return m_winEvents->MessagePump(); -} diff --git a/xbmc/windowing/mir/WinSystemMir.h b/xbmc/windowing/mir/WinSystemMir.h deleted file mode 100644 index 39417c0b61..0000000000 --- a/xbmc/windowing/mir/WinSystemMir.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2016 Canonical Ltd. - * brandon.schaefer@canonical.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#pragma once - -#include <mir_toolkit/mir_client_library.h> - -#include "threads/CriticalSection.h" -#include "windowing/WinSystem.h" - -class IDispResource; - -class CWinSystemMir : public CWinSystemBase -{ -public: - CWinSystemMir(); - virtual ~CWinSystemMir() = default; - - bool InitWindowSystem() override; - bool DestroyWindowSystem() override; - - bool CreateNewWindow(const std::string& name, - bool fullScreen, - RESOLUTION_INFO& res) override; - - bool DestroyWindow() override; - - bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) override; - bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) override; - - void UpdateResolutions() override; - - bool Hide() override; - bool Show(bool raise = true) override; - virtual void Register(IDispResource *resource); - virtual void Unregister(IDispResource *resource); - - // winevents override - bool MessagePump() override; - -protected: - MirConnection* m_connection; - MirWindow* m_window; - MirPixelFormat m_pixel_format; -}; diff --git a/xbmc/windowing/mir/WinSystemMirGLContext.cpp b/xbmc/windowing/mir/WinSystemMirGLContext.cpp deleted file mode 100644 index 1fafc0c5fc..0000000000 --- a/xbmc/windowing/mir/WinSystemMirGLContext.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2016 Canonical Ltd. - * brandon.schaefer@canonical.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - - -#include "WinSystemMirGLContext.h" - -bool CWinSystemMirGLContext::CreateNewWindow(const std::string& name, - bool fullScreen, - RESOLUTION_INFO& res) -{ - if (!m_pGLContext.CreateDisplay(m_connection, - EGL_OPENGL_BIT, - EGL_OPENGL_API)) - { - return false; - } - - m_pixel_format = mir_connection_get_egl_pixel_format(m_connection, - m_pGLContext.m_eglDisplay, - m_pGLContext.m_eglConfig); - - CWinSystemMir::CreateNewWindow(name, fullScreen, res); - - if (!m_pGLContext.CreateSurface(m_window)) - { - return false; - } - - if (!m_pGLContext.CreateContext()) - { - return false; - } - - return SetFullScreen(fullScreen, res, false); -} - -bool CWinSystemMirGLContext::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) -{ - auto ret = CWinSystemMir::SetFullScreen(fullScreen, res, blankOtherDisplays); - if (ret) - { - CRenderSystemGL::ResetRenderSystem(res.iWidth, res.iHeight); - } - - return ret; -} - -void CWinSystemMirGLContext::SetVSyncImpl(bool enable) -{ - m_pGLContext.SetVSync(enable); -} - -void CWinSystemMirGLContext::PresentRenderImpl(bool rendered) -{ - if (rendered) - { - m_pGLContext.SwapBuffers(); - } -} - -EGLDisplay CWinSystemMirGLContext::GetEGLDisplay() const -{ - return m_pGLContext.m_eglDisplay; -} - -EGLSurface CWinSystemMirGLContext::GetEGLSurface() const -{ - return m_pGLContext.m_eglSurface; -} - -EGLContext CWinSystemMirGLContext::GetEGLContext() const -{ - return m_pGLContext.m_eglContext; -} - -EGLConfig CWinSystemMirGLContext::GetEGLConfig() const -{ - return m_pGLContext.m_eglConfig; -} - -// FIXME Implement -bool CWinSystemMirGLContext::IsExtSupported(const char* extension) -{ - return false; -} diff --git a/xbmc/windowing/mir/WinSystemMirGLContext.h b/xbmc/windowing/mir/WinSystemMirGLContext.h deleted file mode 100644 index c619095da6..0000000000 --- a/xbmc/windowing/mir/WinSystemMirGLContext.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2016 Canonical Ltd. - * brandon.schaefer@canonical.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#pragma once - -#include "GLContextEGL.h" -#include "rendering/gl/RenderSystemGL.h" -#include "utils/GlobalsHandling.h" -#include "WinSystemMir.h" - -class CWinSystemMirGLContext : public CWinSystemMir, public CRenderSystemGL -{ -public: - CWinSystemMirGLContext() = default; - virtual ~CWinSystemMirGLContext() = default; - - // Implementation of CWinSystemBase via CWinSystemMir - CRenderSystemBase *GetRenderSystem() override { return this; } - bool CreateNewWindow(const std::string& name, - bool fullScreen, - RESOLUTION_INFO& res) override; - - bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) override; - bool IsExtSupported(const char* extension) override; - EGLDisplay GetEGLDisplay() const; - EGLSurface GetEGLSurface() const; - EGLContext GetEGLContext() const; - EGLConfig GetEGLConfig() const; - -protected: - void SetVSyncImpl(bool enable) override; - void PresentRenderImpl(bool rendered) override; - -private: - CGLContextEGL m_pGLContext; - -}; diff --git a/xbmc/windowing/mir/WinSystemMirGLESContext.cpp b/xbmc/windowing/mir/WinSystemMirGLESContext.cpp deleted file mode 100644 index 6decd7bd37..0000000000 --- a/xbmc/windowing/mir/WinSystemMirGLESContext.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2016 Canonical Ltd. - * brandon.schaefer@canonical.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - - -#include "WinSystemMirGLESContext.h" - -bool CWinSystemMirGLESContext::CreateNewWindow(const std::string& name, - bool fullScreen, - RESOLUTION_INFO& res) -{ - if (!m_pGLContext.CreateDisplay(m_connection, - EGL_OPENGL_ES2_BIT, - EGL_OPENGL_ES_API)) - { - return false; - } - - m_pixel_format = mir_connection_get_egl_pixel_format(m_connection, - m_pGLContext.m_eglDisplay, - m_pGLContext.m_eglConfig); - - CWinSystemMir::CreateNewWindow(name, fullScreen, res); - - if (!m_pGLContext.CreateSurface(m_surface)) - { - return false; - } - - if (!m_pGLContext.CreateContext()) - { - return false; - } - - return SetFullScreen(fullScreen, res, false); -} - -bool CWinSystemMirGLESContext::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) -{ - auto ret = CWinSystemMir::SetFullScreen(fullScreen, res, blankOtherDisplays); - - if (ret) - { - return CRenderSystemGLES::ResetRenderSystem(res.iWidth, res.iHeight); - } - - return ret; -} - -void CWinSystemMirGLESContext::SetVSyncImpl(bool enable) -{ - m_pGLContext.SetVSync(enable); -} - -void CWinSystemMirGLESContext::PresentRenderImpl(bool rendered) -{ - if (rendered) - { - m_pGLContext.SwapBuffers(); - } -} - -EGLDisplay CWinSystemMirGLESContext::GetEGLDisplay() const -{ - return m_pGLContext.m_eglDisplay; -} - -EGLSurface CWinSystemMirGLESContext::GetEGLSurface() const -{ - return m_pGLContext.m_eglSurface; -} - -EGLContext CWinSystemMirGLESContext::GetEGLContext() const -{ - return m_pGLContext.m_eglContext; -} - -EGLConfig CWinSystemMirGLESContext::GetEGLConfig() const -{ - return m_pGLContext.m_eglConfig; -} - -// FIXME Implement -bool CWinSystemMirGLESContext::IsExtSupported(const char* extension) const -{ - return false; -} diff --git a/xbmc/windowing/mir/WinSystemMirGLESContext.h b/xbmc/windowing/mir/WinSystemMirGLESContext.h deleted file mode 100644 index f6226fcaa1..0000000000 --- a/xbmc/windowing/mir/WinSystemMirGLESContext.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2016 Canonical Ltd. - * brandon.schaefer@canonical.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#pragma once - -#include "GLContextEGL.h" -#include "rendering/gles/RenderSystemGLES.h" -#include "utils/GlobalsHandling.h" -#include "WinSystemMir.h" - -class CWinSystemMirGLESContext : public CWinSystemMir, public CRenderSystemGLES -{ -public: - CWinSystemMirGLESContext() = default; - virtual ~CWinSystemMirGLESContext() = default; - - // Implementation of CWinSystemBase via CWinSystemMir - CRenderSystemBase *GetRenderSystem() override { return this; } - bool CreateNewWindow(const std::string& name, - bool fullScreen, - RESOLUTION_INFO& res) override; - - bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) override; - bool IsExtSupported(const char* extension) const override; - EGLDisplay GetEGLDisplay() const; - EGLSurface GetEGLSurface() const; - EGLContext GetEGLContext() const; - EGLConfig GetEGLConfig() const; - -protected: - void SetVSyncImpl(bool enable) override; - void PresentRenderImpl(bool rendered) override; - -private: - CGLContextEGL m_pGLContext; - -}; |