Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-demo.git] / examples / cube-transition-effect / cube-transition-effect-example.cpp
index 5f338e4..300b92a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -222,9 +222,9 @@ void CubeTransitionApp::OnInit( Application& application )
   Toolkit::ToggleButton effectChangeToggleButton = Toolkit::ToggleButton::ToggleButton::New();
 
   effectChangeToggleButton.SetProperty( Toolkit::ToggleButton::Property::STATE_VISUALS,
-                                        Property::Array().Add( EFFECT_WAVE_IMAGE )
-                                                         .Add( EFFECT_CROSS_IMAGE)
-                                                         .Add( EFFECT_FOLD_IMAGE )
+                                        Property::Array{ EFFECT_WAVE_IMAGE,
+                                                         EFFECT_CROSS_IMAGE,
+                                                         EFFECT_FOLD_IMAGE }
                                       );
 
   effectChangeToggleButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnEffectButtonClicked );
@@ -394,9 +394,9 @@ bool CubeTransitionApp::OnTimerTick()
 Texture CubeTransitionApp::LoadStageFillingTexture( const char* filepath )
 {
   ImageDimensions dimensions( Stage::GetCurrent().GetSize().x, Stage::GetCurrent().GetSize().y );
-  BitmapLoader loader = BitmapLoader::New( filepath, dimensions, FittingMode::SCALE_TO_FILL );
-  loader.Load();
-  PixelData pixelData = loader.GetPixelData();
+  Devel::PixelBuffer pixelBuffer = LoadImageFromFile( filepath, dimensions, FittingMode::SCALE_TO_FILL );
+  PixelData pixelData = Devel::PixelBuffer::Convert(pixelBuffer);
+
   Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
   texture.Upload( pixelData );
   return texture;
@@ -413,7 +413,6 @@ void CubeTransitionApp::OnKeyEvent(const KeyEvent& event)
   }
 }
 
-// Entry point for Linux & Tizen applications
 int DALI_EXPORT_API main( int argc, char **argv )
 {
   Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );