"{"
"\"stage\":"
"[{"
- "\"type\": \"Actor\","
+ "\"type\": \"Layer\","
"\"size\": [100,100,1],"
"\"parentOrigin\": \"TOP_LEFT\","
"\"anchorPoint\": \"TOP_LEFT\","
+ "\"maximumSize\": [100,100],"
+ "\"orientation\": [10,10,10,10],"
+ "\"clippingBox\": [10,10,10,10],"
"\"signals\": [{"
- "\"name\": \"touched\","
+ "\"name\": \"touch\","
"\"action\": \"quit\""
"}]"
"}]"
" \"size\": [200, 200, 1],"
" \"orientation\": [0, 0, 30],"
" \"signals\": [{"
- " \"name\": \"touched\","
+ " \"name\": \"touch\","
" \"action\": \"play\","
" \"animation\": \"animate\""
" }]"
" \"size\": [200, 200, 1],"
" \"orientation\": [0, 0, 30],"
" \"signals\": [{"
- " \"name\": \"touched\","
+ " \"name\": \"touch\","
" \"action\": \"play\","
" \"animation\": \"animate\""
" }]"
" \"image\": { \"url\": \"dir/{IMAGE_PATH}\" },"
" \"sizeWidth\": \"{WIDTH}\","
" \"signals\": [{"
- " \"name\": \"touched\","
+ " \"name\": \"touch\","
" \"action\": \"quit\""
" }]"
"}]"
" \"color\": [1,0,0,1],\n"
" \"actors\": {\n"
" \"childImage\": {\n"
- " \"color\": [0,1,0,1]\n"
+ " \"color\": \"34\"\n"
" }\n"
" }\n"
" }\n"
"},\n"
"\"templates\":\n"
"{\n"
+ " \"imageViewTemplate\": { \n"
+ " \"type\": \"ImageView\",\n"
+ " \"styles\": [\"imageStyle\"]\n"
+ " },\n"
" \"imageTree\": { \n"
" \"type\": \"ImageView\",\n"
" \"styles\": [\"imageStyle\"],\n"
" \"name\": \"image\",\n"
" \"size\": \"{SIZE}\",\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
" {\n"
" \"type\":\"ImageView\",\n"
- " \"name\":\"childImage\" \n"
+ " \"name\":\"childImage\", \n"
+ " \"color\": \n"
+ " {\n"
+ " \"r\": 10,\n"
+ " \"g\": 10,\n"
+ " \"b\": 10,\n"
+ " \"a\": 100\n"
+ " }\n"
+ " },\n"
+ " {\n"
+ " \"type\":\"imageViewTemplate\",\n"
+ " \"name\":\"childImage2\"\n"
" }\n"
" ]\n"
" }\n"
" \"color\": [1,0,0,1],\n"
" \"actors\": {\n"
" \"childImage\": {\n"
- " \"color\": [0,1,0,1]\n"
+ " \"color\": \"#344353\"\n"
" }\n"
" }\n"
"}\n"
" \"name\": \"image\",\n"
" \"size\": \"{SIZE}\",\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
"[\n"
" { \n"
" \"type\": \"CameraActor\",\n"
- " \"name\": \"image\"\n"
+ " \"name\": \"camera\"\n"
" }, \n"
" { \n"
" \"type\": \"ImageView\",\n"
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"hide\",\n"
" \"actor\": \"actor\",\n"
" \"childActor\": \"subActor\"\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"set\",\n"
" \"actor\": \"subActor\",\n"
" \"property\": \"visible\",\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"hide\"\n"
" }]\n"
" }]\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"hide\"\n"
" }],\n"
" \"notifications\": [{\n"
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"properties\": {\n"
"\"parentOrigin\": \"TOP_LEFT\","
"\"anchorPoint\": \"TOP_LEFT\","
"\"signals\": [{"
- "\"name\": \"touched\","
+ "\"name\": \"touch\","
"\"action\": \"quit\""
"}]"
"}]"
" \"visible\": false\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"hide\",\n"
" \"actor\": \"actor\",\n"
" \"childActor\": \"subActor\"\n"
#include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
#include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h>
#include <dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h>
+#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
#include <dali/public-api/images/buffer-image.h>
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" );
bool& mSignalVerified;
CubeTransitionEffect& mCurrentEffect;
- Image& mActorTransitTo;
+ Texture& mActorTransitTo;
};
} // namespace
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();
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 );
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() );
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() );
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() );
}
//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 );
}
//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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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
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
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
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 );
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();
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();
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();
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 );
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();
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();
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();
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 );
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();
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();
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();
const uint32_t DEFAULT_BLOCK_HEIGHT( 16u );
const uint32_t SINGLE_PIXEL_PADDING( 1u );
const uint32_t DOUBLE_PIXEL_PADDING( SINGLE_PIXEL_PADDING << 1 );
- const uint32_t FILLED_PIXEL( -1 );
Toolkit::AtlasManager::AtlasSize EMPTY_SIZE;
}
return 0;
}
- Dali::Atlas atlas = Dali::Atlas::New( width, height, pixelformat );
- atlas.Clear( Vector4::ZERO );
+ Dali::Texture atlas = Dali::Texture::New( TextureType::TEXTURE_2D, pixelformat, width, height );
AtlasDescriptor atlasDescriptor;
atlasDescriptor.mAtlas = atlas;
atlasDescriptor.mSize = size;
atlasDescriptor.mTotalBlocks = ( ( width - 1u ) / blockWidth ) * ( ( height - 1u ) / blockHeight );
atlasDescriptor.mAvailableBlocks = atlasDescriptor.mTotalBlocks;
- atlasDescriptor.mHorizontalStrip = BufferImage::New( blockWidth, SINGLE_PIXEL_PADDING, pixelformat );
- atlasDescriptor.mVerticalStrip = BufferImage::New( SINGLE_PIXEL_PADDING, blockHeight - DOUBLE_PIXEL_PADDING, pixelformat );
-
- PixelBuffer* buffer = atlasDescriptor.mHorizontalStrip.GetBuffer();
- if( buffer == NULL )
- {
- DALI_LOG_ERROR("atlasDescriptor.mHorizontalStrip.GetBuffer() returns NULL\n");
- return 0;
- }
- memset( buffer, 0, atlasDescriptor.mHorizontalStrip.GetBufferSize() );
-
- buffer = atlasDescriptor.mVerticalStrip.GetBuffer();
- if( buffer == NULL )
- {
- DALI_LOG_ERROR("atlasDescriptor.mVerticalStrip.GetBuffer() returns NULL\n");
- return 0;
- }
- memset( buffer, 0, atlasDescriptor.mVerticalStrip.GetBufferSize() );
-
- BufferImage filledPixelImage = BufferImage::New( 1u, 1u, pixelformat );
- buffer = filledPixelImage.GetBuffer();
- if( buffer == NULL)
- {
- DALI_LOG_ERROR("filledPixelImage.GetBuffer() returns NULL\n");
- return 0;
- }
-
- memset( buffer, 0xFF, filledPixelImage.GetBufferSize() );
- atlas.Upload( filledPixelImage, 0, 0 );
+ unsigned int bufferSize( blockWidth * SINGLE_PIXEL_PADDING * Dali::Pixel::GetBytesPerPixel(pixelformat) );
+ unsigned char* bufferHorizontalStrip = new unsigned char[bufferSize];
+ memset( bufferHorizontalStrip, 0, bufferSize );
+ atlasDescriptor.mHorizontalStrip = PixelData::New( bufferHorizontalStrip, bufferSize, blockWidth, SINGLE_PIXEL_PADDING, pixelformat, PixelData::DELETE_ARRAY );
+
+ bufferSize = SINGLE_PIXEL_PADDING * (blockHeight - DOUBLE_PIXEL_PADDING) * Dali::Pixel::GetBytesPerPixel(pixelformat);
+ unsigned char* bufferVerticalStrip = new unsigned char[bufferSize];
+ memset( bufferVerticalStrip, 0, bufferSize );
+ atlasDescriptor.mVerticalStrip = PixelData::New( bufferVerticalStrip, bufferSize, SINGLE_PIXEL_PADDING, blockHeight - DOUBLE_PIXEL_PADDING, pixelformat, PixelData::DELETE_ARRAY );
+
+ bufferSize = Dali::Pixel::GetBytesPerPixel(pixelformat);
+ unsigned char* buffer = new unsigned char[bufferSize];
+ memset( buffer, 0xFF, bufferSize );
+ PixelData filledPixelImage = PixelData::New( buffer, bufferSize, 1u, 1u, pixelformat, PixelData::DELETE_ARRAY );
+ atlas.Upload( filledPixelImage, 0u, 0u, 0u, 0u, 1u, 1u );
mAtlasList.push_back( atlasDescriptor );
return mAtlasList.size();
}
mAddFailPolicy = policy;
}
-bool AtlasManager::Add( const BufferImage& image,
+bool AtlasManager::Add( const PixelData& image,
Toolkit::AtlasManager::AtlasSlot& slot,
Toolkit::AtlasManager::AtlasId atlas )
{
return result;
}
-void AtlasManager::UploadImage( const BufferImage& image,
+void AtlasManager::UploadImage( const PixelData& image,
const AtlasSlotDescriptor& desc )
{
// Get the atlas to upload the image to
SizeType height = image.GetHeight();
// Blit image 1 pixel to the right and down into the block to compensate for texture filtering
- if ( !mAtlasList[ atlas ].mAtlas.Upload( image,
+ if ( !mAtlasList[ atlas ].mAtlas.Upload( image, 0u, 0u,
blockOffsetX + SINGLE_PIXEL_PADDING,
- blockOffsetY + SINGLE_PIXEL_PADDING ) )
+ blockOffsetY + SINGLE_PIXEL_PADDING,
+ width, height) )
{
DALI_LOG_ERROR("Uploading image to Atlas Failed!.\n");
}
// Blit top strip
- if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mHorizontalStrip,
+ if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mHorizontalStrip, 0u, 0u,
blockOffsetX,
- blockOffsetY ) )
+ blockOffsetY,
+ mAtlasList[ atlas ].mHorizontalStrip.GetWidth(),
+ mAtlasList[ atlas ].mHorizontalStrip.GetHeight()) )
{
DALI_LOG_ERROR("Uploading top strip to Atlas Failed!\n");
}
// Blit left strip
- if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mVerticalStrip,
+ if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mVerticalStrip, 0u, 0u,
blockOffsetX,
- blockOffsetY + SINGLE_PIXEL_PADDING ) )
+ blockOffsetY + SINGLE_PIXEL_PADDING,
+ mAtlasList[ atlas ].mVerticalStrip.GetWidth(),
+ mAtlasList[ atlas ].mVerticalStrip.GetHeight() ) )
{
DALI_LOG_ERROR("Uploading left strip to Atlas Failed!\n");
}
// Blit bottom strip
if ( blockOffsetY + height + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mSize.mHeight )
{
- if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mHorizontalStrip,
+ if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mHorizontalStrip, 0u, 0u,
blockOffsetX,
- blockOffsetY + height + SINGLE_PIXEL_PADDING ) )
+ blockOffsetY + height + SINGLE_PIXEL_PADDING,
+ mAtlasList[ atlas ].mHorizontalStrip.GetWidth(),
+ mAtlasList[ atlas ].mHorizontalStrip.GetHeight() ) )
{
DALI_LOG_ERROR("Uploading bottom strip to Atlas Failed!.\n");
}
// Blit right strip
if ( blockOffsetX + width + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mSize.mWidth )
{
- if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mVerticalStrip,
+ if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mVerticalStrip, 0u, 0u,
blockOffsetX + width + SINGLE_PIXEL_PADDING,
- blockOffsetY + SINGLE_PIXEL_PADDING ) )
+ blockOffsetY + SINGLE_PIXEL_PADDING,
+ mAtlasList[ atlas ].mVerticalStrip.GetWidth(),
+ mAtlasList[ atlas ].mVerticalStrip.GetHeight() ) )
{
DALI_LOG_ERROR("Uploading right strip to Atlas Failed!.\n");
}
}
}
-Dali::Atlas AtlasManager::GetAtlasContainer( AtlasId atlas ) const
+Dali::Texture AtlasManager::GetAtlasContainer( AtlasId atlas ) const
{
DALI_ASSERT_DEBUG( atlas && atlas <= mAtlasList.size() );
- Dali::Atlas atlasContainer;
+ Dali::Texture atlasContainer;
if ( atlas && atlas-- <= mAtlasList.size() )
{
atlasContainer = mAtlasList[ atlas ].mAtlas;