[vlc-devel] commit: skins2 : fully support transparency for buttons. (Erwan Tulou )

git version control git at videolan.org
Sat May 23 21:40:31 CEST 2009


vlc | branch: master | Erwan Tulou <brezhoneg1 at yahoo.fr> | Sat May 23 09:40:24 2009 +0200| [f56161ec9f0e4a2cba80a8f37d5fa880d7444248] | committer: Jean-Baptiste Kempf 

skins2 : fully support transparency for buttons.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/skins2/src/anim_bitmap.cpp |   12 +++++++++---
 modules/gui/skins2/src/anim_bitmap.hpp |    2 ++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/modules/gui/skins2/src/anim_bitmap.cpp b/modules/gui/skins2/src/anim_bitmap.cpp
index 1b182b2..2f66dec 100644
--- a/modules/gui/skins2/src/anim_bitmap.cpp
+++ b/modules/gui/skins2/src/anim_bitmap.cpp
@@ -30,7 +30,7 @@
 
 AnimBitmap::AnimBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap ):
     SkinObject( pIntf ), m_pImage( NULL ), m_curFrame( 0 ), m_pTimer( NULL ),
-    m_cmdNextFrame( this )
+    m_cmdNextFrame( this ), m_rBitmap( rBitmap )
 {
     // Build the graphics
     OSFactory *pOsFactory = OSFactory::instance( pIntf );
@@ -73,8 +73,14 @@ void AnimBitmap::draw( OSGraphics &rImage, int xDest, int yDest )
     // Draw the current frame
     int height = m_pImage->getHeight() / m_nbFrames;
     int ySrc = height * m_curFrame;
-    rImage.drawGraphics( *m_pImage, 0, ySrc, xDest, yDest,
-                         m_pImage->getWidth(), height );
+
+    // The old way .... transparency was not taken care of
+    // rImage.drawGraphics( *m_pImage, 0, ySrc, xDest, yDest,
+    //                      m_pImage->getWidth(), height );
+
+    // A new way .... needs to be tested thoroughly
+    rImage.drawBitmap( m_rBitmap, 0, ySrc, xDest, yDest,
+                       m_pImage->getWidth(), height, true );
 }
 
 
diff --git a/modules/gui/skins2/src/anim_bitmap.hpp b/modules/gui/skins2/src/anim_bitmap.hpp
index d40bc73..58fd30a 100644
--- a/modules/gui/skins2/src/anim_bitmap.hpp
+++ b/modules/gui/skins2/src/anim_bitmap.hpp
@@ -59,6 +59,8 @@ class AnimBitmap: public SkinObject, public Box,
         virtual int getHeight() const;
 
     private:
+        /// Bitmap stored
+        const GenericBitmap &m_rBitmap;
         /// Graphics to store the bitmap
         OSGraphics *m_pImage;
         /// Number of frames




More information about the vlc-devel mailing list