diff options
author | 2018-09-05 16:35:04 +0000 | |
---|---|---|
committer | 2018-09-05 16:35:04 +0000 | |
commit | cf1c58cd473d927f4c12dbecd33cd99d02dd1e25 (patch) | |
tree | b87edcac8e9441916a07dcd2438e7c8717ff1bd8 /libs/hwui/ResourceCache.cpp | |
parent | 594ce4ca50ed10e28c96c1a7b9654479fa087cf3 (diff) | |
parent | 564ca3e2c9ed752f2a9d549ebfb31a78942ecfec (diff) |
Merge "Reland "TextureView Vulkan support and optimized OpenGL draw""
Diffstat (limited to 'libs/hwui/ResourceCache.cpp')
-rw-r--r-- | libs/hwui/ResourceCache.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp index 464a58d0c0f8..65bee476f14d 100644 --- a/libs/hwui/ResourceCache.cpp +++ b/libs/hwui/ResourceCache.cpp @@ -15,7 +15,6 @@ */ #include "ResourceCache.h" -#include "Caches.h" namespace android { @@ -112,13 +111,9 @@ void ResourceCache::destructorLocked(Res_png_9patch* resource) { ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : nullptr; if (ref == nullptr) { // If we're not tracking this resource, just delete it - if (Caches::hasInstance()) { - // DEAD CODE - } else { - // A Res_png_9patch is actually an array of byte that's larger - // than sizeof(Res_png_9patch). It must be freed as an array. - delete[](int8_t*) resource; - } + // A Res_png_9patch is actually an array of byte that's larger + // than sizeof(Res_png_9patch). It must be freed as an array. + delete[](int8_t*) resource; return; } ref->destroyed = true; @@ -135,14 +130,10 @@ void ResourceCache::deleteResourceReferenceLocked(const void* resource, Resource if (ref->destroyed) { switch (ref->resourceType) { case kNinePatch: { - if (Caches::hasInstance()) { - // DEAD CODE - } else { - // A Res_png_9patch is actually an array of byte that's larger - // than sizeof(Res_png_9patch). It must be freed as an array. - int8_t* patch = (int8_t*)resource; - delete[] patch; - } + // A Res_png_9patch is actually an array of byte that's larger + // than sizeof(Res_png_9patch). It must be freed as an array. + int8_t* patch = (int8_t*)resource; + delete[] patch; } break; } } |