From 43555feb922ea9096f1caede49bfde5e0edf1552 Mon Sep 17 00:00:00 2001 From: Miguel Borges de Freitas <92enen@gmail.com> Date: Tue, 21 Feb 2023 19:12:58 +0000 Subject: [GUI][GUIImage] Fix inconsistencies for colordiffuse --- xbmc/guilib/GUIImage.cpp | 14 +++++++++++--- xbmc/guilib/GUIImage.h | 6 ++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/xbmc/guilib/GUIImage.cpp b/xbmc/guilib/GUIImage.cpp index 82d8775949..0a87c2e002 100644 --- a/xbmc/guilib/GUIImage.cpp +++ b/xbmc/guilib/GUIImage.cpp @@ -60,8 +60,19 @@ void CGUIImage::UpdateVisibility(const CGUIListItem *item) AllocateOnDemand(); } +void CGUIImage::UpdateDiffuseColor(const CGUIListItem* item) +{ + if (m_texture->SetDiffuseColor(m_diffuseColor, item)) + { + MarkDirtyRegion(); + } +} + void CGUIImage::UpdateInfo(const CGUIListItem *item) { + // Update the diffuse color. The texture diffuse color may depend on the current item + UpdateDiffuseColor(item); + if (m_info.IsConstant()) return; // nothing to do @@ -156,9 +167,6 @@ void CGUIImage::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions MarkDirtyRegion(); } - if (m_texture->SetDiffuseColor(m_diffuseColor)) - MarkDirtyRegion(); - if (m_texture->Process(currentTime)) MarkDirtyRegion(); diff --git a/xbmc/guilib/GUIImage.h b/xbmc/guilib/GUIImage.h index 8ce80a5a1c..e9e934767f 100644 --- a/xbmc/guilib/GUIImage.h +++ b/xbmc/guilib/GUIImage.h @@ -95,6 +95,12 @@ protected: unsigned char GetFadeLevel(unsigned int time) const; bool ProcessFading(CFadingTexture *texture, unsigned int frameTime, unsigned int currentTime); + /*! + * \brief Update the diffuse color based on the current item infos + * \param item the item to for info resolution + */ + void UpdateDiffuseColor(const CGUIListItem* item); + bool m_bDynamicResourceAlloc; // border + conditional info -- cgit v1.2.3