Merge "CMake - Option added to define the default toolkit resource path." into devel...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / visual-factory-impl.cpp
index 73c0afc..dc35220 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali/devel-api/scripting/scripting.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 #include <dali-toolkit/public-api/visuals/text-visual-properties.h>
@@ -74,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
 
@@ -95,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 );
@@ -410,7 +412,9 @@ Internal::VisualFactoryCache& VisualFactory::GetFactoryCache()
   {
     mFactoryCache = std::unique_ptr<VisualFactoryCache>( 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 )
     {