From 01d065795794fa56be660d6346e4830eb7e90a41 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Thu, 11 Nov 2010 12:06:27 -0800 Subject: Reduce number of GL calls when drawing with shaders. Change-Id: I27aca9f6d381d5c7e363d90a93225d185f2ff4e3 --- libs/hwui/OpenGLRenderer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs/hwui/OpenGLRenderer.cpp') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 540f115..acce1a2 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -1463,7 +1463,9 @@ void OpenGLRenderer::setupColorRect(float left, float top, float right, float bo dirtyLayer(left, top, right, bottom); } } - mCaches.currentProgram->setColor(r, g, b, a); + if (!mShader || (mShader && setColor)) { + mCaches.currentProgram->setColor(r, g, b, a); + } // Setup attributes and uniforms required by the shaders if (mShader) { -- cgit v1.1