X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-factory-impl.cpp;h=d3be0b4dea4e97d2a63a6cd3f3a702619d111a99;hb=refs%2Fchanges%2F71%2F235671%2F2;hp=d30729bd76b9fc6a5c37f004030be18a0ce856a1;hpb=7b491df53dd39d0c5578d6a9679fd3a6ba4cb4ce;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/visual-factory-impl.cpp b/dali-toolkit/internal/visuals/visual-factory-impl.cpp index d30729b..d3be0b4 100644 --- a/dali-toolkit/internal/visuals/visual-factory-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-factory-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -26,6 +26,7 @@ #include // INTERNAL INCLUDES +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +62,10 @@ namespace Internal namespace { +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_CONTROL_VISUALS"); +#endif + BaseHandle Create() { BaseHandle handle = Toolkit::VisualFactory::Get(); @@ -69,7 +75,7 @@ BaseHandle Create() DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::VisualFactory, Dali::BaseHandle, Create, true ) DALI_TYPE_REGISTRATION_END() -const char * const BROKEN_IMAGE_URL( DALI_IMAGE_DIR "broken.png" ); ///< URL For the broken image +const char* const BROKEN_IMAGE_FILE_NAME = "broken.png"; ///< The file name of the broken image. } // namespace @@ -90,7 +96,8 @@ void VisualFactory::OnStyleChangedSignal( Toolkit::StyleManager styleManager, St { if( type == StyleChange::THEME_CHANGE ) { - std::string brokenImageUrl(BROKEN_IMAGE_URL); + const std::string imageDirPath = AssetManager::GetDaliImagePath(); + std::string brokenImageUrl = imageDirPath + BROKEN_IMAGE_FILE_NAME; Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager ); config["brokenImageUrl"].Get( brokenImageUrl ); @@ -271,11 +278,31 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property } break; } + + case Toolkit::DevelVisual::ARC: + { + visualPtr = ArcVisual::New( GetFactoryCache(), propertyMap ); + break; + } } + DALI_LOG_INFO( gLogFilter, Debug::Concise, "VisualFactory::CreateVisual( VisualType:%s %s%s)\n", + Scripting::GetEnumerationName( visualType, + VISUAL_TYPE_TABLE, + VISUAL_TYPE_TABLE_COUNT ), + ( visualType == Toolkit::DevelVisual::IMAGE ) ? "url:" : "", + ( visualType == Toolkit::DevelVisual::IMAGE ) ? + ( ([&] (){ + // Return URL if present in PropertyMap else return "not found message" + Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME ); + return ( imageURLValue ) ? imageURLValue->Get().c_str() : "url not found in PropertyMap"; + })() + ) + : "" ); + if( !visualPtr ) { - DALI_LOG_ERROR( "Renderer type unknown\n" ); + DALI_LOG_ERROR( "VisualType unknown\n" ); } if( mDebugEnabled && visualType != Toolkit::DevelVisual::WIREFRAME ) @@ -293,15 +320,7 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Image& image ) if( image ) { - NinePatchImage npatchImage = NinePatchImage::DownCast( image ); - if( npatchImage ) - { - visualPtr = NPatchVisual::New( GetFactoryCache(), npatchImage ); - } - else - { - visualPtr = ImageVisual::New(GetFactoryCache(), GetImageVisualShaderFactory(), image ); - } + visualPtr = ImageVisual::New(GetFactoryCache(), GetImageVisualShaderFactory(), image ); } if( mDebugEnabled ) @@ -385,7 +404,9 @@ Internal::VisualFactoryCache& VisualFactory::GetFactoryCache() { mFactoryCache = std::unique_ptr( new VisualFactoryCache( mPreMultiplyOnLoad ) ); - std::string brokenImageUrl(BROKEN_IMAGE_URL); + const std::string imageDirPath = AssetManager::GetDaliImagePath(); + std::string brokenImageUrl = imageDirPath + BROKEN_IMAGE_FILE_NAME; + Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get(); if( styleManager ) {