am 89513ee5: Merge "Fix projection offset caching - DO NOT MERGE" into klp-dev

* commit '89513ee544cd6373496179758e09954af0ba217d':
  Fix projection offset caching - DO NOT MERGE
This commit is contained in:
Chris Craik
2014-03-20 01:08:45 +00:00
committed by Android Git Automerger
2 changed files with 3 additions and 1 deletions

View File

@@ -163,7 +163,7 @@ GLuint Program::buildShader(const char* source, GLenum type) {
void Program::set(const mat4& projectionMatrix, const mat4& modelViewMatrix, void Program::set(const mat4& projectionMatrix, const mat4& modelViewMatrix,
const mat4& transformMatrix, bool offset) { const mat4& transformMatrix, bool offset) {
if (projectionMatrix != mProjection) { if (projectionMatrix != mProjection || offset != mOffset) {
if (CC_LIKELY(!offset)) { if (CC_LIKELY(!offset)) {
glUniformMatrix4fv(projection, 1, GL_FALSE, &projectionMatrix.data[0]); glUniformMatrix4fv(projection, 1, GL_FALSE, &projectionMatrix.data[0]);
} else { } else {
@@ -177,6 +177,7 @@ void Program::set(const mat4& projectionMatrix, const mat4& modelViewMatrix,
glUniformMatrix4fv(projection, 1, GL_FALSE, &p.data[0]); glUniformMatrix4fv(projection, 1, GL_FALSE, &p.data[0]);
} }
mProjection = projectionMatrix; mProjection = projectionMatrix;
mOffset = offset;
} }
mat4 t(transformMatrix); mat4 t(transformMatrix);

View File

@@ -431,6 +431,7 @@ private:
bool mHasSampler; bool mHasSampler;
mat4 mProjection; mat4 mProjection;
bool mOffset;
}; // class Program }; // class Program
}; // namespace uirenderer }; // namespace uirenderer