Reduce texture binds and active texture calls for draw calls by better caching
[platform/core/uifw/dali-core.git] / dali / internal / render / renderers / scene-graph-image-renderer.cpp
index e35f5de..50853c3 100644 (file)
@@ -266,14 +266,14 @@ void ImageRenderer::DoRender( BufferIndex bufferIndex, Program& program, const M
 
   DALI_ASSERT_DEBUG( mVertexBuffer );
 
-  mTextureCache->BindTexture( mTexture, mTextureId,  GL_TEXTURE_2D, TextureUnitAsGLenum( TEXTURE_UNIT_IMAGE ) );
+  mTextureCache->BindTexture( mTexture, mTextureId,  GL_TEXTURE_2D, TEXTURE_UNIT_IMAGE );
 
   if( mTexture->GetTextureId() == 0 )
   {
     return; // early out if we haven't got a GL texture yet (e.g. due to context loss)
   }
 
-  mTexture->ApplySampler( mSamplerBitfield );
+  mTexture->ApplySampler( TEXTURE_UNIT_IMAGE, mSamplerBitfield );
 
   // Set sampler uniform
   GLint samplerLoc = program.GetUniformLocation( Program::UNIFORM_SAMPLER );