aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Borges de Freitas <92enen@gmail.com>2023-02-21 19:12:58 +0000
committerenen92 <92enen@gmail.com>2023-02-22 17:40:45 +0000
commit43555feb922ea9096f1caede49bfde5e0edf1552 (patch)
tree97f2cb6f9ee3cac6b871a307db52a5a53ed7e5c0
parentf5de6ceb6581ca1270bc016a59624baaf2a33c8a (diff)
[GUI][GUIImage] Fix inconsistencies for colordiffuse
-rw-r--r--xbmc/guilib/GUIImage.cpp14
-rw-r--r--xbmc/guilib/GUIImage.h6
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