When deleting a path, remove it from the path cache.
Bug #4170585
Change-Id: I6be4d251ceb908c89afe49c2ff85c05f36c73b70
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index bf1182c..c7459d1 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -93,7 +93,9 @@
mPaints.clear();
for (size_t i = 0; i < mPaths.size(); i++) {
- delete mPaths.itemAt(i);
+ SkPath* path = mPaths.itemAt(i);
+ caches.pathCache.remove(path);
+ delete path;
}
mPaths.clear();
diff --git a/libs/hwui/ShapeCache.h b/libs/hwui/ShapeCache.h
index 859e503..b5cc29c 100644
--- a/libs/hwui/ShapeCache.h
+++ b/libs/hwui/ShapeCache.h
@@ -89,8 +89,11 @@
join = SkPaint::kDefault_Join;
cap = SkPaint::kDefault_Cap;
style = SkPaint::kFill_Style;
- miter = 4.0f;
- strokeWidth = 1.0f;
+ float v = 4.0f;
+ miter = *(uint32_t*) &v;
+ v = 1.0f;
+ strokeWidth = *(uint32_t*) &v;
+ pathEffect = NULL;
}
ShapeCacheEntry(const ShapeCacheEntry& entry):