Revert bug fix in renderer 87/75287/1
authorFerran Sole <ferran.sole@samsung.com>
Fri, 17 Jun 2016 08:27:42 +0000 (09:27 +0100)
committerFerran Sole <ferran.sole@samsung.com>
Fri, 17 Jun 2016 08:29:38 +0000 (09:29 +0100)
Change-Id: Ie4154b9522943df483bd68226e71ddf2b80163b4

dali/internal/render/renderers/render-renderer.cpp

index 9e83849..5400c12 100644 (file)
@@ -369,23 +369,29 @@ bool Renderer::BindTextures( Context& context, SceneGraph::TextureCache& texture
     Internal::Texture* texture = textureCache.GetTexture( textureId );
     if( texture )
     {
-      result = program.GetSamplerUniformLocation( i, uniformLocation ) &&
-               textureCache.BindTexture( texture, textureId, GL_TEXTURE_2D, (TextureUnit)textureUnit );
+      result = textureCache.BindTexture( texture, textureId, GL_TEXTURE_2D, (TextureUnit)textureUnit );
 
-      if( result && Program::UNIFORM_UNKNOWN != uniformLocation )
+      if( result )
       {
-        program.SetUniform1i( uniformLocation, textureUnit );
+        GLint uniformLocation;
 
-        unsigned int samplerBitfield(ImageSampler::DEFAULT_BITFIELD);
-        const Render::Sampler* sampler(  samplers[i] );
-        if( sampler )
+        //TODO : This is a bug, result variable is being shadowed. Fix it!
+        bool result = program.GetSamplerUniformLocation( i, uniformLocation );
+        if( result && Program::UNIFORM_UNKNOWN != uniformLocation )
         {
-          samplerBitfield = sampler->mBitfield;
-        }
+          program.SetUniform1i( uniformLocation, textureUnit );
 
-        texture->ApplySampler( (TextureUnit)textureUnit, samplerBitfield );
+          unsigned int samplerBitfield(ImageSampler::DEFAULT_BITFIELD);
+          const Render::Sampler* sampler(  samplers[i] );
+          if( sampler )
+          {
+            samplerBitfield = sampler->mBitfield;
+          }
 
-        ++textureUnit;
+          texture->ApplySampler( (TextureUnit)textureUnit, samplerBitfield );
+
+          ++textureUnit;
+        }
       }
     }
   }