Stop creating string for sampler name every frame for every program 48/49848/1
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Tue, 20 Oct 2015 17:10:42 +0000 (18:10 +0100)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Tue, 20 Oct 2015 17:10:42 +0000 (18:10 +0100)
Change-Id: Ic5da8308fd6e51ecce7173a159956488b83766cf

dali/internal/render/renderers/render-new-renderer.cpp
dali/internal/render/renderers/render-new-renderer.h
dali/internal/render/renderers/render-texture.h

index ded4957..4a32245 100644 (file)
@@ -328,7 +328,7 @@ void NewRenderer::BindTextures(
   }
 }
 
-unsigned int NewRenderer::GetTextureUniformIndex( Program& program, std::string uniformName )
+unsigned int NewRenderer::GetTextureUniformIndex( Program& program, const std::string& uniformName )
 {
   unsigned int uniformIndex = 0;
   bool found = false;
index d5e6061..84a5ed6 100644 (file)
@@ -179,7 +179,7 @@ private:
    * @param[in] sampler The sampler holding a texture unit uniform name to search for
    * @return The texture uniform index in the program
    */
-  unsigned int GetTextureUniformIndex( Program& program, std::string uniformName );
+  unsigned int GetTextureUniformIndex( Program& program, const std::string& uniformName );
 
 
 public: //@todo MESH_REWORK make private after merge with SceneGraph::Renderer
index 83c82f8..bb79d83 100644 (file)
@@ -71,9 +71,9 @@ public: // SamplerDataProvider interface - called from RenderThread
    * Get the texture unit uniform name
    * @return the name of the texture unit uniform
    */
-  inline const char* GetUniformName() const
+  inline const std::string& GetUniformName() const
   {
-    return mUniformName.c_str();
+    return mUniformName;
   }
 
   /**