Optimize compositing of the shader

Change-Id: I76a7c4a51668e92a86b948f85545ee68381f8287