Speed up Dali Demo loading by removing redundant table resize on image load 85/32385/1
authorKingsley Stephens <k.stephens@partner.samsung.com>
Tue, 25 Nov 2014 10:36:42 +0000 (10:36 +0000)
committerKingsley Stephens <k.stephens@partner.samsung.com>
Wed, 17 Dec 2014 14:30:49 +0000 (14:30 +0000)
Change-Id: I52ea6a18647e5dfe3901f433fc6981080a5fcef6

demo/dali-table-view.cpp
demo/dali-table-view.h

index 4f7176b..454a16d 100644 (file)
@@ -277,6 +277,8 @@ void DaliTableView::Initialize( Application& application )
 
   // Add logo
   mLogo = CreateLogo( LOGO_PATH );
+  mRootActor.SetFixedHeight( 1, mLogo.GetImage().GetHeight() + LOGO_BOTTOM_PADDING_HEIGHT );
+
   Alignment alignment = Alignment::New();
   alignment.Add(mLogo);
   mRootActor.AddChild( alignment, TableView::CellPosition( 1, 0 ) );
@@ -920,8 +922,6 @@ void DaliTableView::GenerateCircle( const Size& size, std::vector< unsigned char
 ImageActor DaliTableView::CreateLogo( std::string imagePath )
 {
   Image image = Image::New( imagePath );
-  image.LoadingFinishedSignal().Connect( this, &DaliTableView::OnLogoLoaded );
-
   ImageActor logo = ImageActor::New( image );
 
   logo.SetAnchorPoint( AnchorPoint::CENTER );
@@ -930,11 +930,6 @@ ImageActor DaliTableView::CreateLogo( std::string imagePath )
   return logo;
 }
 
-void DaliTableView::OnLogoLoaded( Dali::Image image )
-{
-  mRootActor.SetFixedHeight( 1, image.GetHeight() + LOGO_BOTTOM_PADDING_HEIGHT );
-}
-
 bool DaliTableView::PauseBackgroundAnimation()
 {
   PauseAnimation();
index 78b1015..f59e6ef 100644 (file)
@@ -327,13 +327,6 @@ private: // Application callbacks & implementation
   Dali::ImageActor CreateLogo( std::string imagePath );
 
   /**
-   * Callback for when the logo image is loaded
-   *
-   * @param[in] image The loaded logo image
-   */
-  void OnLogoLoaded( Dali::Image image );
-
-  /**
    * Timer handler for ending background animation
    *
    * @return Return value for timer handler