summaryrefslogtreecommitdiff
path: root/libs/rs/rsProgramVertex.cpp
diff options
context:
space:
mode:
author Jason Sams <rjsams@android.com> 2009-09-30 17:36:20 -0700
committer Jason Sams <rjsams@android.com> 2009-09-30 17:40:06 -0700
commite9ad9a719dc66437ddf021d13e6ca736a23b5413 (patch)
treeeaf8a1b1da324af59924a0d49eb6db36cae5b27c /libs/rs/rsProgramVertex.cpp
parent5eb7c9d3e880032972c0d03dd34d9432fa7c719d (diff)
Implement screen aligned bitmap drawing support.
Diffstat (limited to 'libs/rs/rsProgramVertex.cpp')
-rw-r--r--libs/rs/rsProgramVertex.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/rs/rsProgramVertex.cpp b/libs/rs/rsProgramVertex.cpp
index 9bfa6022ae6e..eea8b3b67068 100644
--- a/libs/rs/rsProgramVertex.cpp
+++ b/libs/rs/rsProgramVertex.cpp
@@ -121,7 +121,14 @@ void ProgramVertex::setTextureMatrix(const rsc_Matrix *m) const
mDirty = true;
}
-
+void ProgramVertex::transformToScreen(const Context *rsc, float *v4out, const float *v3in) const
+{
+ float *f = static_cast<float *>(mConstants->getPtr());
+ Matrix mvp;
+ mvp.loadMultiply((Matrix *)&f[RS_PROGRAM_VERTEX_MODELVIEW_OFFSET],
+ (Matrix *)&f[RS_PROGRAM_VERTEX_PROJECTION_OFFSET]);
+ mvp.vectorMultiply(v4out, v3in);
+}
ProgramVertexState::ProgramVertexState()
{