diff --git a/packages/mediacenter/xbmc-theme-Confluence/package.mk b/packages/mediacenter/xbmc-theme-Confluence/package.mk index 599a749edd..f5f2e14235 100644 --- a/packages/mediacenter/xbmc-theme-Confluence/package.mk +++ b/packages/mediacenter/xbmc-theme-Confluence/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="xbmc-theme-Confluence" -PKG_VERSION="13.alpha-4298c43" +PKG_VERSION="13.alpha-5cd779b" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/xbmc/package.mk b/packages/mediacenter/xbmc/package.mk index cc4bba1ed4..f9fd196ae6 100644 --- a/packages/mediacenter/xbmc/package.mk +++ b/packages/mediacenter/xbmc/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="xbmc" -PKG_VERSION="13.alpha-4298c43" +PKG_VERSION="13.alpha-5cd779b" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/xbmc/patches/xbmc-995.01-fernetmenta-fixes-b3b79dd.patch b/packages/mediacenter/xbmc/patches/xbmc-995.01-fernetmenta-fixes-b3b79dd.patch index 10225511c9..6524ff27ac 100644 --- a/packages/mediacenter/xbmc/patches/xbmc-995.01-fernetmenta-fixes-b3b79dd.patch +++ b/packages/mediacenter/xbmc/patches/xbmc-995.01-fernetmenta-fixes-b3b79dd.patch @@ -1,7 +1,7 @@ -From 52d6ad47bc4a632739cdb47e8c36d649e16a435e Mon Sep 17 00:00:00 2001 +From 186846d4e45bc6b7e40097ed0fea0f923174e29f Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:34:39 +0200 -Subject: [PATCH 01/97] videoplayer: adapt lateness detection and dropping to +Subject: [PATCH 01/96] videoplayer: adapt lateness detection and dropping to buffering --- @@ -581,13 +581,13 @@ index f8ad541..186e271 100644 }; -- -1.9.rc1 +1.9.0 -From c762db5b49200c7c54ac8dc1e129decc3b1fd278 Mon Sep 17 00:00:00 2001 +From 1f20d20f59a29698e21cabce118341544774cdcd Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 2 Sep 2012 16:05:21 +0200 -Subject: [PATCH 02/97] video player: present correct pts to user for a/v sync +Subject: [PATCH 02/96] video player: present correct pts to user for a/v sync (after buffering in renderer) --- @@ -652,13 +652,13 @@ index 186e271..59c7f09 100644 double GetOutputDelay(); /* returns the expected delay, from that a packet is put in queue */ -- -1.9.rc1 +1.9.0 -From 4090bce7907853814eee7b09cb990ed169acafd6 Mon Sep 17 00:00:00 2001 +From f242458c50815491a4c0cc17ba72351e8b24c1df Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 16 Feb 2013 18:25:53 +0100 -Subject: [PATCH 03/97] videoplayer: some rework and documentation +Subject: [PATCH 03/96] videoplayer: some rework and documentation --- .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 28 ++++++++++++++++++++-- @@ -765,13 +765,13 @@ index 1d29b6f..ee07f30 100644 if (iDecoderPts == DVD_NOPTS_VALUE) iDecoderPts = pts; -- -1.9.rc1 +1.9.0 -From bee70a1a460aced53edfad8a96f9d9270cc38676 Mon Sep 17 00:00:00 2001 +From 1008e1351410f06cd263bae89e7083ea1f6f2069 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 1 Jun 2013 11:21:19 +0200 -Subject: [PATCH 04/97] renderer: bump buffers to 5 +Subject: [PATCH 04/96] renderer: bump buffers to 5 --- xbmc/cores/VideoRenderers/BaseRenderer.h | 2 +- @@ -791,13 +791,13 @@ index dc2712a..9edfbd4 100644 class CSetting; -- -1.9.rc1 +1.9.0 -From 5bf90ce49e8b7681bf98e7c5a58a92b1d5797777 Mon Sep 17 00:00:00 2001 +From 9d551309514bf57a6f0195610e6bf3324eb70ed5 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:41:31 +0200 -Subject: [PATCH 05/97] videoplayer: update frametime, it might change due to +Subject: [PATCH 05/96] videoplayer: update frametime, it might change due to fps detection --- @@ -818,13 +818,13 @@ index ee07f30..b3175cd 100644 { m_codecname = m_pVideoCodec->GetName(); -- -1.9.rc1 +1.9.0 -From 4bc29d9fbb5f0bb11bdeb7f2ef60602a75070a53 Mon Sep 17 00:00:00 2001 +From aa554d9421a2f7753c325910c34d41a6bae71e33 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:43:06 +0200 -Subject: [PATCH 06/97] videoplayer: give streams with invalid fps a chance for +Subject: [PATCH 06/96] videoplayer: give streams with invalid fps a chance for fps detection --- @@ -845,13 +845,13 @@ index b3175cd..9c36bdb 100644 //reset the stored framerates if no good framerate was detected m_fStableFrameRate = 0.0; -- -1.9.rc1 +1.9.0 -From a8f7517153fea3c02a4bce8f98a9e4100104420d Mon Sep 17 00:00:00 2001 +From 417f2f953475ca870f1275fa3388edd6fc8ae313 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:49:05 +0200 -Subject: [PATCH 07/97] dvdplayer: allow rewinding at end of stream, do a seek +Subject: [PATCH 07/96] dvdplayer: allow rewinding at end of stream, do a seek after rewind --- @@ -859,10 +859,10 @@ Subject: [PATCH 07/97] dvdplayer: allow rewinding at end of stream, do a seek 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index cfd3dc3..686760c 100644 +index 380dcdc..0a46909 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1657,7 +1657,7 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1649,7 +1649,7 @@ void CDVDPlayer::HandlePlaySpeed() } else if (m_CurrentVideo.id >= 0 @@ -871,7 +871,7 @@ index cfd3dc3..686760c 100644 && m_SpeedState.lastpts != m_dvdPlayerVideo.GetCurrentPts() && m_SpeedState.lasttime != GetTime()) { -@@ -2318,6 +2318,12 @@ void CDVDPlayer::HandleMessages() +@@ -2310,6 +2310,12 @@ void CDVDPlayer::HandleMessages() pvrinputstream->Pause( speed == 0 ); } @@ -885,13 +885,13 @@ index cfd3dc3..686760c 100644 // audioplayer, stops outputing audio to audiorendere, but still tries to // sleep an correct amount for each packet -- -1.9.rc1 +1.9.0 -From a1046e1314283fe8172e68abbfc087e39b6ec57c Mon Sep 17 00:00:00 2001 +From 265d000e6b14ea852ea1b7edd07b19724fa04c48 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:22:05 +0200 -Subject: [PATCH 08/97] X11: ditch SDL for video and window events +Subject: [PATCH 08/96] X11: ditch SDL for video and window events --- xbmc/Application.cpp | 2 +- @@ -907,7 +907,7 @@ Subject: [PATCH 08/97] X11: ditch SDL for video and window events create mode 100644 xbmc/windowing/WinEventsX11.h diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 99b2484..16f4700 100644 +index 265881f..43c4517 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -907,7 +907,7 @@ bool CApplication::CreateGUI() @@ -2425,13 +2425,13 @@ index b1464d0..34b912f 100644 CCriticalSection m_resourceSection; std::vector m_resources; -- -1.9.rc1 +1.9.0 -From dfbf863c8166af01c1d2620af2008cabba217f5d Mon Sep 17 00:00:00 2001 +From dc063d452595ef255ff1c453385bb9b927c0e41f Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:24:22 +0200 -Subject: [PATCH 09/97] X11: Add xbmc icon +Subject: [PATCH 09/96] X11: Add xbmc icon --- xbmc/windowing/X11/WinSystemX11.cpp | 126 +++++++++++++++++++++++++++++++++++- @@ -2618,13 +2618,13 @@ index 34b912f..352e90e 100644 CStopWatch m_screensaverReset; }; -- -1.9.rc1 +1.9.0 -From d12c4e0b2c823faae2ae2900c0b2c933b6b208e7 Mon Sep 17 00:00:00 2001 +From 4ce7602a49355991e325f143e83bf7b0b5ccc400 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 20 May 2012 14:11:26 +0200 -Subject: [PATCH 10/97] X11: add SDL joystick until we have a better solution +Subject: [PATCH 10/96] X11: add SDL joystick until we have a better solution --- xbmc/windowing/WinEventsX11.cpp | 26 ++++++++++++++++++++++++++ @@ -2675,13 +2675,13 @@ index ad58aad..6f57a87 100644 } -- -1.9.rc1 +1.9.0 -From 387fee35471e98e528d6ff7edf5fbed1976953f4 Mon Sep 17 00:00:00 2001 +From a2469d77321bc22006adfe65bff59c704d8b20e7 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 12:35:55 +0200 -Subject: [PATCH 11/97] X11: factor out code handling device reset notification +Subject: [PATCH 11/96] X11: factor out code handling device reset notification --- xbmc/windowing/X11/WinSystemX11.cpp | 22 ++++++++++++++-------- @@ -2741,13 +2741,13 @@ index 352e90e..3f91b9b 100644 protected: bool RefreshGlxContext(); -- -1.9.rc1 +1.9.0 -From bff5ed9156f78fd14ce4465a48009881e22ce175 Mon Sep 17 00:00:00 2001 +From b372167f2dc824c26154bbab4eaa5a5e6a3bcd66 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:02:00 +0200 -Subject: [PATCH 12/97] X11: move xrandr events to WinEventsX11 +Subject: [PATCH 12/96] X11: move xrandr events to WinEventsX11 --- xbmc/windowing/WinEventsX11.cpp | 42 +++++++++++++++++++++++++++++++++++++ @@ -2888,13 +2888,13 @@ index 304dac8..16b13aa 100644 void CWinSystemX11::Register(IDispResource *resource) -- -1.9.rc1 +1.9.0 -From 027180282b2e6d1c812fb0a32ba5484afd35b5de Mon Sep 17 00:00:00 2001 +From 9e4fa8328448cc3e6fa53bd812f27b524434777a Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 12 Apr 2012 15:43:56 +0200 -Subject: [PATCH 13/97] xrandr: remove method RestoreState +Subject: [PATCH 13/96] xrandr: remove method RestoreState --- xbmc/windowing/X11/WinSystemX11.cpp | 13 +++++++++++-- @@ -2970,13 +2970,13 @@ index 0aec487..00b49dc 100644 //bool Has1080p(); //bool Has720p(); -- -1.9.rc1 +1.9.0 -From 4520ec99dcce479adb25d364e66a032f6e5e8d5d Mon Sep 17 00:00:00 2001 +From 4a3986400273ec0e5bf3963fd327570be38552eb Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 20 May 2012 13:17:10 +0200 -Subject: [PATCH 14/97] xrandr: observe orientation +Subject: [PATCH 14/96] xrandr: observe orientation --- xbmc/windowing/X11/WinSystemX11.cpp | 89 ++++++++++++++++++++++++++++++------- @@ -3188,13 +3188,13 @@ index 00b49dc..508604d 100644 class CXRandR -- -1.9.rc1 +1.9.0 -From e216e5e23686901d27de7c25b6beeab0d266ad4b Mon Sep 17 00:00:00 2001 +From 51af3d3ec746d0fab968f6db2ee43e9bb20be236 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:54:15 +0200 -Subject: [PATCH 15/97] xrandr: allow getting info for multiple screen's +Subject: [PATCH 15/96] xrandr: allow getting info for multiple screen's Refactored by: Joakim Plate --- @@ -3366,13 +3366,13 @@ index 508604d..d37838a 100644 extern CXRandR g_xrandr; -- -1.9.rc1 +1.9.0 -From 3570e4bf111d18ede3a311ddd35db0c1429347aa Mon Sep 17 00:00:00 2001 +From 06fe661c4965efd3d3a73dd98700098cda7bdc79 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:44:00 +0200 -Subject: [PATCH 16/97] X11: fix multi-head setups +Subject: [PATCH 16/96] X11: fix multi-head setups --- language/English/strings.po | 4 +- @@ -3387,7 +3387,7 @@ Subject: [PATCH 16/97] X11: fix multi-head setups 9 files changed, 227 insertions(+), 113 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index ba434d9..864cc1d 100755 +index e443e7b..806d138 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -1019,7 +1019,9 @@ msgctxt "#245" @@ -3402,7 +3402,7 @@ index ba434d9..864cc1d 100755 msgctxt "#247" msgid "Scripts" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 45e8167..fa62f71 100644 +index 51ebd16..a96e659 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -2163,6 +2163,15 @@ @@ -3556,10 +3556,10 @@ index 8ee1be2..bead24b 100644 protected: CDisplaySettings(); diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp -index 478ec47..c635edd 100644 +index 892a139..1037ddb 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp -@@ -407,6 +407,7 @@ void CSettings::Uninitialize() +@@ -406,6 +406,7 @@ void CSettings::Uninitialize() m_settingsManager->UnregisterSettingOptionsFiller("screens"); m_settingsManager->UnregisterSettingOptionsFiller("stereoscopicmodes"); m_settingsManager->UnregisterSettingOptionsFiller("preferedstereoscopicviewmodes"); @@ -3567,7 +3567,7 @@ index 478ec47..c635edd 100644 m_settingsManager->UnregisterSettingOptionsFiller("shutdownstates"); m_settingsManager->UnregisterSettingOptionsFiller("startupwindows"); m_settingsManager->UnregisterSettingOptionsFiller("streamlanguages"); -@@ -843,6 +844,7 @@ void CSettings::InitializeOptionFillers() +@@ -835,6 +836,7 @@ void CSettings::InitializeOptionFillers() m_settingsManager->RegisterSettingOptionsFiller("screens", CDisplaySettings::SettingOptionsScreensFiller); m_settingsManager->RegisterSettingOptionsFiller("stereoscopicmodes", CDisplaySettings::SettingOptionsStereoscopicModesFiller); m_settingsManager->RegisterSettingOptionsFiller("preferedstereoscopicviewmodes", CDisplaySettings::SettingOptionsPreferredStereoscopicViewModesFiller); @@ -3575,7 +3575,7 @@ index 478ec47..c635edd 100644 m_settingsManager->RegisterSettingOptionsFiller("shutdownstates", CPowerManager::SettingOptionsShutdownStatesFiller); m_settingsManager->RegisterSettingOptionsFiller("startupwindows", ADDON::CSkinInfo::SettingOptionsStartupWindowsFiller); m_settingsManager->RegisterSettingOptionsFiller("streamlanguages", CLangInfo::SettingOptionsStreamLanguagesFiller); -@@ -873,6 +875,9 @@ void CSettings::InitializeConditions() +@@ -865,6 +867,9 @@ void CSettings::InitializeConditions() #ifdef HAS_GL m_settingsManager->AddCondition("has_gl"); #endif @@ -3585,7 +3585,7 @@ index 478ec47..c635edd 100644 #ifdef HAS_GLES m_settingsManager->AddCondition("has_gles"); #endif -@@ -1025,6 +1030,7 @@ void CSettings::InitializeISettingCallbacks() +@@ -1017,6 +1022,7 @@ void CSettings::InitializeISettingCallbacks() settingSet.insert("videoscreen.screen"); settingSet.insert("videoscreen.resolution"); settingSet.insert("videoscreen.screenmode"); @@ -4128,13 +4128,13 @@ index 4175aab..94584ab 100644 private: bool IsSuitableVisual(XVisualInfo *vInfo); -- -1.9.rc1 +1.9.0 -From 363a3eb76db31a99d84563ff0f33408800b8f2fb Mon Sep 17 00:00:00 2001 +From fd6f32fc932cd0c0baef515f9a068dd185e38128 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:36:32 +0200 -Subject: [PATCH 17/97] X11: remove all DefaultScreen and RootWindow macros +Subject: [PATCH 17/96] X11: remove all DefaultScreen and RootWindow macros --- xbmc/windowing/X11/WinSystemX11.cpp | 6 +++--- @@ -4199,13 +4199,13 @@ index 6383754..21e7dc5 100644 CLog::Log(LOGDEBUG, "GLX_EXTENSIONS:%s", m_glxext.c_str()); -- -1.9.rc1 +1.9.0 -From bbf35ef899bd7b8df8a4d1686059ac6a9ed3b4c4 Mon Sep 17 00:00:00 2001 +From 340900ab09c894d0880de7b1ae9fe50fc52e4845 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:45:22 +0200 -Subject: [PATCH 18/97] X11: remove all DefaultScreen and RootWindow macros +Subject: [PATCH 18/96] X11: remove all DefaultScreen and RootWindow macros (VideoRefClock) Note this is on a separate display connection. @@ -4274,13 +4274,13 @@ index 0b3950a..ca43b5a 100644 XRRFreeScreenConfigInfo(CurrInfo); -- -1.9.rc1 +1.9.0 -From 7fde7bea324a8fb97806453b31a4b2601bf920d8 Mon Sep 17 00:00:00 2001 +From 5b5b9601ec91aaa65540aad628981dc0b4f4b8d2 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 20 Jun 2012 17:37:11 +0200 -Subject: [PATCH 19/97] X11: recreate gl context after output has changed +Subject: [PATCH 19/96] X11: recreate gl context after output has changed --- xbmc/windowing/X11/WinSystemX11.cpp | 24 ++++++++++++++---------- @@ -4428,13 +4428,13 @@ index 21e7dc5..8e68d5d 100644 } -- -1.9.rc1 +1.9.0 -From f3024acd55e25088f4dc769671ff350c854d3439 Mon Sep 17 00:00:00 2001 +From 89caeeb759cc62b23960d7b39c8029717e8cf7eb Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:06:25 +0200 -Subject: [PATCH 20/97] X11: hook video reference clock in windowing +Subject: [PATCH 20/96] X11: hook video reference clock in windowing --- xbmc/video/VideoReferenceClock.cpp | 71 +++++++++++++++++++++++++++----------- @@ -4636,13 +4636,13 @@ index dd65a1b..afd71fc 100644 bool m_UseNvSettings; bool m_bIsATI; -- -1.9.rc1 +1.9.0 -From 96e3c80360703f658a3a6df3c28f1353af844e04 Mon Sep 17 00:00:00 2001 +From 358f10e1ff2d809ff0c04c6e722017c05287aad7 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 21 Jun 2012 17:26:51 +0200 -Subject: [PATCH 21/97] X11: fix video calibrations +Subject: [PATCH 21/96] X11: fix video calibrations --- xbmc/windowing/WinSystem.h | 1 + @@ -4731,13 +4731,13 @@ index 9666cc3..5b52d6c 100644 // Local to WinSystemX11 only Display* GetDisplay() { return m_dpy; } -- -1.9.rc1 +1.9.0 -From a4a85c821f122f3f4c71179fbdcfdd9044d3e480 Mon Sep 17 00:00:00 2001 +From 29742330c0ba30bccbea0b1f13405f851475e7c9 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:00:26 +0200 -Subject: [PATCH 22/97] X11: deactivate screen saver on startup +Subject: [PATCH 22/96] X11: deactivate screen saver on startup --- xbmc/windowing/X11/WinSystemX11.cpp | 29 +++++++++++++++++++++++++++++ @@ -4804,13 +4804,13 @@ index 5b52d6c..b2bd5a0 100644 virtual void NotifyAppActiveChange(bool bActivated); virtual void NotifyAppFocusChange(bool bGaining); -- -1.9.rc1 +1.9.0 -From b1b9a868e630abc6722779b269bf65fd96553404 Mon Sep 17 00:00:00 2001 +From 9ea925efcf4e60191d318d8aad4c69d67d4f065e Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:10:09 +0200 -Subject: [PATCH 23/97] X11: change method of going full-screen +Subject: [PATCH 23/96] X11: change method of going full-screen --- xbmc/windowing/X11/WinSystemX11.cpp | 9 ++++++++- @@ -4851,13 +4851,13 @@ index b76b229..869baa8 100644 Pixmap bitmapNoData; XColor black; -- -1.9.rc1 +1.9.0 -From 5b98c9190b7a9a87847fac6bb20f791c9c7fd137 Mon Sep 17 00:00:00 2001 +From bcfabf400d6934b955bf58c968bd6f8b12a77759 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Jun 2012 19:12:39 +0200 -Subject: [PATCH 24/97] X11: reset key repeat and key modifier on focus lost +Subject: [PATCH 24/96] X11: reset key repeat and key modifier on focus lost and gain --- @@ -4886,13 +4886,13 @@ index d98f12f..743aca9 100644 serial = xevent.xfocus.serial; break; -- -1.9.rc1 +1.9.0 -From a27b23129a59af8531393acabbc1710d32bc87c8 Mon Sep 17 00:00:00 2001 +From b307832e330fee860e86e64ede8a26cc81f8ad7e Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 14:18:46 +0200 -Subject: [PATCH 25/97] X11: replace custom utf8 to unicode with charset +Subject: [PATCH 25/96] X11: replace custom utf8 to unicode with charset convertor (squash to x11 events) --- @@ -5106,13 +5106,13 @@ index a412f32..9a8a912 100644 XIC m_xic; XBMC_Event m_lastKey; -- -1.9.rc1 +1.9.0 -From ecc426d0e96b90e645377ae8645b2e9504193516 Mon Sep 17 00:00:00 2001 +From e4b791f60cf0f1d5ef585b2abb518c14e66836cb Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 14:23:54 +0200 -Subject: [PATCH 26/97] X11: fixed invalid usage of sizeof() (squash into x11 +Subject: [PATCH 26/96] X11: fixed invalid usage of sizeof() (squash into x11 changes) --- @@ -5173,13 +5173,13 @@ index 9a8a912..c69169c 100644 XIC m_xic; XBMC_Event m_lastKey; -- -1.9.rc1 +1.9.0 -From 3d786941ecc95d8a37eb4c350f855843fd874c81 Mon Sep 17 00:00:00 2001 +From a6c4bc69cdf3863ec66a59f566ec9230d4ebc94f Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 9 Jun 2012 18:23:53 +0200 -Subject: [PATCH 27/97] add missing keys to xbmc keytable +Subject: [PATCH 27/96] add missing keys to xbmc keytable --- xbmc/input/XBMC_keytable.cpp | 2 ++ @@ -5199,13 +5199,13 @@ index d57f4d3..b807897 100644 // Function keys , { XBMCK_F1, 0, 0, XBMCVK_F1, "f1"} -- -1.9.rc1 +1.9.0 -From 86657ed82ab7b96a553449e653966ef139f0f2be Mon Sep 17 00:00:00 2001 +From 2b548e32d6b59f82934f81bad68bff8e72defae4 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 16 Mar 2012 15:57:51 +0100 -Subject: [PATCH 28/97] videorefclock: temp deactivate of nv settings +Subject: [PATCH 28/96] videorefclock: temp deactivate of nv settings --- xbmc/video/VideoReferenceClock.cpp | 2 +- @@ -5225,13 +5225,13 @@ index 0ddf102..3ae7107 100644 #endif } -- -1.9.rc1 +1.9.0 -From 0607a08cced108971692da01dccde8e1091fc782 Mon Sep 17 00:00:00 2001 +From 59cdaeddac31bc29c0acced61f21fa44eb803e23 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 09:09:09 +0200 -Subject: [PATCH 29/97] videorefclock: ask graphics context for refresh rate +Subject: [PATCH 29/96] videorefclock: ask graphics context for refresh rate --- xbmc/video/VideoReferenceClock.cpp | 3 ++- @@ -5259,13 +5259,13 @@ index 3ae7107..27bebde 100644 CLog::Log(LOGDEBUG, "CVideoReferenceClock: Detected refreshrate: %i hertz", (int)m_RefreshRate); -- -1.9.rc1 +1.9.0 -From 126d5e8a1fff0ccdefb27d6c61876d4cf5232742 Mon Sep 17 00:00:00 2001 +From 82f74ea1e007c11fb0567ed8e2900059b3d4c05e Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 9 Jul 2012 14:00:18 +0200 -Subject: [PATCH 30/97] X11: fix icon texture after +Subject: [PATCH 30/96] X11: fix icon texture after cc5ed3c2474084ebc0373a3046410e6f766e03f4 --- @@ -5370,13 +5370,13 @@ index 869baa8..bfe3797 100644 } -- -1.9.rc1 +1.9.0 -From dc4b2e7f1489d3ac7033194e5a61884286f9cf88 Mon Sep 17 00:00:00 2001 +From f67e6f4729a2a57079d52c0bd4178544f900b4e4 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 10 Jul 2012 11:14:12 +0200 -Subject: [PATCH 31/97] X11: check for window manager +Subject: [PATCH 31/96] X11: check for window manager --- xbmc/windowing/X11/WinSystemX11.cpp | 74 ++++++++++++++++++++++++++++++++++++- @@ -5494,13 +5494,13 @@ index b2bd5a0..3e62cd8 100644 CStopWatch m_screensaverReset; }; -- -1.9.rc1 +1.9.0 -From 83d677d27538680c0954bbf55dcf5bfbdbd76669 Mon Sep 17 00:00:00 2001 +From 0023530fb8dac8ab1e7dbc7285012febae3ebac8 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 12 Jul 2012 11:11:47 +0200 -Subject: [PATCH 32/97] X11: dont set window on xrandr if no mode available +Subject: [PATCH 32/96] X11: dont set window on xrandr if no mode available --- xbmc/windowing/X11/WinSystemX11.cpp | 11 ++++++----- @@ -5534,13 +5534,13 @@ index af82061..4f33c68 100644 CStdString currentOutput = CSettings::Get().GetString("videoscreen.monitor"); -- -1.9.rc1 +1.9.0 -From 8fdfc6875324c0c86cc4aadbcab84706ee091770 Mon Sep 17 00:00:00 2001 +From 9ff4898ad03d8c5c9afa8b7fcea0c2cde04847ca Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 26 Jul 2012 09:34:28 +0200 -Subject: [PATCH 33/97] X11: fix crash after a resolution change on startup +Subject: [PATCH 33/96] X11: fix crash after a resolution change on startup --- xbmc/windowing/X11/WinSystemX11.cpp | 3 ++- @@ -5561,13 +5561,13 @@ index 4f33c68..bc4e963 100644 #endif -- -1.9.rc1 +1.9.0 -From e4bd044b60516bc4cbf2815cd9a96c978cb9c65f Mon Sep 17 00:00:00 2001 +From 1a757becb165f7a0c526356b333723369e830cdf Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 15 Sep 2012 18:27:29 +0200 -Subject: [PATCH 34/97] X11: lock graphics context in NotifyXRREvent +Subject: [PATCH 34/96] X11: lock graphics context in NotifyXRREvent --- xbmc/windowing/X11/WinSystemX11.cpp | 2 ++ @@ -5587,13 +5587,13 @@ index bc4e963..57a8d20 100644 { CLog::Log(LOGERROR, "WinSystemX11::RefreshWindow - failed to query xrandr"); -- -1.9.rc1 +1.9.0 -From 521757aa1f96ac41a8dd06b5383695afe9fab448 Mon Sep 17 00:00:00 2001 +From b3f4959dac57e6ab84e1c16ca2a0137e412ef0a0 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 16:06:39 +0200 -Subject: [PATCH 35/97] dvdplayer: observe pts counter overflow +Subject: [PATCH 35/96] dvdplayer: observe pts counter overflow --- .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 197 ++++++++++++++++++++- @@ -5873,13 +5873,13 @@ index aef5ab1..35abbdf 100644 }; -- -1.9.rc1 +1.9.0 -From b90a1c0c5cd59234c4572be75bace7156a73dded Mon Sep 17 00:00:00 2001 +From 0108b59694665b5144a7e251f6154dff2d8b3d1f Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 2 Oct 2012 13:02:10 +0200 -Subject: [PATCH 36/97] dvdplayer: avoid short screen flicker caused by +Subject: [PATCH 36/96] dvdplayer: avoid short screen flicker caused by unnecessary reconfigure of renderer --- @@ -5909,13 +5909,13 @@ index 9c36bdb..322a581 100644 || ( m_output.extended_format != pPicture->extended_format ) || ( m_output.color_matrix != pPicture->color_matrix && pPicture->color_matrix != 0 ) // don't reconfigure on unspecified -- -1.9.rc1 +1.9.0 -From 5b191d742f003578ec9c3994b0c42b056d1c2666 Mon Sep 17 00:00:00 2001 +From 4d59e64f83a1f6f6e9c1eabf1570fac2d260b966 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 11 Oct 2012 12:05:50 +0200 -Subject: [PATCH 37/97] vdpau: advanced settings for auto deinterlacing +Subject: [PATCH 37/96] vdpau: advanced settings for auto deinterlacing --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- @@ -5978,13 +5978,13 @@ index 1e54c93..6497592 100644 bool m_videoVDPAUdeintSkipChromaHD; bool m_musicUseTimeSeeking; -- -1.9.rc1 +1.9.0 -From a6e2235974b977160ee13331135733b9c5904084 Mon Sep 17 00:00:00 2001 +From e0c50ef3e3a2f14ad20335b52b4ea1fd6598cceb Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 2 Nov 2012 13:20:03 +0100 -Subject: [PATCH 38/97] player: fix rewind +Subject: [PATCH 38/96] player: fix rewind --- xbmc/cores/dvdplayer/DVDMessage.h | 5 ++++- @@ -6032,10 +6032,10 @@ index 2ea8b8f..e8274f9 100644 class CDVDMsgPlayerSeekChapter : public CDVDMsg diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 686760c..1ed1983 100644 +index 0a46909..467a0f6 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1658,11 +1658,13 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1650,11 +1650,13 @@ void CDVDPlayer::HandlePlaySpeed() } else if (m_CurrentVideo.id >= 0 && (m_CurrentVideo.inited == true || GetPlaySpeed() < 0) // allow rewind at end of file @@ -6050,7 +6050,7 @@ index 686760c..1ed1983 100644 // check how much off clock video is when ff/rw:ing // a problem here is that seeking isn't very accurate // and since the clock will be resynced after seek -@@ -1681,7 +1683,7 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1673,7 +1675,7 @@ void CDVDPlayer::HandlePlaySpeed() { CLog::Log(LOGDEBUG, "CDVDPlayer::Process - Seeking to catch up"); int64_t iTime = (int64_t)DVD_TIME_TO_MSEC(m_clock.GetClock() + m_State.time_offset + 500000.0 * m_playSpeed / DVD_PLAYSPEED_NORMAL); @@ -6059,7 +6059,7 @@ index 686760c..1ed1983 100644 } } } -@@ -2167,7 +2169,7 @@ void CDVDPlayer::HandleMessages() +@@ -2159,7 +2161,7 @@ void CDVDPlayer::HandleMessages() else m_StateInput.dts = start; @@ -6068,7 +6068,7 @@ index 686760c..1ed1983 100644 } else CLog::Log(LOGWARNING, "error while seeking"); -@@ -2303,9 +2305,10 @@ void CDVDPlayer::HandleMessages() +@@ -2295,9 +2297,10 @@ void CDVDPlayer::HandleMessages() double offset; offset = CDVDClock::GetAbsoluteClock() - m_State.timestamp; offset *= m_playSpeed / DVD_PLAYSPEED_NORMAL; @@ -6080,7 +6080,7 @@ index 686760c..1ed1983 100644 m_State.timestamp = CDVDClock::GetAbsoluteClock(); } -@@ -2321,7 +2324,8 @@ void CDVDPlayer::HandleMessages() +@@ -2313,7 +2316,8 @@ void CDVDPlayer::HandleMessages() // do a seek after rewind, clock is not in sync with current pts if (m_playSpeed < 0 && speed >= 0) { @@ -6090,7 +6090,7 @@ index 686760c..1ed1983 100644 } // if playspeed is different then DVD_PLAYSPEED_NORMAL or DVD_PLAYSPEED_PAUSE -@@ -3317,7 +3321,7 @@ bool CDVDPlayer::CloseTeletextStream(bool bWaitForBuffers) +@@ -3309,7 +3313,7 @@ bool CDVDPlayer::CloseTeletextStream(bool bWaitForBuffers) return true; } @@ -6099,7 +6099,7 @@ index 686760c..1ed1983 100644 { double startpts; if(accurate) -@@ -3329,19 +3333,23 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) +@@ -3321,19 +3325,23 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) if(startpts != DVD_NOPTS_VALUE) startpts -= m_offset_pts; @@ -6127,7 +6127,7 @@ index 686760c..1ed1983 100644 m_CurrentTeletext.dts = DVD_NOPTS_VALUE; m_CurrentTeletext.startpts = startpts; -@@ -3385,7 +3393,7 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) +@@ -3377,7 +3385,7 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) m_CurrentTeletext.started = false; } @@ -6196,13 +6196,13 @@ index 59c7f09..65dea76 100644 unsigned int m_dropRequests; }; -- -1.9.rc1 +1.9.0 -From e405ca1711bbe08e86ae5fa76ac5c6433399c7e7 Mon Sep 17 00:00:00 2001 +From 78e3f42d46ade0753afba396e450e851501853cc Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 23 Nov 2012 17:41:12 +0100 -Subject: [PATCH 39/97] xrandr: fix query for multiple screens +Subject: [PATCH 39/96] xrandr: fix query for multiple screens --- xbmc/windowing/X11/XRandR.cpp | 10 ++++++---- @@ -6240,13 +6240,13 @@ index 4685413..e610150 100644 FILE* file = popen(cmd.c_str(),"r"); if (!file) -- -1.9.rc1 +1.9.0 -From ec1a9d08025a294b5993800bde207a53d9ac9321 Mon Sep 17 00:00:00 2001 +From bd067117f118fe57436c8da319a79f66d9b9056f Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 2 Dec 2012 15:46:55 +0100 -Subject: [PATCH 40/97] X11: add debug log to print out refresh after xrr event +Subject: [PATCH 40/96] X11: add debug log to print out refresh after xrr event --- xbmc/windowing/X11/WinSystemX11.cpp | 6 ++++++ @@ -6270,13 +6270,13 @@ index 57a8d20..a237dc0 100644 unsigned int i; bool found(false); -- -1.9.rc1 +1.9.0 -From 1ca4908b406b2f0bb668afe9cb45ca6701bf81fe Mon Sep 17 00:00:00 2001 +From 7eb638440d25b703367baee7e3bd827ad038cd35 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 11 Dec 2012 11:08:13 +0100 -Subject: [PATCH 41/97] X11: dont call XCloseDisplay on shutdown, it crashes +Subject: [PATCH 41/96] X11: dont call XCloseDisplay on shutdown, it crashes when powered doen by cec on ATI --- @@ -6298,13 +6298,13 @@ index a237dc0..ab660b1 100644 // m_SDLSurface is free()'d by SDL_Quit(). -- -1.9.rc1 +1.9.0 -From 1e52564f8c89e963598d862e7d76786f037a263a Mon Sep 17 00:00:00 2001 +From c5982ff87c815bc68bc38853f83c75b6b39b8257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Coutant?= Date: Wed, 12 Dec 2012 19:49:47 +0100 -Subject: [PATCH 42/97] x11: support for multiple x screens +Subject: [PATCH 42/96] x11: support for multiple x screens --- xbmc/windowing/X11/XRandR.cpp | 2 +- @@ -6324,13 +6324,13 @@ index e610150..5c53574 100644 // TODO ERROR return false; -- -1.9.rc1 +1.9.0 -From 6ef18d23828dfe2423abd1b9cee5c9f41a8704ee Mon Sep 17 00:00:00 2001 +From 285767c47d14feafc1c112017e65f931c74f6ddb Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 24 Dec 2012 16:02:42 +0100 -Subject: [PATCH 43/97] pvr: increase changes counter of stream on stream +Subject: [PATCH 43/96] pvr: increase changes counter of stream on stream change, cosmetics after dd307930d39d92f145a01a16600cd00e01ec39be --- @@ -6361,13 +6361,13 @@ index e5f8234..96c9e89 100644 else if (props.stream[i].iCodecType == XBMC_CODEC_TYPE_VIDEO) { -- -1.9.rc1 +1.9.0 -From e36cc08eb758f7a7aa006ddcf2cf0faa32e35f98 Mon Sep 17 00:00:00 2001 +From 232f2cc9d65a5c6ed1a878784d67b10e15f1254d Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 17 Jan 2013 16:03:22 +0100 -Subject: [PATCH 44/97] X11: add keymapping for XF86XK_Sleep +Subject: [PATCH 44/96] X11: add keymapping for XF86XK_Sleep --- xbmc/windowing/WinEventsX11.cpp | 1 + @@ -6386,13 +6386,13 @@ index a62521f..263cb5a 100644 , {XK_Undo, XBMCK_UNDO} /* Media keys */ -- -1.9.rc1 +1.9.0 -From a99e8cc54f1119e12c2b073eed8e166a420407b6 Mon Sep 17 00:00:00 2001 +From 54794b6719b785fc2dc55e300e2627cc0d03caac Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 21 Jan 2013 09:00:19 +0100 -Subject: [PATCH 45/97] X11: remove toggle full screen after resume +Subject: [PATCH 45/96] X11: remove toggle full screen after resume --- xbmc/powermanagement/PowerManager.cpp | 5 ----- @@ -6415,13 +6415,13 @@ index 590a887..35b5a21 100644 } g_application.ResetScreenSaver(); -- -1.9.rc1 +1.9.0 -From 0841bcaa8cbb5cdbd54c98d492ed2d9b858050e5 Mon Sep 17 00:00:00 2001 +From d0455b55bd656f05d09fd902e897ffd941e9e25d Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 23 Jan 2013 17:03:02 +0100 -Subject: [PATCH 46/97] xrandr: set screen on mode change command +Subject: [PATCH 46/96] xrandr: set screen on mode change command --- xbmc/windowing/X11/XRandR.cpp | 2 +- @@ -6441,13 +6441,13 @@ index 5c53574..4355ef7 100644 return false; CLog::Log(LOGINFO, "XRANDR: %s", cmd); -- -1.9.rc1 +1.9.0 -From b09da8c55abf10517265bb7553d292dabb4640de Mon Sep 17 00:00:00 2001 +From 0e78877e11cd6a1fd0aa8460b4db59a83566daba Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 23 Jan 2013 17:03:39 +0100 -Subject: [PATCH 47/97] X11: recreate glx context when output changes +Subject: [PATCH 47/96] X11: recreate glx context when output changes --- xbmc/windowing/X11/WinSystemX11.cpp | 6 +++--- @@ -6495,13 +6495,13 @@ index 3e62cd8..2a1fb41 100644 void OnLostDevice(); bool SetWindow(int width, int height, bool fullscreen, const CStdString &output); -- -1.9.rc1 +1.9.0 -From 1fc0bfb1f007fc1341f1ce0f386c2e5cf28675ff Mon Sep 17 00:00:00 2001 +From d47a1358ee7a56281db2f17a81f5f4b0b56d62bd Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 14 Dec 2012 14:19:15 +0100 -Subject: [PATCH 48/97] pvr: do not show selection dialog for a single menu +Subject: [PATCH 48/96] pvr: do not show selection dialog for a single menu hook --- @@ -6536,13 +6536,13 @@ index 14c9cde..57b18a5 100644 client->CallMenuHook(hooks->at(hookIDs.at(selection)), item); } -- -1.9.rc1 +1.9.0 -From ffa2aacd78eac06079eb7b25d57a6bef8629bfb3 Mon Sep 17 00:00:00 2001 +From 79ad7add02d6d3bde40618fe99235e33d802924d Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 3 Feb 2013 08:17:16 +0100 -Subject: [PATCH 49/97] X11: use default screen parameters if no output +Subject: [PATCH 49/96] X11: use default screen parameters if no output connected --- @@ -6643,13 +6643,13 @@ index 4329a22..2adf8a0 100644 mask, &swa); -- -1.9.rc1 +1.9.0 -From a2e48a88f7e4b80d7204516b54fbef3d37212bcf Mon Sep 17 00:00:00 2001 +From cde28d04deea80cfff87e8438565820cd610a56e Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 23 Mar 2013 15:13:32 +0100 -Subject: [PATCH 50/97] X11: create parent window +Subject: [PATCH 50/96] X11: create parent window --- xbmc/windowing/X11/WinSystemX11.cpp | 69 +++++++++++++++++++++++-------------- @@ -6912,13 +6912,13 @@ index 2a1fb41..e8993f1 100644 Display* m_dpy; Cursor m_invisibleCursor; -- -1.9.rc1 +1.9.0 -From 6e414357c8f725ce2ec131173489a29ca1979690 Mon Sep 17 00:00:00 2001 +From a13160c00eccaa1b09beb49241fc3d73f862a92e Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 24 Mar 2013 12:30:12 +0100 -Subject: [PATCH 51/97] X11: use system key repeat rate instead of hardcoded +Subject: [PATCH 51/96] X11: use system key repeat rate instead of hardcoded one, taken from 58fd64b194e38b73b5f3132744bab35e994e7441 --- @@ -7117,13 +7117,13 @@ index c69169c..6429291 100644 int m_keymodState; bool m_structureChanged; -- -1.9.rc1 +1.9.0 -From f2681c6ad1ba8e9615424e14c703d8cf980aa931 Mon Sep 17 00:00:00 2001 +From 3fe6a47b76c6147862818f0a4abb7605d4fddb66 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 24 Mar 2013 16:04:48 +0100 -Subject: [PATCH 52/97] linux: use CLOCK_MONOTONIC_RAW as this is not subject +Subject: [PATCH 52/96] linux: use CLOCK_MONOTONIC_RAW as this is not subject to NTP --- @@ -7158,20 +7158,20 @@ index c06b8c5..4390d2e 100644 #endif } -- -1.9.rc1 +1.9.0 -From da998fb36b347944b186f9272bed12f5ccd277f9 Mon Sep 17 00:00:00 2001 +From 32417e43d5670b5c7ac07d6c9d3925cd9c05b1f3 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 15:18:53 +0100 -Subject: [PATCH 53/97] OMXPlayer: some caching fixes for pvr +Subject: [PATCH 53/96] OMXPlayer: some caching fixes for pvr --- xbmc/cores/omxplayer/OMXPlayer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp -index 4fbd3bd..50c353c 100644 +index 2b9f94b..d3b01d0 100644 --- a/xbmc/cores/omxplayer/OMXPlayer.cpp +++ b/xbmc/cores/omxplayer/OMXPlayer.cpp @@ -2572,7 +2572,8 @@ void COMXPlayer::HandleMessages() @@ -7185,23 +7185,23 @@ index 4fbd3bd..50c353c 100644 m_av_clock.OMXSetSpeed(speed); m_av_clock.OMXPause(); -- -1.9.rc1 +1.9.0 -From 55ee9c896f273f92b02fb3dc49b2cf3db19bd661 Mon Sep 17 00:00:00 2001 +From 234390062853ae10b396d9ba9f14c5e5d747e1fd Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 20:50:59 +0100 -Subject: [PATCH 54/97] fix incorrect display of fps when dr kicks in +Subject: [PATCH 54/96] fix incorrect display of fps when dr kicks in --- xbmc/Application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 16f4700..98ab374 100644 +index 43c4517..4131707 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2304,10 +2304,11 @@ void CApplication::Render() +@@ -2307,10 +2307,11 @@ void CApplication::Render() if (frameTime < singleFrameTime) Sleep(singleFrameTime - frameTime); } @@ -7215,13 +7215,13 @@ index 16f4700..98ab374 100644 g_renderManager.UpdateResolution(); -- -1.9.rc1 +1.9.0 -From 54885a6d4a9967215caf4dc07a2e09729e694738 Mon Sep 17 00:00:00 2001 +From 15cda4c4a401b540c8c8345e4111c5926aa3e104 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 13 Apr 2013 08:32:06 +0200 -Subject: [PATCH 55/97] X11: fix mouse coverage +Subject: [PATCH 55/96] X11: fix mouse coverage --- xbmc/windowing/X11/WinSystemX11.cpp | 11 ++++++++--- @@ -7284,13 +7284,13 @@ index e8993f1..5cccfb7 100644 CCriticalSection m_resourceSection; std::vector m_resources; -- -1.9.rc1 +1.9.0 -From 853e9ae00e463965c32558377e4803cb93291974 Mon Sep 17 00:00:00 2001 +From 272a94560b0fd3b31e64851c791ebb0f94bcf753 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 8 May 2013 13:14:58 +0200 -Subject: [PATCH 56/97] X11: fix incorrectly used screen num in desktop +Subject: [PATCH 56/96] X11: fix incorrectly used screen num in desktop resolution --- @@ -7322,13 +7322,13 @@ index 2acb36d..101ba98 100644 res.iHeight = mode.h; res.iScreenWidth = mode.w; -- -1.9.rc1 +1.9.0 -From fb7c801e05556c46db7957f2a9703a26f96b9a98 Mon Sep 17 00:00:00 2001 +From 8c6efe872230a07ff7805f21c20f3acecff5aaf4 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 9 May 2013 12:07:09 +0200 -Subject: [PATCH 57/97] X11: do not overwrite user selected monitor with +Subject: [PATCH 57/96] X11: do not overwrite user selected monitor with fallback --- @@ -7450,13 +7450,13 @@ index 5cccfb7..1b658e2 100644 bool m_bIsInternalXrr; bool m_newGlContext; -- -1.9.rc1 +1.9.0 -From 874008cfe073c9ea3799ed860c92be3319bca9fb Mon Sep 17 00:00:00 2001 +From e86b5d5d7f6059e3128dbcb39916d3e648085fe0 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 12 May 2013 10:50:30 +0200 -Subject: [PATCH 58/97] xrandr: add turn on/off to wrapper +Subject: [PATCH 58/96] xrandr: add turn on/off to wrapper --- xbmc/windowing/X11/XRandR.cpp | 78 +++++++++++++++++++++++++++++++++++++++---- @@ -7619,13 +7619,13 @@ index d37838a..059062f 100644 //bool Has1080p(); //bool Has720p(); -- -1.9.rc1 +1.9.0 -From c480601bfcecb17e77300d0a2c6e10a1d984454c Mon Sep 17 00:00:00 2001 +From e4d94513463a7cf658a6b7a43e845901f2d9539a Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 19 May 2013 12:55:35 +0200 -Subject: [PATCH 59/97] xrandr: add GetPreferredMode to wrapper +Subject: [PATCH 59/96] xrandr: add GetPreferredMode to wrapper --- xbmc/windowing/X11/XRandR.cpp | 23 +++++++++++++++++++++++ @@ -7679,13 +7679,13 @@ index 059062f..ab7cc63 100644 bool SetMode(XOutput output, XMode mode); void LoadCustomModeLinesToAllOutputs(void); -- -1.9.rc1 +1.9.0 -From b80b6b3c7b1011dc5bf560609e20d58346f3435b Mon Sep 17 00:00:00 2001 +From 4a4a2b2bcf841ed81da78f1370a3399aeeabdc5b Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 11 May 2013 17:12:12 +0200 -Subject: [PATCH 60/97] X11: multi-head improvement - poll for desired output +Subject: [PATCH 60/96] X11: multi-head improvement - poll for desired output if we do not get an xrr event --- @@ -7700,7 +7700,7 @@ Subject: [PATCH 60/97] X11: multi-head improvement - poll for desired output 8 files changed, 105 insertions(+), 12 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 864cc1d..b38ea65 100755 +index 806d138..ca0e122 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -6537,7 +6537,7 @@ msgctxt "#14071" @@ -7727,7 +7727,7 @@ index 864cc1d..b38ea65 100755 #: xbmc/video/VideoDatabase.cpp msgctxt "#15012" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index fa62f71..f9361b8 100644 +index a96e659..d2eeb01 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -2172,6 +2172,11 @@ @@ -7963,13 +7963,13 @@ index 62003f5..8525ede 100644 int status = system(cmd.c_str()); if (status == -1) -- -1.9.rc1 +1.9.0 -From e015165d5c66156eb9b70cd60b1ae54adb7d6355 Mon Sep 17 00:00:00 2001 +From 7848ef437555ea93ef71b185afda2c18d294ba62 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 15 May 2013 09:14:34 +0200 -Subject: [PATCH 61/97] X11: ignore mouse move event form other windows +Subject: [PATCH 61/96] X11: ignore mouse move event form other windows --- xbmc/windowing/WinEventsX11.cpp | 4 +++- @@ -7998,13 +7998,13 @@ index 908c8b6..938ad26 100644 memset(&newEvent, 0, sizeof(newEvent)); newEvent.type = XBMC_MOUSEMOTION; -- -1.9.rc1 +1.9.0 -From 92a6532f0c93d9d6fd4d683aad13e1a083dacfaa Mon Sep 17 00:00:00 2001 +From 0a33b2ca8d64414e8dd1862ad6b38ff69f520aec Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 11 Jun 2013 16:20:29 +0200 -Subject: [PATCH 62/97] renderer: allow some lateness within vblank interval +Subject: [PATCH 62/96] renderer: allow some lateness within vblank interval --- xbmc/cores/VideoRenderers/RenderManager.cpp | 12 ++++++++++-- @@ -8061,13 +8061,13 @@ index 949c652..d84ff6c 100644 OVERLAY::CRenderer m_overlays; -- -1.9.rc1 +1.9.0 -From 59839efa93251991f61ab2ccf78811bfcf58a07e Mon Sep 17 00:00:00 2001 +From 3a2a817f5c8fee5c704d3ac640cda60d78c62977 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 16 Jun 2013 13:22:58 +0200 -Subject: [PATCH 63/97] X11: another fix for mouse coverage +Subject: [PATCH 63/96] X11: another fix for mouse coverage --- xbmc/windowing/WinEventsX11.cpp | 6 ++++-- @@ -8097,13 +8097,13 @@ index 938ad26..e4ca56d 100644 break; } -- -1.9.rc1 +1.9.0 -From ba83e6c055695f2e2288fe3fb96e6729f1b57e4b Mon Sep 17 00:00:00 2001 +From 4846c1020c294846511306fbc03dfccd86819c37 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Fri, 5 Jul 2013 12:14:00 +0200 -Subject: [PATCH 64/97] X11: set windows class name +Subject: [PATCH 64/96] X11: set windows class name --- xbmc/windowing/X11/WinSystemX11.cpp | 9 ++++++++- @@ -8142,20 +8142,20 @@ index b3fe510..df5fe9b 100644 // register interest in the delete window message -- -1.9.rc1 +1.9.0 -From 311a30b76461d34de3732e6cb92e4826baab7f6a Mon Sep 17 00:00:00 2001 +From 417c34da11ddf95411cba8c3f5b5eafbccdff821 Mon Sep 17 00:00:00 2001 From: spiff Date: Tue, 16 Jul 2013 14:34:04 +0200 -Subject: [PATCH 65/97] fixed: typo +Subject: [PATCH 65/96] fixed: typo --- language/English/strings.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language/English/strings.po b/language/English/strings.po -index b38ea65..ee0c57f 100755 +index ca0e122..59eb97d 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -6671,7 +6671,7 @@ msgstr "" @@ -8168,20 +8168,20 @@ index b38ea65..ee0c57f 100755 #empty strings from id 14102 to 15011 -- -1.9.rc1 +1.9.0 -From 3236d0a2dcaf5167df2980cdc0cf38d614233154 Mon Sep 17 00:00:00 2001 +From 12ee5510a221f8a1a8d0b31976a48d2cb37790af Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 25 Jul 2013 17:18:13 +0200 -Subject: [PATCH 66/97] ActiveAE: slightly reduce buffer size +Subject: [PATCH 66/96] ActiveAE: slightly reduce buffer size --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 0a4aba0..f72d063 100644 +index c871ee8..99bc37a 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp @@ -30,8 +30,8 @@ using namespace ActiveAE; @@ -8196,13 +8196,13 @@ index 0a4aba0..f72d063 100644 void CEngineStats::Reset(unsigned int sampleRate) { -- -1.9.rc1 +1.9.0 -From 5588a5e5bb1b99cc30bbdd3aa2ffe407be3524f6 Mon Sep 17 00:00:00 2001 +From 1146424f9fba6862bd7a1ad856039da9faf8b5d2 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 4 Aug 2013 10:11:16 +0200 -Subject: [PATCH 67/97] Revert "vdpau: comment some features that will be added +Subject: [PATCH 67/96] Revert "vdpau: comment some features that will be added later" This reverts commit e00b4f65864d623ab4d2e9e5c06db138e661f1cf. @@ -8255,13 +8255,13 @@ index 30ccc3f..f414221 100644 m_mixersteps = 1; } -- -1.9.rc1 +1.9.0 -From bf8c4164d14d8c5d490608309e7fcd0cfd2809bc Mon Sep 17 00:00:00 2001 +From 234aceef4f04fcdc4f6dab95d9a52c7a69adb74d Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Fri, 9 Aug 2013 18:01:40 +0200 -Subject: [PATCH 68/97] X11: fix keysyms +Subject: [PATCH 68/96] X11: fix keysyms --- xbmc/windowing/WinEventsX11.cpp | 2 +- @@ -8281,13 +8281,13 @@ index e4ca56d..b20130c 100644 newEvent.key.keysym.unicode = keys[keys.length() - 1]; newEvent.key.state = xevent.xkey.state; -- -1.9.rc1 +1.9.0 -From 6a57fe762b5e272896403aff808d18ceda335338 Mon Sep 17 00:00:00 2001 +From c9025a3bd86f00cd92a624612f0252465f4110cd Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Fri, 9 Aug 2013 18:42:36 +0200 -Subject: [PATCH 69/97] X11: fix keysym for non-IM +Subject: [PATCH 69/96] X11: fix keysym for non-IM --- xbmc/windowing/WinEventsX11.cpp | 2 +- @@ -8307,13 +8307,13 @@ index b20130c..a38890c 100644 newEvent.key.keysym.scancode = xevent.xkey.keycode; newEvent.key.state = xevent.xkey.state; -- -1.9.rc1 +1.9.0 -From e1f52f24f9ad2f354de8dbbac3cb6d33647e14b2 Mon Sep 17 00:00:00 2001 +From 7e9e644e31944cd12999c1847367c24b17b01427 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 10 Aug 2013 11:18:16 +0200 -Subject: [PATCH 70/97] add some missing multi media keys +Subject: [PATCH 70/96] add some missing multi media keys --- system/keymaps/keyboard.xml | 3 +++ @@ -8365,13 +8365,13 @@ index ee6bb69..364b45a 100644 XBMCVK_LCONTROL = 0xD0, XBMCVK_RCONTROL = 0xD1, -- -1.9.rc1 +1.9.0 -From ffaa66b82ae031b15d2b60026b0ed2f026fe10e5 Mon Sep 17 00:00:00 2001 +From 1102b59f067d340177d900c0348d25d4ebf28bbc Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 10 Aug 2013 15:53:45 +0200 -Subject: [PATCH 71/97] X11: squash multi +Subject: [PATCH 71/96] X11: squash multi --- xbmc/windowing/X11/WinSystemX11.cpp | 2 +- @@ -8391,13 +8391,13 @@ index df5fe9b..d8e04d6 100644 bool CWinSystemX11::IsSuitableVisual(XVisualInfo *vInfo) -- -1.9.rc1 +1.9.0 -From 6a684f45f0b32cf6ddb1bda0a4935eab99b6f066 Mon Sep 17 00:00:00 2001 +From add7ab11cb0c795138bb350aebbaf705960a8a84 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 3 Sep 2013 20:46:17 +0200 -Subject: [PATCH 72/97] X11: do not poll default monitor +Subject: [PATCH 72/96] X11: do not poll default monitor --- xbmc/windowing/X11/WinSystemX11.cpp | 2 +- @@ -8417,13 +8417,13 @@ index d8e04d6..01f5272 100644 int numScreens = XScreenCount(m_dpy); -- -1.9.rc1 +1.9.0 -From 782f2aa0f4343418a744ca3fc6df805b792f19b8 Mon Sep 17 00:00:00 2001 +From bdbaef8fb2cf3d8797d683892b51adb74cdd626f Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 29 Oct 2013 20:57:28 +0100 -Subject: [PATCH 73/97] X11: fix broken monitor switching +Subject: [PATCH 73/96] X11: fix broken monitor switching --- system/settings/settings.xml | 1 - @@ -8431,7 +8431,7 @@ Subject: [PATCH 73/97] X11: fix broken monitor switching 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index f9361b8..011b7cb 100644 +index d2eeb01..6865718 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -2216,7 +2216,6 @@ @@ -8523,13 +8523,13 @@ index 40bc3b3..1663836 100644 current = monitors[i]; } -- -1.9.rc1 +1.9.0 -From 1114b3fe779c4ea9a248de0bec331e8c0d78f014 Mon Sep 17 00:00:00 2001 +From 4284c9da6feab81bfd2675c8b0cbee8defcbe579 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 29 Oct 2013 20:57:59 +0100 -Subject: [PATCH 74/97] X11: remove polling for connected outputs, use xrr +Subject: [PATCH 74/96] X11: remove polling for connected outputs, use xrr events --- @@ -8827,13 +8827,13 @@ index 7ec5be4..14622cb 100644 bool m_bIsInternalXrr; bool m_newGlContext; -- -1.9.rc1 +1.9.0 -From 2a3cbddef24707e42db0580654239bf90aee66b1 Mon Sep 17 00:00:00 2001 +From 11a1fa69951934af3332d3f7eb038a735ef301e4 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 31 Oct 2013 09:37:13 +0100 -Subject: [PATCH 75/97] X11: remove grabbing of keyboard and mouse +Subject: [PATCH 75/96] X11: remove grabbing of keyboard and mouse --- xbmc/windowing/WinEventsX11.cpp | 4 ---- @@ -8948,13 +8948,13 @@ index 14622cb..d1c8729 100644 CCriticalSection m_resourceSection; std::vector m_resources; -- -1.9.rc1 +1.9.0 -From 25e32c5a99dd9a789426a8588e972a478bed7df9 Mon Sep 17 00:00:00 2001 +From 0a2f56c8cfb9109715a2099a8cd90566c91166f6 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 31 Oct 2013 10:46:40 +0100 -Subject: [PATCH 76/97] X11: set ExposureMask on gl window, fixes not updated +Subject: [PATCH 76/96] X11: set ExposureMask on gl window, fixes not updated areas --- @@ -8977,13 +8977,13 @@ index 695b352..e55583c 100644 m_glWindow = XCreateWindow(m_dpy, m_mainWindow, 0, 0, width, height, 0, vi->depth, -- -1.9.rc1 +1.9.0 -From 5ba846661ffc5567df2b68564609882a64545f86 Mon Sep 17 00:00:00 2001 +From 5aefb59b3583bec09e73b23dc8b9661032c7989e Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 31 Oct 2013 11:25:19 +0100 -Subject: [PATCH 77/97] X11: drop shortcuts, have WM do this +Subject: [PATCH 77/96] X11: drop shortcuts, have WM do this --- xbmc/windowing/WinEventsX11.cpp | 21 --------------------- @@ -9042,20 +9042,20 @@ index 6429291..4334d21 100644 Display *m_display; Window m_window; -- -1.9.rc1 +1.9.0 -From 5dce51b7ea17feab7ff06ade0e430118f9d95747 Mon Sep 17 00:00:00 2001 +From 45ca79fb25e13d415e06f3b33e13cf40058f36e2 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 7 Nov 2013 15:02:00 +0100 -Subject: [PATCH 78/97] X11: adapt to new settings +Subject: [PATCH 78/96] X11: adapt to new settings --- system/settings/settings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 011b7cb..0abb304 100644 +index 6865718..8cf4b9c 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -2176,6 +2176,7 @@ @@ -9067,13 +9067,13 @@ index 011b7cb..0abb304 100644 0 -- -1.9.rc1 +1.9.0 -From 63e985d9b041282068296b6b417955a483d16317 Mon Sep 17 00:00:00 2001 +From 69c9bbd075667dbb9db491995b6eb3d6d6471b8a Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 14 Nov 2013 09:28:24 +0100 -Subject: [PATCH 79/97] X11: adapt to changes in cstdstring +Subject: [PATCH 79/96] X11: adapt to changes in cstdstring --- xbmc/windowing/X11/WinSystemX11.cpp | 4 ++-- @@ -9118,13 +9118,13 @@ index 8525ede..c94f2e3 100644 int status = system(cmd.c_str()); if (status == -1) -- -1.9.rc1 +1.9.0 -From d33f0f8b14cad118fd04177703def311577cc9cb Mon Sep 17 00:00:00 2001 +From a62d637c75f72ad671f87076e142e3c8ba08d5f7 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Mon, 18 Nov 2013 17:44:31 +0100 -Subject: [PATCH 80/97] ActiveAE: correct time of buffered samples by resample +Subject: [PATCH 80/96] ActiveAE: correct time of buffered samples by resample ratio --- @@ -9133,7 +9133,7 @@ Subject: [PATCH 80/97] ActiveAE: correct time of buffered samples by resample 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index f72d063..ced6b50 100644 +index 99bc37a..17ac95e 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp @@ -101,7 +101,7 @@ float CEngineStats::GetDelay(CActiveAEStream *stream) @@ -9158,13 +9158,13 @@ index 99989b3..0287e73 100644 CActiveAEStream::~CActiveAEStream() -- -1.9.rc1 +1.9.0 -From fc8e05fd3d63e227edcda42429892973655dc9c7 Mon Sep 17 00:00:00 2001 +From fb0aa7c8fea84236a94685649741c6d1900e3959 Mon Sep 17 00:00:00 2001 From: Marcel Groothuis Date: Thu, 5 Dec 2013 22:02:50 +0100 -Subject: [PATCH 81/97] ffmpeg demuxer: faster channel change for PVR addons +Subject: [PATCH 81/96] ffmpeg demuxer: faster channel change for PVR addons without internal demuxing (such as MediaPortal, ArgusTV, MythTV, NextPVR) Credits: FernetMenta, Davilla, Popcornmix, Whaupt @@ -9475,13 +9475,13 @@ index ca689d0..f383563 100644 else return NULL; -- -1.9.rc1 +1.9.0 -From f64efb980a04cacca979cd4ea122f9e46093fc68 Mon Sep 17 00:00:00 2001 +From ac4ba822f7b3d79a8a38840322e3569754a75b5d Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 14 Nov 2013 20:35:04 +0100 -Subject: [PATCH 82/97] ffmpeg demuxer: make sure we start mpegts video with an +Subject: [PATCH 82/96] ffmpeg demuxer: make sure we start mpegts video with an i-frame --- @@ -9562,13 +9562,13 @@ index acde9a8..9ec0877 100644 AVDictionary *GetFFMpegOptionsFromURL(const CURL &url); double ConvertTimestamp(int64_t pts, int den, int num); -- -1.9.rc1 +1.9.0 -From 348e7f147ec7263d705b5ee588d825926698440f Mon Sep 17 00:00:00 2001 +From 4f4ab22f30778a09221f39b8c83c00e5ae2ea0d3 Mon Sep 17 00:00:00 2001 From: Wolfgang Haupt Date: Thu, 5 Dec 2013 22:11:57 +0100 -Subject: [PATCH 83/97] DVDFactoryDemuxer: skip streaminfo for udp tcp and +Subject: [PATCH 83/96] DVDFactoryDemuxer: skip streaminfo for udp tcp and pvr-channels --- @@ -9689,13 +9689,13 @@ index cf7ea3f..7857c3b 100644 static void AddSlashAtEnd(std::string& strFolder); static bool HasSlashAtEnd(const std::string& strFile, bool checkURL = false); -- -1.9.rc1 +1.9.0 -From 1bf1fde157530e2b5d3ab86664f49da11ab40614 Mon Sep 17 00:00:00 2001 +From dd8543008969be5f2228cd5978b4a39041b61c60 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 28 Jan 2014 08:43:29 +0100 -Subject: [PATCH 84/97] squash fast switch +Subject: [PATCH 84/96] squash fast switch --- xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 2 +- @@ -9715,13 +9715,13 @@ index 782fb3d..b57b391 100644 st->codec->width = 0; } -- -1.9.rc1 +1.9.0 -From 168677798bc91de2c00f8200231995d5fce96c04 Mon Sep 17 00:00:00 2001 +From e57ecab5b2deb7e29a6ee3d22bd6897aff17a98a Mon Sep 17 00:00:00 2001 From: Rainer Hochecker -Date: Sat, 15 Feb 2014 13:56:40 +0200 -Subject: [PATCH 85/97] linux: add shared lib for sse4 operations +Date: Mon, 24 Feb 2014 20:45:36 +0200 +Subject: [PATCH 85/96] linux: add shared lib for sse4 operations Conflicts: configure.in @@ -9764,10 +9764,10 @@ index 8eda3c4..b0b5c24 100644 externals: codecs libs visualizations screensavers libaddon pvraddons diff --git a/configure.in b/configure.in -index 93d2772..fa67b97 100644 +index 7390167..800546c 100644 --- a/configure.in +++ b/configure.in -@@ -885,6 +885,19 @@ if test "$target_platform" = "target_linux"; then +@@ -883,6 +883,19 @@ if test "$use_static_ffmpeg" = "yes"; then VORBISENC_ALL_LIBS=`${PKG_CONFIG} --static --libs-only-l --silence-errors vorbisenc` fi @@ -9787,7 +9787,7 @@ index 93d2772..fa67b97 100644 # Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_CHOWN -@@ -2583,6 +2596,10 @@ if test "$use_codec_libstagefright" = "yes"; then +@@ -2591,6 +2604,10 @@ if test "$use_codec_libstagefright" = "yes"; then OUTPUT_FILES="$OUTPUT_FILES xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/Makefile" fi @@ -9798,7 +9798,7 @@ index 93d2772..fa67b97 100644 OUTPUT_FILES="$OUTPUT_FILES \ xbmc/interfaces/python/Makefile \ xbmc/interfaces/python/test/Makefile" -@@ -2661,6 +2678,7 @@ AC_SUBST(USE_DOXYGEN) +@@ -2669,6 +2686,7 @@ AC_SUBST(USE_DOXYGEN) AC_SUBST(USE_PVR_ADDONS) AC_SUBST(GNUTLS_ALL_LIBS) AC_SUBST(VORBISENC_ALL_LIBS) @@ -10015,31 +10015,31 @@ index 0000000..45aa826 + +include ../../../Makefile.include -- -1.9.rc1 +1.9.0 -From 925b42845d3962ac2de3160d22a536a1558a3605 Mon Sep 17 00:00:00 2001 +From 35cb2b30e230b9f060efd337db650d3e9ef60b2b Mon Sep 17 00:00:00 2001 From: Rainer Hochecker -Date: Sat, 15 Feb 2014 13:59:12 +0200 -Subject: [PATCH 86/97] vaapi: option to enable sw filters +Date: Mon, 24 Feb 2014 20:48:18 +0200 +Subject: [PATCH 86/96] vaapi: option to enable sw filters Conflicts: xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h --- language/English/strings.po | 15 +- - system/settings/settings.xml | 7 + + system/settings/settings.xml | 9 ++ xbmc/cores/VideoRenderers/RenderManager.cpp | 4 +- xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp | 1 + - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 76 +++++++++-- + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 76 ++++++++-- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 3 + - xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 152 +++++++++++++++++++++ + xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 154 +++++++++++++++++++++ xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h | 36 ++++- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 32 ++--- - 9 files changed, 284 insertions(+), 42 deletions(-) + 9 files changed, 288 insertions(+), 42 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index ee0c57f..adaf2f6 100755 +index 59eb97d..77c8b1d 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -6074,7 +6074,13 @@ msgctxt "#13452" @@ -10057,7 +10057,7 @@ index ee0c57f..adaf2f6 100755 #: system/settings/settings.xml msgctxt "#13500" -@@ -14877,7 +14883,12 @@ msgctxt "#36429" +@@ -14889,7 +14895,12 @@ msgctxt "#36429" msgid "Select this if the audio out connection only supports multichannel audio as Dolby Digital 5.1, this allows multichannel audio such as AAC5.1 or FLAC5.1 to be listened to in 5.1 surround sound. Note - transcoding can lead to a reduction in sound quality" msgstr "" @@ -10072,23 +10072,25 @@ index ee0c57f..adaf2f6 100755 #: system/settings/settings.xml diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 0abb304..7553396 100644 +index 8cf4b9c..119d9ce 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -513,6 +513,13 @@ - true - - 3 -+ +@@ -516,6 +516,15 @@ + false + + + + HAVE_LIBVA + + true + + 3 - false - - ++ false ++ ++ + + HasDXVA2 + diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp index 8dc8a91..c15f559 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp @@ -10321,7 +10323,7 @@ index c0ce198..4f88532 100644 + bool m_interlace; }; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -index bfefc9d..cce40d2 100644 +index bfefc9d..51f9bed 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp @@ -24,6 +24,17 @@ @@ -10360,16 +10362,19 @@ index bfefc9d..cce40d2 100644 } void CDecoder::RelBuffer(AVCodecContext *avctx, AVFrame *pic) -@@ -388,6 +404,8 @@ bool CDecoder::Open(AVCodecContext *avctx, enum PixelFormat fmt, unsigned int su +@@ -388,6 +404,11 @@ bool CDecoder::Open(AVCodecContext *avctx, enum PixelFormat fmt, unsigned int su if (!EnsureContext(avctx)) return false; -+ CheckUseFilter(); ++ if (avctx->width <= 1920 && avctx->height <= 1088) ++ CheckUseFilter(); ++ else ++ m_use_filter = false; + m_hwaccel->display = m_display->get(); avctx->hwaccel_context = m_hwaccel; -@@ -472,7 +490,35 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* frame) +@@ -472,7 +493,35 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* frame) return status; if(frame) @@ -10405,7 +10410,7 @@ index bfefc9d..cce40d2 100644 else return VC_BUFFER; } -@@ -550,4 +596,110 @@ unsigned CDecoder::GetAllowedReferences() +@@ -550,4 +599,109 @@ unsigned CDecoder::GetAllowedReferences() return m_renderbuffers_count; } @@ -10433,10 +10438,9 @@ index bfefc9d..cce40d2 100644 + m_use_filter = false; + return; + } -+ VASurfaceStatus surf_status; + VAImage image; + VASurfaceID surface = m_surfaces_free.front()->m_id; -+ VAStatus status = status = vaDeriveImage(m_display->get(), surface, &image); ++ VAStatus status = vaDeriveImage(m_display->get(), surface, &image); + m_use_filter = true; + if (status != VA_STATUS_SUCCESS) + { @@ -10666,13 +10670,13 @@ index 9c5469b..b30e450 100644 int iResult = OutputPicture(&picture, pts); -- -1.9.rc1 +1.9.0 -From 41e507b94f446feb585657d365f40f2180794c8e Mon Sep 17 00:00:00 2001 +From 69d6df09b8a0c4cfc56555cead5b26e47a8cc767 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Fri, 3 Jan 2014 20:50:46 +0100 -Subject: [PATCH 87/97] X11: check for user output on resize window +Subject: [PATCH 87/96] X11: check for user output on resize window --- xbmc/windowing/X11/WinSystemX11.cpp | 17 ++++++++++++++--- @@ -10714,13 +10718,13 @@ index 9962f08..c95f4ec 100644 && m_nHeight == newHeight && m_userOutput.compare(m_currentOutput) == 0) -- -1.9.rc1 +1.9.0 -From 9124b34b5f3dd017ef26508c9e5b2a83b1b16f76 Mon Sep 17 00:00:00 2001 +From 973f3c21aed9a7e89ce4e946e019e3792a5fa22c Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Fri, 24 Jan 2014 18:29:33 +0100 -Subject: [PATCH 88/97] dvdplayer: flush ffmpeg after hw decoder returned an +Subject: [PATCH 88/96] dvdplayer: flush ffmpeg after hw decoder returned an error --- @@ -10757,13 +10761,13 @@ index 7b45cc2..68e353a 100644 result = FilterProcess(m_pFrame); else -- -1.9.rc1 +1.9.0 -From 574bfeea15d2fdb4b946810bafa0b2d052b5118c Mon Sep 17 00:00:00 2001 +From 0480010a0c3f87e0cd16422a8692e48ccc139b70 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 28 Jan 2014 10:05:26 +0100 -Subject: [PATCH 89/97] xbmc pr 3080 +Subject: [PATCH 89/96] xbmc pr 3080 --- .../dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 14 ++++++++++++-- @@ -10802,13 +10806,13 @@ index 68e353a..205ec66 100644 pDvdVideoPicture->pts = DVD_NOPTS_VALUE; -- -1.9.rc1 +1.9.0 -From 890daa20b2af1bceef8708df3116f99f622fea06 Mon Sep 17 00:00:00 2001 +From 43fcb2425e5316918bbed1db3abadf9592d60333 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 28 Jan 2014 17:24:58 +0100 -Subject: [PATCH 90/97] set preatpicture if pts is equal to last frame +Subject: [PATCH 90/96] set preatpicture if pts is equal to last frame --- xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 8 ++++++++ @@ -10835,24 +10839,24 @@ index 205ec66..f593fcd 100644 pDvdVideoPicture->pts = DVD_NOPTS_VALUE; -- -1.9.rc1 +1.9.0 -From 1f3a5f1b86e77e3e24ee44aff50c39be314422aa Mon Sep 17 00:00:00 2001 +From 61ca95b8f685f21a41a618968b058424bdf0e1a2 Mon Sep 17 00:00:00 2001 From: fritsch Date: Mon, 27 Jan 2014 19:49:03 +0100 -Subject: [PATCH 91/97] Introduce SWCodec - these are codecs that don't have +Subject: [PATCH 91/96] Introduce SWCodec - these are codecs that don't have any GPU acceleration (yet) - add HVEC --- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 15 ++++++++++----- + .../dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 15 +++++++++------ .../cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 2 +- xbmc/settings/AdvancedSettings.cpp | 4 ++-- xbmc/settings/AdvancedSettings.h | 2 +- - 4 files changed, 14 insertions(+), 9 deletions(-) + 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index f593fcd..f2dcd8a 100644 +index f593fcd..7ab9d25 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -159,7 +159,7 @@ CDVDVideoCodecFFmpeg::CDVDVideoCodecFFmpeg() : CDVDVideoCodec() @@ -10864,7 +10868,7 @@ index f593fcd..f2dcd8a 100644 m_pHardware = NULL; m_iLastKeyframe = 0; m_dts = DVD_NOPTS_VALUE; -@@ -215,10 +215,15 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options +@@ -215,10 +215,12 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options // this is needed to not open the decoders m_bSoftware = true; // this we need to enable multithreading for hi10p via advancedsettings @@ -10873,15 +10877,12 @@ index f593fcd..f2dcd8a 100644 break; } } -+ #ifdef AV_CODEC_ID_HEVC + else if (hints.codec == AV_CODEC_ID_HEVC) + m_isSWCodec = true; -+ #endif -+ if(pCodec == NULL) pCodec = m_dllAvCodec.avcodec_find_decoder(hints.codec); -@@ -244,12 +249,12 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options +@@ -244,12 +246,12 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options * sensitive to changes in frame sizes, and it causes crashes * during HW accell - so we unset it in this case. * @@ -10897,6 +10898,16 @@ index f593fcd..f2dcd8a 100644 m_pCodecContext->thread_type); } else if (CSettings::Get().GetBool("videoplayer.useframemtdec")) +@@ -301,7 +303,8 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + int num_threads = std::min(8 /*MAX_THREADS*/, g_cpuInfo.getCPUCount()); + if( num_threads > 1 && !hints.software && m_pHardware == NULL // thumbnail extraction fails when run threaded + && ( pCodec->id == AV_CODEC_ID_H264 +- || pCodec->id == AV_CODEC_ID_MPEG4 )) ++ || pCodec->id == AV_CODEC_ID_MPEG4 ++ || pCodec->id == AV_CODEC_ID_HEVC)) + m_pCodecContext->thread_count = num_threads; + + if (m_dllAvCodec.avcodec_open2(m_pCodecContext, pCodec, NULL) < 0) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h index 4f88532..e301aa8 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h @@ -10946,13 +10957,13 @@ index 6497592..d44f38a 100644 CStdString m_videoDefaultPlayer; -- -1.9.rc1 +1.9.0 -From ea332ee59dbd749528cad186d096d473632a40fc Mon Sep 17 00:00:00 2001 +From 112f6ea0e79408135cf9b0d546402b0f19ae00b9 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 18 Jan 2014 13:02:21 +0100 -Subject: [PATCH 92/97] vdpau: map/unmap surfaces on every cycle, requested by +Subject: [PATCH 92/96] vdpau: map/unmap surfaces on every cycle, requested by AMD --- @@ -11189,69 +11200,13 @@ index 2dd3c28..9f58e76 100644 bool CheckStatus(VdpStatus vdp_st, int line); CEvent m_outMsgEvent; -- -1.9.rc1 +1.9.0 -From 5fa323df32c740f4a9521d651de0fe57f8afd33a Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sun, 9 Feb 2014 15:50:53 +0100 -Subject: [PATCH 93/97] VAAPI: remove unneeded VASurfaceStatus - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -index cce40d2..d7c9863 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -@@ -620,10 +620,9 @@ void CDecoder::CheckUseFilter() - m_use_filter = false; - return; - } -- VASurfaceStatus surf_status; - VAImage image; - VASurfaceID surface = m_surfaces_free.front()->m_id; -- VAStatus status = status = vaDeriveImage(m_display->get(), surface, &image); -+ VAStatus status = vaDeriveImage(m_display->get(), surface, &image); - m_use_filter = true; - if (status != VA_STATUS_SUCCESS) - { --- -1.9.rc1 - - -From 69d224c84e597afbb26dfcfe9ff20588b29a031a Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Mon, 10 Feb 2014 23:04:55 +0100 -Subject: [PATCH 94/97] Settings: Readd toggle after merge (would not be - visible at all) - ---- - system/settings/settings.xml | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 7553396..1b29179 100644 ---- a/system/settings/settings.xml -+++ b/system/settings/settings.xml -@@ -513,6 +513,8 @@ - true - - 3 -+ false -+ - - - HAVE_LIBVA --- -1.9.rc1 - - -From 95cf4dce2bef8470f06cd1cc7cc88541829eb76f Mon Sep 17 00:00:00 2001 +From 400a66fb8ab5e0fd08fe9be4fccad1458d914d5f Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 11 Feb 2014 18:15:06 +0100 -Subject: [PATCH 95/97] ActiveAE: add some debug logging +Subject: [PATCH 93/96] ActiveAE: add some debug logging --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp | 6 ++++++ @@ -11276,43 +11231,39 @@ index 0287e73..6904cb9 100644 return copied; } -- -1.9.rc1 +1.9.0 -From 734b32b95f48526f78747b2c92c2e44d5eca9531 Mon Sep 17 00:00:00 2001 +From 5cc18a6bc551c73c43c5d7ce1290ccac5a36d9df Mon Sep 17 00:00:00 2001 From: fritsch -Date: Wed, 12 Feb 2014 08:05:15 +0100 -Subject: [PATCH 96/97] VAAPI: Only use swfilter when width <= 1920 and height - <= 1088 +Date: Mon, 24 Feb 2014 17:29:11 +0100 +Subject: [PATCH 94/96] Change swfilter to be visible in Advanced setting level --- - xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) + system/settings/settings.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -index d7c9863..51f9bed 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -@@ -404,7 +404,10 @@ bool CDecoder::Open(AVCodecContext *avctx, enum PixelFormat fmt, unsigned int su - if (!EnsureContext(avctx)) - return false; - -- CheckUseFilter(); -+ if (avctx->width <= 1920 && avctx->height <= 1088) -+ CheckUseFilter(); -+ else -+ m_use_filter = false; - - m_hwaccel->display = m_display->get(); - +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index 119d9ce..1f15396 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -521,7 +521,7 @@ + + true + +- 3 ++ 2 + false + + -- -1.9.rc1 +1.9.0 -From 27c2fcb4d6151a98727a7499a938630e5baa4e34 Mon Sep 17 00:00:00 2001 +From f84db770e82fede21b0217bfc8467a1538e4e6f8 Mon Sep 17 00:00:00 2001 From: Stefan Saraev -Date: Sat, 15 Feb 2014 14:54:29 +0200 -Subject: [PATCH 97/97] vaapi: fix build +Date: Mon, 24 Feb 2014 20:49:47 +0200 +Subject: [PATCH 95/96] vaapi: fix build --- xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 13 ++----------- @@ -11387,5 +11338,44 @@ index 3541c9c..49d3117 100644 namespace VAAPI { -- -1.9.rc1 +1.9.0 + + +From 248a0176e19a555c015c830c82df9c1ad102a468 Mon Sep 17 00:00:00 2001 +From: Stefan Saraev +Date: Mon, 24 Feb 2014 20:58:52 +0200 +Subject: [PATCH 96/96] no hevc in ffmpeg 1.2 + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index 7ab9d25..f2dcd8a 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -219,8 +219,11 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + break; + } + } ++ #ifdef AV_CODEC_ID_HEVC + else if (hints.codec == AV_CODEC_ID_HEVC) + m_isSWCodec = true; ++ #endif ++ + + if(pCodec == NULL) + pCodec = m_dllAvCodec.avcodec_find_decoder(hints.codec); +@@ -303,8 +306,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + int num_threads = std::min(8 /*MAX_THREADS*/, g_cpuInfo.getCPUCount()); + if( num_threads > 1 && !hints.software && m_pHardware == NULL // thumbnail extraction fails when run threaded + && ( pCodec->id == AV_CODEC_ID_H264 +- || pCodec->id == AV_CODEC_ID_MPEG4 +- || pCodec->id == AV_CODEC_ID_HEVC)) ++ || pCodec->id == AV_CODEC_ID_MPEG4 )) + m_pCodecContext->thread_count = num_threads; + + if (m_dllAvCodec.avcodec_open2(m_pCodecContext, pCodec, NULL) < 0) +-- +1.9.0 diff --git a/packages/mediacenter/xbmc/patches/xbmc-999-010-linux-static-ffmpeg.patch b/packages/mediacenter/xbmc/patches/xbmc-999-010-linux-static-ffmpeg.patch deleted file mode 100644 index 20921e32b4..0000000000 --- a/packages/mediacenter/xbmc/patches/xbmc-999-010-linux-static-ffmpeg.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff -Naur xbmc-13.alpha-65ad3ae/configure.in xbmc-13.alpha-65ad3ae.patch/configure.in ---- xbmc-13.alpha-65ad3ae/configure.in 2014-02-03 16:36:26.000000000 +0100 -+++ xbmc-13.alpha-65ad3ae.patch/configure.in 2014-02-05 02:38:47.233903531 +0100 -@@ -622,24 +622,22 @@ - use_sdl=no - use_x11=no - build_shared_lib=yes -- ;; -+ ;; - i*86*-linux-gnu*|i*86*-*-linux-uclibc*) - ARCH="i486-linux" - if test "$use_cpu" = "no" -a "$cross_compiling" = "yes"; then - use_arch="x86" - use_cpu="i686" -- else -- target_platform=target_linux - fi -+ use_static_ffmpeg=yes - ;; - x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*) - ARCH="x86_64-linux" - if test "$use_cpu" = "no" -a "$cross_compiling" = "yes"; then - use_arch="x86_64" - use_cpu="x86_64" -- else -- target_platform=target_linux - fi -+ use_static_ffmpeg=yes - ;; - i386-*-freebsd*) - ARCH="x86-freebsd" -@@ -695,6 +693,7 @@ - use_sdl=no - use_x11=no - use_wayland=no -+ use_static_ffmpeg=yes - ;; - arm*-*linux-android*) - target_platform=target_android -@@ -872,9 +871,8 @@ - fi - fi - fi --if test "$target_platform" = "target_linux"; then -+if test "$use_static_ffmpeg" = "yes"; then - USE_STATIC_FFMPEG=1 -- use_static_ffmpeg=yes - AC_DEFINE([USE_STATIC_FFMPEG], [1], [link ffmpeg statically]) - # ffmpeg may depend on gnutls and vorbisenc, we add those libs at the end of linker - # command in order to resolve any missing symbols -@@ -2795,7 +2793,6 @@ - LDFLAGS="$(echo "$LDFLAGS" | sed "s/-Wl,-Bsymbolic-functions//g")" \ - ./configure \ - --extra-cflags="$PASSED_CFLAGS $FFMPEG_EXTRACFLAGS" \ -- --disable-static \ - `if test "$use_debug" = "no"; then echo --disable-debug; fi` \ - `if test "$cross_compiling" = "yes"; then echo --enable-cross-compile; fi` \ - `if test "$use_arch" != "no"; then echo --arch=$use_arch; fi`\ -@@ -2819,7 +2816,7 @@ - --disable-ffserver \ - --disable-ffmpeg \ - --disable-crystalhd \ -- `if test "$use_static_ffmpeg" = "yes"; then echo --enable-static; else echo --enable-shared; fi` \ -+ `if test "$use_static_ffmpeg" = "yes"; then echo --enable-static --disable-shared; else echo --disable-static --enable-shared; fi` \ - --disable-doc \ - --enable-postproc \ - --enable-gpl \ diff --git a/packages/mediacenter/xbmc/patches/xbmc-999.80.004-PR4143.patch b/packages/mediacenter/xbmc/patches/xbmc-999.80.004-PR4143.patch deleted file mode 100644 index 49864eb779..0000000000 --- a/packages/mediacenter/xbmc/patches/xbmc-999.80.004-PR4143.patch +++ /dev/null @@ -1,3300 +0,0 @@ -From 6b8130456cd24fa6b658df3d7c3066400cd132f1 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Wed, 11 Dec 2013 17:21:54 +0000 -Subject: [PATCH 01/17] Move the reference-counting of Begin and End calls from - DX and GL source files into GUIFontTTF.cpp. - ---- - xbmc/guilib/GUIFontTTF.cpp | 21 ++++++++ - xbmc/guilib/GUIFontTTF.h | 6 ++- - xbmc/guilib/GUIFontTTFDX.cpp | 79 +++++++++++++---------------- - xbmc/guilib/GUIFontTTFDX.h | 4 +- - xbmc/guilib/GUIFontTTFGL.cpp | 118 +++++++++++++++++++------------------------ - xbmc/guilib/GUIFontTTFGL.h | 4 +- - 6 files changed, 117 insertions(+), 115 deletions(-) - -diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp -index 9c8e516..90b9c4a 100644 ---- a/xbmc/guilib/GUIFontTTF.cpp -+++ b/xbmc/guilib/GUIFontTTF.cpp -@@ -309,6 +309,27 @@ bool CGUIFontTTFBase::Load(const CStdString& strFilename, float height, float as - return true; - } - -+void CGUIFontTTFBase::Begin() -+{ -+ if (m_nestedBeginCount == 0 && m_texture != NULL && FirstBegin()) -+ { -+ m_vertex_count = 0; -+ } -+ // Keep track of the nested begin/end calls. -+ m_nestedBeginCount++; -+} -+ -+void CGUIFontTTFBase::End() -+{ -+ if (m_nestedBeginCount == 0) -+ return; -+ -+ if (--m_nestedBeginCount > 0) -+ return; -+ -+ LastEnd(); -+} -+ - void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors, const vecText &text, uint32_t alignment, float maxPixelWidth, bool scrolling) - { - Begin(); -diff --git a/xbmc/guilib/GUIFontTTF.h b/xbmc/guilib/GUIFontTTF.h -index 9723a43..c1c4507 100644 ---- a/xbmc/guilib/GUIFontTTF.h -+++ b/xbmc/guilib/GUIFontTTF.h -@@ -77,8 +77,8 @@ class CGUIFontTTFBase - - bool Load(const CStdString& strFilename, float height = 20.0f, float aspect = 1.0f, float lineSpacing = 1.0f, bool border = false); - -- virtual void Begin() = 0; -- virtual void End() = 0; -+ void Begin(); -+ void End(); - - const CStdString& GetFileName() const { return m_strFileName; }; - -@@ -169,6 +169,8 @@ class CGUIFontTTFBase - CStdString m_strFileName; - - private: -+ virtual bool FirstBegin() = 0; -+ virtual void LastEnd() = 0; - CGUIFontTTFBase(const CGUIFontTTFBase&); - CGUIFontTTFBase& operator=(const CGUIFontTTFBase&); - int m_referenceCount; -diff --git a/xbmc/guilib/GUIFontTTFDX.cpp b/xbmc/guilib/GUIFontTTFDX.cpp -index e3eba24..2f90668 100644 ---- a/xbmc/guilib/GUIFontTTFDX.cpp -+++ b/xbmc/guilib/GUIFontTTFDX.cpp -@@ -51,65 +51,56 @@ - free(m_index); - } - --void CGUIFontTTFDX::Begin() -+bool CGUIFontTTFDX::FirstBegin() - { - LPDIRECT3DDEVICE9 pD3DDevice = g_Windowing.Get3DDevice(); - - if (pD3DDevice == NULL) -+ { - CLog::Log(LOGERROR, __FUNCTION__" - failed to get Direct3D device"); -+ return false; -+ } - -- if (m_nestedBeginCount == 0 && pD3DDevice != NULL && m_texture != NULL) -+ int unit = 0; -+ // just have to blit from our texture. -+ m_texture->BindToUnit(unit); -+ pD3DDevice->SetTextureStageState( unit, D3DTSS_COLOROP, D3DTOP_SELECTARG1 ); // only use diffuse -+ pD3DDevice->SetTextureStageState( unit, D3DTSS_COLORARG1, D3DTA_DIFFUSE); -+ pD3DDevice->SetTextureStageState( unit, D3DTSS_ALPHAOP, D3DTOP_MODULATE ); -+ pD3DDevice->SetTextureStageState( unit, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); -+ pD3DDevice->SetTextureStageState( unit, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE); -+ unit++; -+ -+ if(g_Windowing.UseLimitedColor()) - { -- int unit = 0; -- // just have to blit from our texture. -- m_texture->BindToUnit(unit); -- pD3DDevice->SetTextureStageState( unit, D3DTSS_COLOROP, D3DTOP_SELECTARG1 ); // only use diffuse -- pD3DDevice->SetTextureStageState( unit, D3DTSS_COLORARG1, D3DTA_DIFFUSE); -- pD3DDevice->SetTextureStageState( unit, D3DTSS_ALPHAOP, D3DTOP_MODULATE ); -- pD3DDevice->SetTextureStageState( unit, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); -- pD3DDevice->SetTextureStageState( unit, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE); -+ pD3DDevice->SetTextureStageState( unit, D3DTSS_COLOROP , D3DTOP_ADD ); -+ pD3DDevice->SetTextureStageState( unit, D3DTSS_COLORARG1, D3DTA_CURRENT) ; -+ pD3DDevice->SetRenderState( D3DRS_TEXTUREFACTOR, D3DCOLOR_RGBA(16,16,16,0) ); -+ pD3DDevice->SetTextureStageState( unit, D3DTSS_COLORARG2, D3DTA_TFACTOR ); - unit++; -- -- if(g_Windowing.UseLimitedColor()) -- { -- pD3DDevice->SetTextureStageState( unit, D3DTSS_COLOROP , D3DTOP_ADD ); -- pD3DDevice->SetTextureStageState( unit, D3DTSS_COLORARG1, D3DTA_CURRENT) ; -- pD3DDevice->SetRenderState( D3DRS_TEXTUREFACTOR, D3DCOLOR_RGBA(16,16,16,0) ); -- pD3DDevice->SetTextureStageState( unit, D3DTSS_COLORARG2, D3DTA_TFACTOR ); -- unit++; -- } -- -- // no other texture stages needed -- pD3DDevice->SetTextureStageState( unit, D3DTSS_COLOROP, D3DTOP_DISABLE); -- pD3DDevice->SetTextureStageState( unit, D3DTSS_ALPHAOP, D3DTOP_DISABLE); -- -- pD3DDevice->SetRenderState( D3DRS_ZENABLE, FALSE ); -- pD3DDevice->SetRenderState( D3DRS_FOGENABLE, FALSE ); -- pD3DDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID ); -- pD3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE ); -- pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ); -- pD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA ); -- pD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); -- pD3DDevice->SetRenderState( D3DRS_LIGHTING, FALSE); -- -- pD3DDevice->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1); -- m_vertex_count = 0; - } - -- // Keep track of the nested begin/end calls. -- m_nestedBeginCount++; -+ // no other texture stages needed -+ pD3DDevice->SetTextureStageState( unit, D3DTSS_COLOROP, D3DTOP_DISABLE); -+ pD3DDevice->SetTextureStageState( unit, D3DTSS_ALPHAOP, D3DTOP_DISABLE); -+ -+ pD3DDevice->SetRenderState( D3DRS_ZENABLE, FALSE ); -+ pD3DDevice->SetRenderState( D3DRS_FOGENABLE, FALSE ); -+ pD3DDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID ); -+ pD3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE ); -+ pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ); -+ pD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA ); -+ pD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); -+ pD3DDevice->SetRenderState( D3DRS_LIGHTING, FALSE); -+ -+ pD3DDevice->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1); -+ return true; - } - --void CGUIFontTTFDX::End() -+void CGUIFontTTFDX::LastEnd() - { - LPDIRECT3DDEVICE9 pD3DDevice = g_Windowing.Get3DDevice(); - -- if (m_nestedBeginCount == 0) -- return; -- -- if (--m_nestedBeginCount > 0) -- return; -- - if (m_vertex_count == 0) - return; - -diff --git a/xbmc/guilib/GUIFontTTFDX.h b/xbmc/guilib/GUIFontTTFDX.h -index 0431085..17dfefe 100644 ---- a/xbmc/guilib/GUIFontTTFDX.h -+++ b/xbmc/guilib/GUIFontTTFDX.h -@@ -41,8 +41,8 @@ class CGUIFontTTFDX : public CGUIFontTTFBase - CGUIFontTTFDX(const CStdString& strFileName); - virtual ~CGUIFontTTFDX(void); - -- virtual void Begin(); -- virtual void End(); -+ virtual bool FirstBegin(); -+ virtual void LastEnd(); - - protected: - virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp -index 3358a5a..93b7ea6 100644 ---- a/xbmc/guilib/GUIFontTTFGL.cpp -+++ b/xbmc/guilib/GUIFontTTFGL.cpp -@@ -50,90 +50,78 @@ - { - } - --void CGUIFontTTFGL::Begin() -+bool CGUIFontTTFGL::FirstBegin() - { -- if (m_nestedBeginCount == 0 && m_texture != NULL) -+ if (!m_bTextureLoaded) - { -- if (!m_bTextureLoaded) -- { -- // Have OpenGL generate a texture object handle for us -- glGenTextures(1, (GLuint*) &m_nTexture); -+ // Have OpenGL generate a texture object handle for us -+ glGenTextures(1, (GLuint*) &m_nTexture); - -- // Bind the texture object -- glBindTexture(GL_TEXTURE_2D, m_nTexture); -+ // Bind the texture object -+ glBindTexture(GL_TEXTURE_2D, m_nTexture); - #ifdef HAS_GL -- glEnable(GL_TEXTURE_2D); -+ glEnable(GL_TEXTURE_2D); - #endif -- // Set the texture's stretching properties -- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -+ // Set the texture's stretching properties -+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - -- // Set the texture image -- THIS WORKS, so the pixels must be wrong. -- glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, m_texture->GetWidth(), m_texture->GetHeight(), 0, -- GL_ALPHA, GL_UNSIGNED_BYTE, m_texture->GetPixels()); -+ // Set the texture image -- THIS WORKS, so the pixels must be wrong. -+ glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, m_texture->GetWidth(), m_texture->GetHeight(), 0, -+ GL_ALPHA, GL_UNSIGNED_BYTE, m_texture->GetPixels()); - -- VerifyGLState(); -- m_bTextureLoaded = true; -- } -+ VerifyGLState(); -+ m_bTextureLoaded = true; -+ } - -- // Turn Blending On -- glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_ONE); -- glEnable(GL_BLEND); -+ // Turn Blending On -+ glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_ONE); -+ glEnable(GL_BLEND); - #ifdef HAS_GL -- glEnable(GL_TEXTURE_2D); -+ glEnable(GL_TEXTURE_2D); - #endif -- glBindTexture(GL_TEXTURE_2D, m_nTexture); -+ glBindTexture(GL_TEXTURE_2D, m_nTexture); - - #ifdef HAS_GL -- glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE); -- glTexEnvi(GL_TEXTURE_ENV,GL_COMBINE_RGB,GL_REPLACE); -- glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PRIMARY_COLOR); -- glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); -- glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE); -- glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_TEXTURE0); -- glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA); -- glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA, GL_PRIMARY_COLOR); -- glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA); -- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); -- VerifyGLState(); -+ glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE); -+ glTexEnvi(GL_TEXTURE_ENV,GL_COMBINE_RGB,GL_REPLACE); -+ glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PRIMARY_COLOR); -+ glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); -+ glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE); -+ glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_TEXTURE0); -+ glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA); -+ glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA, GL_PRIMARY_COLOR); -+ glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA); -+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); -+ VerifyGLState(); -+ -+ if(g_Windowing.UseLimitedColor()) -+ { -+ glActiveTexture(GL_TEXTURE1); -+ glBindTexture(GL_TEXTURE_2D, m_nTexture); // dummy bind -+ glEnable(GL_TEXTURE_2D); - -- if(g_Windowing.UseLimitedColor()) -- { -- glActiveTexture(GL_TEXTURE1); -- glBindTexture(GL_TEXTURE_2D, m_nTexture); // dummy bind -- glEnable(GL_TEXTURE_2D); -- -- const GLfloat rgba[4] = {16.0f / 255.0f, 16.0f / 255.0f, 16.0f / 255.0f, 0.0f}; -- glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE , GL_COMBINE); -- glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, rgba); -- glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB , GL_ADD); -- glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB , GL_PREVIOUS); -- glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE1_RGB , GL_CONSTANT); -- glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB , GL_SRC_COLOR); -- glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND1_RGB , GL_SRC_COLOR); -- glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_ALPHA , GL_REPLACE); -- glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_ALPHA , GL_PREVIOUS); -- VerifyGLState(); -- } -+ const GLfloat rgba[4] = {16.0f / 255.0f, 16.0f / 255.0f, 16.0f / 255.0f, 0.0f}; -+ glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE , GL_COMBINE); -+ glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, rgba); -+ glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB , GL_ADD); -+ glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB , GL_PREVIOUS); -+ glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE1_RGB , GL_CONSTANT); -+ glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB , GL_SRC_COLOR); -+ glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND1_RGB , GL_SRC_COLOR); -+ glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_ALPHA , GL_REPLACE); -+ glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_ALPHA , GL_PREVIOUS); -+ VerifyGLState(); -+ } - - #else -- g_Windowing.EnableGUIShader(SM_FONTS); -+ g_Windowing.EnableGUIShader(SM_FONTS); - #endif -- -- m_vertex_count = 0; -- } -- // Keep track of the nested begin/end calls. -- m_nestedBeginCount++; -+ return true; - } - --void CGUIFontTTFGL::End() -+void CGUIFontTTFGL::LastEnd() - { -- if (m_nestedBeginCount == 0) -- return; -- -- if (--m_nestedBeginCount > 0) -- return; -- - #ifdef HAS_GL - glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); - -diff --git a/xbmc/guilib/GUIFontTTFGL.h b/xbmc/guilib/GUIFontTTFGL.h -index a0dacba..6736cf7 100644 ---- a/xbmc/guilib/GUIFontTTFGL.h -+++ b/xbmc/guilib/GUIFontTTFGL.h -@@ -41,8 +41,8 @@ class CGUIFontTTFGL : public CGUIFontTTFBase - CGUIFontTTFGL(const CStdString& strFileName); - virtual ~CGUIFontTTFGL(void); - -- virtual void Begin(); -- virtual void End(); -+ virtual bool FirstBegin(); -+ virtual void LastEnd(); - - protected: - virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); --- -1.8.5.1 - - -From 7f031c9813202a6cbdca46ef1d95c9a2476b6533 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Wed, 11 Dec 2013 18:47:54 +0000 -Subject: [PATCH 02/17] Convert CGUIFontTTFBase::m_vertex to be managed as a - std::vector. Also retired CGUIFontTTFBase::m_vertex_count and - CGUIFontTTFBase::m_vertex_size because these can be derived from vector - member functions. - ---- - xbmc/guilib/GUIFontTTF.cpp | 29 +++++------------------------ - xbmc/guilib/GUIFontTTF.h | 4 +--- - xbmc/guilib/GUIFontTTFDX.cpp | 12 ++++++------ - xbmc/guilib/GUIFontTTFGL.cpp | 12 ++++++------ - 4 files changed, 18 insertions(+), 39 deletions(-) - -diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp -index 90b9c4a..3f219d9 100644 ---- a/xbmc/guilib/GUIFontTTF.cpp -+++ b/xbmc/guilib/GUIFontTTF.cpp -@@ -139,8 +139,7 @@ class CFreeTypeLibrary - m_nestedBeginCount = 0; - - m_bTextureLoaded = false; -- m_vertex_size = 4*1024; -- m_vertex = (SVertex*)malloc(m_vertex_size * sizeof(SVertex)); -+ m_vertex.reserve(4*1024); - - m_face = NULL; - m_stroker = NULL; -@@ -155,7 +154,6 @@ class CFreeTypeLibrary - m_textureScaleX = m_textureScaleY = 0.0; - m_ellipsesWidth = m_height = 0.0f; - m_color = 0; -- m_vertex_count = 0; - m_nTexture = 0; - } - -@@ -216,9 +214,7 @@ void CGUIFontTTFBase::Clear() - g_freeTypeLibrary.ReleaseStroker(m_stroker); - m_stroker = NULL; - -- free(m_vertex); -- m_vertex = NULL; -- m_vertex_count = 0; -+ m_vertex.clear(); - } - - bool CGUIFontTTFBase::Load(const CStdString& strFilename, float height, float aspect, float lineSpacing, bool border) -@@ -313,7 +309,7 @@ void CGUIFontTTFBase::Begin() - { - if (m_nestedBeginCount == 0 && m_texture != NULL && FirstBegin()) - { -- m_vertex_count = 0; -+ m_vertex.clear(); - } - // Keep track of the nested begin/end calls. - m_nestedBeginCount++; -@@ -746,22 +742,9 @@ void CGUIFontTTFBase::RenderCharacter(float posX, float posY, const Character *c - float tt = texture.y1 * m_textureScaleY; - float tb = texture.y2 * m_textureScaleY; - -- // grow the vertex buffer if required -- if(m_vertex_count >= m_vertex_size) -- { -- m_vertex_size *= 2; -- void* old = m_vertex; -- m_vertex = (SVertex*)realloc(m_vertex, m_vertex_size * sizeof(SVertex)); -- if (!m_vertex) -- { -- free(old); -- CLog::Log(LOGSEVERE, "%s: can't allocate %"PRIdS" bytes for texture", __FUNCTION__ , m_vertex_size * sizeof(SVertex)); -- return; -- } -- } -- -+ m_vertex.resize(m_vertex.size() + 4); -+ SVertex* v = &m_vertex[m_vertex.size() - 4]; - m_color = color; -- SVertex* v = m_vertex + m_vertex_count; - - unsigned char r = GET_R(color) - , g = GET_G(color) -@@ -828,8 +811,6 @@ void CGUIFontTTFBase::RenderCharacter(float posX, float posY, const Character *c - v[3].y = y[2]; - v[3].z = z[2]; - #endif -- -- m_vertex_count+=4; - } - - // Oblique code - original taken from freetype2 (ftsynth.c) -diff --git a/xbmc/guilib/GUIFontTTF.h b/xbmc/guilib/GUIFontTTF.h -index c1c4507..35e3cf9 100644 ---- a/xbmc/guilib/GUIFontTTF.h -+++ b/xbmc/guilib/GUIFontTTF.h -@@ -157,9 +157,7 @@ class CGUIFontTTFBase - bool m_bTextureLoaded; - unsigned int m_nTexture; - -- SVertex* m_vertex; -- int m_vertex_count; -- int m_vertex_size; -+ std::vector m_vertex; - - float m_textureScaleX; - float m_textureScaleY; -diff --git a/xbmc/guilib/GUIFontTTFDX.cpp b/xbmc/guilib/GUIFontTTFDX.cpp -index 2f90668..6ef8984 100644 ---- a/xbmc/guilib/GUIFontTTFDX.cpp -+++ b/xbmc/guilib/GUIFontTTFDX.cpp -@@ -101,17 +101,17 @@ void CGUIFontTTFDX::LastEnd() - { - LPDIRECT3DDEVICE9 pD3DDevice = g_Windowing.Get3DDevice(); - -- if (m_vertex_count == 0) -+ if (m_vertex.size() == 0) - return; - -- unsigned index_size = m_vertex_size * 6 / 4; -+ unsigned index_size = m_vertex.capacity() * 6 / 4; - if(m_index_size < index_size) - { - uint16_t* id = (uint16_t*)calloc(index_size, sizeof(uint16_t)); - if(id == NULL) - return; - -- for(int i = 0, b = 0; i < m_vertex_size; i += 4, b += 6) -+ for(int i = 0, b = 0; i < m_vertex.capacity(); i += 4, b += 6) - { - id[b+0] = i + 0; - id[b+1] = i + 1; -@@ -140,11 +140,11 @@ void CGUIFontTTFDX::LastEnd() - - pD3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST - , 0 -- , m_vertex_count -- , m_vertex_count / 2 -+ , m_vertex.size() -+ , m_vertex.size() / 2 - , m_index - , D3DFMT_INDEX16 -- , m_vertex -+ , &m_vertex[0] - , sizeof(SVertex)); - pD3DDevice->SetTransform(D3DTS_WORLD, &orig); - -diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp -index 93b7ea6..a4e8571 100644 ---- a/xbmc/guilib/GUIFontTTFGL.cpp -+++ b/xbmc/guilib/GUIFontTTFGL.cpp -@@ -125,13 +125,13 @@ void CGUIFontTTFGL::LastEnd() - #ifdef HAS_GL - glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); - -- glColorPointer (4, GL_UNSIGNED_BYTE, sizeof(SVertex), (char*)m_vertex + offsetof(SVertex, r)); -- glVertexPointer (3, GL_FLOAT , sizeof(SVertex), (char*)m_vertex + offsetof(SVertex, x)); -- glTexCoordPointer(2, GL_FLOAT , sizeof(SVertex), (char*)m_vertex + offsetof(SVertex, u)); -+ glColorPointer (4, GL_UNSIGNED_BYTE, sizeof(SVertex), (char*)&m_vertex[0] + offsetof(SVertex, r)); -+ glVertexPointer (3, GL_FLOAT , sizeof(SVertex), (char*)&m_vertex[0] + offsetof(SVertex, x)); -+ glTexCoordPointer(2, GL_FLOAT , sizeof(SVertex), (char*)&m_vertex[0] + offsetof(SVertex, u)); - glEnableClientState(GL_COLOR_ARRAY); - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); -- glDrawArrays(GL_QUADS, 0, m_vertex_count); -+ glDrawArrays(GL_QUADS, 0, m_vertex.size()); - glPopClientAttrib(); - - glActiveTexture(GL_TEXTURE1); -@@ -147,10 +147,10 @@ void CGUIFontTTFGL::LastEnd() - GLint tex0Loc = g_Windowing.GUIShaderGetCoord0(); - - // stack object until VBOs will be used -- std::vector vecVertices( 6 * (m_vertex_count / 4) ); -+ std::vector vecVertices( 6 * (m_vertex.size() / 4) ); - SVertex *vertices = &vecVertices[0]; - -- for (int i=0; i -Date: Mon, 16 Dec 2013 18:58:12 +0000 -Subject: [PATCH 03/17] CGUIFontTTFBase::RenderCharacter can now append to - arbitrary vectors of vertices rather than only CGUIFontTTFBase::m_vertex - ---- - xbmc/guilib/GUIFontTTF.cpp | 12 +++++++----- - xbmc/guilib/GUIFontTTF.h | 2 +- - 2 files changed, 8 insertions(+), 6 deletions(-) - -diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp -index 3f219d9..1aaf68b 100644 ---- a/xbmc/guilib/GUIFontTTF.cpp -+++ b/xbmc/guilib/GUIFontTTF.cpp -@@ -330,6 +330,8 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors - { - Begin(); - -+ std::vector &vertices = m_vertex; -+ - // save the origin, which is scaled separately - m_originX = x; - m_originY = y; -@@ -410,7 +412,7 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors - - for (int i = 0; i < 3; i++) - { -- RenderCharacter(startX + cursorX, startY, period, color, !scrolling); -+ RenderCharacter(startX + cursorX, startY, period, color, !scrolling, vertices); - cursorX += period->advance; - } - break; -@@ -419,7 +421,7 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors - else if (maxPixelWidth > 0 && cursorX > maxPixelWidth) - break; // exceeded max allowed width - stop rendering - -- RenderCharacter(startX + cursorX, startY, ch, color, !scrolling); -+ RenderCharacter(startX + cursorX, startY, ch, color, !scrolling, vertices); - if ( alignment & XBFONT_JUSTIFIED ) - { - if ((*pos & 0xffff) == L' ') -@@ -676,7 +678,7 @@ bool CGUIFontTTFBase::CacheCharacter(wchar_t letter, uint32_t style, Character * - return true; - } - --void CGUIFontTTFBase::RenderCharacter(float posX, float posY, const Character *ch, color_t color, bool roundX) -+void CGUIFontTTFBase::RenderCharacter(float posX, float posY, const Character *ch, color_t color, bool roundX, std::vector &vertices) - { - // actual image width isn't same as the character width as that is - // just baseline width and height should include the descent -@@ -742,8 +744,8 @@ void CGUIFontTTFBase::RenderCharacter(float posX, float posY, const Character *c - float tt = texture.y1 * m_textureScaleY; - float tb = texture.y2 * m_textureScaleY; - -- m_vertex.resize(m_vertex.size() + 4); -- SVertex* v = &m_vertex[m_vertex.size() - 4]; -+ vertices.resize(vertices.size() + 4); -+ SVertex* v = &vertices[vertices.size() - 4]; - m_color = color; - - unsigned char r = GET_R(color) -diff --git a/xbmc/guilib/GUIFontTTF.h b/xbmc/guilib/GUIFontTTF.h -index 35e3cf9..4a6a696 100644 ---- a/xbmc/guilib/GUIFontTTF.h -+++ b/xbmc/guilib/GUIFontTTF.h -@@ -109,7 +109,7 @@ class CGUIFontTTFBase - // Stuff for pre-rendering for speed - inline Character *GetCharacter(character_t letter); - bool CacheCharacter(wchar_t letter, uint32_t style, Character *ch); -- void RenderCharacter(float posX, float posY, const Character *ch, color_t color, bool roundX); -+ void RenderCharacter(float posX, float posY, const Character *ch, color_t color, bool roundX, std::vector &vertices); - void ClearCharacterCache(); - - virtual CBaseTexture* ReallocTexture(unsigned int& newHeight) = 0; --- -1.8.5.1 - - -From a46ceb87785e051b670340feb30d15050b060bfd Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Wed, 15 Jan 2014 17:18:38 +0000 -Subject: [PATCH 04/17] Add a cache of font glyph bounding box vertices. This - is implemented as a template because ultimately we will key on different - parameters and store values of different types, depending upon whether we - have a GLES or non-GLES backend, and for GLES, whether or not the currently - applicable transformation matrices permit the use of hardware clipping. - ---- - xbmc/guilib/GUIFontCache.cpp | 105 ++++++++++++++++++++ - xbmc/guilib/GUIFontCache.h | 217 ++++++++++++++++++++++++++++++++++++++++++ - xbmc/guilib/GUIFontTTF.cpp | 181 +++++++++++++++++++---------------- - xbmc/guilib/GUIFontTTF.h | 5 + - xbmc/guilib/GUIFontTTFGL.cpp | 1 + - xbmc/guilib/GraphicContext.h | 1 + - xbmc/guilib/Makefile.in | 1 + - xbmc/guilib/TransformMatrix.h | 11 +++ - 8 files changed, 438 insertions(+), 84 deletions(-) - create mode 100644 xbmc/guilib/GUIFontCache.cpp - create mode 100644 xbmc/guilib/GUIFontCache.h - -diff --git a/xbmc/guilib/GUIFontCache.cpp b/xbmc/guilib/GUIFontCache.cpp -new file mode 100644 -index 0000000..c029713 ---- /dev/null -+++ b/xbmc/guilib/GUIFontCache.cpp -@@ -0,0 +1,105 @@ -+/* -+ * Copyright (C) 2005-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * 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 -+#include -+#include "utils/StdString.h" // required by GUIFontTTF.h -+#include "GUIFontTTF.h" -+#include "GraphicContext.h" -+ -+template -+void CGUIFontCacheEntry::Reassign::operator()(CGUIFontCacheEntry &entry) -+{ -+ entry.m_key.m_pos = m_key.m_pos; -+ entry.m_key.m_colors.assign(m_key.m_colors.begin(), m_key.m_colors.end()); -+ entry.m_key.m_text.assign(m_key.m_text.begin(), m_key.m_text.end()); -+ entry.m_key.m_alignment = m_key.m_alignment; -+ entry.m_key.m_maxPixelWidth = m_key.m_maxPixelWidth; -+ entry.m_key.m_scrolling = m_key.m_scrolling; -+ entry.m_matrix = m_key.m_matrix; -+ entry.m_key.m_scaleX = m_key.m_scaleX; -+ entry.m_key.m_scaleY = m_key.m_scaleY; -+ -+ entry.m_lastUsedMillis = m_nowMillis; -+ entry.m_value.clear(); -+} -+ -+template -+CGUIFontCacheEntry::~CGUIFontCacheEntry() -+{ -+ delete &m_key.m_colors; -+ delete &m_key.m_text; -+ m_value.clear(); -+} -+ -+template -+Value &CGUIFontCache::Lookup(Position &pos, -+ const vecColors &colors, const vecText &text, -+ uint32_t alignment, float maxPixelWidth, -+ bool scrolling, -+ unsigned int nowMillis, bool &dirtyCache) -+{ -+ const CGUIFontCacheKey key(pos, -+ const_cast(colors), const_cast(text), -+ alignment, maxPixelWidth, -+ scrolling, g_graphicsContext.GetGUIMatrix(), -+ g_graphicsContext.GetGUIScaleX(), g_graphicsContext.GetGUIScaleY()); -+ EntryHashIterator i = m_list.get().find(key); -+ if (i == m_list.get().end()) -+ { -+ /* Cache miss */ -+ EntryAgeIterator oldest = m_list.get().begin(); -+ if (!m_list.get().empty() && nowMillis - oldest->m_lastUsedMillis > FONT_CACHE_TIME_LIMIT) -+ { -+ /* The oldest existing entry is old enough to expire and reuse */ -+ m_list.get().modify(m_list.project(oldest), typename CGUIFontCacheEntry::Reassign(key, nowMillis)); -+ m_list.get().relocate(m_list.get().end(), oldest); -+ } -+ else -+ { -+ /* We need a new entry instead */ -+ /* Yes, this causes the creation an destruction of a temporary entry, but -+ * this code ought to only be used infrequently, when the cache needs to grow */ -+ m_list.get().push_back(CGUIFontCacheEntry(*this, key, nowMillis)); -+ } -+ dirtyCache = true; -+ return (--m_list.get().end())->m_value; -+ } -+ else -+ { -+ /* Cache hit */ -+ /* Update time in entry and move to the back of the list */ -+ i->m_lastUsedMillis = nowMillis; -+ m_list.get().relocate(m_list.get().end(), m_list.project(i)); -+ dirtyCache = false; -+ return i->m_value; -+ } -+} -+ -+template -+void CGUIFontCache::Flush() -+{ -+ m_list.get().clear(); -+} -+ -+template void CGUIFontCacheEntry::Reassign::operator()(CGUIFontCacheEntry &entry); -+template CGUIFontCacheEntry::~CGUIFontCacheEntry(); -+template CGUIFontCacheStaticValue &CGUIFontCache::Lookup(CGUIFontCacheStaticPosition &, const vecColors &, const vecText &, uint32_t, float, bool, unsigned int, bool &); -+template void CGUIFontCache::Flush(); -diff --git a/xbmc/guilib/GUIFontCache.h b/xbmc/guilib/GUIFontCache.h -new file mode 100644 -index 0000000..ef65845 ---- /dev/null -+++ b/xbmc/guilib/GUIFontCache.h -@@ -0,0 +1,217 @@ -+/*! -+\file GUIFontCache.h -+\brief -+*/ -+ -+#ifndef CGUILIB_GUIFONTCACHE_H -+#define CGUILIB_GUIFONTCACHE_H -+#pragma once -+ -+/* -+ * Copyright (C) 2005-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * 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 -+#include -+#include -+ -+#include -+#include -+ -+#include "boost/multi_index_container.hpp" -+#include "boost/multi_index/sequenced_index.hpp" -+#include "boost/multi_index/hashed_index.hpp" -+#include "boost/multi_index/member.hpp" -+ -+#include "TransformMatrix.h" -+ -+using namespace boost::multi_index; -+ -+#define FONT_CACHE_TIME_LIMIT (1000) -+ -+template class CGUIFontCache; -+class CGUIFontTTFBase; -+ -+template -+struct CGUIFontCacheKey -+{ -+ Position m_pos; -+ vecColors &m_colors; -+ vecText &m_text; -+ uint32_t m_alignment; -+ float m_maxPixelWidth; -+ bool m_scrolling; -+ const TransformMatrix &m_matrix; -+ float m_scaleX; -+ float m_scaleY; -+ -+ CGUIFontCacheKey(Position pos, -+ vecColors &colors, vecText &text, -+ uint32_t alignment, float maxPixelWidth, -+ bool scrolling, const TransformMatrix &matrix, -+ float scaleX, float scaleY) : -+ m_pos(pos), -+ m_colors(colors), m_text(text), -+ m_alignment(alignment), m_maxPixelWidth(maxPixelWidth), -+ m_scrolling(scrolling), m_matrix(matrix), -+ m_scaleX(scaleX), m_scaleY(scaleY) -+ {} -+}; -+ -+template -+struct CGUIFontCacheEntry -+{ -+ const CGUIFontCache &m_cache; -+ CGUIFontCacheKey m_key; -+ TransformMatrix m_matrix; -+ -+ /* These need to be declared as mutable to get round the fact that only -+ * const iterators are available. These fields do not affect comparison or -+ * hash functors, so from the container's point of view, they are mutable. */ -+ mutable unsigned int m_lastUsedMillis; -+ mutable Value m_value; -+ -+ CGUIFontCacheEntry(const CGUIFontCache &cache, const CGUIFontCacheKey &key, unsigned int nowMillis) : -+ m_cache(cache), -+ m_key(key.m_pos, -+ *new vecColors, *new vecText, -+ key.m_alignment, key.m_maxPixelWidth, -+ key.m_scrolling, m_matrix, -+ key.m_scaleX, key.m_scaleY), -+ m_lastUsedMillis(nowMillis) -+ { -+ m_key.m_colors.assign(key.m_colors.begin(), key.m_colors.end()); -+ m_key.m_text.assign(key.m_text.begin(), key.m_text.end()); -+ m_matrix = key.m_matrix; -+ } -+ -+ CGUIFontCacheEntry(const CGUIFontCacheEntry &other) : -+ m_cache(other.m_cache), -+ m_key(other.m_key.m_pos, -+ *new vecColors, *new vecText, -+ other.m_key.m_alignment, other.m_key.m_maxPixelWidth, -+ other.m_key.m_scrolling, m_matrix, -+ other.m_key.m_scaleX, other.m_key.m_scaleY), -+ m_lastUsedMillis(other.m_lastUsedMillis), -+ m_value(other.m_value) -+ { -+ m_key.m_colors.assign(other.m_key.m_colors.begin(), other.m_key.m_colors.end()); -+ m_key.m_text.assign(other.m_key.m_text.begin(), other.m_key.m_text.end()); -+ m_matrix = other.m_key.m_matrix; -+ } -+ -+ struct Reassign -+ { -+ Reassign(const CGUIFontCacheKey &key, unsigned int nowMillis) : m_key(key), m_nowMillis(nowMillis) {} -+ void operator()(CGUIFontCacheEntry &entry); -+ private: -+ const CGUIFontCacheKey &m_key; -+ unsigned int m_nowMillis; -+ }; -+ -+ ~CGUIFontCacheEntry(); -+}; -+ -+template -+struct CGUIFontCacheHash -+{ -+ size_t operator()(const CGUIFontCacheKey &key) const -+ { -+ /* Not much effort has gone into choosing this hash function */ -+ size_t hash = 0, i; -+ for (i = 0; i < 3 && i < key.m_text.size(); ++i) -+ hash += key.m_text[i]; -+ if (key.m_colors.size()) -+ hash += key.m_colors[0]; -+ hash += MatrixHashContribution(key); -+ return hash; -+ } -+}; -+ -+template -+struct CGUIFontCacheKeysMatch -+{ -+ bool operator()(const CGUIFontCacheKey &a, const CGUIFontCacheKey &b) const -+ { -+ return a.m_text == b.m_text && -+ a.m_colors == b.m_colors && -+ a.m_alignment == b.m_alignment && -+ a.m_scrolling == b.m_scrolling && -+ a.m_maxPixelWidth == b.m_maxPixelWidth && -+ Match(a.m_pos, a.m_matrix, b.m_pos, b.m_matrix, a.m_scrolling) && -+ a.m_scaleX == b.m_scaleX && -+ a.m_scaleY == b.m_scaleY; -+ } -+}; -+ -+template -+class CGUIFontCache -+{ -+ /* Empty structs used as tags to identify indexes */ -+ struct Age {}; -+ struct Hash {}; -+ -+ typedef multi_index_container< -+ CGUIFontCacheEntry, -+ indexed_by< -+ sequenced >, -+ hashed_unique, member, CGUIFontCacheKey, &CGUIFontCacheEntry::m_key>, CGUIFontCacheHash, CGUIFontCacheKeysMatch > -+ > -+ > EntryList; -+ -+ typedef typename EntryList::template index::type::iterator EntryAgeIterator; -+ typedef typename EntryList::template index::type::iterator EntryHashIterator; -+ -+ EntryList m_list; -+ -+public: -+ const CGUIFontTTFBase &m_font; -+ -+ CGUIFontCache(CGUIFontTTFBase &font) : m_font(font) {} -+ Value &Lookup(Position &pos, -+ const vecColors &colors, const vecText &text, -+ uint32_t alignment, float maxPixelWidth, -+ bool scrolling, -+ unsigned int nowMillis, bool &dirtyCache); -+ void Flush(); -+}; -+ -+struct CGUIFontCacheStaticPosition -+{ -+ float m_x; -+ float m_y; -+ CGUIFontCacheStaticPosition(float x, float y) : m_x(x), m_y(y) {} -+}; -+ -+typedef std::vector CGUIFontCacheStaticValue; -+ -+inline bool Match(const CGUIFontCacheStaticPosition &a, const TransformMatrix &a_m, -+ const CGUIFontCacheStaticPosition &b, const TransformMatrix &b_m, -+ bool scrolling) -+{ -+ return a.m_x == b.m_x && a.m_y == b.m_y && a_m == b_m; -+} -+ -+inline float MatrixHashContribution(const CGUIFontCacheKey &a) -+{ -+ /* Ensure horizontally translated versions end up in different buckets */ -+ return a.m_matrix.m[0][3]; -+} -+ -+#endif -diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp -index 1aaf68b..288e61a 100644 ---- a/xbmc/guilib/GUIFontTTF.cpp -+++ b/xbmc/guilib/GUIFontTTF.cpp -@@ -27,6 +27,7 @@ - #include "utils/MathUtils.h" - #include "utils/log.h" - #include "windowing/WindowingFactory.h" -+#include "threads/SystemClock.h" - - #include - -@@ -131,7 +132,7 @@ class CFreeTypeLibrary - XBMC_GLOBAL_REF(CFreeTypeLibrary, g_freeTypeLibrary); // our freetype library - #define g_freeTypeLibrary XBMC_GLOBAL_USE(CFreeTypeLibrary) - --CGUIFontTTFBase::CGUIFontTTFBase(const CStdString& strFileName) -+CGUIFontTTFBase::CGUIFontTTFBase(const CStdString& strFileName) : m_staticCache(*this) - { - m_texture = NULL; - m_char = NULL; -@@ -330,108 +331,120 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors - { - Begin(); - -- std::vector &vertices = m_vertex; -- -- // save the origin, which is scaled separately -- m_originX = x; -- m_originY = y; -- -- // Check if we will really need to truncate or justify the text -- if ( alignment & XBFONT_TRUNCATED ) -+ bool dirtyCache; -+ CGUIFontCacheStaticPosition staticPos(x, y); -+ std::vector &vertices = m_staticCache.Lookup(staticPos, -+ colors, text, -+ alignment, maxPixelWidth, -+ scrolling, -+ XbmcThreads::SystemClockMillis(), -+ dirtyCache); -+ if (dirtyCache) - { -- if ( maxPixelWidth <= 0.0f || GetTextWidthInternal(text.begin(), text.end()) <= maxPixelWidth) -- alignment &= ~XBFONT_TRUNCATED; -- } -- else if ( alignment & XBFONT_JUSTIFIED ) -- { -- if ( maxPixelWidth <= 0.0f ) -- alignment &= ~XBFONT_JUSTIFIED; -- } -+ // save the origin, which is scaled separately -+ m_originX = x; -+ m_originY = y; - -- // calculate sizing information -- float startX = 0; -- float startY = (alignment & XBFONT_CENTER_Y) ? -0.5f*m_cellHeight : 0; // vertical centering -+ // Check if we will really need to truncate or justify the text -+ if ( alignment & XBFONT_TRUNCATED ) -+ { -+ if ( maxPixelWidth <= 0.0f || GetTextWidthInternal(text.begin(), text.end()) <= maxPixelWidth) -+ alignment &= ~XBFONT_TRUNCATED; -+ } -+ else if ( alignment & XBFONT_JUSTIFIED ) -+ { -+ if ( maxPixelWidth <= 0.0f ) -+ alignment &= ~XBFONT_JUSTIFIED; -+ } - -- if ( alignment & (XBFONT_RIGHT | XBFONT_CENTER_X) ) -- { -- // Get the extent of this line -- float w = GetTextWidthInternal( text.begin(), text.end() ); -+ // calculate sizing information -+ float startX = 0; -+ float startY = (alignment & XBFONT_CENTER_Y) ? -0.5f*m_cellHeight : 0; // vertical centering - -- if ( alignment & XBFONT_TRUNCATED && w > maxPixelWidth + 0.5f ) // + 0.5f due to rounding issues -- w = maxPixelWidth; -+ if ( alignment & (XBFONT_RIGHT | XBFONT_CENTER_X) ) -+ { -+ // Get the extent of this line -+ float w = GetTextWidthInternal( text.begin(), text.end() ); - -- if ( alignment & XBFONT_CENTER_X) -- w *= 0.5f; -- // Offset this line's starting position -- startX -= w; -- } -+ if ( alignment & XBFONT_TRUNCATED && w > maxPixelWidth + 0.5f ) // + 0.5f due to rounding issues -+ w = maxPixelWidth; - -- float spacePerLetter = 0; // for justification effects -- if ( alignment & XBFONT_JUSTIFIED ) -- { -- // first compute the size of the text to render in both characters and pixels -- unsigned int lineChars = 0; -- float linePixels = 0; -- for (vecText::const_iterator pos = text.begin(); pos != text.end(); ++pos) -+ if ( alignment & XBFONT_CENTER_X) -+ w *= 0.5f; -+ // Offset this line's starting position -+ startX -= w; -+ } -+ -+ float spacePerLetter = 0; // for justification effects -+ if ( alignment & XBFONT_JUSTIFIED ) - { -- Character *ch = GetCharacter(*pos); -- if (ch) -- { // spaces have multiple times the justification spacing of normal letters -- lineChars += ((*pos & 0xffff) == L' ') ? justification_word_weight : 1; -- linePixels += ch->advance; -+ // first compute the size of the text to render in both characters and pixels -+ unsigned int lineChars = 0; -+ float linePixels = 0; -+ for (vecText::const_iterator pos = text.begin(); pos != text.end(); ++pos) -+ { -+ Character *ch = GetCharacter(*pos); -+ if (ch) -+ { // spaces have multiple times the justification spacing of normal letters -+ lineChars += ((*pos & 0xffff) == L' ') ? justification_word_weight : 1; -+ linePixels += ch->advance; -+ } - } -+ if (lineChars > 1) -+ spacePerLetter = (maxPixelWidth - linePixels) / (lineChars - 1); - } -- if (lineChars > 1) -- spacePerLetter = (maxPixelWidth - linePixels) / (lineChars - 1); -- } -- float cursorX = 0; // current position along the line -- -- for (vecText::const_iterator pos = text.begin(); pos != text.end(); ++pos) -- { -- // If starting text on a new line, determine justification effects -- // Get the current letter in the CStdString -- color_t color = (*pos & 0xff0000) >> 16; -- if (color >= colors.size()) -- color = 0; -- color = colors[color]; -+ float cursorX = 0; // current position along the line - -- // grab the next character -- Character *ch = GetCharacter(*pos); -- if (!ch) continue; -- -- if ( alignment & XBFONT_TRUNCATED ) -+ for (vecText::const_iterator pos = text.begin(); pos != text.end(); ++pos) - { -- // Check if we will be exceeded the max allowed width -- if ( cursorX + ch->advance + 3 * m_ellipsesWidth > maxPixelWidth ) -- { -- // Yup. Let's draw the ellipses, then bail -- // Perhaps we should really bail to the next line in this case?? -- Character *period = GetCharacter(L'.'); -- if (!period) -- break; -+ // If starting text on a new line, determine justification effects -+ // Get the current letter in the CStdString -+ color_t color = (*pos & 0xff0000) >> 16; -+ if (color >= colors.size()) -+ color = 0; -+ color = colors[color]; -+ -+ // grab the next character -+ Character *ch = GetCharacter(*pos); -+ if (!ch) continue; - -- for (int i = 0; i < 3; i++) -+ if ( alignment & XBFONT_TRUNCATED ) -+ { -+ // Check if we will be exceeded the max allowed width -+ if ( cursorX + ch->advance + 3 * m_ellipsesWidth > maxPixelWidth ) - { -- RenderCharacter(startX + cursorX, startY, period, color, !scrolling, vertices); -- cursorX += period->advance; -+ // Yup. Let's draw the ellipses, then bail -+ // Perhaps we should really bail to the next line in this case?? -+ Character *period = GetCharacter(L'.'); -+ if (!period) -+ break; -+ -+ for (int i = 0; i < 3; i++) -+ { -+ RenderCharacter(startX + cursorX, startY, period, color, !scrolling, vertices); -+ cursorX += period->advance; -+ } -+ break; - } -- break; - } -- } -- else if (maxPixelWidth > 0 && cursorX > maxPixelWidth) -- break; // exceeded max allowed width - stop rendering -+ else if (maxPixelWidth > 0 && cursorX > maxPixelWidth) -+ break; // exceeded max allowed width - stop rendering - -- RenderCharacter(startX + cursorX, startY, ch, color, !scrolling, vertices); -- if ( alignment & XBFONT_JUSTIFIED ) -- { -- if ((*pos & 0xffff) == L' ') -- cursorX += ch->advance + spacePerLetter * justification_word_weight; -+ RenderCharacter(startX + cursorX, startY, ch, color, !scrolling, vertices); -+ if ( alignment & XBFONT_JUSTIFIED ) -+ { -+ if ((*pos & 0xffff) == L' ') -+ cursorX += ch->advance + spacePerLetter * justification_word_weight; -+ else -+ cursorX += ch->advance + spacePerLetter; -+ } - else -- cursorX += ch->advance + spacePerLetter; -+ cursorX += ch->advance; - } -- else -- cursorX += ch->advance; - } -+ /* Append the new vertices (from the cache or otherwise) to the set collected -+ * since the first Begin() call */ -+ m_vertex.insert(m_vertex.end(), vertices.begin(), vertices.end()); - - End(); - } -diff --git a/xbmc/guilib/GUIFontTTF.h b/xbmc/guilib/GUIFontTTF.h -index 4a6a696..7cb4669 100644 ---- a/xbmc/guilib/GUIFontTTF.h -+++ b/xbmc/guilib/GUIFontTTF.h -@@ -64,6 +64,9 @@ struct SVertex - }; - - -+#include "GUIFontCache.h" -+ -+ - class CGUIFontTTFBase - { - friend class CGUIFont; -@@ -166,6 +169,8 @@ class CGUIFontTTFBase - - CStdString m_strFileName; - -+ CGUIFontCache m_staticCache; -+ - private: - virtual bool FirstBegin() = 0; - virtual void LastEnd() = 0; -diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp -index a4e8571..cb56987 100644 ---- a/xbmc/guilib/GUIFontTTFGL.cpp -+++ b/xbmc/guilib/GUIFontTTFGL.cpp -@@ -200,6 +200,7 @@ CBaseTexture* CGUIFontTTFGL::ReallocTexture(unsigned int& newHeight) - m_textureScaleX = 1.0f / m_textureWidth; - if (m_textureHeight < newHeight) - CLog::Log(LOGWARNING, "%s: allocated new texture with height of %d, requested %d", __FUNCTION__, m_textureHeight, newHeight); -+ m_staticCache.Flush(); - - memset(newTexture->GetPixels(), 0, m_textureHeight * newTexture->GetPitch()); - if (m_texture) -diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index 6c2dcd4..bab2457 100644 ---- a/xbmc/guilib/GraphicContext.h -+++ b/xbmc/guilib/GraphicContext.h -@@ -146,6 +146,7 @@ class CGraphicContext : public CCriticalSection, - inline void ScaleFinalCoords(float &x, float &y, float &z) const XBMC_FORCE_INLINE { m_finalTransform.matrix.TransformPosition(x, y, z); } - bool RectIsAngled(float x1, float y1, float x2, float y2) const; - -+ inline const TransformMatrix &GetGUIMatrix() const XBMC_FORCE_INLINE { return m_finalTransform.matrix; } - inline float GetGUIScaleX() const XBMC_FORCE_INLINE { return m_finalTransform.scaleX; } - inline float GetGUIScaleY() const XBMC_FORCE_INLINE { return m_finalTransform.scaleY; } - inline color_t MergeAlpha(color_t color) const XBMC_FORCE_INLINE -diff --git a/xbmc/guilib/Makefile.in b/xbmc/guilib/Makefile.in -index 086fb0d..af82979 100644 ---- a/xbmc/guilib/Makefile.in -+++ b/xbmc/guilib/Makefile.in -@@ -23,6 +23,7 @@ SRCS += GUIEditControl.cpp - SRCS += GUIFadeLabelControl.cpp - SRCS += GUIFixedListContainer.cpp - SRCS += GUIFont.cpp -+SRCS += GUIFontCache.cpp - SRCS += GUIFontManager.cpp - SRCS += GUIFontTTF.cpp - SRCS += GUIImage.cpp -diff --git a/xbmc/guilib/TransformMatrix.h b/xbmc/guilib/TransformMatrix.h -index f351c99..9036ba9 100644 ---- a/xbmc/guilib/TransformMatrix.h -+++ b/xbmc/guilib/TransformMatrix.h -@@ -245,3 +245,14 @@ class TransformMatrix - float alpha; - bool identity; - }; -+ -+inline bool operator==(const TransformMatrix &a, const TransformMatrix &b) -+{ -+ return a.alpha == b.alpha && ((a.identity && b.identity) || -+ (!a.identity && !b.identity && std::equal(&a.m[0][0], &a.m[0][0] + sizeof a.m / sizeof a.m[0][0], &b.m[0][0]))); -+} -+ -+inline bool operator!=(const TransformMatrix &a, const TransformMatrix &b) -+{ -+ return !operator==(a, b); -+} --- -1.8.5.1 - - -From 577707ca22fa5a7f9f1dc33120941386aacd8801 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Thu, 23 Jan 2014 22:24:17 +0000 -Subject: [PATCH 05/17] Lay the groundwork for hardware clipping. - -For glScissor() to replace CGraphicContext::ClipRect, a necessary condition -is that no shear or rotation is introduced between the coordinate systems -they use; this depends upon the settings of the GUI matrix m_finalTransform -as well as the OpenGL model-view and projection matrices. These all remain -unchanged between paired calls of CGUIShader::OnEnabled and -CGUIShader::OnDisabled, so we scan the matrices in CGUIShader::OnEnabled to -see whether hardware clipping is possible. - -Then, in CGUIFontTTFBase::RenderCharacter, we don't apply software clipping -in such cases. However, because vertices arising from multiple -CGUIFontTTFBase::DrawTextInternal calls (each of which often uses a different -clip rectangle) get lumped into the same vector, which only at the end is -passed to OpenGL for rendering, we need to wait a few commits before we can -actually apply hardware clipping. In the meantime, expect to see rendering -errors. ---- - xbmc/guilib/GUIFontTTF.cpp | 3 +- - xbmc/guilib/GUIShader.cpp | 80 +++++++++++++++++++++++++++++++- - xbmc/guilib/GUIShader.h | 11 +++++ - xbmc/guilib/GraphicContext.cpp | 10 ++++ - xbmc/guilib/GraphicContext.h | 1 + - xbmc/rendering/RenderSystem.h | 2 + - xbmc/rendering/gles/RenderSystemGLES.cpp | 22 +++++++++ - xbmc/rendering/gles/RenderSystemGLES.h | 2 + - 8 files changed, 128 insertions(+), 3 deletions(-) - -diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp -index 288e61a..19c7ff4 100644 ---- a/xbmc/guilib/GUIFontTTF.cpp -+++ b/xbmc/guilib/GUIFontTTF.cpp -@@ -710,7 +710,8 @@ void CGUIFontTTFBase::RenderCharacter(float posX, float posY, const Character *c - (posY + ch->offsetY + height) * g_graphicsContext.GetGUIScaleY()); - vertex += CPoint(m_originX, m_originY); - CRect texture(ch->left, ch->top, ch->right, ch->bottom); -- g_graphicsContext.ClipRect(vertex, texture); -+ if (!g_Windowing.ScissorsCanEffectClipping()) -+ g_graphicsContext.ClipRect(vertex, texture); - - // transform our positions - note, no scaling due to GUI calibration/resolution occurs - float x[4], y[4], z[4]; -diff --git a/xbmc/guilib/GUIShader.cpp b/xbmc/guilib/GUIShader.cpp -index 11089b8..53bce09 100644 ---- a/xbmc/guilib/GUIShader.cpp -+++ b/xbmc/guilib/GUIShader.cpp -@@ -26,6 +26,8 @@ - #include "GUIShader.h" - #include "MatrixGLES.h" - #include "utils/log.h" -+#include "windowing/egl/WinSystemEGL.h" -+#include "guilib/GraphicContext.h" - - CGUIShader::CGUIShader( const char *shader ) : CGLSLShaderProgram("guishader_vert.glsl", shader) - { -@@ -86,8 +88,82 @@ bool CGUIShader::OnEnabled() - { - // This is called after glUseProgram() - -- glUniformMatrix4fv(m_hProj, 1, GL_FALSE, g_matrices.GetMatrix(MM_PROJECTION)); -- glUniformMatrix4fv(m_hModel, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); -+ GLfloat *projMatrix = g_matrices.GetMatrix(MM_PROJECTION); -+ GLfloat *modelMatrix = g_matrices.GetMatrix(MM_MODELVIEW); -+ glUniformMatrix4fv(m_hProj, 1, GL_FALSE, projMatrix); -+ glUniformMatrix4fv(m_hModel, 1, GL_FALSE, modelMatrix); -+ -+ const TransformMatrix &guiMatrix = g_graphicsContext.GetGUIMatrix(); -+ CRect viewPort; // absolute positions of corners -+ g_Windowing.GetViewPort(viewPort); -+ -+ /* glScissor operates in window coordinates. In order that we can use it to -+ * perform clipping, we must ensure that there is an independent linear -+ * transformation from the coordinate system used by CGraphicContext::ClipRect -+ * to window coordinates, separately for X and Y (in other words, no -+ * rotation or shear is introduced at any stage). To do, this, we need to -+ * check that zeros are present in the following locations: -+ * -+ * GUI matrix: -+ * / * 0 * * \ -+ * | 0 * * * | -+ * \ 0 0 * * / -+ * ^ TransformMatrix::TransformX/Y/ZCoord are only ever called with -+ * input z = 0, so this column doesn't matter -+ * Model-view matrix: -+ * / * 0 0 * \ -+ * | 0 * 0 * | -+ * | 0 0 * * | -+ * \ * * * * / <- eye w has no influence on window x/y (last column below -+ * is either 0 or ignored) -+ * Projection matrix: -+ * / * 0 0 0 \ -+ * | 0 * 0 0 | -+ * | * * * * | <- normalised device coordinate z has no influence on window x/y -+ * \ 0 0 * 0 / -+ * -+ * Some of these zeros are not strictly required to ensure this, but they tend -+ * to be zeroed in the common case, so by checking for zeros here, we simplify -+ * the calculation of the window x/y coordinates further down the line. -+ * -+ * (Minor detail: we don't quite deal in window coordinates as defined by -+ * OpenGL, because CRenderSystemGLES::SetScissors flips the Y axis. But all -+ * that's needed to handle that is an effective negation at the stage where -+ * Y is in normalised device coordinates.) -+ */ -+ m_clipPossible = guiMatrix.m[0][1] == 0 && -+ guiMatrix.m[1][0] == 0 && -+ guiMatrix.m[2][0] == 0 && -+ guiMatrix.m[2][1] == 0 && -+ modelMatrix[0+1*4] == 0 && -+ modelMatrix[0+2*4] == 0 && -+ modelMatrix[1+0*4] == 0 && -+ modelMatrix[1+2*4] == 0 && -+ modelMatrix[2+0*4] == 0 && -+ modelMatrix[2+1*4] == 0 && -+ projMatrix[0+1*4] == 0 && -+ projMatrix[0+2*4] == 0 && -+ projMatrix[0+3*4] == 0 && -+ projMatrix[1+0*4] == 0 && -+ projMatrix[1+2*4] == 0 && -+ projMatrix[1+3*4] == 0 && -+ projMatrix[3+0*4] == 0 && -+ projMatrix[3+1*4] == 0 && -+ projMatrix[3+3*4] == 0; -+ if (m_clipPossible) -+ { -+ m_clipXFactor = guiMatrix.m[0][0] * modelMatrix[0+0*4] * projMatrix[0+0*4]; -+ m_clipXOffset = (guiMatrix.m[0][3] * modelMatrix[0+0*4] + modelMatrix[0+3*4]) * projMatrix[0+0*4]; -+ m_clipYFactor = guiMatrix.m[1][1] * modelMatrix[1+1*4] * projMatrix[1+1*4]; -+ m_clipYOffset = (guiMatrix.m[1][3] * modelMatrix[1+1*4] + modelMatrix[1+3*4]) * projMatrix[1+1*4]; -+ float clipW = (guiMatrix.m[2][3] * modelMatrix[2+2*4] + modelMatrix[2+3*4]) * projMatrix[3+2*4]; -+ float xMult = (viewPort.x2 - viewPort.x1) / (2 * clipW); -+ float yMult = (viewPort.y1 - viewPort.y2) / (2 * clipW); // correct for inverted window coordinate scheme -+ m_clipXFactor = m_clipXFactor * xMult; -+ m_clipXOffset = m_clipXOffset * xMult + (viewPort.x2 + viewPort.x1) / 2; -+ m_clipYFactor = m_clipYFactor * yMult; -+ m_clipYOffset = m_clipYOffset * yMult + (viewPort.y2 + viewPort.y1) / 2; -+ } - - return true; - } -diff --git a/xbmc/guilib/GUIShader.h b/xbmc/guilib/GUIShader.h -index c7e95aa..86ce4cc 100644 ---- a/xbmc/guilib/GUIShader.h -+++ b/xbmc/guilib/GUIShader.h -@@ -41,6 +41,11 @@ class CGUIShader : public CGLSLShaderProgram - GLint GetCord1Loc() { return m_hCord1; } - GLint GetUniColLoc() { return m_hUniCol; } - GLint GetCoord0MatrixLoc() { return m_hCoord0Matrix; } -+ bool HardwareClipIsPossible() { return m_clipPossible; } -+ GLfloat GetClipXFactor() { return m_clipXFactor; } -+ GLfloat GetClipXOffset() { return m_clipXOffset; } -+ GLfloat GetClipYFactor() { return m_clipYFactor; } -+ GLfloat GetClipYOffset() { return m_clipYOffset; } - - protected: - GLint m_hTex0; -@@ -56,6 +61,12 @@ class CGUIShader : public CGLSLShaderProgram - - GLfloat *m_proj; - GLfloat *m_model; -+ -+ bool m_clipPossible; -+ GLfloat m_clipXFactor; -+ GLfloat m_clipXOffset; -+ GLfloat m_clipYFactor; -+ GLfloat m_clipYOffset; - }; - - #endif // GUI_SHADER_H -diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index ff29532..1621d17 100644 ---- a/xbmc/guilib/GraphicContext.cpp -+++ b/xbmc/guilib/GraphicContext.cpp -@@ -167,6 +167,16 @@ void CGraphicContext::ClipRect(CRect &vertex, CRect &texture, CRect *texture2) - } - } - -+CRect CGraphicContext::GetClipRegion() -+{ -+ if (m_clipRegions.empty()) -+ return CRect(0, 0, m_iScreenWidth, m_iScreenHeight); -+ CRect clipRegion(m_clipRegions.top()); -+ if (!m_origins.empty()) -+ clipRegion -= m_origins.top(); -+ return clipRegion; -+} -+ - bool CGraphicContext::SetViewPort(float fx, float fy, float fwidth, float fheight, bool intersectPrevious /* = false */) - { - // transform coordinates - we may have a rotation which changes the positioning of the -diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index bab2457..0a27643 100644 ---- a/xbmc/guilib/GraphicContext.h -+++ b/xbmc/guilib/GraphicContext.h -@@ -199,6 +199,7 @@ class CGraphicContext : public CCriticalSection, - void ApplyHardwareTransform(); - void RestoreHardwareTransform(); - void ClipRect(CRect &vertex, CRect &texture, CRect *diffuse = NULL); -+ CRect GetClipRegion(); - inline void AddGUITransform() - { - m_transforms.push(m_finalTransform); -diff --git a/xbmc/rendering/RenderSystem.h b/xbmc/rendering/RenderSystem.h -index 2bceb67..12cc784 100644 ---- a/xbmc/rendering/RenderSystem.h -+++ b/xbmc/rendering/RenderSystem.h -@@ -109,6 +109,8 @@ class CRenderSystemBase - virtual void SetViewPort(CRect& viewPort) = 0; - virtual void GetViewPort(CRect& viewPort) = 0; - -+ virtual bool ScissorsCanEffectClipping() { return false; } -+ virtual CRect ClipRectToScissorRect(const CRect &rect) { return CRect(); } - virtual void SetScissors(const CRect &rect) = 0; - virtual void ResetScissors() = 0; - -diff --git a/xbmc/rendering/gles/RenderSystemGLES.cpp b/xbmc/rendering/gles/RenderSystemGLES.cpp -index ad531f8..87b2cb6 100644 ---- a/xbmc/rendering/gles/RenderSystemGLES.cpp -+++ b/xbmc/rendering/gles/RenderSystemGLES.cpp -@@ -533,6 +533,28 @@ void CRenderSystemGLES::SetViewPort(CRect& viewPort) - m_viewPort[3] = viewPort.Height(); - } - -+bool CRenderSystemGLES::ScissorsCanEffectClipping() -+{ -+ if (m_pGUIshader[m_method]) -+ return m_pGUIshader[m_method]->HardwareClipIsPossible(); -+ -+ return false; -+} -+ -+CRect CRenderSystemGLES::ClipRectToScissorRect(const CRect &rect) -+{ -+ if (!m_pGUIshader[m_method]) -+ return CRect(); -+ float xFactor = m_pGUIshader[m_method]->GetClipXFactor(); -+ float xOffset = m_pGUIshader[m_method]->GetClipXOffset(); -+ float yFactor = m_pGUIshader[m_method]->GetClipYFactor(); -+ float yOffset = m_pGUIshader[m_method]->GetClipYOffset(); -+ return CRect(rect.x1 * xFactor + xOffset, -+ rect.y1 * yFactor + yOffset, -+ rect.x2 * xFactor + xOffset, -+ rect.y2 * yFactor + yOffset); -+} -+ - void CRenderSystemGLES::SetScissors(const CRect &rect) - { - if (!m_bRenderCreated) -diff --git a/xbmc/rendering/gles/RenderSystemGLES.h b/xbmc/rendering/gles/RenderSystemGLES.h -index b0e4a19..af2dbbb 100644 ---- a/xbmc/rendering/gles/RenderSystemGLES.h -+++ b/xbmc/rendering/gles/RenderSystemGLES.h -@@ -63,6 +63,8 @@ class CRenderSystemGLES : public CRenderSystemBase - virtual void SetViewPort(CRect& viewPort); - virtual void GetViewPort(CRect& viewPort); - -+ virtual bool ScissorsCanEffectClipping(); -+ virtual CRect ClipRectToScissorRect(const CRect &rect); - virtual void SetScissors(const CRect& rect); - virtual void ResetScissors(); - --- -1.8.5.1 - - -From 0faf86c9908a625fd4d93201966eda785aff5bc0 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Thu, 23 Jan 2014 16:42:22 +0000 -Subject: [PATCH 06/17] Increase font cache hit rate by keying on the - fractional part of m_originX and m_originY *after* they have been through the - graphics context's transformation matrix, plus the scale/rotation elements of - the matrix, rather than the origin in the original frame of reference plus - the complete transformation matrix. All vertices of individual glyph bounding - boxes are a constant offset from this position, and when the fractional part - of the translation is a match, the rounding of each vertex will be in the - same direction; this permits us to calculate the desired vertices from the - cached ones simply by adding the integer parts of the translations with no - additional rounding steps. - -Note that this requires that software clipping is *not* performed. ---- - xbmc/guilib/GUIFontCache.cpp | 8 +++++++ - xbmc/guilib/GUIFontCache.h | 43 +++++++++++++++++++++++++++++++++++ - xbmc/guilib/GUIFontTTF.cpp | 53 +++++++++++++++++++++++++++++++++++--------- - xbmc/guilib/GUIFontTTF.h | 1 + - 4 files changed, 95 insertions(+), 10 deletions(-) - -diff --git a/xbmc/guilib/GUIFontCache.cpp b/xbmc/guilib/GUIFontCache.cpp -index c029713..b66c00b 100644 ---- a/xbmc/guilib/GUIFontCache.cpp -+++ b/xbmc/guilib/GUIFontCache.cpp -@@ -85,6 +85,9 @@ - else - { - /* Cache hit */ -+ /* Update the translation arguments so that they hold the offset to apply -+ * to the cached values (but only in the dynamic case) */ -+ pos.UpdateWithOffsets(i->m_key.m_pos, scrolling); - /* Update time in entry and move to the back of the list */ - i->m_lastUsedMillis = nowMillis; - m_list.get().relocate(m_list.get().end(), m_list.project(i)); -@@ -103,3 +106,8 @@ - template CGUIFontCacheEntry::~CGUIFontCacheEntry(); - template CGUIFontCacheStaticValue &CGUIFontCache::Lookup(CGUIFontCacheStaticPosition &, const vecColors &, const vecText &, uint32_t, float, bool, unsigned int, bool &); - template void CGUIFontCache::Flush(); -+ -+template void CGUIFontCacheEntry::Reassign::operator()(CGUIFontCacheEntry &entry); -+template CGUIFontCacheEntry::~CGUIFontCacheEntry(); -+template CGUIFontCacheDynamicValue &CGUIFontCache::Lookup(CGUIFontCacheDynamicPosition &, const vecColors &, const vecText &, uint32_t, float, bool, unsigned int, bool &); -+template void CGUIFontCache::Flush(); -diff --git a/xbmc/guilib/GUIFontCache.h b/xbmc/guilib/GUIFontCache.h -index ef65845..d913dee 100644 ---- a/xbmc/guilib/GUIFontCache.h -+++ b/xbmc/guilib/GUIFontCache.h -@@ -44,6 +44,7 @@ - using namespace boost::multi_index; - - #define FONT_CACHE_TIME_LIMIT (1000) -+#define FONT_CACHE_DIST_LIMIT (0.01) - - template class CGUIFontCache; - class CGUIFontTTFBase; -@@ -197,6 +198,7 @@ struct CGUIFontCacheStaticPosition - float m_x; - float m_y; - CGUIFontCacheStaticPosition(float x, float y) : m_x(x), m_y(y) {} -+ void UpdateWithOffsets(const CGUIFontCacheStaticPosition &cached, bool scrolling) {} - }; - - typedef std::vector CGUIFontCacheStaticValue; -@@ -214,4 +216,45 @@ inline float MatrixHashContribution(const CGUIFontCacheKey CGUIFontCacheDynamicValue; -+ -+inline bool Match(const CGUIFontCacheDynamicPosition &a, const TransformMatrix &a_m, -+ const CGUIFontCacheDynamicPosition &b, const TransformMatrix &b_m, -+ bool scrolling) -+{ -+ float diffX = a.m_x - b.m_x + FONT_CACHE_DIST_LIMIT; -+ float diffY = a.m_y - b.m_y + FONT_CACHE_DIST_LIMIT; -+ float diffZ = a.m_z - b.m_z + FONT_CACHE_DIST_LIMIT; -+ return (scrolling || diffX - floorf(diffX) < 2 * FONT_CACHE_DIST_LIMIT) && -+ diffY - floorf(diffY) < 2 * FONT_CACHE_DIST_LIMIT && -+ diffZ - floorf(diffZ) < 2 * FONT_CACHE_DIST_LIMIT && -+ a_m.m[0][0] == b_m.m[0][0] && -+ a_m.m[1][1] == b_m.m[1][1] && -+ a_m.m[2][2] == b_m.m[2][2]; -+ // We already know the first 3 columns of both matrices are diagonal, so no need to check the other elements -+} -+ -+inline float MatrixHashContribution(const CGUIFontCacheKey &a) -+{ -+ return 0; -+} -+ - #endif -diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp -index 19c7ff4..73f0e50 100644 ---- a/xbmc/guilib/GUIFontTTF.cpp -+++ b/xbmc/guilib/GUIFontTTF.cpp -@@ -132,7 +132,7 @@ class CFreeTypeLibrary - XBMC_GLOBAL_REF(CFreeTypeLibrary, g_freeTypeLibrary); // our freetype library - #define g_freeTypeLibrary XBMC_GLOBAL_USE(CFreeTypeLibrary) - --CGUIFontTTFBase::CGUIFontTTFBase(const CStdString& strFileName) : m_staticCache(*this) -+CGUIFontTTFBase::CGUIFontTTFBase(const CStdString& strFileName) : m_staticCache(*this), m_dynamicCache(*this) - { - m_texture = NULL; - m_char = NULL; -@@ -332,13 +332,28 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors - Begin(); - - bool dirtyCache; -+ bool hardwareClipping = g_Windowing.ScissorsCanEffectClipping(); - CGUIFontCacheStaticPosition staticPos(x, y); -- std::vector &vertices = m_staticCache.Lookup(staticPos, -- colors, text, -- alignment, maxPixelWidth, -- scrolling, -- XbmcThreads::SystemClockMillis(), -- dirtyCache); -+ CGUIFontCacheDynamicPosition dynamicPos; -+ if (hardwareClipping) -+ { -+ dynamicPos = CGUIFontCacheDynamicPosition(g_graphicsContext.ScaleFinalXCoord(x, y), -+ g_graphicsContext.ScaleFinalYCoord(x, y), -+ g_graphicsContext.ScaleFinalZCoord(x, y)); -+ } -+ std::vector &vertices = hardwareClipping ? -+ m_dynamicCache.Lookup(dynamicPos, -+ colors, text, -+ alignment, maxPixelWidth, -+ scrolling, -+ XbmcThreads::SystemClockMillis(), -+ dirtyCache) : -+ m_staticCache.Lookup(staticPos, -+ colors, text, -+ alignment, maxPixelWidth, -+ scrolling, -+ XbmcThreads::SystemClockMillis(), -+ dirtyCache); - if (dirtyCache) - { - // save the origin, which is scaled separately -@@ -441,10 +456,28 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors - else - cursorX += ch->advance; - } -+ if (hardwareClipping) -+ /* Append the new vertices (which we have just constructed in the cache) -+ * to the set collected since the first Begin() call */ -+ m_vertex.insert(m_vertex.end(), vertices.begin(), vertices.end()); -+ } -+ else if (hardwareClipping) -+ { -+ /* Apply the translation offset to the vertices from the cache after -+ * appending them to the set collected since the first Begin() call */ -+ m_vertex.insert(m_vertex.end(), vertices.begin(), vertices.end()); -+ SVertex *v; -+ for (v = &*m_vertex.end() - vertices.size(); v != &*m_vertex.end(); v++) -+ { -+ v->x += dynamicPos.m_x; -+ v->y += dynamicPos.m_y; -+ v->z += dynamicPos.m_z; -+ } - } -- /* Append the new vertices (from the cache or otherwise) to the set collected -- * since the first Begin() call */ -- m_vertex.insert(m_vertex.end(), vertices.begin(), vertices.end()); -+ if (!hardwareClipping) -+ /* Append the new vertices (from the cache or otherwise) to the set collected -+ * since the first Begin() call */ -+ m_vertex.insert(m_vertex.end(), vertices.begin(), vertices.end()); - - End(); - } -diff --git a/xbmc/guilib/GUIFontTTF.h b/xbmc/guilib/GUIFontTTF.h -index 7cb4669..78445ab 100644 ---- a/xbmc/guilib/GUIFontTTF.h -+++ b/xbmc/guilib/GUIFontTTF.h -@@ -170,6 +170,7 @@ class CGUIFontTTFBase - CStdString m_strFileName; - - CGUIFontCache m_staticCache; -+ CGUIFontCache m_dynamicCache; - - private: - virtual bool FirstBegin() = 0; --- -1.8.5.1 - - -From 1cc1bebef45c0a75786fa3df0e11816107ba4da1 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Wed, 8 Jan 2014 12:16:33 +0000 -Subject: [PATCH 07/17] Rewrite of scrolling text code. - -No longer shuffles the string round to minimise the number of characters -before the clipping rectangle; this doesn't save much on rendering time but -does harm the effectiveness of the cache. Now uses a pixel offset into the -string rather than a character + pixel offset, and plots the entire string -every time (execpt when the wrap point is visible, in which case the entire -string is plotted twice). - -It also makes motion smoother, because (possibly unintentionally) the -previous code preferred to align the scroll offset with character boundaries. -This would lead to uneven changes of position, especially when the width of -the character currently being scrolled off the edge was only slightly more -than an integral multiple of the scroll increment. ---- - xbmc/guilib/GUIFadeLabelControl.cpp | 8 +-- - xbmc/guilib/GUIFont.cpp | 123 +++++++++++++----------------------- - xbmc/guilib/GUIFont.h | 17 ++--- - xbmc/guilib/GUIRSSControl.cpp | 6 +- - xbmc/utils/RssReader.cpp | 2 +- - xbmc/utils/RssReader.h | 2 +- - 6 files changed, 58 insertions(+), 100 deletions(-) - -diff --git a/xbmc/guilib/GUIFadeLabelControl.cpp b/xbmc/guilib/GUIFadeLabelControl.cpp -index d594c04..86ee73a 100644 ---- a/xbmc/guilib/GUIFadeLabelControl.cpp -+++ b/xbmc/guilib/GUIFadeLabelControl.cpp -@@ -109,18 +109,14 @@ void CGUIFadeLabelControl::Process(unsigned int currentTime, CDirtyRegionList &d - bool moveToNextLabel = false; - if (!m_scrollOut) - { -- vecText text; -- m_textLayout.GetFirstText(text); -- if (m_scrollInfo.characterPos && m_scrollInfo.characterPos < text.size()) -- text.erase(text.begin(), text.begin() + min((int)m_scrollInfo.characterPos - 1, (int)text.size())); -- if (m_label.font->GetTextWidth(text) < m_width) -+ if (m_scrollInfo.pixelPos + m_width > m_scrollInfo.m_textWidth) - { - if (m_fadeAnim.GetProcess() != ANIM_PROCESS_NORMAL) - m_fadeAnim.QueueAnimation(ANIM_PROCESS_NORMAL); - moveToNextLabel = true; - } - } -- else if (m_scrollInfo.characterPos > m_textLayout.GetTextLength()) -+ else if (m_scrollInfo.pixelPos > m_scrollInfo.m_textWidth) - moveToNextLabel = true; - - // apply the fading animation -diff --git a/xbmc/guilib/GUIFont.cpp b/xbmc/guilib/GUIFont.cpp -index 63ecf85..eb8efdb 100644 ---- a/xbmc/guilib/GUIFont.cpp -+++ b/xbmc/guilib/GUIFont.cpp -@@ -36,7 +36,12 @@ - initialWait = wait; - initialPos = pos; - SetSpeed(speed ? speed : defaultSpeed); -- g_charsetConverter.utf8ToW(scrollSuffix, suffix); -+ CStdStringW wsuffix; -+ g_charsetConverter.utf8ToW(scrollSuffix, wsuffix); -+ suffix.clear(); -+ suffix.reserve(wsuffix.size()); -+ for (vecText::size_type i = 0; i < wsuffix.size(); i++) -+ suffix.push_back(wsuffix[i]); - Reset(); - } - -@@ -115,11 +120,12 @@ bool CGUIFont::UpdateScrollInfo(const vecText &text, CScrollInfo &scrollInfo) - { - // draw at our scroll position - // we handle the scrolling as follows: -- // We scroll on a per-pixel basis up until we have scrolled the first character outside -- // of our viewport, whereby we cycle the string around, and reset the scroll position. -- // -- // pixelPos is the amount in pixels to move the string by. -- // characterPos is the amount in characters to rotate the string by. -+ // We scroll on a per-pixel basis (eschewing the use of character indices -+ // which were also in use previously). The complete string, including suffix, -+ // is plotted to achieve the desired effect - normally just the one time, but -+ // if there is a wrap point within the viewport then it will be plotted twice. -+ // If the string is smaller than the viewport, then it may be plotted even -+ // more times than that. - // - if (scrollInfo.waitTime) - { -@@ -135,54 +141,19 @@ bool CGUIFont::UpdateScrollInfo(const vecText &text, CScrollInfo &scrollInfo) - // move along by the appropriate scroll amount - float scrollAmount = fabs(scrollInfo.GetPixelsPerFrame() * g_graphicsContext.GetGUIScaleX()); - -- if (scrollInfo.pixelSpeed > 0) -+ if (!scrollInfo.m_widthValid) - { -- // we want to move scrollAmount, grab the next character -- float charWidth = GetCharWidth(scrollInfo.GetCurrentChar(text)); -- if (scrollInfo.pixelPos + scrollAmount < charWidth) -- scrollInfo.pixelPos += scrollAmount; // within the current character -- else -- { // past the current character, decrement scrollAmount by the charWidth and move to the next character -- while (scrollInfo.pixelPos + scrollAmount >= charWidth) -- { -- scrollAmount -= (charWidth - scrollInfo.pixelPos); -- scrollInfo.pixelPos = 0; -- scrollInfo.characterPos++; -- if (scrollInfo.characterPos >= text.size() + scrollInfo.suffix.size()) -- { -- scrollInfo.Reset(); -- break; -- } -- charWidth = GetCharWidth(scrollInfo.GetCurrentChar(text)); -- } -- } -- } -- else if (scrollInfo.pixelSpeed < 0) -- { // scrolling backwards -- // we want to move scrollAmount, grab the next character -- float charWidth = GetCharWidth(scrollInfo.GetCurrentChar(text)); -- if (scrollInfo.pixelPos + scrollAmount < charWidth) -- scrollInfo.pixelPos += scrollAmount; // within the current character -- else -- { // past the current character, decrement scrollAmount by the charWidth and move to the next character -- while (scrollInfo.pixelPos + scrollAmount >= charWidth) -- { -- scrollAmount -= (charWidth - scrollInfo.pixelPos); -- scrollInfo.pixelPos = 0; -- if (scrollInfo.characterPos == 0) -- { -- scrollInfo.Reset(); -- scrollInfo.characterPos = text.size() + scrollInfo.suffix.size() - 1; -- break; -- } -- scrollInfo.characterPos--; -- charWidth = GetCharWidth(scrollInfo.GetCurrentChar(text)); -- } -- } -+ /* Calculate the pixel width of the complete string */ -+ scrollInfo.m_textWidth = GetTextWidth(text); -+ scrollInfo.m_totalWidth = scrollInfo.m_textWidth + GetTextWidth(scrollInfo.suffix); -+ scrollInfo.m_widthValid = true; - } -+ scrollInfo.pixelPos += scrollAmount; -+ assert(scrollInfo.m_totalWidth != 0); -+ while (scrollInfo.pixelPos >= scrollInfo.m_totalWidth) -+ scrollInfo.pixelPos -= scrollInfo.m_totalWidth; - -- if(scrollInfo.characterPos != old.characterPos -- || scrollInfo.pixelPos != old.pixelPos) -+ if (scrollInfo.pixelPos != old.pixelPos) - return true; - else - return false; -@@ -194,39 +165,27 @@ void CGUIFont::DrawScrollingText(float x, float y, const vecColors &colors, colo - if (!m_font) return; - if (!shadowColor) shadowColor = m_shadowColor; - -- float spaceWidth = GetCharWidth(L' '); -- // max chars on screen + extra margin chars -- vecText::size_type maxChars = -- std::min( -- (text.size() + (vecText::size_type)scrollInfo.suffix.size()), -- (vecText::size_type)((maxWidth * 1.05f) / spaceWidth)); -- - if (!text.size() || ClippedRegionIsEmpty(x, y, maxWidth, alignment)) - return; // nothing to render - -- maxWidth = ROUND(maxWidth / g_graphicsContext.GetGUIScaleX()); -+ if (!scrollInfo.m_widthValid) -+ { -+ /* Calculate the pixel width of the complete string */ -+ scrollInfo.m_textWidth = GetTextWidth(text); -+ scrollInfo.m_totalWidth = scrollInfo.m_textWidth + GetTextWidth(scrollInfo.suffix); -+ scrollInfo.m_widthValid = true; -+ } -+ -+ assert(scrollInfo.m_totalWidth != 0); -+ -+ float textPixelWidth = ROUND(scrollInfo.m_textWidth / g_graphicsContext.GetGUIScaleX()); -+ float suffixPixelWidth = ROUND((scrollInfo.m_totalWidth - scrollInfo.m_textWidth) / g_graphicsContext.GetGUIScaleX()); - -- float charWidth = GetCharWidth(scrollInfo.GetCurrentChar(text)); - float offset; - if(scrollInfo.pixelSpeed >= 0) - offset = scrollInfo.pixelPos; - else -- offset = charWidth - scrollInfo.pixelPos; -- -- // Now rotate our string as needed, only take a slightly larger then visible part of the text. -- unsigned int pos = scrollInfo.characterPos; -- vecText renderText; -- renderText.reserve(maxChars); -- for (vecText::size_type i = 0; i < maxChars; i++) -- { -- if (pos >= text.size() + scrollInfo.suffix.size()) -- pos = 0; -- if (pos < text.size()) -- renderText.push_back(text[pos]); -- else -- renderText.push_back(scrollInfo.suffix[pos - text.size()]); -- pos++; -- } -+ offset = scrollInfo.m_totalWidth - scrollInfo.pixelPos; - - vecColors renderColors; - for (unsigned int i = 0; i < colors.size(); i++) -@@ -239,9 +198,17 @@ void CGUIFont::DrawScrollingText(float x, float y, const vecColors &colors, colo - vecColors shadowColors; - for (unsigned int i = 0; i < renderColors.size(); i++) - shadowColors.push_back((renderColors[i] & 0xff000000) != 0 ? shadowColor : 0); -- m_font->DrawTextInternal(x - offset + 1, y + 1, shadowColors, renderText, alignment, maxWidth + scrollInfo.pixelPos + m_font->GetLineHeight(2.0f), scroll); -+ for (float dx = -offset; dx < maxWidth; dx += scrollInfo.m_totalWidth) -+ { -+ m_font->DrawTextInternal(x + dx + 1, y + 1, shadowColors, text, alignment, textPixelWidth, scroll); -+ m_font->DrawTextInternal(x + dx + scrollInfo.m_textWidth + 1, y + 1, shadowColors, scrollInfo.suffix, alignment, suffixPixelWidth, scroll); -+ } -+ } -+ for (float dx = -offset; dx < maxWidth; dx += scrollInfo.m_totalWidth) -+ { -+ m_font->DrawTextInternal(x + dx, y, renderColors, text, alignment, textPixelWidth, scroll); -+ m_font->DrawTextInternal(x + dx + scrollInfo.m_textWidth, y, renderColors, scrollInfo.suffix, alignment, suffixPixelWidth, scroll); - } -- m_font->DrawTextInternal(x - offset, y, renderColors, renderText, alignment, maxWidth + scrollInfo.pixelPos + m_font->GetLineHeight(2.0f), scroll); - - g_graphicsContext.RestoreClipRegion(); - } -diff --git a/xbmc/guilib/GUIFont.h b/xbmc/guilib/GUIFont.h -index c55db48..09cf9b3 100644 ---- a/xbmc/guilib/GUIFont.h -+++ b/xbmc/guilib/GUIFont.h -@@ -64,7 +64,6 @@ class CScrollInfo - void Reset() - { - waitTime = initialWait; -- characterPos = 0; - // pixelPos is where we start the current letter, so is measured - // to the left of the text rendering's left edge. Thus, a negative - // value will mean the text starts to the right -@@ -72,25 +71,19 @@ class CScrollInfo - // privates: - m_averageFrameTime = 1000.f / abs(defaultSpeed); - m_lastFrameTime = 0; -- } -- uint32_t GetCurrentChar(const vecText &text) const -- { -- assert(text.size()); -- if (characterPos < text.size()) -- return text[characterPos]; -- else if (characterPos < text.size() + suffix.size()) -- return suffix[characterPos - text.size()]; -- return text[0]; -+ m_widthValid = false; - } - float GetPixelsPerFrame(); - - float pixelPos; - float pixelSpeed; - unsigned int waitTime; -- unsigned int characterPos; - unsigned int initialWait; - float initialPos; -- CStdStringW suffix; -+ vecText suffix; -+ mutable float m_textWidth; -+ mutable float m_totalWidth; -+ mutable bool m_widthValid; - - static const int defaultSpeed = 60; - private: -diff --git a/xbmc/guilib/GUIRSSControl.cpp b/xbmc/guilib/GUIRSSControl.cpp -index b68e08b..6bd37fd 100644 ---- a/xbmc/guilib/GUIRSSControl.cpp -+++ b/xbmc/guilib/GUIRSSControl.cpp -@@ -122,7 +122,9 @@ void CGUIRSSControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyre - dirty = true; - - if (CRssManager::Get().GetReader(GetID(), GetParentID(), this, m_pReader)) -- m_scrollInfo.characterPos = m_pReader->m_SavedScrollPos; -+ { -+ m_scrollInfo.pixelPos = m_pReader->m_savedScrollPixelPos; -+ } - else - { - if (m_strRSSTags != "") -@@ -180,7 +182,7 @@ void CGUIRSSControl::Render() - if (m_pReader) - { - m_pReader->CheckForUpdates(); -- m_pReader->m_SavedScrollPos = m_scrollInfo.characterPos; -+ m_pReader->m_savedScrollPixelPos = m_scrollInfo.pixelPos; - } - } - CGUIControl::Render(); -diff --git a/xbmc/utils/RssReader.cpp b/xbmc/utils/RssReader.cpp -index b1e53b7..f68597a 100644 ---- a/xbmc/utils/RssReader.cpp -+++ b/xbmc/utils/RssReader.cpp -@@ -54,7 +54,7 @@ - m_pObserver = NULL; - m_spacesBetweenFeeds = 0; - m_bIsRunning = false; -- m_SavedScrollPos = 0; -+ m_savedScrollPixelPos = 0; - m_rtlText = false; - m_requestRefresh = false; - } -diff --git a/xbmc/utils/RssReader.h b/xbmc/utils/RssReader.h -index 2c6f366..b74faf2 100644 ---- a/xbmc/utils/RssReader.h -+++ b/xbmc/utils/RssReader.h -@@ -43,7 +43,7 @@ class CRssReader : public CThread - void SetObserver(IRssObserver* observer); - void CheckForUpdates(); - void requestRefresh(); -- unsigned int m_SavedScrollPos; -+ float m_savedScrollPixelPos; - - private: - void Process(); --- -1.8.5.1 - - -From 38f0baa539e8ded3affdf13fa6640caa7dd8bebe Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Mon, 27 Jan 2014 23:21:10 +0000 -Subject: [PATCH 08/17] Move the application of the translation offsets into - the GLES code. Still all pure software at this stage. Main change is in the - data types at the interface between CGUIFontTTFBase and CGUIFontTTFGL. The - old way (array of vertices in m_vertex) are retained in addition, for the - sake`of cases that need to use software clipping on GLES, as well as for DX - and GL support where the new scheme is not (yet?) used. - ---- - xbmc/guilib/GUIFontTTF.cpp | 19 +++--------- - xbmc/guilib/GUIFontTTF.h | 17 +++++++++++ - xbmc/guilib/GUIFontTTFGL.cpp | 72 ++++++++++++++++++++++++++++++++------------ - 3 files changed, 73 insertions(+), 35 deletions(-) - -diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp -index 73f0e50..ad0a53b 100644 ---- a/xbmc/guilib/GUIFontTTF.cpp -+++ b/xbmc/guilib/GUIFontTTF.cpp -@@ -215,6 +215,7 @@ void CGUIFontTTFBase::Clear() - g_freeTypeLibrary.ReleaseStroker(m_stroker); - m_stroker = NULL; - -+ m_vertexTrans.clear(); - m_vertex.clear(); - } - -@@ -310,6 +311,7 @@ void CGUIFontTTFBase::Begin() - { - if (m_nestedBeginCount == 0 && m_texture != NULL && FirstBegin()) - { -+ m_vertexTrans.clear(); - m_vertex.clear(); - } - // Keep track of the nested begin/end calls. -@@ -457,23 +459,10 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors - cursorX += ch->advance; - } - if (hardwareClipping) -- /* Append the new vertices (which we have just constructed in the cache) -- * to the set collected since the first Begin() call */ -- m_vertex.insert(m_vertex.end(), vertices.begin(), vertices.end()); -+ m_vertexTrans.push_back(CTranslatedVertices(0, 0, 0, &vertices)); - } - else if (hardwareClipping) -- { -- /* Apply the translation offset to the vertices from the cache after -- * appending them to the set collected since the first Begin() call */ -- m_vertex.insert(m_vertex.end(), vertices.begin(), vertices.end()); -- SVertex *v; -- for (v = &*m_vertex.end() - vertices.size(); v != &*m_vertex.end(); v++) -- { -- v->x += dynamicPos.m_x; -- v->y += dynamicPos.m_y; -- v->z += dynamicPos.m_z; -- } -- } -+ m_vertexTrans.push_back(CTranslatedVertices(dynamicPos.m_x, dynamicPos.m_y, dynamicPos.m_z, &vertices)); - if (!hardwareClipping) - /* Append the new vertices (from the cache or otherwise) to the set collected - * since the first Begin() call */ -diff --git a/xbmc/guilib/GUIFontTTF.h b/xbmc/guilib/GUIFontTTF.h -index 78445ab..c71f90d 100644 ---- a/xbmc/guilib/GUIFontTTF.h -+++ b/xbmc/guilib/GUIFontTTF.h -@@ -61,6 +61,14 @@ struct SVertex - unsigned char r, g, b, a; - #endif - float u, v; -+ struct SVertex Offset(float translate[3]) const -+ { -+ SVertex out = *this; -+ out.x += translate[0]; -+ out.y += translate[1]; -+ out.z += translate[2]; -+ return out; -+ } - }; - - -@@ -160,6 +168,15 @@ class CGUIFontTTFBase - bool m_bTextureLoaded; - unsigned int m_nTexture; - -+ struct CTranslatedVertices -+ { -+ float translateX; -+ float translateY; -+ float translateZ; -+ const std::vector *vertexBuffer; -+ CTranslatedVertices(float translateX, float translateY, float translateZ, const std::vector *vertexBuffer) : translateX(translateX), translateY(translateY), translateZ(translateZ), vertexBuffer(vertexBuffer) {} -+ }; -+ std::vector m_vertexTrans; - std::vector m_vertex; - - float m_textureScaleX; -diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp -index cb56987..f6aa081 100644 ---- a/xbmc/guilib/GUIFontTTFGL.cpp -+++ b/xbmc/guilib/GUIFontTTFGL.cpp -@@ -146,34 +146,65 @@ void CGUIFontTTFGL::LastEnd() - GLint colLoc = g_Windowing.GUIShaderGetCol(); - GLint tex0Loc = g_Windowing.GUIShaderGetCoord0(); - -- // stack object until VBOs will be used -- std::vector vecVertices( 6 * (m_vertex.size() / 4) ); -- SVertex *vertices = &vecVertices[0]; -+ // Enable the attributes used by this shader -+ glEnableVertexAttribArray(posLoc); -+ glEnableVertexAttribArray(colLoc); -+ glEnableVertexAttribArray(tex0Loc); - -- for (size_t i=0; i 0) - { -- *vertices++ = m_vertex[i]; -- *vertices++ = m_vertex[i+1]; -- *vertices++ = m_vertex[i+2]; -+ // Deal with vertices that had to use software clipping -+ std::vector vecVertices( 6 * (m_vertex.size() / 4) ); -+ SVertex *vertices = &vecVertices[0]; - -- *vertices++ = m_vertex[i+1]; -- *vertices++ = m_vertex[i+3]; -- *vertices++ = m_vertex[i+2]; -- } -+ for (size_t i=0; i 0) -+ { -+ // Deal with the vertices that can be hardware clipped and therefore translated -+ std::vector vecVertices; -+ for (size_t i = 0; i < m_vertexTrans.size(); i++) -+ { -+ float translate[3] = { m_vertexTrans[i].translateX, m_vertexTrans[i].translateY, m_vertexTrans[i].translateZ }; -+ for (size_t j = 0; j < m_vertexTrans[i].vertexBuffer->size(); j += 4) -+ { -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j].Offset(translate)); -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+1].Offset(translate)); -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+2].Offset(translate)); -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+1].Offset(translate)); -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+3].Offset(translate)); -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+2].Offset(translate)); -+ } -+ } -+ SVertex *vertices = &vecVertices[0]; - -- glDrawArrays(GL_TRIANGLES, 0, vecVertices.size()); -+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, x)); -+ // Normalize color values. Does not affect Performance at all. -+ glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, r)); -+ glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, u)); -+ -+ glDrawArrays(GL_TRIANGLES, 0, vecVertices.size()); -+ } - -+ // Disable the attributes used by this shader - glDisableVertexAttribArray(posLoc); - glDisableVertexAttribArray(colLoc); - glDisableVertexAttribArray(tex0Loc); -@@ -201,6 +232,7 @@ CBaseTexture* CGUIFontTTFGL::ReallocTexture(unsigned int& newHeight) - if (m_textureHeight < newHeight) - CLog::Log(LOGWARNING, "%s: allocated new texture with height of %d, requested %d", __FUNCTION__, m_textureHeight, newHeight); - m_staticCache.Flush(); -+ m_dynamicCache.Flush(); - - memset(newTexture->GetPixels(), 0, m_textureHeight * newTexture->GetPitch()); - if (m_texture) --- -1.8.5.1 - - -From 66d47fad537cd3fc7dbbe23c2aad897a2b085c72 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Wed, 15 Jan 2014 15:28:06 +0000 -Subject: [PATCH 09/17] Rather than applying the translation offsets to the - vertices, now applies them to the model view matrix from the top of the - matrix stack and pushes it over to OpenGL. The vertices themselves are still - all held client-side. - ---- - xbmc/guilib/GUIFontTTF.h | 8 ------- - xbmc/guilib/GUIFontTTFGL.cpp | 40 +++++++++++++++++++++----------- - xbmc/guilib/GUIShader.h | 1 + - xbmc/rendering/gles/RenderSystemGLES.cpp | 8 +++++++ - xbmc/rendering/gles/RenderSystemGLES.h | 1 + - 5 files changed, 36 insertions(+), 22 deletions(-) - -diff --git a/xbmc/guilib/GUIFontTTF.h b/xbmc/guilib/GUIFontTTF.h -index c71f90d..fde2085 100644 ---- a/xbmc/guilib/GUIFontTTF.h -+++ b/xbmc/guilib/GUIFontTTF.h -@@ -61,14 +61,6 @@ struct SVertex - unsigned char r, g, b, a; - #endif - float u, v; -- struct SVertex Offset(float translate[3]) const -- { -- SVertex out = *this; -- out.x += translate[0]; -- out.y += translate[1]; -- out.z += translate[2]; -- return out; -- } - }; - - -diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp -index f6aa081..fbffaa0 100644 ---- a/xbmc/guilib/GUIFontTTFGL.cpp -+++ b/xbmc/guilib/GUIFontTTFGL.cpp -@@ -29,6 +29,7 @@ - #include "utils/log.h" - #include "utils/GLUtils.h" - #include "windowing/WindowingFactory.h" -+#include "guilib/MatrixGLES.h" - - // stuff for freetype - #include -@@ -145,6 +146,7 @@ void CGUIFontTTFGL::LastEnd() - GLint posLoc = g_Windowing.GUIShaderGetPos(); - GLint colLoc = g_Windowing.GUIShaderGetCol(); - GLint tex0Loc = g_Windowing.GUIShaderGetCoord0(); -+ GLint modelLoc = g_Windowing.GUIShaderGetModel(); - - // Enable the attributes used by this shader - glEnableVertexAttribArray(posLoc); -@@ -183,25 +185,35 @@ void CGUIFontTTFGL::LastEnd() - std::vector vecVertices; - for (size_t i = 0; i < m_vertexTrans.size(); i++) - { -- float translate[3] = { m_vertexTrans[i].translateX, m_vertexTrans[i].translateY, m_vertexTrans[i].translateZ }; -+ // Apply the translation to the currently active (top-of-stack) model view matrix -+ g_matrices.MatrixMode(MM_MODELVIEW); -+ g_matrices.PushMatrix(); -+ g_matrices.Translatef(m_vertexTrans[i].translateX, m_vertexTrans[i].translateY, m_vertexTrans[i].translateZ); -+ glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); -+ -+ vecVertices.clear(); - for (size_t j = 0; j < m_vertexTrans[i].vertexBuffer->size(); j += 4) - { -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j].Offset(translate)); -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+1].Offset(translate)); -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+2].Offset(translate)); -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+1].Offset(translate)); -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+3].Offset(translate)); -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+2].Offset(translate)); -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j]); -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+1]); -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+2]); -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+1]); -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+3]); -+ vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+2]); - } -- } -- SVertex *vertices = &vecVertices[0]; -+ SVertex *vertices = &vecVertices[0]; - -- glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, x)); -- // Normalize color values. Does not affect Performance at all. -- glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, r)); -- glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, u)); -+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, x)); -+ // Normalize color values. Does not affect Performance at all. -+ glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, r)); -+ glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, u)); - -- glDrawArrays(GL_TRIANGLES, 0, vecVertices.size()); -+ glDrawArrays(GL_TRIANGLES, 0, vecVertices.size()); -+ -+ g_matrices.PopMatrix(); -+ } -+ // Restore the original model view matrix -+ glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); - } - - // Disable the attributes used by this shader -diff --git a/xbmc/guilib/GUIShader.h b/xbmc/guilib/GUIShader.h -index 86ce4cc..ba01956 100644 ---- a/xbmc/guilib/GUIShader.h -+++ b/xbmc/guilib/GUIShader.h -@@ -41,6 +41,7 @@ class CGUIShader : public CGLSLShaderProgram - GLint GetCord1Loc() { return m_hCord1; } - GLint GetUniColLoc() { return m_hUniCol; } - GLint GetCoord0MatrixLoc() { return m_hCoord0Matrix; } -+ GLint GetModelLoc() { return m_hModel; } - bool HardwareClipIsPossible() { return m_clipPossible; } - GLfloat GetClipXFactor() { return m_clipXFactor; } - GLfloat GetClipXOffset() { return m_clipXOffset; } -diff --git a/xbmc/rendering/gles/RenderSystemGLES.cpp b/xbmc/rendering/gles/RenderSystemGLES.cpp -index 87b2cb6..3069ed8 100644 ---- a/xbmc/rendering/gles/RenderSystemGLES.cpp -+++ b/xbmc/rendering/gles/RenderSystemGLES.cpp -@@ -678,4 +678,12 @@ GLint CRenderSystemGLES::GUIShaderGetCoord0Matrix() - return -1; - } - -+GLint CRenderSystemGLES::GUIShaderGetModel() -+{ -+ if (m_pGUIshader[m_method]) -+ return m_pGUIshader[m_method]->GetModelLoc(); -+ -+ return -1; -+} -+ - #endif -diff --git a/xbmc/rendering/gles/RenderSystemGLES.h b/xbmc/rendering/gles/RenderSystemGLES.h -index af2dbbb..ac1780b 100644 ---- a/xbmc/rendering/gles/RenderSystemGLES.h -+++ b/xbmc/rendering/gles/RenderSystemGLES.h -@@ -90,6 +90,7 @@ class CRenderSystemGLES : public CRenderSystemBase - GLint GUIShaderGetCoord1(); - GLint GUIShaderGetUniCol(); - GLint GUIShaderGetCoord0Matrix(); -+ GLint GUIShaderGetModel(); - - protected: - virtual void SetVSyncImpl(bool enable) = 0; --- -1.8.5.1 - - -From 8cb5497b9d572d6761edb7778d4ced562d32141d Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Wed, 29 Jan 2014 13:21:19 +0000 -Subject: [PATCH 10/17] Enable hardware clipping. - ---- - xbmc/guilib/GUIFontTTF.cpp | 4 ++-- - xbmc/guilib/GUIFontTTF.h | 5 ++++- - xbmc/guilib/GUIFontTTFGL.cpp | 6 ++++++ - 3 files changed, 12 insertions(+), 3 deletions(-) - -diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp -index ad0a53b..4dc4c8e 100644 ---- a/xbmc/guilib/GUIFontTTF.cpp -+++ b/xbmc/guilib/GUIFontTTF.cpp -@@ -459,10 +459,10 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors - cursorX += ch->advance; - } - if (hardwareClipping) -- m_vertexTrans.push_back(CTranslatedVertices(0, 0, 0, &vertices)); -+ m_vertexTrans.push_back(CTranslatedVertices(0, 0, 0, &vertices, g_graphicsContext.GetClipRegion())); - } - else if (hardwareClipping) -- m_vertexTrans.push_back(CTranslatedVertices(dynamicPos.m_x, dynamicPos.m_y, dynamicPos.m_z, &vertices)); -+ m_vertexTrans.push_back(CTranslatedVertices(dynamicPos.m_x, dynamicPos.m_y, dynamicPos.m_z, &vertices, g_graphicsContext.GetClipRegion())); - if (!hardwareClipping) - /* Append the new vertices (from the cache or otherwise) to the set collected - * since the first Begin() call */ -diff --git a/xbmc/guilib/GUIFontTTF.h b/xbmc/guilib/GUIFontTTF.h -index fde2085..5e7c31f 100644 ---- a/xbmc/guilib/GUIFontTTF.h -+++ b/xbmc/guilib/GUIFontTTF.h -@@ -27,6 +27,8 @@ - * - */ - -+#include "Geometry.h" -+ - // forward definition - class CBaseTexture; - -@@ -166,7 +168,8 @@ class CGUIFontTTFBase - float translateY; - float translateZ; - const std::vector *vertexBuffer; -- CTranslatedVertices(float translateX, float translateY, float translateZ, const std::vector *vertexBuffer) : translateX(translateX), translateY(translateY), translateZ(translateZ), vertexBuffer(vertexBuffer) {} -+ CRect clip; -+ CTranslatedVertices(float translateX, float translateY, float translateZ, const std::vector *vertexBuffer, const CRect &clip) : translateX(translateX), translateY(translateY), translateZ(translateZ), vertexBuffer(vertexBuffer), clip(clip) {} - }; - std::vector m_vertexTrans; - std::vector m_vertex; -diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp -index fbffaa0..b7618e1 100644 ---- a/xbmc/guilib/GUIFontTTFGL.cpp -+++ b/xbmc/guilib/GUIFontTTFGL.cpp -@@ -185,6 +185,10 @@ void CGUIFontTTFGL::LastEnd() - std::vector vecVertices; - for (size_t i = 0; i < m_vertexTrans.size(); i++) - { -+ // Apply the clip rectangle -+ CRect clip = g_Windowing.ClipRectToScissorRect(m_vertexTrans[i].clip); -+ g_graphicsContext.SetScissors(clip); -+ - // Apply the translation to the currently active (top-of-stack) model view matrix - g_matrices.MatrixMode(MM_MODELVIEW); - g_matrices.PushMatrix(); -@@ -212,6 +216,8 @@ void CGUIFontTTFGL::LastEnd() - - g_matrices.PopMatrix(); - } -+ // Restore the original scissor rectangle -+ g_graphicsContext.ResetScissors(); - // Restore the original model view matrix - glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); - } --- -1.8.5.1 - - -From 7a9076fcb30b45d7071cc64def09b0745974c988 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Wed, 15 Jan 2014 15:32:51 +0000 -Subject: [PATCH 11/17] Move the vertex data across to a vertex buffer object - just prior to drawing. - ---- - xbmc/guilib/GUIFontTTFGL.cpp | 24 +++++++++++++++++++----- - 1 file changed, 19 insertions(+), 5 deletions(-) - -diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp -index b7618e1..0df3749 100644 ---- a/xbmc/guilib/GUIFontTTFGL.cpp -+++ b/xbmc/guilib/GUIFontTTFGL.cpp -@@ -207,12 +207,24 @@ void CGUIFontTTFGL::LastEnd() - } - SVertex *vertices = &vecVertices[0]; - -- glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, x)); -- // Normalize color values. Does not affect Performance at all. -- glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, r)); -- glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, u)); -- -+ // Generate a unique buffer object name and put it in vertexBuffer -+ GLuint vertexBuffer; -+ glGenBuffers(1, &vertexBuffer); -+ // Bind the buffer to the OpenGL context's GL_ARRAY_BUFFER binding point -+ glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); -+ // Create a data store for the buffer object bound to the GL_ARRAY_BUFFER -+ // binding point (i.e. our buffer object) and initialise it from the -+ // specified client-side pointer -+ glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof *vertices, vertices, GL_STATIC_DRAW); -+ // Set up the offsets of the various vertex attributes within the buffer -+ // object bound to GL_ARRAY_BUFFER -+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, x)); -+ glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, r)); -+ glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, u)); -+ // Do the actual drawing operation, using the full set of vertices in the buffer - glDrawArrays(GL_TRIANGLES, 0, vecVertices.size()); -+ // Release the buffer name for reuse -+ glDeleteBuffers(1, &vertexBuffer); - - g_matrices.PopMatrix(); - } -@@ -220,6 +232,8 @@ void CGUIFontTTFGL::LastEnd() - g_graphicsContext.ResetScissors(); - // Restore the original model view matrix - glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); -+ // Unbind GL_ARRAY_BUFFER -+ glBindBuffer(GL_ARRAY_BUFFER, 0); - } - - // Disable the attributes used by this shader --- -1.8.5.1 - - -From 0751ac01d3cb02b36c21828c94c33c6d090a63b5 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Wed, 15 Jan 2014 16:04:04 +0000 -Subject: [PATCH 12/17] Move vertex data into an OpenGL VBO when the font cache - entry is populated. The font cache now stores the "name" (handle) of the VBO, - rather than a vector of vertices. - ---- - xbmc/guilib/GUIFontCache.cpp | 6 ++++ - xbmc/guilib/GUIFontCache.h | 30 +++++++++++++++++- - xbmc/guilib/GUIFontTTF.cpp | 15 +++++++-- - xbmc/guilib/GUIFontTTF.h | 7 +++-- - xbmc/guilib/GUIFontTTFGL.cpp | 74 ++++++++++++++++++++++++++++++-------------- - xbmc/guilib/GUIFontTTFGL.h | 5 +++ - 6 files changed, 107 insertions(+), 30 deletions(-) - -diff --git a/xbmc/guilib/GUIFontCache.cpp b/xbmc/guilib/GUIFontCache.cpp -index b66c00b..895fa72 100644 ---- a/xbmc/guilib/GUIFontCache.cpp -+++ b/xbmc/guilib/GUIFontCache.cpp -@@ -111,3 +111,9 @@ - template CGUIFontCacheEntry::~CGUIFontCacheEntry(); - template CGUIFontCacheDynamicValue &CGUIFontCache::Lookup(CGUIFontCacheDynamicPosition &, const vecColors &, const vecText &, uint32_t, float, bool, unsigned int, bool &); - template void CGUIFontCache::Flush(); -+ -+void CVertexBuffer::clear() -+{ -+ if (m_font != NULL) -+ m_font->DestroyVertexBuffer(*this); -+} -diff --git a/xbmc/guilib/GUIFontCache.h b/xbmc/guilib/GUIFontCache.h -index d913dee..ff766bf 100644 ---- a/xbmc/guilib/GUIFontCache.h -+++ b/xbmc/guilib/GUIFontCache.h -@@ -234,7 +234,35 @@ struct CGUIFontCacheDynamicPosition - } - }; - --typedef std::vector CGUIFontCacheDynamicValue; -+struct CVertexBuffer -+{ -+ void *bufferHandle; -+ size_t size; -+ CVertexBuffer() : bufferHandle(NULL), size(0), m_font(NULL) {} -+ CVertexBuffer(void *bufferHandle, size_t size, const CGUIFontTTFBase *font) : bufferHandle(bufferHandle), size(size), m_font(font) {} -+ CVertexBuffer(const CVertexBuffer &other) : bufferHandle(other.bufferHandle), size(other.size), m_font(other.m_font) -+ { -+ /* In practice, the copy constructor is only called before a vertex buffer -+ * has been attached. If this should ever change, we'll need another support -+ * function in GUIFontTTFGL/DX to duplicate a buffer, given its handle. */ -+ assert(other.bufferHandle == 0); -+ } -+ CVertexBuffer &operator=(CVertexBuffer &other) -+ { -+ /* This is used with move-assignment semantics for initialising the object in the font cache */ -+ assert(bufferHandle == 0); -+ bufferHandle = other.bufferHandle; -+ other.bufferHandle = 0; -+ size = other.size; -+ m_font = other.m_font; -+ return *this; -+ } -+ void clear(); -+private: -+ const CGUIFontTTFBase *m_font; -+}; -+ -+typedef CVertexBuffer CGUIFontCacheDynamicValue; - - inline bool Match(const CGUIFontCacheDynamicPosition &a, const TransformMatrix &a_m, - const CGUIFontCacheDynamicPosition &b, const TransformMatrix &b_m, -diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp -index 4dc4c8e..8b25306 100644 ---- a/xbmc/guilib/GUIFontTTF.cpp -+++ b/xbmc/guilib/GUIFontTTF.cpp -@@ -343,13 +343,18 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors - g_graphicsContext.ScaleFinalYCoord(x, y), - g_graphicsContext.ScaleFinalZCoord(x, y)); - } -- std::vector &vertices = hardwareClipping ? -+ CVertexBuffer unusedVertexBuffer; -+ CVertexBuffer &vertexBuffer = hardwareClipping ? - m_dynamicCache.Lookup(dynamicPos, - colors, text, - alignment, maxPixelWidth, - scrolling, - XbmcThreads::SystemClockMillis(), - dirtyCache) : -+ unusedVertexBuffer; -+ std::vector tempVertices; -+ std::vector &vertices = hardwareClipping ? -+ tempVertices : - m_staticCache.Lookup(staticPos, - colors, text, - alignment, maxPixelWidth, -@@ -459,10 +464,14 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors - cursorX += ch->advance; - } - if (hardwareClipping) -- m_vertexTrans.push_back(CTranslatedVertices(0, 0, 0, &vertices, g_graphicsContext.GetClipRegion())); -+ { -+ CVertexBuffer newVertexBuffer = CreateVertexBuffer(tempVertices); -+ vertexBuffer = newVertexBuffer; -+ m_vertexTrans.push_back(CTranslatedVertices(0, 0, 0, &vertexBuffer, g_graphicsContext.GetClipRegion())); -+ } - } - else if (hardwareClipping) -- m_vertexTrans.push_back(CTranslatedVertices(dynamicPos.m_x, dynamicPos.m_y, dynamicPos.m_z, &vertices, g_graphicsContext.GetClipRegion())); -+ m_vertexTrans.push_back(CTranslatedVertices(dynamicPos.m_x, dynamicPos.m_y, dynamicPos.m_z, &vertexBuffer, g_graphicsContext.GetClipRegion())); - if (!hardwareClipping) - /* Append the new vertices (from the cache or otherwise) to the set collected - * since the first Begin() call */ -diff --git a/xbmc/guilib/GUIFontTTF.h b/xbmc/guilib/GUIFontTTF.h -index 5e7c31f..b1cd525 100644 ---- a/xbmc/guilib/GUIFontTTF.h -+++ b/xbmc/guilib/GUIFontTTF.h -@@ -84,6 +84,9 @@ class CGUIFontTTFBase - - void Begin(); - void End(); -+ /* The next two should only be called if we've declared we can do hardware clipping */ -+ virtual CVertexBuffer CreateVertexBuffer(const std::vector &vertices) const { assert(false); return CVertexBuffer(); } -+ virtual void DestroyVertexBuffer(CVertexBuffer &bufferHandle) const {} - - const CStdString& GetFileName() const { return m_strFileName; }; - -@@ -167,9 +170,9 @@ class CGUIFontTTFBase - float translateX; - float translateY; - float translateZ; -- const std::vector *vertexBuffer; -+ const CVertexBuffer *vertexBuffer; - CRect clip; -- CTranslatedVertices(float translateX, float translateY, float translateZ, const std::vector *vertexBuffer, const CRect &clip) : translateX(translateX), translateY(translateY), translateZ(translateZ), vertexBuffer(vertexBuffer), clip(clip) {} -+ CTranslatedVertices(float translateX, float translateY, float translateZ, const CVertexBuffer *vertexBuffer, const CRect &clip) : translateX(translateX), translateY(translateY), translateZ(translateZ), vertexBuffer(vertexBuffer), clip(clip) {} - }; - std::vector m_vertexTrans; - std::vector m_vertex; -diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp -index 0df3749..1cd684b 100644 ---- a/xbmc/guilib/GUIFontTTFGL.cpp -+++ b/xbmc/guilib/GUIFontTTFGL.cpp -@@ -49,6 +49,10 @@ - - CGUIFontTTFGL::~CGUIFontTTFGL(void) - { -+ // It's important that all the CGUIFontCacheEntry objects are -+ // destructed before the CGUIFontTTFGL goes out of scope, because -+ // our virtual methods won't be accessible after this point -+ m_dynamicCache.Flush(); - } - - bool CGUIFontTTFGL::FirstBegin() -@@ -182,7 +186,6 @@ void CGUIFontTTFGL::LastEnd() - if (m_vertexTrans.size() > 0) - { - // Deal with the vertices that can be hardware clipped and therefore translated -- std::vector vecVertices; - for (size_t i = 0; i < m_vertexTrans.size(); i++) - { - // Apply the clip rectangle -@@ -195,36 +198,17 @@ void CGUIFontTTFGL::LastEnd() - g_matrices.Translatef(m_vertexTrans[i].translateX, m_vertexTrans[i].translateY, m_vertexTrans[i].translateZ); - glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); - -- vecVertices.clear(); -- for (size_t j = 0; j < m_vertexTrans[i].vertexBuffer->size(); j += 4) -- { -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j]); -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+1]); -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+2]); -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+1]); -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+3]); -- vecVertices.push_back((*m_vertexTrans[i].vertexBuffer)[j+2]); -- } -- SVertex *vertices = &vecVertices[0]; -- -- // Generate a unique buffer object name and put it in vertexBuffer -- GLuint vertexBuffer; -- glGenBuffers(1, &vertexBuffer); - // Bind the buffer to the OpenGL context's GL_ARRAY_BUFFER binding point -- glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); -- // Create a data store for the buffer object bound to the GL_ARRAY_BUFFER -- // binding point (i.e. our buffer object) and initialise it from the -- // specified client-side pointer -- glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof *vertices, vertices, GL_STATIC_DRAW); -+ glBindBuffer(GL_ARRAY_BUFFER, (GLuint) m_vertexTrans[i].vertexBuffer->bufferHandle); -+ - // Set up the offsets of the various vertex attributes within the buffer - // object bound to GL_ARRAY_BUFFER - glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, x)); - glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, r)); - glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, u)); -+ - // Do the actual drawing operation, using the full set of vertices in the buffer -- glDrawArrays(GL_TRIANGLES, 0, vecVertices.size()); -- // Release the buffer name for reuse -- glDeleteBuffers(1, &vertexBuffer); -+ glDrawArrays(GL_TRIANGLES, 0, 6 * m_vertexTrans[i].vertexBuffer->size); - - g_matrices.PopMatrix(); - } -@@ -245,6 +229,48 @@ void CGUIFontTTFGL::LastEnd() - #endif - } - -+#if HAS_GLES -+CVertexBuffer CGUIFontTTFGL::CreateVertexBuffer(const std::vector &vertices) const -+{ -+ // Rearrange the vertices to describe triangles -+ std::vector triangleVertices; -+ triangleVertices.reserve(vertices.size() * 6 / 4); -+ for (size_t i = 0; i < vertices.size(); i += 4) -+ { -+ triangleVertices.push_back(vertices[i]); -+ triangleVertices.push_back(vertices[i+1]); -+ triangleVertices.push_back(vertices[i+2]); -+ triangleVertices.push_back(vertices[i+1]); -+ triangleVertices.push_back(vertices[i+3]); -+ triangleVertices.push_back(vertices[i+2]); -+ } -+ -+ // Generate a unique buffer object name and put it in bufferHandle -+ GLuint bufferHandle; -+ glGenBuffers(1, &bufferHandle); -+ // Bind the buffer to the OpenGL context's GL_ARRAY_BUFFER binding point -+ glBindBuffer(GL_ARRAY_BUFFER, bufferHandle); -+ // Create a data store for the buffer object bound to the GL_ARRAY_BUFFER -+ // binding point (i.e. our buffer object) and initialise it from the -+ // specified client-side pointer -+ glBufferData(GL_ARRAY_BUFFER, triangleVertices.size() * sizeof (SVertex), &triangleVertices[0], GL_STATIC_DRAW); -+ // Unbind GL_ARRAY_BUFFER -+ glBindBuffer(GL_ARRAY_BUFFER, 0); -+ -+ return CVertexBuffer((void *) bufferHandle, vertices.size() / 4, this); -+} -+ -+void CGUIFontTTFGL::DestroyVertexBuffer(CVertexBuffer &buffer) const -+{ -+ if (buffer.bufferHandle != 0) -+ { -+ // Release the buffer name for reuse -+ glDeleteBuffers(1, (GLuint *) &buffer.bufferHandle); -+ buffer.bufferHandle = 0; -+ } -+} -+#endif -+ - CBaseTexture* CGUIFontTTFGL::ReallocTexture(unsigned int& newHeight) - { - newHeight = CBaseTexture::PadPow2(newHeight); -diff --git a/xbmc/guilib/GUIFontTTFGL.h b/xbmc/guilib/GUIFontTTFGL.h -index 6736cf7..168fb21 100644 ---- a/xbmc/guilib/GUIFontTTFGL.h -+++ b/xbmc/guilib/GUIFontTTFGL.h -@@ -29,6 +29,7 @@ - - - #include "GUIFontTTF.h" -+#include "system.h" - - - /*! -@@ -43,6 +44,10 @@ class CGUIFontTTFGL : public CGUIFontTTFBase - - virtual bool FirstBegin(); - virtual void LastEnd(); -+#if HAS_GLES -+ virtual CVertexBuffer CreateVertexBuffer(const std::vector &vertices) const; -+ virtual void DestroyVertexBuffer(CVertexBuffer &bufferHandle) const; -+#endif - - protected: - virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); --- -1.8.5.1 - - -From 694ebf8bb53c9d664c2750bc4d590bc84f7dac2b Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Thu, 16 Jan 2014 16:29:42 +0000 -Subject: [PATCH 13/17] Switch from glDrawArrays() to glDrawElements(). This - involves setting up a static VBO containing the indexes necessary to convert - from quads to triangles on the fly in the GPU. - ---- - xbmc/guilib/GUIFontTTFGL.cpp | 72 +++++++++++++++++++++++++------------ - xbmc/guilib/GUIFontTTFGL.h | 9 +++++ - xbmc/windowing/egl/WinSystemEGL.cpp | 17 +++++++++ - 3 files changed, 76 insertions(+), 22 deletions(-) - -diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp -index 1cd684b..d476409 100644 ---- a/xbmc/guilib/GUIFontTTFGL.cpp -+++ b/xbmc/guilib/GUIFontTTFGL.cpp -@@ -186,6 +186,10 @@ void CGUIFontTTFGL::LastEnd() - if (m_vertexTrans.size() > 0) - { - // Deal with the vertices that can be hardware clipped and therefore translated -+ -+ // Bind our pre-calculated array to GL_ELEMENT_ARRAY_BUFFER -+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_elementArrayHandle); -+ - for (size_t i = 0; i < m_vertexTrans.size(); i++) - { - // Apply the clip rectangle -@@ -201,14 +205,21 @@ void CGUIFontTTFGL::LastEnd() - // Bind the buffer to the OpenGL context's GL_ARRAY_BUFFER binding point - glBindBuffer(GL_ARRAY_BUFFER, (GLuint) m_vertexTrans[i].vertexBuffer->bufferHandle); - -- // Set up the offsets of the various vertex attributes within the buffer -- // object bound to GL_ARRAY_BUFFER -- glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, x)); -- glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, r)); -- glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, u)); -+ // Do the actual drawing operation, split into groups of characters no -+ // larger than the pre-determined size of the element array -+ for (size_t character = 0; m_vertexTrans[i].vertexBuffer->size > character; character += ELEMENT_ARRAY_MAX_CHAR_INDEX) -+ { -+ size_t count = m_vertexTrans[i].vertexBuffer->size - character; -+ count = std::min(count, ELEMENT_ARRAY_MAX_CHAR_INDEX); -+ -+ // Set up the offsets of the various vertex attributes within the buffer -+ // object bound to GL_ARRAY_BUFFER -+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) (character*sizeof(SVertex)*4 + offsetof(SVertex, x))); -+ glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (GLvoid *) (character*sizeof(SVertex)*4 + offsetof(SVertex, r))); -+ glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) (character*sizeof(SVertex)*4 + offsetof(SVertex, u))); - -- // Do the actual drawing operation, using the full set of vertices in the buffer -- glDrawArrays(GL_TRIANGLES, 0, 6 * m_vertexTrans[i].vertexBuffer->size); -+ glDrawElements(GL_TRIANGLES, 6 * count, GL_UNSIGNED_SHORT, 0); -+ } - - g_matrices.PopMatrix(); - } -@@ -216,8 +227,9 @@ void CGUIFontTTFGL::LastEnd() - g_graphicsContext.ResetScissors(); - // Restore the original model view matrix - glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); -- // Unbind GL_ARRAY_BUFFER -+ // Unbind GL_ARRAY_BUFFER and GL_ELEMENT_ARRAY_BUFFER - glBindBuffer(GL_ARRAY_BUFFER, 0); -+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - } - - // Disable the attributes used by this shader -@@ -232,19 +244,6 @@ void CGUIFontTTFGL::LastEnd() - #if HAS_GLES - CVertexBuffer CGUIFontTTFGL::CreateVertexBuffer(const std::vector &vertices) const - { -- // Rearrange the vertices to describe triangles -- std::vector triangleVertices; -- triangleVertices.reserve(vertices.size() * 6 / 4); -- for (size_t i = 0; i < vertices.size(); i += 4) -- { -- triangleVertices.push_back(vertices[i]); -- triangleVertices.push_back(vertices[i+1]); -- triangleVertices.push_back(vertices[i+2]); -- triangleVertices.push_back(vertices[i+1]); -- triangleVertices.push_back(vertices[i+3]); -- triangleVertices.push_back(vertices[i+2]); -- } -- - // Generate a unique buffer object name and put it in bufferHandle - GLuint bufferHandle; - glGenBuffers(1, &bufferHandle); -@@ -253,7 +252,7 @@ CVertexBuffer CGUIFontTTFGL::CreateVertexBuffer(const std::vector &vert - // Create a data store for the buffer object bound to the GL_ARRAY_BUFFER - // binding point (i.e. our buffer object) and initialise it from the - // specified client-side pointer -- glBufferData(GL_ARRAY_BUFFER, triangleVertices.size() * sizeof (SVertex), &triangleVertices[0], GL_STATIC_DRAW); -+ glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof (SVertex), &vertices[0], GL_STATIC_DRAW); - // Unbind GL_ARRAY_BUFFER - glBindBuffer(GL_ARRAY_BUFFER, 0); - -@@ -348,4 +347,33 @@ void CGUIFontTTFGL::DeleteHardwareTexture() - } - } - -+#if HAS_GLES -+void CGUIFontTTFGL::CreateStaticVertexBuffers(void) -+{ -+ // Bind a new buffer to the OpenGL context's GL_ELEMENT_ARRAY_BUFFER binding point -+ glGenBuffers(1, &m_elementArrayHandle); -+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_elementArrayHandle); -+ // Create an array holding the mesh indices to convert quads to triangles -+ GLushort index[ELEMENT_ARRAY_MAX_CHAR_INDEX][6]; -+ for (size_t i = 0; i < ELEMENT_ARRAY_MAX_CHAR_INDEX; i++) -+ { -+ index[i][0] = 4*i; -+ index[i][1] = 4*i+1; -+ index[i][2] = 4*i+2; -+ index[i][3] = 4*i+1; -+ index[i][4] = 4*i+3; -+ index[i][5] = 4*i+2; -+ } -+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof index, index, GL_STATIC_DRAW); -+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); -+} -+ -+void CGUIFontTTFGL::DestroyStaticVertexBuffers(void) -+{ -+ glDeleteBuffers(1, &m_elementArrayHandle); -+} -+ -+GLuint CGUIFontTTFGL::m_elementArrayHandle; -+#endif -+ - #endif -diff --git a/xbmc/guilib/GUIFontTTFGL.h b/xbmc/guilib/GUIFontTTFGL.h -index 168fb21..a14ab7a 100644 ---- a/xbmc/guilib/GUIFontTTFGL.h -+++ b/xbmc/guilib/GUIFontTTFGL.h -@@ -30,6 +30,7 @@ - - #include "GUIFontTTF.h" - #include "system.h" -+#include "system_gl.h" - - - /*! -@@ -47,6 +48,8 @@ class CGUIFontTTFGL : public CGUIFontTTFBase - #if HAS_GLES - virtual CVertexBuffer CreateVertexBuffer(const std::vector &vertices) const; - virtual void DestroyVertexBuffer(CVertexBuffer &bufferHandle) const; -+ static void CreateStaticVertexBuffers(void); -+ static void DestroyStaticVertexBuffers(void); - #endif - - protected: -@@ -54,6 +57,12 @@ class CGUIFontTTFGL : public CGUIFontTTFBase - virtual bool CopyCharToTexture(FT_BitmapGlyph bitGlyph, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2); - virtual void DeleteHardwareTexture(); - -+#if HAS_GLES -+#define ELEMENT_ARRAY_MAX_CHAR_INDEX (1000) -+ -+ static GLuint m_elementArrayHandle; -+#endif -+ - }; - - #endif -diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp -index 2f063e6..5a437c2 100644 ---- a/xbmc/windowing/egl/WinSystemEGL.cpp -+++ b/xbmc/windowing/egl/WinSystemEGL.cpp -@@ -29,6 +29,7 @@ - #include "settings/AdvancedSettings.h" - #include "settings/Settings.h" - #include "settings/DisplaySettings.h" -+#include "guilib/GUIFontTTFGL.h" - #include "utils/log.h" - #include "EGLWrapper.h" - #include "EGLQuirks.h" -@@ -192,6 +193,9 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) - return false; - } - -+#if HAS_GLES -+ bool newContext = false; -+#endif - if (m_context == EGL_NO_CONTEXT) - { - if (!m_egl->CreateContext(m_display, m_config, contextAttrs, &m_context)) -@@ -199,6 +203,9 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) - CLog::Log(LOGERROR, "%s: Could not create context",__FUNCTION__); - return false; - } -+#if HAS_GLES -+ newContext = true; -+#endif - } - - if (!m_egl->BindContext(m_display, m_surface, m_context)) -@@ -207,6 +214,11 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) - return false; - } - -+#if HAS_GLES -+ if (newContext) -+ CGUIFontTTFGL::CreateStaticVertexBuffers(); -+#endif -+ - // for the non-trivial dirty region modes, we need the EGL buffer to be preserved across updates - if (g_advancedSettings.m_guiAlgorithmDirtyRegions == DIRTYREGION_SOLVER_COST_REDUCTION || - g_advancedSettings.m_guiAlgorithmDirtyRegions == DIRTYREGION_SOLVER_UNION) -@@ -228,7 +240,12 @@ bool CWinSystemEGL::DestroyWindowSystem() - DestroyWindow(); - - if (m_context != EGL_NO_CONTEXT) -+ { -+#if HAS_GLES -+ CGUIFontTTFGL::DestroyStaticVertexBuffers(); -+#endif - m_egl->DestroyContext(m_display, m_context); -+ } - m_context = EGL_NO_CONTEXT; - - if (m_display != EGL_NO_DISPLAY) --- -1.8.5.1 - - -From 973ea1a1b04d7fb1a43f7486a039855102c2abcf Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Tue, 4 Feb 2014 16:17:57 +0000 -Subject: [PATCH 14/17] Update Windows project files - ---- - project/VS2010Express/XBMC.vcxproj | 2 ++ - project/VS2010Express/XBMC.vcxproj.filters | 6 ++++++ - 2 files changed, 8 insertions(+) - -diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj -index 3d9875c..413206f 100644 ---- a/project/VS2010Express/XBMC.vcxproj -+++ b/project/VS2010Express/XBMC.vcxproj -@@ -539,6 +539,7 @@ - - - -+ - - - -@@ -2060,6 +2061,7 @@ - - - -+ - - - -diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters -index b5e72d9..190e598 100644 ---- a/project/VS2010Express/XBMC.vcxproj.filters -+++ b/project/VS2010Express/XBMC.vcxproj.filters -@@ -1036,6 +1036,9 @@ - - guilib - -+ -+ guilib -+ - - guilib - -@@ -4002,6 +4005,9 @@ - - guilib - -+ -+ guilib -+ - - guilib - --- -1.8.5.1 - - -From 4a1c8ecbaf4a129100a6af4c5cd5031449bfe218 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Tue, 4 Feb 2014 16:49:45 +0000 -Subject: [PATCH 15/17] Update XCode project file - ---- - XBMC.xcodeproj/project.pbxproj | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj -index ae59e25..8cec946 100644 ---- a/XBMC.xcodeproj/project.pbxproj -+++ b/XBMC.xcodeproj/project.pbxproj -@@ -168,6 +168,9 @@ - 1D638128161E211E003603ED /* PeripheralImon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1D638126161E211E003603ED /* PeripheralImon.cpp */; }; - 1DAFDB7C16DFDCA7007F8C68 /* PeripheralBusCEC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1DAFDB7A16DFDCA7007F8C68 /* PeripheralBusCEC.cpp */; }; - 1DE0443515828F4B005DDB4D /* Exception.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1DE0443315828F4B005DDB4D /* Exception.cpp */; }; -+ 2FD7EC5F18A14FE50047F86C /* GUIFontCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2FD7EC5D18A14FE50047F86C /* GUIFontCache.cpp */; }; -+ 2FD7EC6018A14FE50047F86C /* GUIFontCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2FD7EC5D18A14FE50047F86C /* GUIFontCache.cpp */; }; -+ 2FD7EC6118A14FE50047F86C /* GUIFontCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2FD7EC5D18A14FE50047F86C /* GUIFontCache.cpp */; }; - 32C631281423A90F00F18420 /* JpegIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32C631261423A90F00F18420 /* JpegIO.cpp */; }; - 36A9443D15821E2800727135 /* DatabaseUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443B15821E2800727135 /* DatabaseUtils.cpp */; }; - 36A9444115821E7C00727135 /* SortUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443F15821E7C00727135 /* SortUtils.cpp */; }; -@@ -3523,6 +3526,8 @@ - 1DAFDB7B16DFDCA7007F8C68 /* PeripheralBusCEC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeripheralBusCEC.h; sourceTree = ""; }; - 1DE0443315828F4B005DDB4D /* Exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Exception.cpp; path = commons/Exception.cpp; sourceTree = ""; }; - 1DE0443415828F4B005DDB4D /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Exception.h; path = commons/Exception.h; sourceTree = ""; }; -+ 2FD7EC5D18A14FE50047F86C /* GUIFontCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIFontCache.cpp; sourceTree = ""; }; -+ 2FD7EC5E18A14FE50047F86C /* GUIFontCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIFontCache.h; sourceTree = ""; }; - 32C631261423A90F00F18420 /* JpegIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JpegIO.cpp; sourceTree = ""; }; - 32C631271423A90F00F18420 /* JpegIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JpegIO.h; sourceTree = ""; }; - 36A9443B15821E2800727135 /* DatabaseUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseUtils.cpp; sourceTree = ""; }; -@@ -5865,6 +5870,8 @@ - 18B7C76A1294222E009E7A26 /* GUIFixedListContainer.cpp */, - 18B7C7101294222D009E7A26 /* GUIFixedListContainer.h */, - 18B7C76B1294222E009E7A26 /* GUIFont.cpp */, -+ 2FD7EC5D18A14FE50047F86C /* GUIFontCache.cpp */, -+ 2FD7EC5E18A14FE50047F86C /* GUIFontCache.h */, - 18B7C7111294222D009E7A26 /* GUIFont.h */, - 18B7C76C1294222E009E7A26 /* GUIFontManager.cpp */, - 18B7C7121294222D009E7A26 /* GUIFontManager.h */, -@@ -10749,6 +10756,7 @@ - 7C1409A9184015C9009F9411 /* InfoExpression.cpp in Sources */, - AE32174218313ADF0003FAFC /* XSLTUtils.cpp in Sources */, - 7C15DCBC1892481400FCE564 /* InfoBool.cpp in Sources */, -+ 2FD7EC5F18A14FE50047F86C /* GUIFontCache.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -@@ -11792,6 +11800,7 @@ - 7C1409AB184015C9009F9411 /* InfoExpression.cpp in Sources */, - AE32174318313AE10003FAFC /* XSLTUtils.cpp in Sources */, - 7C15DCBE1892481400FCE564 /* InfoBool.cpp in Sources */, -+ 2FD7EC6118A14FE50047F86C /* GUIFontCache.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -@@ -12837,6 +12846,7 @@ - 7C1409AA184015C9009F9411 /* InfoExpression.cpp in Sources */, - AE4E87A717354C4A00D15206 /* XSLTUtils.cpp in Sources */, - 7C15DCBD1892481400FCE564 /* InfoBool.cpp in Sources */, -+ 2FD7EC6018A14FE50047F86C /* GUIFontCache.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; --- -1.8.5.1 - - -From 661e76a40031c17e726b87f13005de6d17c4e2da Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Tue, 4 Feb 2014 17:44:34 +0000 -Subject: [PATCH 16/17] Clang seems to be more picky than gcc about some C++ - template syntax - ---- - xbmc/guilib/GUIFontCache.cpp | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) - -diff --git a/xbmc/guilib/GUIFontCache.cpp b/xbmc/guilib/GUIFontCache.cpp -index 895fa72..bd84b9a 100644 ---- a/xbmc/guilib/GUIFontCache.cpp -+++ b/xbmc/guilib/GUIFontCache.cpp -@@ -61,26 +61,26 @@ - alignment, maxPixelWidth, - scrolling, g_graphicsContext.GetGUIMatrix(), - g_graphicsContext.GetGUIScaleX(), g_graphicsContext.GetGUIScaleY()); -- EntryHashIterator i = m_list.get().find(key); -- if (i == m_list.get().end()) -+ EntryHashIterator i = m_list.template get().find(key); -+ if (i == m_list.template get().end()) - { - /* Cache miss */ -- EntryAgeIterator oldest = m_list.get().begin(); -- if (!m_list.get().empty() && nowMillis - oldest->m_lastUsedMillis > FONT_CACHE_TIME_LIMIT) -+ EntryAgeIterator oldest = m_list.template get().begin(); -+ if (!m_list.template get().empty() && nowMillis - oldest->m_lastUsedMillis > FONT_CACHE_TIME_LIMIT) - { - /* The oldest existing entry is old enough to expire and reuse */ -- m_list.get().modify(m_list.project(oldest), typename CGUIFontCacheEntry::Reassign(key, nowMillis)); -- m_list.get().relocate(m_list.get().end(), oldest); -+ m_list.template get().modify(m_list.template project(oldest), typename CGUIFontCacheEntry::Reassign(key, nowMillis)); -+ m_list.template get().relocate(m_list.template get().end(), oldest); - } - else - { - /* We need a new entry instead */ - /* Yes, this causes the creation an destruction of a temporary entry, but - * this code ought to only be used infrequently, when the cache needs to grow */ -- m_list.get().push_back(CGUIFontCacheEntry(*this, key, nowMillis)); -+ m_list.template get().push_back(CGUIFontCacheEntry(*this, key, nowMillis)); - } - dirtyCache = true; -- return (--m_list.get().end())->m_value; -+ return (--m_list.template get().end())->m_value; - } - else - { -@@ -90,7 +90,7 @@ - pos.UpdateWithOffsets(i->m_key.m_pos, scrolling); - /* Update time in entry and move to the back of the list */ - i->m_lastUsedMillis = nowMillis; -- m_list.get().relocate(m_list.get().end(), m_list.project(i)); -+ m_list.template get().relocate(m_list.template get().end(), m_list.template project(i)); - dirtyCache = false; - return i->m_value; - } -@@ -99,7 +99,7 @@ - template - void CGUIFontCache::Flush() - { -- m_list.get().clear(); -+ m_list.template get().clear(); - } - - template void CGUIFontCacheEntry::Reassign::operator()(CGUIFontCacheEntry &entry); --- -1.8.5.1 - - -From c4db53861a2bf05b0e4f914a4a1e388ff2426f04 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Tue, 4 Feb 2014 18:52:14 +0000 -Subject: [PATCH 17/17] Fix header to hopefully permit iOS builds to work - again. GUIShader.cpp added #include windowing/egl/WinSystemEGL.h inside a but - also need the header windowing/osx/WinSystemIOS.h instead. The only thing - GUIShader.cpp needed was g_windowing.GetViewPort, which is provided by the - common base class CRenderSystemGLES of g_windowing in both cases, so I think - it should be sufficient to use windowing/WindowingFactory.h instead, which is - abstracted away from the other header files. - ---- - xbmc/guilib/GUIShader.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/guilib/GUIShader.cpp b/xbmc/guilib/GUIShader.cpp -index 53bce09..86330cc 100644 ---- a/xbmc/guilib/GUIShader.cpp -+++ b/xbmc/guilib/GUIShader.cpp -@@ -26,7 +26,7 @@ - #include "GUIShader.h" - #include "MatrixGLES.h" - #include "utils/log.h" --#include "windowing/egl/WinSystemEGL.h" -+#include "windowing/WindowingFactory.h" - #include "guilib/GraphicContext.h" - - CGUIShader::CGUIShader( const char *shader ) : CGLSLShaderProgram("guishader_vert.glsl", shader) --- -1.8.5.1 -