}
/// Helper method to create ResourceImage using property
-BitmapImage NewBitmapImage( const Property::Value& map )
+BufferImage NewBufferImage( const Property::Value& map )
{
- BitmapImage image = BitmapImage::DownCast( NewImage( map ) );
+ BufferImage image = BufferImage::DownCast( NewImage( map ) );
return image;
}
Image image = NewImage( map );
DALI_TEST_CHECK( FrameBufferImage::DownCast( image ) );
}
- // type BitMapImage
- map[ "type" ] = "BitmapImage";
+ // type BufferImage
+ map[ "type" ] = "BufferImage";
{
Image image = NewImage( map );
- DALI_TEST_CHECK( BitmapImage::DownCast( image ) );
- DALI_TEST_CHECK((BitmapImage::DownCast( image )).GetPixelFormat()== Pixel::RGBA8888);
+ DALI_TEST_CHECK( BufferImage::DownCast( image ) );
+ DALI_TEST_CHECK((BufferImage::DownCast( image )).GetPixelFormat()== Pixel::RGBA8888);
}
// pixel-format
{ "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC", Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC },
{ "COMPRESSED_RGB8_ETC1", Pixel::COMPRESSED_RGB8_ETC1 },
{ "COMPRESSED_RGB_PVRTC_4BPPV1", Pixel::COMPRESSED_RGB_PVRTC_4BPPV1 },*/
- // BitmapImage doesnot support compressed format
+ // BufferImage doesnot support compressed format
};
- TestEnumStrings< Pixel::Format, BitmapImage >( map, values, ( sizeof( values ) / sizeof ( values[0] ) ), &BitmapImage::GetPixelFormat, &NewBitmapImage );
+ TestEnumStrings< Pixel::Format, BufferImage >( map, values, ( sizeof( values ) / sizeof ( values[0] ) ), &BufferImage::GetPixelFormat, &NewBufferImage );
}
// type Image
- map[ "type" ] = "Image";
+ map[ "type" ] = "ResourceImage";
{
Image image = NewImage( map );
DALI_TEST_CHECK( ResourceImage::DownCast( image ) );
DALI_TEST_CHECK( !FrameBufferImage::DownCast( image ) );
- DALI_TEST_CHECK( !BitmapImage::DownCast( image ) );
+ DALI_TEST_CHECK( !BufferImage::DownCast( image ) );
}
END_TEST;
}
child2Map[ "type" ] = "TextActor";
child2Map[ "position" ] = Vector3::ZAXIS;
- Property::Map grandChildMap;
- grandChildMap[ "type" ] = "LightActor";
- grandChildMap[ "position" ] = Vector3::ONE;
-
- // Add arrays to appropriate maps
- Property::Array grandChildArray;
- grandChildArray.push_back( grandChildMap );
Property::Array childArray;
- child1Map[ "actors" ] = grandChildArray;
childArray.push_back( child1Map );
childArray.push_back( child2Map );
map[ "actors" ] = childArray;
DALI_TEST_CHECK( child1 );
DALI_TEST_CHECK( ImageActor::DownCast( child1 ) );
DALI_TEST_EQUALS( child1.GetCurrentPosition(), Vector3::YAXIS, TEST_LOCATION );
- DALI_TEST_EQUALS( child1.GetChildCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS( child1.GetChildCount(), 0u, TEST_LOCATION );
Actor child2 = handle.GetChildAt(1);
DALI_TEST_CHECK( child2 );
DALI_TEST_EQUALS( child2.GetCurrentPosition(), Vector3::ZAXIS, TEST_LOCATION );
DALI_TEST_EQUALS( child2.GetChildCount(), 0u, TEST_LOCATION );
- Actor grandChild = child1.GetChildAt( 0 );
- DALI_TEST_CHECK( grandChild );
- DALI_TEST_CHECK( LightActor::DownCast( grandChild ) );
- DALI_TEST_EQUALS( grandChild.GetCurrentPosition(), Vector3::ONE, TEST_LOCATION );
- DALI_TEST_EQUALS( grandChild.GetChildCount(), 0u, TEST_LOCATION );
-
Stage::GetCurrent().Remove( handle );
END_TEST;
}
Actor actor = Actor::New();
Actor child = ImageActor::New();
Actor grandChild = TextActor::New();
- Actor grandChild2 = LightActor::New();
+
actor.Add( child );
child.Add( grandChild );
- child.Add( grandChild2 );
Stage::GetCurrent().Add( actor );
application.SendNotification();
DALI_TEST_CHECK( childValue.HasKey( "actors" ) );
Property::Array grandChildren( childValue.GetValue( "actors").Get< Property::Array >() );
- DALI_TEST_CHECK( grandChildren.size() == 2u );
+ DALI_TEST_CHECK( grandChildren.size() == 1u );
Property::Map grandChildMap( grandChildren[0].Get< Property::Map >() );
DALI_TEST_CHECK( !grandChildMap.Empty() );
DALI_TEST_CHECK( grandChildValue.HasKey( "type" ) );
DALI_TEST_EQUALS( grandChildValue.GetValue( "type" ).Get< std::string >(), "TextActor", TEST_LOCATION );
- Property::Map grandChild2Map( grandChildren[1].Get< Property::Map >() );
- DALI_TEST_CHECK( !grandChild2Map.Empty() );
- Property::Value grandChild2Value( grandChild2Map );
- DALI_TEST_CHECK( grandChild2Value.HasKey( "type" ) );
- DALI_TEST_EQUALS( grandChild2Value.GetValue( "type" ).Get< std::string >(), "LightActor", TEST_LOCATION );
Stage::GetCurrent().Remove( actor );
}
DALI_TEST_EQUALS( value.GetValue( "height" ).Get< int >(), 400, TEST_LOCATION );
}
- // BitmapImage
+ // BufferImage
{
- Image image = BitmapImage::New( 200, 300, Pixel::A8 );
+ Image image = BufferImage::New( 200, 300, Pixel::A8 );
Property::Map map;
CreatePropertyMap( image, map );
Property::Value value( map );
DALI_TEST_CHECK( value.HasKey( "type" ) );
- DALI_TEST_EQUALS( value.GetValue( "type" ).Get< std::string >(), "BitmapImage", TEST_LOCATION );
+ DALI_TEST_EQUALS( value.GetValue( "type" ).Get< std::string >(), "BufferImage", TEST_LOCATION );
DALI_TEST_CHECK( value.HasKey( "pixel-format") );
DALI_TEST_EQUALS( value.GetValue( "pixel-format" ).Get< std::string >(), "A8", TEST_LOCATION );
}