diff options
author | Romain Guy <romainguy@google.com> | 2010-12-02 17:15:05 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-12-02 17:15:05 -0800 |
commit | 9d0161799c1f210937bb10e5cc92383a2c94bd9c (patch) | |
tree | 594d8738febd96b257a77b191bb15dd150797400 /libs | |
parent | 9d5055a2bcb231ea13e8da8f64bd93398f04225e (diff) | |
parent | bd41a11078e94b755c8b6f78e1e4242c715fccd4 (diff) | |
download | frameworks_base-9d0161799c1f210937bb10e5cc92383a2c94bd9c.zip frameworks_base-9d0161799c1f210937bb10e5cc92383a2c94bd9c.tar.gz frameworks_base-9d0161799c1f210937bb10e5cc92383a2c94bd9c.tar.bz2 |
Merge "Correctly index transparent quads when generating 9patch meshes. Bug #3250026"
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/Patch.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/hwui/Patch.cpp b/libs/hwui/Patch.cpp index 7ca289d..ebffd34 100644 --- a/libs/hwui/Patch.cpp +++ b/libs/hwui/Patch.cpp @@ -42,6 +42,9 @@ Patch::Patch(const uint32_t xCount, const uint32_t yCount, const int8_t emptyQua mXDivs = new int32_t[mXCount]; mYDivs = new int32_t[mYCount]; + PATCH_LOGD(" patch: xCount = %d, yCount = %d, emptyQuads = %d, vertices = %d", + xCount, yCount, emptyQuads, verticesCount); + glGenBuffers(1, &meshBuffer); } @@ -208,7 +211,15 @@ void Patch::generateRow(TextureVertex*& vertex, float y1, float y2, float v1, fl void Patch::generateQuad(TextureVertex*& vertex, float x1, float y1, float x2, float y2, float u1, float v1, float u2, float v2, uint32_t& quadCount) { - if (((mColorKey >> quadCount++) & 0x1) == 1) { + uint32_t oldQuadCount = quadCount; + + // Degenerate quads are an artifact of our implementation and should not + // be taken into account when checking for transparent quads + if (x2 - x1 > 0.999f && y2 - y1 > 0.999f) { + quadCount++; + } + + if (((mColorKey >> oldQuadCount) & 0x1) == 1) { return; } |