diff options
author | Romain Guy <romainguy@google.com> | 2010-11-11 12:06:27 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2010-11-11 12:06:27 -0800 |
commit | 01d065795794fa56be660d6346e4830eb7e90a41 (patch) | |
tree | bb20f3b363618cb6998aaaa26331e4459d79379c /libs/hwui/OpenGLRenderer.cpp | |
parent | a6689ddbba5d7d5e9ad7a07ae84a187497f18121 (diff) | |
download | frameworks_base-01d065795794fa56be660d6346e4830eb7e90a41.zip frameworks_base-01d065795794fa56be660d6346e4830eb7e90a41.tar.gz frameworks_base-01d065795794fa56be660d6346e4830eb7e90a41.tar.bz2 |
Reduce number of GL calls when drawing with shaders.
Change-Id: I27aca9f6d381d5c7e363d90a93225d185f2ff4e3
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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) { |