diff --git a/examples/page-turn-view/page-turn-view-example.cpp b/examples/page-turn-view/page-turn-view-example.cpp index 55f8663..7c40ef4 100644 --- a/examples/page-turn-view/page-turn-view-example.cpp +++ b/examples/page-turn-view/page-turn-view-example.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -71,19 +70,19 @@ const char* PAGE_IMAGES_LANDSCAPE[] = }; const unsigned int NUMBER_OF_LANDSCAPE_IMAGE( sizeof(PAGE_IMAGES_LANDSCAPE) / sizeof(PAGE_IMAGES_LANDSCAPE[0]) ); -Atlas LoadImages( const char*imagePath1, const char* imagePath2 ) +Texture LoadTextures( const char* imagePath1, const char* imagePath2 ) { PixelData pixelData1 = DemoHelper::LoadPixelData( imagePath1, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT ); PixelData pixelData2 = DemoHelper::LoadPixelData( imagePath2, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT ); - unsigned int width = pixelData1.GetWidth()+pixelData2.GetWidth(); + unsigned int width = pixelData1.GetWidth() + pixelData2.GetWidth(); unsigned int height = pixelData1.GetHeight() > pixelData2.GetHeight() ? pixelData1.GetHeight() : pixelData2.GetHeight(); - Atlas image = Atlas::New( width, height ); - image.Upload( pixelData1, 0u, 0u ); - image.Upload( pixelData2, pixelData1.GetWidth(), 0u ); + Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGB888, width, height ); + texture.Upload( pixelData1 ); + texture.Upload( pixelData2, 0u, 0u, pixelData1.GetWidth(), 0u, pixelData2.GetWidth(), pixelData2.GetHeight() ); - return image; + return texture; } }// end LOCAL STUFF @@ -99,21 +98,21 @@ class PortraitPageFactory : public PageFactory return 10*NUMBER_OF_PORTRAIT_IMAGE + 1; } /** - * Create an image to represent a page. + * Create an texture to represent a page. * @param[in] pageId The ID of the page to create. - * @return An image, or an uninitialized pointer if the ID is out of range. + * @return A texture, or an uninitialized handle if the ID is out of range. */ - virtual Image NewPage( unsigned int pageId ) + virtual Texture NewPage( unsigned int pageId ) { - Atlas page; + Texture page; if( pageId == 0 ) { - page = DemoHelper::LoadImage( BOOK_COVER_PORTRAIT ); + page = DemoHelper::LoadTexture( BOOK_COVER_PORTRAIT ); } else { - page = DemoHelper::LoadImage( PAGE_IMAGES_PORTRAIT[ (pageId-1) % NUMBER_OF_PORTRAIT_IMAGE ] ); + page = DemoHelper::LoadTexture( PAGE_IMAGES_PORTRAIT[ (pageId-1) % NUMBER_OF_PORTRAIT_IMAGE ] ); } return page; @@ -132,22 +131,21 @@ class LandscapePageFactory : public PageFactory return 10*NUMBER_OF_LANDSCAPE_IMAGE / 2 + 1; } /** - * Create an image to represent a page. + * Create an texture to represent a page. * @param[in] pageId The ID of the page to create. - * @return An image, or an uninitialized pointer if the ID is out of range. + * @return A texture, or an uninitialized handle if the ID is out of range. */ - virtual Image NewPage( unsigned int pageId ) + virtual Texture NewPage( unsigned int pageId ) { - - Atlas page; + Texture page; if( pageId == 0 ) { - page = LoadImages( BOOK_COVER_LANDSCAPE, BOOK_COVER_BACK_LANDSCAPE ); + page = LoadTextures( BOOK_COVER_LANDSCAPE, BOOK_COVER_BACK_LANDSCAPE ); } else { unsigned int imageId = (pageId-1)*2; - page = LoadImages( PAGE_IMAGES_LANDSCAPE[ imageId % NUMBER_OF_LANDSCAPE_IMAGE ], PAGE_IMAGES_LANDSCAPE[ (imageId+1) % NUMBER_OF_LANDSCAPE_IMAGE ] ); + page = LoadTextures( PAGE_IMAGES_LANDSCAPE[ imageId % NUMBER_OF_LANDSCAPE_IMAGE ], PAGE_IMAGES_LANDSCAPE[ (imageId+1) % NUMBER_OF_LANDSCAPE_IMAGE ] ); } return page; @@ -157,8 +155,8 @@ class LandscapePageFactory : public PageFactory /** * This example shows how to use the page turn UI control to implement the page-turn demo * The effect follows the pan gesture to animate the page - * Pan the image inwards, the page will bent, - * Depends on the distance of the panning, the image might turn over or slide back + * Pan the page inwards, the page will bent, + * Depends on the distance of the panning, the page might turn over or slide back * Also, in portrait view, the pan gesture outwards from position near the spine could turn the previous page back * Allows to turn multiple pages one by one quickly towards the same direction, multiple animations are launched in this case */ diff --git a/examples/styling/image-channel-control-impl.cpp b/examples/styling/image-channel-control-impl.cpp index aa4f325..0d19830 100644 --- a/examples/styling/image-channel-control-impl.cpp +++ b/examples/styling/image-channel-control-impl.cpp @@ -97,8 +97,8 @@ void ImageChannelControl::SetImage( const std::string& url ) properties[Dali::Toolkit::Visual::Property::SHADER]=shader; properties[Dali::Toolkit::ImageVisual::Property::URL] = url; - Dali::Toolkit::InitializeVisual( self, mVisual, properties ); - RegisterVisual( Demo::ImageChannelControl::Property::IMAGE_VISUAL, self, mVisual ); + mVisual = Toolkit::VisualFactory::Get().CreateVisual( properties ); + RegisterVisual( Demo::ImageChannelControl::Property::IMAGE_VISUAL, mVisual ); mVisual.SetName("imageVisual"); RelayoutRequest(); diff --git a/packaging/com.samsung.dali-demo.spec b/packaging/com.samsung.dali-demo.spec index 237dae1..1b50e7e 100755 --- a/packaging/com.samsung.dali-demo.spec +++ b/packaging/com.samsung.dali-demo.spec @@ -2,7 +2,7 @@ Name: com.samsung.dali-demo Summary: The OpenGLES Canvas Core Demo -Version: 1.2.12 +Version: 1.2.13 Release: 1 Group: System/Libraries License: Apache-2.0 diff --git a/resources/style/demo-theme.json.in b/resources/style/demo-theme.json.in index 8cf572d..f9c0d99 100644 --- a/resources/style/demo-theme.json.in +++ b/resources/style/demo-theme.json.in @@ -27,7 +27,7 @@ }, "TextLabel": { - "fontStyle":"Regular", + "fontStyle":{"weight":"normal"}, "pointSize":18 }, "LauncherLabel": diff --git a/resources/style/mobile/demo-theme.json.in b/resources/style/mobile/demo-theme.json.in index f8b5099..f42198e 100644 --- a/resources/style/mobile/demo-theme.json.in +++ b/resources/style/mobile/demo-theme.json.in @@ -24,7 +24,7 @@ }, "TextLabel": { - "fontStyle":"Regular", + "fontStyle":{"weight":"normal"}, "pointSize":18 }, "TextLabelFontSize0": diff --git a/shared/utility.h b/shared/utility.h index 294e6f4..ece3327 100644 --- a/shared/utility.h +++ b/shared/utility.h @@ -37,17 +37,15 @@ Dali::PixelData LoadPixelData( const char* imagePath, return loader.GetPixelData(); } - -Dali::Atlas LoadImage( const char* imagePath, +/** + * @deprecated, dont use this anymore + */ +Dali::Image LoadImage( const char* imagePath, Dali::ImageDimensions size = Dali::ImageDimensions(), Dali::FittingMode::Type fittingMode = Dali::FittingMode::DEFAULT, Dali::SamplingMode::Type samplingMode = Dali::SamplingMode::DEFAULT ) { - Dali::PixelData pixelData = LoadPixelData(imagePath, size, fittingMode, samplingMode); - Dali::Atlas image =Dali:: Atlas::New( pixelData.GetWidth(), pixelData.GetHeight(), pixelData.GetPixelFormat() ); - image.Upload( pixelData, 0u, 0u ); - - return image; + return Dali::ResourceImage::New( imagePath, size, fittingMode, samplingMode ); } Dali::Texture LoadTexture( const char* imagePath, @@ -67,6 +65,7 @@ Dali::Texture LoadTexture( const char* imagePath, /** * @brief Load an bitmap resource. + * @deprecated, dont use this anymore * * If it is required to scaled-down to no more than the stage dimensions, * uses image scaling mode FittingMode::SCALE_TO_FILL to resize the image at @@ -75,7 +74,7 @@ Dali::Texture LoadTexture( const char* imagePath, * maximum quality. */ -Dali::Atlas LoadStageFillingImage( const char* imagePath ) +Dali::Image LoadStageFillingImage( const char* imagePath ) { Dali::Vector2 stageSize = Dali::Stage::GetCurrent().GetSize(); return LoadImage( imagePath, Dali::ImageDimensions( stageSize.x, stageSize.y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR ); diff --git a/shared/view.h b/shared/view.h index 29e1012..6ec55d0 100644 --- a/shared/view.h +++ b/shared/view.h @@ -46,7 +46,6 @@ struct ViewStyle const ViewStyle DEFAULT_VIEW_STYLE( 0.1f, 0.7f, 80.f, 4.f ); const char* DEFAULT_TEXT_STYLE_FONT_FAMILY("HelveticaNue"); -const char* DEFAULT_TEXT_STYLE_FONT_STYLE("Regular"); const float DEFAULT_TEXT_STYLE_POINT_SIZE( 8.0f ); const Dali::Toolkit::Alignment::Padding DEFAULT_PLAY_PADDING(12.0f, 12.0f, 12.0f, 12.0f);