Microbench hackery
Change-Id: I35428350e16982824bb4e8a0015a4cb98b1c0799
diff --git a/libs/hwui/DisplayList.cpp b/libs/hwui/DisplayList.cpp
index 0af9420..ee51da2 100644
--- a/libs/hwui/DisplayList.cpp
+++ b/libs/hwui/DisplayList.cpp
@@ -36,15 +36,17 @@
}
void DisplayListData::cleanupResources() {
- ResourceCache& resourceCache = ResourceCache::getInstance();
- resourceCache.lock();
+ if (CC_UNLIKELY(patchResources.size())) {
+ ResourceCache& resourceCache = ResourceCache::getInstance();
+ resourceCache.lock();
- for (size_t i = 0; i < patchResources.size(); i++) {
- resourceCache.decrementRefcountLocked(patchResources[i]);
+ for (size_t i = 0; i < patchResources.size(); i++) {
+ resourceCache.decrementRefcountLocked(patchResources[i]);
+ }
+
+ resourceCache.unlock();
}
- resourceCache.unlock();
-
for (size_t i = 0; i < pathResources.size(); i++) {
const SkPath* path = pathResources[i];
if (path->unique() && Caches::hasInstance()) {