diff options
author | Romain Guy <romainguy@google.com> | 2011-01-19 10:35:46 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-19 10:35:46 -0800 |
commit | 49903d265be787885619e017edcc42604005f6b0 (patch) | |
tree | 263362422bd3c7579ffeb996f02ff5ceeef108bc /libs | |
parent | 8e7d626385eef104d52aa9080b70395ca840a0cd (diff) | |
parent | fdbec3e4828f93bfa5cde758ad0e77b89c5c2ecd (diff) | |
download | frameworks_base-49903d265be787885619e017edcc42604005f6b0.zip frameworks_base-49903d265be787885619e017edcc42604005f6b0.tar.gz frameworks_base-49903d265be787885619e017edcc42604005f6b0.tar.bz2 |
Merge "Fix 9patches in Launcher" into honeycomb
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/Patch.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/libs/hwui/Patch.cpp b/libs/hwui/Patch.cpp index 3f0036a..999e4ea 100644 --- a/libs/hwui/Patch.cpp +++ b/libs/hwui/Patch.cpp @@ -167,6 +167,10 @@ void Patch::updateVertices(const float bitmapWidth, const float bitmapHeight, float v2 = fmax(0.0f, stepY - 0.5f) / bitmapHeight; if (stepY > 0.0f) { + if (i == mYCount - 1 && mYDivs[i] == bitmapHeight) { + y2 = bottom - top; + v2 = 1.0f; + } generateRow(vertex, y1, y2, v1, v2, stretchX, right - left, bitmapWidth, quadCount); } @@ -177,8 +181,10 @@ void Patch::updateVertices(const float bitmapWidth, const float bitmapHeight, previousStepY = stepY; } - generateRow(vertex, y1, bottom - top, v1, 1.0f, stretchX, right - left, - bitmapWidth, quadCount); + if (previousStepY != bitmapHeight) { + generateRow(vertex, y1, bottom - top, v1, 1.0f, stretchX, right - left, + bitmapWidth, quadCount); + } if (verticesCount > 0) { Caches::getInstance().bindMeshBuffer(meshBuffer); @@ -216,6 +222,10 @@ void Patch::generateRow(TextureVertex*& vertex, float y1, float y2, float v1, fl float u2 = fmax(0.0f, stepX - 0.5f) / bitmapWidth; if (stepX > 0.0f) { + if (i == mXCount - 1 && mXDivs[i] == bitmapWidth) { + x2 = bitmapWidth; + u2 = 1.0f; + } generateQuad(vertex, x1, y1, x2, y2, u1, v1, u2, v2, quadCount); } @@ -225,7 +235,9 @@ void Patch::generateRow(TextureVertex*& vertex, float y1, float y2, float v1, fl previousStepX = stepX; } - generateQuad(vertex, x1, y1, width, y2, u1, v1, 1.0f, v2, quadCount); + if (previousStepX != bitmapWidth) { + generateQuad(vertex, x1, y1, width, y2, u1, v1, 1.0f, v2, quadCount); + } } void Patch::generateQuad(TextureVertex*& vertex, float x1, float y1, float x2, float y2, |