diff options
author | Romain Guy <romainguy@google.com> | 2010-07-12 14:17:16 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-07-12 14:17:16 -0700 |
commit | d12315ae7ee06902f4b7470259ce33076b6f542c (patch) | |
tree | 2c142845465004ef4d1a7d9de19dea50bc617be0 /libs/hwui/Program.cpp | |
parent | 77ad5e64116ba692efea060d528681c069aa439b (diff) | |
parent | 0b9db91c3dc8007b47c8fd4fb9dd85be97201a88 (diff) |
Merge "Remove math from the vertex shader."
Diffstat (limited to 'libs/hwui/Program.cpp')
-rw-r--r-- | libs/hwui/Program.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp index 819e7368aad3..98d254cc9fdb 100644 --- a/libs/hwui/Program.cpp +++ b/libs/hwui/Program.cpp @@ -127,17 +127,17 @@ DrawColorProgram::DrawColorProgram(const char* vertex, const char* fragment): void DrawColorProgram::getAttribsAndUniforms() { position = addAttrib("position"); color = addUniform("color"); - projection = addUniform("projection"); - modelView = addUniform("modelView"); transform = addUniform("transform"); } -void DrawColorProgram::use(const GLfloat* projectionMatrix, const GLfloat* modelViewMatrix, - const GLfloat* transformMatrix) { +void DrawColorProgram::use(const float* projectionMatrix, const mat4& modelViewMatrix, + const mat4& transformMatrix) { + mat4 t(projectionMatrix); + t.multiply(transformMatrix); + t.multiply(modelViewMatrix); + Program::use(); - glUniformMatrix4fv(projection, 1, GL_FALSE, projectionMatrix); - glUniformMatrix4fv(modelView, 1, GL_FALSE, modelViewMatrix); - glUniformMatrix4fv(transform, 1, GL_FALSE, transformMatrix); + glUniformMatrix4fv(transform, 1, GL_FALSE, &t.data[0]); } /////////////////////////////////////////////////////////////////////////////// |