From 6501ecf527a61ef1f2e9fe424ffc43069937cd83 Mon Sep 17 00:00:00 2001 From: Kingsley Stephens Date: Tue, 25 Nov 2014 10:36:42 +0000 Subject: [PATCH] Speed up Dali Demo loading by removing redundant table resize on image load Change-Id: I52ea6a18647e5dfe3901f433fc6981080a5fcef6 --- demo/dali-table-view.cpp | 9 ++------- demo/dali-table-view.h | 7 ------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/demo/dali-table-view.cpp b/demo/dali-table-view.cpp index 4f7176b..454a16d 100644 --- a/demo/dali-table-view.cpp +++ b/demo/dali-table-view.cpp @@ -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(); diff --git a/demo/dali-table-view.h b/demo/dali-table-view.h index 78b1015..f59e6ef 100644 --- a/demo/dali-table-view.h +++ b/demo/dali-table-view.h @@ -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 -- 2.7.4