summaryrefslogtreecommitdiff
path: root/libs/hwui/PatchCache.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2010-11-30 12:04:14 -0800
committer Romain Guy <romainguy@google.com> 2010-11-30 12:06:39 -0800
commit6f72bebe92a4db7b5dc83f4ac5b5fd02e3b4e2cd (patch)
tree50c8b82bd203c9c71821a4cf8b649f73d258eeae /libs/hwui/PatchCache.cpp
parent730666858692ea396f5ad779654b5d86ff90b6ca (diff)
Update 9patch structure when rendering with different divs/colors.
Bug #3221488 Change-Id: Ifc9e42a991d630feadc9e8032322f37504d09d6d
Diffstat (limited to 'libs/hwui/PatchCache.cpp')
-rw-r--r--libs/hwui/PatchCache.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/PatchCache.cpp b/libs/hwui/PatchCache.cpp
index 71bab91bfa8e..9702c3d50c1f 100644
--- a/libs/hwui/PatchCache.cpp
+++ b/libs/hwui/PatchCache.cpp
@@ -87,8 +87,9 @@ Patch* PatchCache::get(const float bitmapWidth, const float bitmapHeight,
width, height, pixelWidth, pixelHeight, bitmapWidth, bitmapHeight);
mesh = new Patch(width, height, transparentQuads);
- mesh->updateVertices(bitmapWidth, bitmapHeight, 0.0f, 0.0f,
- pixelWidth, pixelHeight, xDivs, yDivs, width, height, colorKey);
+ mesh->updateColorKey(colorKey);
+ mesh->copy(xDivs, yDivs);
+ mesh->updateVertices(bitmapWidth, bitmapHeight, 0.0f, 0.0f, pixelWidth, pixelHeight);
if (mCache.size() >= mMaxEntries) {
delete mCache.valueAt(mCache.size() - 1);
@@ -96,6 +97,9 @@ Patch* PatchCache::get(const float bitmapWidth, const float bitmapHeight,
}
mCache.add(description, mesh);
+ } else if (!mesh->matches(xDivs, yDivs, colorKey)) {
+ PATCH_LOGD("Patch mesh does not match, refreshing vertices");
+ mesh->updateVertices(bitmapWidth, bitmapHeight, 0.0f, 0.0f, pixelWidth, pixelHeight);
}
return mesh;