[4.0] Add ImageVisualShaderFactory
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / visual-factory-impl.h
old mode 100644 (file)
new mode 100755 (executable)
index 257b03c..d334e9c
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_VISUAL_FACTORY_IMPL_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -35,7 +35,7 @@ namespace Internal
 {
 
 class VisualFactoryCache;
-typedef IntrusivePtr<VisualFactoryCache> VisualFactoryCachePtr;
+class ImageVisualShaderFactory;
 
 /**
  * @copydoc Toolkit::VisualFactory
@@ -52,21 +52,31 @@ public:
   VisualFactory( bool debugEnabled );
 
   /**
-   * @copydoc Toolkit::RenderFactory::CreateVisual( const Property::Map& )
+   * @copydoc Toolkit::VisualFactory::CreateVisual( const Property::Map& )
    */
   Toolkit::Visual::Base CreateVisual( const Property::Map& propertyMap );
 
   /**
-   * @copydoc Toolkit::RenderFactory::CreateVisual( const Image& )
+   * @copydoc Toolkit::VisualFactory::CreateVisual( const Image& )
    */
   Toolkit::Visual::Base CreateVisual( const Image& image );
 
   /**
-   * @copydoc Toolkit::RenderFactory::CreateVisual( const std::string&, ImageDimensions )
+   * @copydoc Toolkit::VisualFactory::CreateVisual( const std::string&, ImageDimensions )
    */
   Toolkit::Visual::Base CreateVisual( const std::string& image, ImageDimensions size );
 
   /**
+   * @copydoc Toolkit::VisualFactory::SetPreMultiplyOnLoad()
+   */
+  void SetPreMultiplyOnLoad( bool preMultiply );
+
+  /**
+   * @copydoc Toolkit::VisualFactory::GetPreMultiplyOnLoad()
+   */
+  bool GetPreMultiplyOnLoad() const;
+
+  /**
    * @return the reference to texture manager
    */
   Internal::TextureManager& GetTextureManager();
@@ -79,21 +89,25 @@ protected:
   virtual ~VisualFactory();
 
 private:
-
   /**
-   * Undefined copy constructor.
+   * Get the factory cache, creating it if necessary.
    */
-  VisualFactory(const VisualFactory&);
+  Internal::VisualFactoryCache& GetFactoryCache();
 
   /**
-   * Undefined assignment operator.
+   * Get the image visual shader factory, creating it if necessary.
    */
-  VisualFactory& operator=(const VisualFactory& rhs);
+  ImageVisualShaderFactory& GetImageVisualShaderFactory();
 
-private:
+  VisualFactory(const VisualFactory&) = delete;
 
-  VisualFactoryCachePtr   mFactoryCache;
-  bool                    mDebugEnabled;
+  VisualFactory& operator=(const VisualFactory& rhs) = delete;
+
+private:
+  std::unique_ptr<VisualFactoryCache>         mFactoryCache;
+  std::unique_ptr< ImageVisualShaderFactory > mImageVisualShaderFactory;
+  bool                                        mDebugEnabled:1;
+  bool                                        mPreMultiplyOnLoad:1; ///< Local store for this flag
 };
 
 /**