summaryrefslogtreecommitdiff
path: root/libs/hwui/Program.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-07-09 18:53:25 -0700
committerRomain Guy <romainguy@google.com>2010-07-09 18:53:25 -0700
commit0b9db91c3dc8007b47c8fd4fb9dd85be97201a88 (patch)
treef8de431ac029c79d581e54b8ba52afe8a90e3e6b /libs/hwui/Program.cpp
parent8445ca6c3ba9b7cee6d20f5919e3b3ba8e6b8c96 (diff)
Remove math from the vertex shader.
Change-Id: I02847a60a8734bf8b3d29ec12e76297795095e38
Diffstat (limited to 'libs/hwui/Program.cpp')
-rw-r--r--libs/hwui/Program.cpp14
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]);
}
///////////////////////////////////////////////////////////////////////////////