[vlc-commits] skins2: reuse graphics from generic bitmap cache (radialslider)

Erwan Tulou git at videolan.org
Sat Apr 6 14:50:09 CEST 2013


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Sat Apr  6 02:20:59 2013 +0200| [4166f7e89da522095609242cf8b6d770a4da6267] | committer: Erwan Tulou

skins2: reuse graphics from generic bitmap cache (radialslider)

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

 modules/gui/skins2/controls/ctrl_radialslider.cpp |   15 ++++-----------
 modules/gui/skins2/controls/ctrl_radialslider.hpp |    4 +---
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/modules/gui/skins2/controls/ctrl_radialslider.cpp b/modules/gui/skins2/controls/ctrl_radialslider.cpp
index 14a6e2d..e06673a 100644
--- a/modules/gui/skins2/controls/ctrl_radialslider.cpp
+++ b/modules/gui/skins2/controls/ctrl_radialslider.cpp
@@ -40,17 +40,11 @@ CtrlRadialSlider::CtrlRadialSlider( intf_thread_t *pIntf,
                                     VarBool *pVisible ):
     CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ), m_numImg( numImg ),
     m_rVariable( rVariable ), m_minAngle( minAngle ), m_maxAngle( maxAngle ),
-    m_position( 0 ), m_cmdUpDown( this ), m_cmdDownUp( this ),
-    m_cmdMove( this )
+    m_position( 0 ),
+    m_width( rBmpSeq.getWidth() ), m_height( rBmpSeq.getHeight() / numImg ),
+    m_pImgSeq( rBmpSeq.getGraphics() ),
+    m_cmdUpDown( this ), m_cmdDownUp( this ), m_cmdMove( this )
 {
-    // Build the images of the sequence
-    m_pImgSeq = OSFactory::instance( getIntf() )->createOSGraphics(
-                                     rBmpSeq.getWidth(), rBmpSeq.getHeight() );
-    m_pImgSeq->drawBitmap( rBmpSeq, 0, 0 );
-
-    m_width = rBmpSeq.getWidth();
-    m_height = rBmpSeq.getHeight() / numImg;
-
     // States
     m_fsm.addState( "up" );
     m_fsm.addState( "down" );
@@ -71,7 +65,6 @@ CtrlRadialSlider::CtrlRadialSlider( intf_thread_t *pIntf,
 CtrlRadialSlider::~CtrlRadialSlider()
 {
     m_rVariable.delObserver( this );
-    delete m_pImgSeq;
 }
 
 
diff --git a/modules/gui/skins2/controls/ctrl_radialslider.hpp b/modules/gui/skins2/controls/ctrl_radialslider.hpp
index e17852b..b7d427b 100644
--- a/modules/gui/skins2/controls/ctrl_radialslider.hpp
+++ b/modules/gui/skins2/controls/ctrl_radialslider.hpp
@@ -76,9 +76,7 @@ private:
     /// The last received event
     EvtGeneric *m_pEvt;
     /// Sequence of images
-    OSGraphics *m_pImgSeq;
-    /// Last saved position
-    int m_lastPos;
+    const OSGraphics * const m_pImgSeq;
 
     /// Callback objects
     DEFINE_CALLBACK( CtrlRadialSlider, UpDown )



More information about the vlc-commits mailing list