diff options
author | Jason Sams <rjsams@android.com> | 2009-11-12 16:09:45 -0800 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2009-11-12 16:09:45 -0800 |
commit | eb4b031804f42d52645d0d74f8ebc806f85a043b (patch) | |
tree | 03b23878f972d71ddb329d80387f42a29df4966d /libs/rs/rsProgramVertex.cpp | |
parent | 59175ac269df2a584241e9786dc70ac35cb973e3 (diff) | |
download | frameworks_base-eb4b031804f42d52645d0d74f8ebc806f85a043b.zip frameworks_base-eb4b031804f42d52645d0d74f8ebc806f85a043b.tar.gz frameworks_base-eb4b031804f42d52645d0d74f8ebc806f85a043b.tar.bz2 |
Make default vertex program correctly track surface size.
Diffstat (limited to 'libs/rs/rsProgramVertex.cpp')
-rw-r--r-- | libs/rs/rsProgramVertex.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/rs/rsProgramVertex.cpp b/libs/rs/rsProgramVertex.cpp index eea8b3b..68f589f 100644 --- a/libs/rs/rsProgramVertex.cpp +++ b/libs/rs/rsProgramVertex.cpp @@ -157,12 +157,17 @@ void ProgramVertexState::init(Context *rsc, int32_t w, int32_t h) pv->bindAllocation(alloc); + updateSize(rsc, w, h); +} + +void ProgramVertexState::updateSize(Context *rsc, int32_t w, int32_t h) +{ Matrix m; m.loadOrtho(0,w, h,0, -1,1); - alloc->subData(RS_PROGRAM_VERTEX_PROJECTION_OFFSET, 16, &m.m[0], 16*4); + mDefaultAlloc->subData(RS_PROGRAM_VERTEX_PROJECTION_OFFSET, 16, &m.m[0], 16*4); m.loadIdentity(); - alloc->subData(RS_PROGRAM_VERTEX_MODELVIEW_OFFSET, 16, &m.m[0], 16*4); + mDefaultAlloc->subData(RS_PROGRAM_VERTEX_MODELVIEW_OFFSET, 16, &m.m[0], 16*4); } void ProgramVertexState::deinit(Context *rsc) |