Use modern construct 'using' instead of typedef.
[platform/core/uifw/dali-core.git] / dali / internal / event / effects / shader-factory.h
index 17a4204..c09f859 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_SHADER_FACTORY_H__
-#define __DALI_INTERNAL_SHADER_FACTORY_H__
+#ifndef DALI_INTERNAL_SHADER_FACTORY_H
+#define DALI_INTERNAL_SHADER_FACTORY_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -20,8 +20,8 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-vector.h>
-#include <dali/internal/event/effects/shader-declarations.h>
 #include <dali/internal/common/message.h>
+#include <dali/internal/common/shader-data.h>
 #include <dali/internal/common/shader-saver.h>
 
 namespace Dali
@@ -31,12 +31,12 @@ namespace Internal
 {
 
 class ShaderData;
-typedef IntrusivePtr<ShaderData> ShaderDataPtr;
+using ShaderDataPtr = IntrusivePtr<ShaderData>;
 
 /**
- * ShaderFactory is an object which manages shader binary resource load requests,
- * It triggers the load requests during core initialization and sends a message to the
- * render manager with information about all the requested shader binaries.
+ * @brief ShaderFactory loads and saves shader binaries synchronously.
+ *
+ * Binaries loaded or saved are also cached by the ShaderFactory.
  */
 class ShaderFactory : public ShaderSaver
 {
@@ -67,10 +67,11 @@ public:
    *                            a compiled shader program binary if one could be found, else an
    *                            empty binary buffer cleared to size zero.
    */
-  Internal::ShaderDataPtr Load( const std::string& vertexSource, const std::string& fragmentSource, size_t& shaderHash );
+  Internal::ShaderDataPtr Load( const std::string& vertexSource, const std::string& fragmentSource, const Dali::Shader::Hint::Value hints, size_t& shaderHash );
 
   /**
    * @brief Saves shader to memory cache and filesystem.
+   *
    * This is called when a shader binary is ready to be saved to the memory cache file system.
    * Shaders that pass through here become available to subsequent invocations of Load.
    * @param[in] shader The data to be saved.
@@ -78,11 +79,6 @@ public:
    */
   virtual void SaveBinary( Internal::ShaderDataPtr shader );
 
-  /**
-   * Called during Core initialization to load the default shader.
-   */
-  void LoadDefaultShaders();
-
 private:
 
   void MemoryCacheInsert( Internal::ShaderData& shaderData );
@@ -94,7 +90,6 @@ private:
   ShaderFactory& operator=( const ShaderFactory& rhs );
 
 private:
-  ShaderEffectPtr                           mDefaultShader;
   Dali::Vector< Internal::ShaderData* > mShaderBinaryCache; ///< Cache of pre-compiled shaders.
 
 }; // class ShaderFactory
@@ -110,4 +105,4 @@ inline MessageBase* ShaderCompiledMessage( ShaderSaver& factory, Internal::Shade
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_SHADER_FACTORY_H__
+#endif // DALI_INTERNAL_SHADER_FACTORY_H