[vlc-commits] commit: skins2: fix minor artefact with animated image (Erwan Tulou )

git at videolan.org git at videolan.org
Mon Nov 22 16:36:16 CET 2010


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Fri Nov 19 19:58:36 2010 +0100| [a38c6d0f5f5779fd39367988091c52db3d155c8c] | committer: Erwan Tulou 

skins2: fix minor artefact with animated image

Don't do anything if the image doesn't change. Otherwise, some unpleasant
flickering occurs when the image is animated.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a38c6d0f5f5779fd39367988091c52db3d155c8c
---

 modules/gui/skins2/controls/ctrl_button.cpp   |    3 +++
 modules/gui/skins2/controls/ctrl_checkbox.cpp |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/modules/gui/skins2/controls/ctrl_button.cpp b/modules/gui/skins2/controls/ctrl_button.cpp
index 1c19bc3..b89a26a 100644
--- a/modules/gui/skins2/controls/ctrl_button.cpp
+++ b/modules/gui/skins2/controls/ctrl_button.cpp
@@ -132,6 +132,9 @@ void CtrlButton::draw( OSGraphics &rImage, int xDest, int yDest, int w, int h )
 
 void CtrlButton::setImage( AnimBitmap *pImg )
 {
+    if( pImg == m_pImg )
+        return;
+
     AnimBitmap *pOldImg = m_pImg;
     m_pImg = pImg;
 
diff --git a/modules/gui/skins2/controls/ctrl_checkbox.cpp b/modules/gui/skins2/controls/ctrl_checkbox.cpp
index 82991a8..428c339 100644
--- a/modules/gui/skins2/controls/ctrl_checkbox.cpp
+++ b/modules/gui/skins2/controls/ctrl_checkbox.cpp
@@ -159,6 +159,9 @@ void CtrlCheckbox::draw( OSGraphics &rImage, int xDest, int yDest, int w, int h
 
 void CtrlCheckbox::setImage( AnimBitmap *pImg )
 {
+    if( pImg == m_pImgCurrent )
+        return;
+
     AnimBitmap *pOldImg = m_pImgCurrent;
     m_pImgCurrent = pImg;
 



More information about the vlc-commits mailing list