diff options
author | Alex Sakhartchouk <alexst@google.com> | 2011-11-15 15:15:21 -0800 |
---|---|---|
committer | Alex Sakhartchouk <alexst@google.com> | 2011-11-15 15:15:21 -0800 |
commit | e60149d2277da53c4a681b7f3971cf13cd4b012b (patch) | |
tree | 1bb4f453808bf3ebd87d6f724c7b1b73d5d54934 /libs/rs/rsFont.cpp | |
parent | 7b95eba9f47a3992128d59a9ec593b887e4dac0e (diff) | |
download | frameworks_base-e60149d2277da53c4a681b7f3971cf13cd4b012b.zip frameworks_base-e60149d2277da53c4a681b7f3971cf13cd4b012b.tar.gz frameworks_base-e60149d2277da53c4a681b7f3971cf13cd4b012b.tar.bz2 |
Expand RS vector3 types to vector4.
BUG=5609007
The underlying LLVM implementation for vector3 types does this implicitly. If
RS does not adjust its implementation, we will always be misaligned for any
subsequent data after a vector3 type. We previously inserted padding into the
reflected layers from llvm-rs-cc (hence the skip padding part of this change).
We can safely ignore the padding now that the Java/native code is updated to
use the expanded size. The compiler will also need modification to ensure that
we don't mistakenly skip over any end-of-struct padding.
Fixing the 3 component vector padding problem.
Change-Id: If68af42287deb8f4b28addcd19a9fa314656be44
Diffstat (limited to 'libs/rs/rsFont.cpp')
-rw-r--r-- | libs/rs/rsFont.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/rs/rsFont.cpp b/libs/rs/rsFont.cpp index 7efed9d..d1b7324 100644 --- a/libs/rs/rsFont.cpp +++ b/libs/rs/rsFont.cpp @@ -651,7 +651,7 @@ void FontState::appendMeshQuad(float x1, float y1, float z1, float x4, float y4, float z4, float u4, float v4) { const uint32_t vertsPerQuad = 4; - const uint32_t floatsPerVert = 5; + const uint32_t floatsPerVert = 6; float *currentPos = mTextMeshPtr + mCurrentQuadIndex * vertsPerQuad * floatsPerVert; // Cull things that are off the screen @@ -670,24 +670,28 @@ void FontState::appendMeshQuad(float x1, float y1, float z1, (*currentPos++) = x1; (*currentPos++) = y1; (*currentPos++) = z1; + (*currentPos++) = 0; (*currentPos++) = u1; (*currentPos++) = v1; (*currentPos++) = x2; (*currentPos++) = y2; (*currentPos++) = z2; + (*currentPos++) = 0; (*currentPos++) = u2; (*currentPos++) = v2; (*currentPos++) = x3; (*currentPos++) = y3; (*currentPos++) = z3; + (*currentPos++) = 0; (*currentPos++) = u3; (*currentPos++) = v3; (*currentPos++) = x4; (*currentPos++) = y4; (*currentPos++) = z4; + (*currentPos++) = 0; (*currentPos++) = u4; (*currentPos++) = v4; |