diff -Nru kodi-18.0+git20180717.0206-c1baadd/BUILDDATE kodi-18.0+git20180718.0202-bfdaaec/BUILDDATE --- kodi-18.0+git20180717.0206-c1baadd/BUILDDATE 2018-07-17 00:06:22.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/BUILDDATE 2018-07-18 00:02:12.000000000 +0000 @@ -1 +1 @@ -20180717 +20180718 diff -Nru kodi-18.0+git20180717.0206-c1baadd/cmake/modules/FindMir.cmake kodi-18.0+git20180718.0202-bfdaaec/cmake/modules/FindMir.cmake --- kodi-18.0+git20180717.0206-c1baadd/cmake/modules/FindMir.cmake 2018-06-21 18:59:46.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/cmake/modules/FindMir.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -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 -Nru kodi-18.0+git20180717.0206-c1baadd/cmake/platform/linux/mir.cmake kodi-18.0+git20180718.0202-bfdaaec/cmake/platform/linux/mir.cmake --- kodi-18.0+git20180717.0206-c1baadd/cmake/platform/linux/mir.cmake 2018-05-01 00:00:11.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/cmake/platform/linux/mir.cmake 2018-07-18 00:01:43.000000000 +0000 @@ -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 -Nru kodi-18.0+git20180717.0206-c1baadd/cmake/scripts/linux/ArchSetup.cmake kodi-18.0+git20180718.0202-bfdaaec/cmake/scripts/linux/ArchSetup.cmake --- kodi-18.0+git20180717.0206-c1baadd/cmake/scripts/linux/ArchSetup.cmake 2018-06-21 18:59:46.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/cmake/scripts/linux/ArchSetup.cmake 2018-07-18 00:01:43.000000000 +0000 @@ -108,10 +108,6 @@ 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 -Nru kodi-18.0+git20180717.0206-c1baadd/cmake/treedata/optional/common/mir.txt kodi-18.0+git20180718.0202-bfdaaec/cmake/treedata/optional/common/mir.txt --- kodi-18.0+git20180717.0206-c1baadd/cmake/treedata/optional/common/mir.txt 2018-05-01 00:00:12.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/cmake/treedata/optional/common/mir.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -xbmc/windowing/mir windowing/mir # MIR diff -Nru kodi-18.0+git20180717.0206-c1baadd/debian/changelog kodi-18.0+git20180718.0202-bfdaaec/debian/changelog --- kodi-18.0+git20180717.0206-c1baadd/debian/changelog 2018-07-17 00:08:22.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/debian/changelog 2018-07-18 00:03:05.000000000 +0000 @@ -1,4 +1,11 @@ -kodi (2:18.0+git20180717.0206-c1baadd-0bionic) bionic; urgency=high +kodi (2:18.0+git20180718.0202-bfdaaec-0bionic) bionic; urgency=high + + [h.udo] + * [mir] Drop platform + + [ace20022] + * [videoplayer] Fix "Iterator 'it' used after element has been erased". + [h.udo] * [lang] Uniformize "not available" string usage diff -Nru kodi-18.0+git20180717.0206-c1baadd/debian/changelog.tmp kodi-18.0+git20180718.0202-bfdaaec/debian/changelog.tmp --- kodi-18.0+git20180717.0206-c1baadd/debian/changelog.tmp 2018-07-17 00:08:22.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/debian/changelog.tmp 2018-07-18 00:03:05.000000000 +0000 @@ -1,4 +1,11 @@ -kodi (2:18.0+git20180717.0206-c1baadd-0dist) dist; urgency=high +kodi (2:18.0+git20180718.0202-bfdaaec-0dist) dist; urgency=high + + [h.udo] + * [mir] Drop platform + + [ace20022] + * [videoplayer] Fix "Iterator 'it' used after element has been erased". + [h.udo] * [lang] Uniformize "not available" string usage diff -Nru kodi-18.0+git20180717.0206-c1baadd/debian/changelog.tmp.old kodi-18.0+git20180718.0202-bfdaaec/debian/changelog.tmp.old --- kodi-18.0+git20180717.0206-c1baadd/debian/changelog.tmp.old 2018-07-17 00:06:22.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/debian/changelog.tmp.old 2018-07-18 00:02:12.000000000 +0000 @@ -1,5 +1,57 @@ kodi (2:18.0+git20171029.0201-910143c-0dist) dist; urgency=high + [h.udo] + * [lang] Uniformize "not available" string usage + + [Rechi] + * link with libbluray instead of loading it dynamic + + [Rechi] + * move libbluray filesystem callbacks to seperate class + + [ace20022] + * [cleanup][subs] Silence some conversion warnings. + + [ace20022] + * [cleanup][util] Fix a possible bug and silence conversion warnings. + + [ace20022] + * [cleanup][guilib] Silence some conversion warnings. + + [ace20022] + * [cleanup][demuxer] Silence type conversion warning. + + [Rechi] + * [threads] remove const constructor from CSingleLock + + [Rechi] + * [threads] remove const constructor from CExclusiveLock + + [Rechi] + * [threads] remove const constructor from CSharedLock + + [Viktor Richter] + * fix PlayMedia builtin playlist handling + + [Max Kellermann] + * utils/StringUtils: eliminate LangInfo.h header dependency + + [Max Kellermann] + * interfaces/DrmCryptoSession: ad missing includes for std::map and std::vector + + [Max Kellermann] + * utils/EGLUtils: include cleanup + + [Max Kellermann] + * input/MouseTranslator: add missing include for std::map + + [Max Kellermann] + * addons/AddonManager, ...: add missing include for g_langInfo + + [Max Kellermann] + * utils/BitstreamStats: include cleanup + + [fritsch] * AESinkPULSE: Don't deadlock - separate callback handling diff -Nru kodi-18.0+git20180717.0206-c1baadd/tools/depends/configure.ac kodi-18.0+git20180718.0202-bfdaaec/tools/depends/configure.ac --- kodi-18.0+git20180717.0206-c1baadd/tools/depends/configure.ac 2018-06-21 18:59:47.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/tools/depends/configure.ac 2018-07-18 00:01:43.000000000 +0000 @@ -382,7 +382,7 @@ 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 -Nru kodi-18.0+git20180717.0206-c1baadd/VERSION kodi-18.0+git20180718.0202-bfdaaec/VERSION --- kodi-18.0+git20180717.0206-c1baadd/VERSION 2018-07-17 00:06:22.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/VERSION 2018-07-18 00:02:12.000000000 +0000 @@ -1 +1 @@ -c1baadd +bfdaaec diff -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/cores/VideoPlayer/Process/VideoBuffer.cpp kodi-18.0+git20180718.0202-bfdaaec/xbmc/cores/VideoPlayer/Process/VideoBuffer.cpp --- kodi-18.0+git20180717.0206-c1baadd/xbmc/cores/VideoPlayer/Process/VideoBuffer.cpp 2018-05-01 00:00:25.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/cores/VideoPlayer/Process/VideoBuffer.cpp 2018-07-18 00:01:43.000000000 +0000 @@ -428,6 +428,7 @@ m_discardedPools.push_back(*it); m_pools.erase(it); pool->Discard(this, &CVideoBufferManager::ReadyForDisposal); + break; } } } diff -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt kodi-18.0+git20180718.0202-bfdaaec/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt --- kodi-18.0+git20180717.0206-c1baadd/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt 2018-05-01 00:00:25.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt 2018-07-18 00:01:43.000000000 +0000 @@ -46,7 +46,6 @@ 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 -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt kodi-18.0+git20180718.0202-bfdaaec/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt --- kodi-18.0+git20180717.0206-c1baadd/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt 2018-05-01 00:00:25.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt 2018-07-18 00:01:43.000000000 +0000 @@ -26,7 +26,6 @@ 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 -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/CMakeLists.txt kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/CMakeLists.txt --- kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/CMakeLists.txt 2018-05-01 00:00:33.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -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 -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/GLContextEGL.cpp kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/GLContextEGL.cpp --- kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/GLContextEGL.cpp 2018-05-01 00:00:33.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/GLContextEGL.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -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 - * . - * - */ - - -#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( - 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 -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/GLContextEGL.h kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/GLContextEGL.h --- kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/GLContextEGL.h 2018-06-21 18:59:50.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/GLContextEGL.h 1970-01-01 00:00:00.000000000 +0000 @@ -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 - * . - * - */ - -#pragma once - -#include -#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 -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinEventsMir.cpp kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinEventsMir.cpp --- kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinEventsMir.cpp 2018-06-21 18:59:50.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinEventsMir.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -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 - * . - * - */ - - -#include "WinEventsMir.h" - -#include -#include -#include - -#include "AppInboundProtocol.h" -#include "ServiceBroker.h" -#include "input/mouse/MouseStat.h" -#include "input/Key.h" - -namespace -{ - -// XkbCommon keysym to xkbmc -std::unordered_map 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 appPort = CServiceBroker::GetAppPort(); - - while (GetQueueSize()) - { - XBMC_Event e; - { - std::lock_guard 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 event_lock(m_mutex); - return m_events.size(); -} - -void CWinEventsMir::MessagePush(XBMC_Event* ev) -{ - std::lock_guard event_lock(m_mutex); - m_events.push(*ev); -} diff -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinEventsMir.h kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinEventsMir.h --- kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinEventsMir.h 2018-06-21 18:59:50.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinEventsMir.h 1970-01-01 00:00:00.000000000 +0000 @@ -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 - * . - * - */ - -#pragma once - -#include -#include -#include - -#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 m_events; - std::mutex m_mutex; -}; diff -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMir.cpp kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMir.cpp --- kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMir.cpp 2018-06-21 18:59:50.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMir.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -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 - * . - * - */ - - -#include "WinSystemMir.h" - -#include - -#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 -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMirGLContext.cpp kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMirGLContext.cpp --- kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMirGLContext.cpp 2018-05-01 00:00:33.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMirGLContext.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -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 - * . - * - */ - - -#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 -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMirGLContext.h kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMirGLContext.h --- kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMirGLContext.h 2018-06-21 18:59:50.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMirGLContext.h 1970-01-01 00:00:00.000000000 +0000 @@ -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 - * . - * - */ - -#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 -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMirGLESContext.cpp kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMirGLESContext.cpp --- kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMirGLESContext.cpp 2018-05-01 00:00:33.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMirGLESContext.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -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 - * . - * - */ - - -#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 -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMirGLESContext.h kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMirGLESContext.h --- kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMirGLESContext.h 2018-06-21 18:59:50.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMirGLESContext.h 1970-01-01 00:00:00.000000000 +0000 @@ -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 - * . - * - */ - -#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; - -}; diff -Nru kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMir.h kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMir.h --- kodi-18.0+git20180717.0206-c1baadd/xbmc/windowing/mir/WinSystemMir.h 2018-06-21 18:59:50.000000000 +0000 +++ kodi-18.0+git20180718.0202-bfdaaec/xbmc/windowing/mir/WinSystemMir.h 1970-01-01 00:00:00.000000000 +0000 @@ -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 - * . - * - */ - -#pragma once - -#include - -#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; -};