Skip to content

Commit

Permalink
kodi: fix gui drawing issue on some platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
warpme committed Jan 10, 2025
1 parent 22cd65e commit 27c32af
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
2 changes: 2 additions & 0 deletions script/mediaplayers/kodi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ PATCHFILES += 0052-update-libdvdnav-sha.patch
PATCHFILES += 0053-stop-uncoditionally-building-udfread.patch
PATCHFILES += 0054-stop-detecting-clang.patch
PATCHFILES += 0055-stop-using-10bitRGB-for-gui-plane.patch
PATCHFILES += 0056-PR25981-EGL_KHR_partial_update.patch

WORKSRC = $(WORKDIR)/xbmc-$(GARVERSION)

LICENSE = GPL
Expand Down
1 change: 1 addition & 0 deletions script/mediaplayers/kodi/checksums
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ e9853e591769aca02eedc4e4923a9ebe download/0052-update-libdvdnav-sha.patch
ee5b64b896acb7bdceeae8ffc7730492 download/0053-stop-uncoditionally-building-udfread.patch
480a4944f671147882ea709f4c7fd19f download/0054-stop-detecting-clang.patch
1606b6602b02e92431633bb11d8c3853 download/0055-stop-using-10bitRGB-for-gui-plane.patch
d9bdea38f3a4be991f4589d1094e847e download/0056-PR25981-EGL_KHR_partial_update.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
From 67415370fd17eea05e5d93c3e4562c13145d9cee Mon Sep 17 00:00:00 2001
From: sarbes <[email protected]>
Date: Sun, 17 Nov 2024 22:47:32 +0100
Subject: [PATCH] Fix rendering for EGL_KHR_partial_update enabled platforms

---
xbmc/guilib/GUIWindowManager.cpp | 5 ++++-
xbmc/utils/EGLUtils.cpp | 9 ++++++---
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp
index 8d7802e4b672e..4f893c4dd3577 100644
--- a/xbmc/guilib/GUIWindowManager.cpp
+++ b/xbmc/guilib/GUIWindowManager.cpp
@@ -43,6 +43,7 @@
#include "settings/windows/GUIWindowSettingsCategory.h"
#include "settings/windows/GUIWindowSettingsScreenCalibration.h"
#include "threads/SingleLock.h"
+#include "utils/Geometry.h"
#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
#include "utils/Variant.h"
@@ -1367,7 +1368,6 @@ bool CGUIWindowManager::Render()
m_tracker.CleanMarkedRegions(10);

CDirtyRegionList dirtyRegions = m_tracker.GetDirtyRegions();
- CServiceBroker::GetWinSystem()->SetDirtyRegions(dirtyRegions);

bool hasRendered = false;
// If we visualize the regions we will always render the entire viewport
@@ -1394,6 +1394,9 @@ bool CGUIWindowManager::Render()
if (i.IsEmpty())
continue;

+ if (!hasRendered)
+ CServiceBroker::GetWinSystem()->SetDirtyRegions(dirtyRegions);
+
CServiceBroker::GetWinSystem()->GetGfxContext().SetScissors(i);
RenderPass();
hasRendered = true;
diff --git a/xbmc/utils/EGLUtils.cpp b/xbmc/utils/EGLUtils.cpp
index 01867354cf363..a7cf808043694 100644
--- a/xbmc/utils/EGLUtils.cpp
+++ b/xbmc/utils/EGLUtils.cpp
@@ -667,13 +667,16 @@ void CEGLContextUtils::SetDamagedRegions(const CDirtyRegionList& dirtyRegions)
}
else
{
- EGLint height = eglQuerySurface(m_eglDisplay, m_eglSurface, EGL_HEIGHT, &height);
+ EGLint height;
+ eglQuerySurface(m_eglDisplay, m_eglSurface, EGL_HEIGHT, &height);
std::vector<Rect> rects;
rects.reserve(dirtyRegions.size());
for (const auto& region : dirtyRegions)
{
- rects.push_back({static_cast<EGLint>(region.x1), static_cast<EGLint>(height - region.y2),
- static_cast<EGLint>(region.Width()), static_cast<EGLint>(region.Height())});
+ rects.push_back({static_cast<EGLint>(std::round(region.x1)),
+ static_cast<EGLint>(std::round(height - region.y2)),
+ static_cast<EGLint>(std::round(region.Width())),
+ static_cast<EGLint>(std::round(region.Height()))});
}
m_eglSetDamageRegionKHR(m_eglDisplay, m_eglSurface, reinterpret_cast<EGLint*>(rects.data()),
rects.size());

0 comments on commit 27c32af

Please sign in to comment.