Fix a custom shader issue
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-TextureManager.cpp
index 2d06a44..d72bf17 100644 (file)
@@ -20,7 +20,7 @@
 #include <stdlib.h>
 
 #include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/internal/visuals/texture-manager.h>
+#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
 #include <dali-toolkit/internal/visuals/texture-upload-observer.h>
 
 using namespace Dali::Toolkit::Internal;
@@ -34,7 +34,8 @@ public:
   {
   }
 
-  void UploadComplete( bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect )
+  virtual void UploadComplete( bool loadSuccess, int32_t textureId, TextureSet textureSet,
+                               bool useAtlasing, const Vector4& atlasRect, bool preMultiplied ) override
   {
     mLoaded = loadSuccess;
     mObserverCalled = true;
@@ -53,16 +54,46 @@ int UtcTextureManagerRequestLoad(void)
 
   TestObserver observer;
   std::string filename("image.png");
-
+  auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
   TextureManager::TextureId textureId = textureManager.RequestLoad(
     filename,
     ImageDimensions(),
     FittingMode::SCALE_TO_FILL,
     SamplingMode::BOX_THEN_LINEAR,
     TextureManager::NO_ATLAS,
-    &observer );
+    &observer,
+    true,
+    TextureManager::ReloadPolicy::CACHED,
+    preMultiply);
+
+  VisualUrl url = textureManager.GetVisualUrl( textureId );
+
+  DALI_TEST_EQUALS( url.GetUrl().compare( filename ), 0, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcTextureManagerGenerateHash(void)
+{
+  ToolkitTestApplication application;
+
+  TextureManager textureManager; // Create new texture manager
+
+  TestObserver observer;
+  std::string filename( "image.png" );
+  auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
+  TextureManager::TextureId textureId = textureManager.RequestLoad(
+    filename,
+    ImageDimensions(),
+    FittingMode::SCALE_TO_FILL,
+    SamplingMode::BOX_THEN_LINEAR,
+    TextureManager::USE_ATLAS,
+    &observer,
+    true,
+    TextureManager::ReloadPolicy::CACHED,
+    preMultiply);
 
-  const VisualUrl& url = textureManager.GetVisualUrl( textureId );
+  VisualUrl url = textureManager.GetVisualUrl( textureId );
 
   DALI_TEST_EQUALS( url.GetUrl().compare( filename ), 0, TEST_LOCATION );