From d41c4d8c732095ae99c955b6b82f7306633004b1 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Mon, 5 Jan 2015 15:51:13 -0800 Subject: Add overrides and switch to nullptr keyword for all files Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf --- libs/hwui/ResourceCache.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'libs/hwui/ResourceCache.cpp') diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp index 8a48a6e6c04c..45c27c25880e 100644 --- a/libs/hwui/ResourceCache.cpp +++ b/libs/hwui/ResourceCache.cpp @@ -79,8 +79,8 @@ void ResourceCache::incrementRefcount(const Res_png_9patch* patchResource) { void ResourceCache::incrementRefcountLocked(void* resource, ResourceType resourceType) { ssize_t index = mCache->indexOfKey(resource); - ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : NULL; - if (ref == NULL || mCache->size() == 0) { + ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : nullptr; + if (ref == nullptr || mCache->size() == 0) { ref = new ResourceReference(resourceType); mCache->add(resource, ref); } @@ -118,8 +118,8 @@ void ResourceCache::decrementRefcount(const Res_png_9patch* patchResource) { void ResourceCache::decrementRefcountLocked(void* resource) { ssize_t index = mCache->indexOfKey(resource); - ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : NULL; - if (ref == NULL) { + ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : nullptr; + if (ref == nullptr) { // Should not get here - shouldn't get a call to decrement if we're not yet tracking it return; } @@ -148,8 +148,8 @@ void ResourceCache::destructor(SkPath* resource) { void ResourceCache::destructorLocked(SkPath* resource) { ssize_t index = mCache->indexOfKey(resource); - ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : NULL; - if (ref == NULL) { + ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : nullptr; + if (ref == nullptr) { // If we're not tracking this resource, just delete it if (Caches::hasInstance()) { Caches::getInstance().pathCache.removeDeferred(resource); @@ -171,8 +171,8 @@ void ResourceCache::destructor(const SkBitmap* resource) { void ResourceCache::destructorLocked(const SkBitmap* resource) { ssize_t index = mCache->indexOfKey(resource); - ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : NULL; - if (ref == NULL) { + ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : nullptr; + if (ref == nullptr) { // If we're not tracking this resource, just delete it if (Caches::hasInstance()) { Caches::getInstance().textureCache.releaseTexture(resource); @@ -193,8 +193,8 @@ void ResourceCache::destructor(Res_png_9patch* resource) { void ResourceCache::destructorLocked(Res_png_9patch* resource) { ssize_t index = mCache->indexOfKey(resource); - ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : NULL; - if (ref == NULL) { + ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : nullptr; + if (ref == nullptr) { // If we're not tracking this resource, just delete it if (Caches::hasInstance()) { Caches::getInstance().patchCache.removeDeferred(resource); @@ -231,11 +231,11 @@ bool ResourceCache::recycleLocked(SkBitmap* resource) { Caches::getInstance().textureCache.releaseTexture(resource); } // not tracking this resource; just recycle the pixel data - resource->setPixels(NULL, NULL); + resource->setPixels(nullptr, nullptr); return true; } ResourceReference* ref = mCache->valueAt(index); - if (ref == NULL) { + if (ref == nullptr) { // Should not get here - shouldn't get a call to recycle if we're not yet tracking it return true; } @@ -258,7 +258,7 @@ void ResourceCache::deleteResourceReferenceLocked(const void* resource, Resource if (Caches::hasInstance()) { Caches::getInstance().textureCache.releaseTexture(bitmap); } - bitmap->setPixels(NULL, NULL); + bitmap->setPixels(nullptr, nullptr); } if (ref->destroyed) { switch (ref->resourceType) { -- cgit v1.2.3-59-g8ed1b