From: Adeel Kazmi Date: Fri, 8 Jul 2016 11:17:49 +0000 (-0700) Subject: Merge "(Automated Tests) Increase line coverage of Builder" into devel/master X-Git-Tag: dali_1.1.43~20 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=ab01efc8b47c89288c7fbc9948dead57d0411c1f;hp=181e7013001eabaea30eda4f56fed71ef7e8a8c8 Merge "(Automated Tests) Increase line coverage of Builder" into devel/master --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp index a8aca48..07b810f 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp @@ -147,3 +147,59 @@ int UtcDaliCheckBoxButtonSetGetSelected(void) DALI_TEST_CHECK( gCheckBoxButtonState ); END_TEST; } + +int UtcDaliCheckBoxSetLabelP(void) +{ + TestApplication application; + + CheckBoxButton checkBox = CheckBoxButton::New(); + + Property::Map propertyMap; + propertyMap.Insert("text", "activate"); + checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap ); + + DALI_TEST_EQUALS( checkBox.GetLabelText(), "activate", TEST_LOCATION ); // Change to use GerProperty once that code is implemented + + END_TEST; +} + +int UtcDaliCheckBoxSetLabelDisabledP(void) +{ + TestApplication application; + + CheckBoxButton checkBox = CheckBoxButton::New(); + Stage::GetCurrent().Add( checkBox ); + + checkBox.SetSize( Vector2( 20.0f, 20.0f ) ); + checkBox.SetDisabledBackgroundImage( "Image.jpg" ); + + application.SendNotification(); + application.Render(); + + Property::Map propertyMap; + propertyMap.Insert("text", "activate"); + checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), true); + + checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap ); + + DALI_TEST_CHECK( checkBox.GetProperty(checkBox.GetPropertyIndex("disabled")) ); + DALI_TEST_EQUALS( checkBox.GetLabelText(), "activate", TEST_LOCATION ); // Change to use GerProperty once that code is implemented + + END_TEST; +} + +int UtcDaliCheckBoxSettingDisabled(void) +{ + ToolkitTestApplication application; + + CheckBoxButton checkBox = CheckBoxButton::New(); + + checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), true); + DALI_TEST_CHECK( checkBox.GetProperty(checkBox.GetPropertyIndex("disabled")) ); + + checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), false); + + DALI_TEST_CHECK( !checkBox.GetProperty(checkBox.GetPropertyIndex("disabled")) ); + + END_TEST; +} diff --git a/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp b/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp index e759409..5efd46d 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -77,14 +78,14 @@ void Wait(ToolkitTestApplication& application, float durationToPass) class TransitionCompletedCallback : public Dali::ConnectionTracker { public: - TransitionCompletedCallback( bool& signalReceived, CubeTransitionEffect& effect, Image& image ) + TransitionCompletedCallback( bool& signalReceived, CubeTransitionEffect& effect, Texture& image ) : mSignalVerified( signalReceived ), mCurrentEffect( effect ), mActorTransitTo( image ) { } - void Callback( CubeTransitionEffect effect, Image image ) + void Callback( CubeTransitionEffect effect, Texture image ) { tet_infoline( "Verifying TransitionCompletedSignal" ); @@ -101,7 +102,7 @@ public: bool& mSignalVerified; CubeTransitionEffect& mCurrentEffect; - Image& mActorTransitTo; + Texture& mActorTransitTo; }; } // namespace @@ -257,13 +258,13 @@ int UtcDaliCubeTransitionEffectGetRoot(void) unsigned int totalNum = NUM_ROWS*NUM_COLUMNS; - Image image = BufferImage::New( 40, 40 ) ; + Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 ); CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS ); waveEffect.SetSize( VIEW_AREA_SIZE ); Stage::GetCurrent().Add( waveEffect ); - waveEffect.SetCurrentImage( image ); - waveEffect.SetTargetImage( image ); + waveEffect.SetCurrentTexture( texture ); + waveEffect.SetTargetTexture( texture ); application.SendNotification(); application.Render(); @@ -289,7 +290,7 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void) tet_infoline(" UtcDaliCubeTransitionEffectIsTransiting "); application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE ); - Image image = BufferImage::New( 40, 40 ) ; + Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 ); CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS ); waveEffect.SetSize( VIEW_AREA_SIZE ); @@ -299,8 +300,8 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void) waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT ); DALI_TEST_CHECK( !waveEffect.IsTransitioning() ); - waveEffect.SetCurrentImage( image ); - waveEffect.SetTargetImage( image ); + waveEffect.SetCurrentTexture( texture ); + waveEffect.SetTargetTexture( texture ); //transition is started waveEffect.StartTransition(); DALI_TEST_CHECK( waveEffect.IsTransitioning() ); @@ -316,8 +317,8 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void) crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT ); DALI_TEST_CHECK( !crossEffect.IsTransitioning() ); - crossEffect.SetCurrentImage( image ); - crossEffect.SetTargetImage( image ); + crossEffect.SetCurrentTexture( texture ); + crossEffect.SetTargetTexture( texture ); //transition is started crossEffect.StartTransition(false); DALI_TEST_CHECK( crossEffect.IsTransitioning() ); @@ -332,8 +333,8 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void) foldEffect.SetTransitionDuration( TRANSITION_DURATION ); DALI_TEST_CHECK( !foldEffect.IsTransitioning() ); - foldEffect.SetCurrentImage( image ); - foldEffect.SetTargetImage( image ); + foldEffect.SetCurrentTexture( texture ); + foldEffect.SetTargetTexture( texture ); //transition is started foldEffect.StartTransition(true); DALI_TEST_CHECK(foldEffect.IsTransitioning() ); @@ -345,17 +346,17 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void) } //Test common codes in base class -int UtcDaliCubeTransitionEffectSetCurrentImage(void) +int UtcDaliCubeTransitionEffectSetCurrentTexture(void) { ToolkitTestApplication application; - tet_infoline(" UtcDaliCubeTransitionEffectSetCurrentImage "); + tet_infoline(" UtcDaliCubeTransitionEffectSetCurrentTexture "); application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE ); - Image image = BufferImage::New( 40, 40 ) ; + Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 ); CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS ); waveEffect.SetSize( VIEW_AREA_SIZE ); - waveEffect.SetCurrentImage( image ); + waveEffect.SetCurrentTexture( texture ); Stage::GetCurrent().Add( waveEffect ); @@ -384,20 +385,19 @@ int UtcDaliCubeTransitionEffectSetCurrentImage(void) } //Test common codes in base class -int UtcDaliCubeTransitionEffectSetTargetImage(void) +int UtcDaliCubeTransitionEffectSetTargetTexture(void) { ToolkitTestApplication application; - tet_infoline(" UtcDaliCubeTransitionEffectSetTargetImage "); + tet_infoline(" UtcDaliCubeTransitionEffectSetTargetTexture "); application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE ); - Image image = BufferImage::New( 30, 30 ); - + Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 ); CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS ); waveEffect.SetSize( VIEW_AREA_SIZE ); Stage::GetCurrent().Add( waveEffect ); - waveEffect.SetCurrentImage( image ); - waveEffect.SetTargetImage( image ); + waveEffect.SetCurrentTexture( texture ); + waveEffect.SetTargetTexture( texture ); Stage::GetCurrent().Add( waveEffect ); @@ -430,13 +430,18 @@ int UtcDaliCubeTransitionWaveEffectStartTransition(void) tet_infoline(" UtcDaliCubeTransitionWaveEffectStartTransition "); application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE ); - Image image = ResourceImage::New( "Image.jpg" ); + + BitmapLoader loader = BitmapLoader::New( "Image.jpg" ); + loader.Load(); + PixelData pixelData = loader.GetPixelData(); + Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() ); + texture.Upload( pixelData ); CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS ); waveEffect.SetSize( VIEW_AREA_SIZE ); waveEffect.SetTransitionDuration( TRANSITION_DURATION ); waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT ); - waveEffect.SetCurrentImage( image ); + waveEffect.SetCurrentTexture( texture ); Stage::GetCurrent().Add( waveEffect ); @@ -448,27 +453,27 @@ int UtcDaliCubeTransitionWaveEffectStartTransition(void) Actor cube = waveEffect.GetChildAt(0).GetChildAt(0); //check the cube rotation value and color values just before the end of different transitions - waveEffect.SetTargetImage( image ); + waveEffect.SetTargetTexture( texture ); Wait( application, TRANSITION_BEFORE_END_DURATION ); DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION ); - waveEffect.SetTargetImage( image ); + waveEffect.SetTargetTexture( texture ); waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1); Wait( application, TRANSITION_BEFORE_END_DURATION ); DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION ); - waveEffect.SetTargetImage( image ); + waveEffect.SetTargetTexture( texture ); waveEffect.StartTransition(false); Wait( application, TRANSITION_BEFORE_END_DURATION ); DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION ); - waveEffect.SetTargetImage( image ); + waveEffect.SetTargetTexture( texture ); waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2); Wait( application, TRANSITION_BEFORE_END_DURATION ); DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION ); @@ -483,14 +488,19 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void) tet_infoline(" UtcDaliCubeTransitionCrossEffectStartTransition "); application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE ); - Image image = ResourceImage::New( "Image.jpg" ); + + BitmapLoader loader = BitmapLoader::New( "Image.jpg" ); + loader.Load(); + PixelData pixelData = loader.GetPixelData(); + Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() ); + texture.Upload( pixelData ); CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS ); crossEffect.SetSize( VIEW_AREA_SIZE ); crossEffect.SetTransitionDuration( TRANSITION_DURATION ); crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT ); - crossEffect.SetCurrentImage( image ); - crossEffect.SetTargetImage( image ); + crossEffect.SetCurrentTexture( texture ); + crossEffect.SetTargetTexture( texture ); Stage::GetCurrent().Add( crossEffect ); @@ -510,7 +520,7 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION ); - crossEffect.SetTargetImage( image ); + crossEffect.SetTargetTexture( texture ); crossEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1); Wait( application, TRANSITION_BEFORE_END_DURATION ); DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION ); @@ -519,7 +529,7 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION ); - crossEffect.SetTargetImage( image ); + crossEffect.SetTargetTexture( texture ); crossEffect.StartTransition(false); Wait( application, TRANSITION_BEFORE_END_DURATION ); DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION ); @@ -527,7 +537,7 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION ); - crossEffect.SetTargetImage( image ); + crossEffect.SetTargetTexture( texture ); crossEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2); Wait( application, TRANSITION_BEFORE_END_DURATION ); DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION ); @@ -543,13 +553,12 @@ int UtcDaliCubeTransitionFoldEffectStartTransition(void) tet_infoline(" UtcDaliCubeTransitionFoldEffectStartTransition "); application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE ); - Image image = BufferImage::New( 30, 30 ); - + Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 ); CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS ); foldEffect.SetSize( VIEW_AREA_SIZE ); foldEffect.SetTransitionDuration( TRANSITION_DURATION ); - foldEffect.SetCurrentImage( image ); - foldEffect.SetTargetImage( image ); + foldEffect.SetCurrentTexture( texture ); + foldEffect.SetTargetTexture( texture ); Stage::GetCurrent().Add( foldEffect ); @@ -568,7 +577,7 @@ int UtcDaliCubeTransitionFoldEffectStartTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION ); - foldEffect.SetTargetImage( image ); + foldEffect.SetTargetTexture( texture ); foldEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1); Wait( application, TRANSITION_BEFORE_END_DURATION ); DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION ); @@ -577,7 +586,7 @@ int UtcDaliCubeTransitionFoldEffectStartTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION ); - foldEffect.SetTargetImage( image ); + foldEffect.SetTargetTexture( texture ); foldEffect.StartTransition(false); Wait( application, TRANSITION_BEFORE_END_DURATION ); DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION ); @@ -585,7 +594,7 @@ int UtcDaliCubeTransitionFoldEffectStartTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(),FULL_BRIGHTNESS, EPISILON, TEST_LOCATION ); - foldEffect.SetTargetImage( image ); + foldEffect.SetTargetTexture( texture ); foldEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2); Wait( application, TRANSITION_BEFORE_END_DURATION ); DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION ); @@ -601,9 +610,9 @@ int UtcDaliCubeTransitionEffectSignalTransitionCompleted(void) tet_infoline(" UtcDaliCubeTransitionEffectSignalTransitionCompleted "); application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE ); - Image firstImage = BufferImage::New( 30, 30 ); - Image secondImage = BufferImage::New( 20, 20 ); - Image thirdImage = BufferImage::New( 40, 40 ); + Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 ); + Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 ); + Texture thirdTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 ); CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS ); waveEffect.SetSize( VIEW_AREA_SIZE ); @@ -624,61 +633,61 @@ int UtcDaliCubeTransitionEffectSignalTransitionCompleted(void) bool signalVerified = false; CubeTransitionEffect currentEffect; - Image actorTransitTo; + Texture actorTransitTo; TransitionCompletedCallback callback(signalVerified, currentEffect, actorTransitTo); waveEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback ); crossEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback ); foldEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback ); - //check that the wave effect is used to transit to secondImage + //check that the wave effect is used to transit to secondTexture currentEffect = waveEffect; - actorTransitTo = secondImage; - waveEffect.SetCurrentImage( firstImage ); - waveEffect.SetTargetImage( secondImage ); + actorTransitTo = secondTexture; + waveEffect.SetCurrentTexture( firstTexture ); + waveEffect.SetTargetTexture( secondTexture ); waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1); Wait( application, TRANSITION_DURATION ); DALI_TEST_CHECK(callback.mSignalVerified); callback.Reset(); - //check that the wave effect is used to transit to thirdImage - actorTransitTo = thirdImage; - waveEffect.SetTargetImage( thirdImage ); + //check that the wave effect is used to transit to thirdTexture + actorTransitTo = thirdTexture; + waveEffect.SetTargetTexture( thirdTexture ); waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2); Wait( application, TRANSITION_DURATION ); DALI_TEST_CHECK(callback.mSignalVerified); callback.Reset(); - //check that the cross effect is used to transit to secondImage + //check that the cross effect is used to transit to secondTexture currentEffect = crossEffect; - actorTransitTo = secondImage; - crossEffect.SetCurrentImage( thirdImage ); - crossEffect.SetTargetImage( secondImage ); + actorTransitTo = secondTexture; + crossEffect.SetCurrentTexture( thirdTexture ); + crossEffect.SetTargetTexture( secondTexture ); crossEffect.StartTransition(true); Wait( application, TRANSITION_DURATION ); DALI_TEST_CHECK(callback.mSignalVerified); callback.Reset(); - //check that the cross effect is used to transit to firstImage - actorTransitTo = firstImage; - crossEffect.SetTargetImage( firstImage ); + //check that the cross effect is used to transit to firstTexture + actorTransitTo = firstTexture; + crossEffect.SetTargetTexture( firstTexture ); crossEffect.StartTransition(false); Wait( application, TRANSITION_DURATION ); DALI_TEST_CHECK(callback.mSignalVerified); callback.Reset(); - //check that the fold effect is used to transit to secondImage + //check that the fold effect is used to transit to secondTexture currentEffect = foldEffect; - actorTransitTo = secondImage; - foldEffect.SetCurrentImage( firstImage ); - foldEffect.SetTargetImage( secondImage ); + actorTransitTo = secondTexture; + foldEffect.SetCurrentTexture( firstTexture ); + foldEffect.SetTargetTexture( secondTexture ); foldEffect.StartTransition(); Wait( application, TRANSITION_DURATION ); DALI_TEST_CHECK( callback.mSignalVerified ); callback.Reset(); - //check that the fold effect is used to transit to thirdImage - actorTransitTo = thirdImage; - foldEffect.SetTargetImage( thirdImage ); + //check that the fold effect is used to transit to thirdTexture + actorTransitTo = thirdTexture; + foldEffect.SetTargetTexture( thirdTexture ); foldEffect.StartTransition( false ); Wait( application, TRANSITION_DURATION ); DALI_TEST_CHECK( callback.mSignalVerified ); @@ -691,8 +700,8 @@ int UtcDaliCubeTransitionEffectPauseResumeTransition(void) tet_infoline(" UtcDaliCubeTransitionEffectPauseResumeTransition "); application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE ); - Image firstImage = BufferImage::New( 30, 30 ); - Image secondImage = BufferImage::New( 20, 20 ); + Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 ); + Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 ); CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS ); waveEffect.SetSize( VIEW_AREA_SIZE ); @@ -713,16 +722,16 @@ int UtcDaliCubeTransitionEffectPauseResumeTransition(void) bool signalVerified = false; CubeTransitionEffect currentEffect; - Image actorTransitTo; + Texture actorTransitTo; TransitionCompletedCallback callback(signalVerified, currentEffect, actorTransitTo); waveEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback ); crossEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback ); foldEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback ); currentEffect = waveEffect; - actorTransitTo = secondImage; - waveEffect.SetCurrentImage( firstImage ); - waveEffect.SetTargetImage( secondImage ); + actorTransitTo = secondTexture; + waveEffect.SetCurrentTexture( firstTexture ); + waveEffect.SetTargetTexture( secondTexture ); // start transition; transit for 0.5*duration; pause for 0.5*duration; // resume for 0.25*duration; pause for 0.25*duration; resume for another 0.25*duration; // only until now the transition finished signal can be received @@ -744,9 +753,9 @@ int UtcDaliCubeTransitionEffectPauseResumeTransition(void) callback.Reset(); currentEffect = crossEffect; - actorTransitTo = firstImage; - crossEffect.SetCurrentImage( secondImage ); - crossEffect.SetTargetImage( firstImage ); + actorTransitTo = firstTexture; + crossEffect.SetCurrentTexture( secondTexture ); + crossEffect.SetTargetTexture( firstTexture ); // start transition; transit for 0.25*duration; pause for 0.2*duration; // resume for 0.5*duration; pause for 0.2*duration; resume for another 0.25*duration; // only until now the transition finished signal can be received @@ -768,9 +777,9 @@ int UtcDaliCubeTransitionEffectPauseResumeTransition(void) callback.Reset(); currentEffect = foldEffect; - actorTransitTo = secondImage; - foldEffect.SetCurrentImage( firstImage ); - foldEffect.SetTargetImage( secondImage ); + actorTransitTo = secondTexture; + foldEffect.SetCurrentTexture( firstTexture ); + foldEffect.SetTargetTexture( secondTexture ); // start transition; transit for 0.5*duration; pause for 0.5*duration; // resume for 0.25*duration; pause for 0.25*duration; resume for another 0.25*duration; // only until now the transition finished signal can be received @@ -798,15 +807,15 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void) tet_infoline(" UtcDaliCubeTransitionWaveEffectStopTransition "); application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE ); - Image firstImage = BufferImage::New( 30, 30 ); - Image secondImage = BufferImage::New( 20, 20 ); + Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 ); + Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 ); CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS ); waveEffect.SetSize( VIEW_AREA_SIZE ); waveEffect.SetTransitionDuration( TRANSITION_DURATION ); waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT ); - waveEffect.SetCurrentImage( firstImage ); - waveEffect.SetTargetImage( secondImage ); + waveEffect.SetCurrentTexture( firstTexture ); + waveEffect.SetTargetTexture( secondTexture ); Stage::GetCurrent().Add( waveEffect ); @@ -826,7 +835,7 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void) DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); - waveEffect.SetTargetImage( firstImage ); + waveEffect.SetTargetTexture( firstTexture ); waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1); Wait( application, TRANSITION_DURATION*0.4f ); waveEffect.StopTransition(); @@ -836,7 +845,7 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void) DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); - waveEffect.SetTargetImage( secondImage ); + waveEffect.SetTargetTexture( secondTexture ); waveEffect.StartTransition(false); Wait( application, TRANSITION_DURATION*0.6f ); waveEffect.StopTransition(); @@ -846,7 +855,7 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void) DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); - waveEffect.SetTargetImage( firstImage ); + waveEffect.SetTargetTexture( firstTexture ); waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2); Wait( application, TRANSITION_DURATION*0.8f ); waveEffect.StopTransition(); @@ -864,15 +873,15 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void) tet_infoline(" UtcDaliCubeTransitionCrossEffectStopTransition "); application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE ); - Image firstImage = BufferImage::New( 30, 30 ); - Image secondImage = BufferImage::New( 20, 20 ); + Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 ); + Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 ); CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS ); crossEffect.SetSize( VIEW_AREA_SIZE ); crossEffect.SetTransitionDuration( TRANSITION_DURATION ); crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT ); - crossEffect.SetCurrentImage( firstImage ); - crossEffect.SetTargetImage( secondImage ); + crossEffect.SetCurrentTexture( firstTexture ); + crossEffect.SetTargetTexture( secondTexture ); Stage::GetCurrent().Add( crossEffect ); @@ -894,7 +903,7 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); - crossEffect.SetTargetImage( firstImage ); + crossEffect.SetTargetTexture( firstTexture ); crossEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1); Wait( application, TRANSITION_DURATION*0.4f ); crossEffect.StopTransition(); @@ -905,7 +914,7 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); - crossEffect.SetTargetImage( secondImage ); + crossEffect.SetTargetTexture( secondTexture ); crossEffect.StartTransition(false); Wait( application, TRANSITION_DURATION*0.6f ); crossEffect.StopTransition(); @@ -916,7 +925,7 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); - crossEffect.SetTargetImage( firstImage ); + crossEffect.SetTargetTexture( firstTexture ); crossEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2); Wait( application, TRANSITION_DURATION*0.8f ); crossEffect.StopTransition(); @@ -935,14 +944,14 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void) tet_infoline(" UtcDaliCubeTransitionFoldEffectStopTransition "); application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE ); - Image firstImage = BufferImage::New( 30, 30 ); - Image secondImage = BufferImage::New( 20, 20 ); + Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 ); + Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 ); CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS ); foldEffect.SetSize( VIEW_AREA_SIZE ); foldEffect.SetTransitionDuration( TRANSITION_DURATION ); - foldEffect.SetCurrentImage( firstImage ); - foldEffect.SetTargetImage( secondImage ); + foldEffect.SetCurrentTexture( firstTexture ); + foldEffect.SetTargetTexture( secondTexture ); Stage::GetCurrent().Add( foldEffect ); @@ -965,7 +974,7 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); - foldEffect.SetTargetImage( firstImage ); + foldEffect.SetTargetTexture( firstTexture ); foldEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1); Wait( application, TRANSITION_DURATION*0.4f ); foldEffect.StopTransition(); @@ -976,7 +985,7 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); - foldEffect.SetTargetImage( secondImage ); + foldEffect.SetTargetTexture( secondTexture ); foldEffect.StartTransition(false); Wait( application, TRANSITION_DURATION*0.6f ); foldEffect.StopTransition(); @@ -987,7 +996,7 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void) DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION ); - foldEffect.SetTargetImage( firstImage ); + foldEffect.SetTargetTexture( firstTexture ); foldEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2); Wait( application, TRANSITION_DURATION*0.8f ); foldEffect.StopTransition(); diff --git a/dali-toolkit/devel-api/transition-effects/cube-transition-effect.cpp b/dali-toolkit/devel-api/transition-effects/cube-transition-effect.cpp index de78244..6cd9de4 100644 --- a/dali-toolkit/devel-api/transition-effects/cube-transition-effect.cpp +++ b/dali-toolkit/devel-api/transition-effects/cube-transition-effect.cpp @@ -76,14 +76,14 @@ bool CubeTransitionEffect::IsTransitioning() return GetImpl(*this).IsTransitioning(); } -void CubeTransitionEffect::SetCurrentImage( Image image ) +void CubeTransitionEffect::SetCurrentTexture( Texture texture ) { - GetImpl(*this).SetCurrentImage( image ); + GetImpl(*this).SetCurrentTexture( texture ); } -void CubeTransitionEffect::SetTargetImage( Image image ) +void CubeTransitionEffect::SetTargetTexture( Texture texture ) { - GetImpl(*this).SetTargetImage( image ); + GetImpl(*this).SetTargetTexture( texture ); } void CubeTransitionEffect::StartTransition( bool toNextImage ) diff --git a/dali-toolkit/devel-api/transition-effects/cube-transition-effect.h b/dali-toolkit/devel-api/transition-effects/cube-transition-effect.h index 05546a9..198d352 100644 --- a/dali-toolkit/devel-api/transition-effects/cube-transition-effect.h +++ b/dali-toolkit/devel-api/transition-effects/cube-transition-effect.h @@ -21,6 +21,9 @@ // INTERNAL INCLUDES #include +// EXTERNAL INCLUDES +#include + namespace Dali { @@ -135,17 +138,17 @@ public: bool IsTransitioning(); /** - * Set the current image to transition from + * Set the current texture to transition from * if using this same effect continually, only need to set once - * @param[in] image The current image + * @param[in] texture The current texture */ - void SetCurrentImage(Image image); + void SetCurrentTexture( Texture texture ); /** - * Set the target image to transit to - * @param[in] image The new Image showing on stage + * Set the target texture to transit to + * @param[in] texture The new Texture showing on stage */ - void SetTargetImage(Image image); + void SetTargetTexture( Texture texture ); /** * Activate the transition animation with horizontally left/right panGesture @@ -184,13 +187,13 @@ public: public: //Signal //Transition animation completed signal - typedef Signal< void ( CubeTransitionEffect, Image ) > TransitionCompletedSignalType; + typedef Signal< void ( CubeTransitionEffect, Texture ) > TransitionCompletedSignalType; /** * Signal emitted when the transition has completed animation * A callback of the following type may be connected * @code - * void YourCallbackName( CubeTransitionEffect cubeEffect, Image currentImage ); + * void YourCallbackName( CubeTransitionEffect cubeEffect, Texture currentTexture ); * @endcode * @return The Signal to connect to. */ diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp index 30e84a9..dc00a3c 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -722,32 +722,6 @@ std::string Button::GetSelectedImageFilename() const return std::string(); } -std::string Button::GetBackgroundImageFilename() const -{ - if( mBackgroundContent ) - { - ResourceImage image = ResourceImage::DownCast( mBackgroundContent ); - if( image ) - { - return image.GetUrl(); - } - } - return std::string(); -} - -std::string Button::GetSelectedBackgroundImageFilename() const -{ - if( mSelectedBackgroundContent ) - { - ResourceImage image = ResourceImage::DownCast( mSelectedBackgroundContent ); - if( image ) - { - return image.GetUrl(); - } - } - return std::string(); -} - std::string Button::GetDisabledImageFilename() const { if( mDisabledContent ) @@ -761,32 +735,6 @@ std::string Button::GetDisabledImageFilename() const return std::string(); } -std::string Button::GetDisabledSelectedImageFilename() const -{ - if( mDisabledSelectedContent ) - { - ResourceImage image = ResourceImage::DownCast( mDisabledSelectedContent ); - if( image ) - { - return image.GetUrl(); - } - } - return std::string(); -} - -std::string Button::GetDisabledBackgroundImageFilename() const -{ - if( mDisabledBackgroundContent ) - { - ResourceImage image = ResourceImage::DownCast( mDisabledBackgroundContent ); - if( image ) - { - return image.GetUrl(); - } - } - return std::string(); -} - bool Button::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes ) { bool ret = false; diff --git a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp index 6d904b5..08bf54d 100644 --- a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp +++ b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp @@ -250,9 +250,9 @@ void CubeTransitionEffect::OnStageConnection( int depth ) TextureSet textureSet = TextureSet::New(); - if( mCurrentImage ) + if( mCurrentTexture ) { - textureSet.SetImage( 0u, mCurrentImage ); + textureSet.SetTexture( 0u, mCurrentTexture ); } mCurrentRenderer = Renderer::New( geometry, shader ); mCurrentRenderer.SetTextures( textureSet ); @@ -311,24 +311,25 @@ bool CubeTransitionEffect::IsTransitioning() return mIsAnimating; } -void CubeTransitionEffect::SetCurrentImage( Image image ) +void CubeTransitionEffect::SetCurrentTexture( Texture texture ) { - mCurrentImage = image; + mCurrentTexture = texture; + if( mCurrentRenderer ) { TextureSet textureSet = mCurrentRenderer.GetTextures(); - textureSet.SetImage( 0u, mCurrentImage ); + textureSet.SetTexture( 0u, mCurrentTexture); } } -void CubeTransitionEffect::SetTargetImage( Image image ) +void CubeTransitionEffect::SetTargetTexture( Texture texture ) { - mTargetImage = image; + mTargetTexture = texture; if( mTargetRenderer ) { TextureSet textureSet = mTargetRenderer.GetTextures(); - textureSet.SetImage( 0u, mTargetImage ); + textureSet.SetTexture( 0u, mTargetTexture ); } } @@ -355,9 +356,9 @@ void CubeTransitionEffect::StartTransition( Vector2 panPosition, Vector2 panDisp //create the target renderer TextureSet textureSet = TextureSet::New(); - if( mTargetImage ) + if( mTargetTexture ) { - textureSet.SetImage( 0u, mTargetImage ); + textureSet.SetTexture( 0u, mTargetTexture ); } Geometry geometry = mCurrentRenderer.GetGeometry(); Shader shader( mCurrentRenderer.GetShader() ); @@ -467,13 +468,13 @@ void CubeTransitionEffect::OnTransitionFinished(Animation& source) std::swap( mCurrentTiles, mTargetTiles ); std::swap( mCurrentRenderer, mTargetRenderer ); - std::swap( mCurrentImage, mTargetImage ); + std::swap( mCurrentTexture, mTargetTexture ); ResetToInitialState(); //Emit signal Toolkit::CubeTransitionEffect handle( GetOwner() ); - mTransitionCompletedSignal.Emit( handle, mCurrentImage ); + mTransitionCompletedSignal.Emit( handle, mCurrentTexture ); } Toolkit::CubeTransitionEffect::TransitionCompletedSignalType& CubeTransitionEffect::TransitionCompletedSignal() diff --git a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h index 35319bf..8d1760e 100644 --- a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h +++ b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h @@ -76,14 +76,14 @@ public: bool IsTransitioning(); /** - * @copydoc Toolkit::CubeTransitionEffect::SetFirstImage + * @copydoc Toolkit::CubeTransitionEffect::SetCurrentTexture */ - void SetCurrentImage( Image image ); + void SetCurrentTexture( Texture texture ); /** - * @copydoc Toolkit::CubeTransitionEffect::SetTargetImage + * @copydoc Toolkit::CubeTransitionEffect::SetTargetTexture */ - void SetTargetImage( Image image ); + void SetTargetTexture( Texture texture ); /** * @copydoc Toolkit::CubeTransitionEffect::StartTransition(bool) @@ -214,8 +214,9 @@ protected: Renderer mCurrentRenderer; Renderer mTargetRenderer; - Image mCurrentImage; - Image mTargetImage; + Texture mCurrentTexture; + Texture mTargetTexture; + Animation mAnimation; Vector2 mTileSize;