summaryrefslogtreecommitdiff
path: root/libs/hwui/ResourceCache.cpp
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2018-08-29 15:51:15 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-08-29 15:51:15 +0000
commit54b9892f3cc8ed30bfe660ff2957aefeb484b092 (patch)
tree0c9374ad222a99e4c7b709230e594be12d57dc24 /libs/hwui/ResourceCache.cpp
parentc8344a19637ff39f84cbd6acecb952c80f2c4de5 (diff)
parentc8e22a653297837da9a80b0ba65f6854c8986c96 (diff)
Merge "TextureView Vulkan support and optimized OpenGL draw"
Diffstat (limited to 'libs/hwui/ResourceCache.cpp')
-rw-r--r--libs/hwui/ResourceCache.cpp23
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;
}
}