Avoid Heap allocation in UniformMap.
[platform/core/uifw/dali-core.git] / dali / internal / render / data-providers / uniform-map-data-provider.h
index e5610a5..68ae5e7 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_UNIFORM_MAP_DATA_PROVIDER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -16,9 +16,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <dali/public-api/common/dali-vector.h>
-#include <dali/integration-api/resource-declarations.h>
 #include <dali/internal/common/buffer-index.h>
+#include <dali/internal/update/common/uniform-map.h>
+#include <dali/public-api/common/dali-vector.h>
 
 namespace Dali
 {
@@ -29,7 +29,7 @@ namespace SceneGraph
 class UniformMap;
 class UniformPropertyMapping;
 
-typedef Dali::Vector< const UniformPropertyMapping* > CollectedUniformMap;
+using CollectedUniformMap = Dali::Vector<UniformPropertyMapping>;
 
 /**
  * This class maps uniform names to property value pointers.
@@ -40,9 +40,7 @@ public:
   /**
    * Constructor
    */
-  UniformMapDataProvider()
-  {
-  }
+  UniformMapDataProvider() = default;
 
   /**
    * Return true if the uniform map has been changed this frame
@@ -56,6 +54,8 @@ public:
 
   /**
    * Get the complete map of uniforms to property value addresses
+   * (The map is double buffered - it can be retrieved through this interface)
+   *
    * @param[in] bufferIndex The bufferIndex
    * @return the uniform map
    */
@@ -65,9 +65,7 @@ protected:
   /**
    * No deletion through this interface
    */
-  virtual ~UniformMapDataProvider()
-  {
-  }
+  virtual ~UniformMapDataProvider() = default;
 };
 
 } // namespace SceneGraph