summaryrefslogtreecommitdiff
path: root/libs/hwui/ResourceCache.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2015-01-06 00:50:52 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2015-01-06 00:50:53 +0000
commitb15f21effb8d5be988bb46eea00b6ff28222aa98 (patch)
tree1e972cc58de13661c5db8bf76d3b8d860a0bcfb4 /libs/hwui/ResourceCache.cpp
parent578efef682cc2216db121bb88d2af977703ee6e2 (diff)
parentd41c4d8c732095ae99c955b6b82f7306633004b1 (diff)
Merge "Add overrides and switch to nullptr keyword for all files"
Diffstat (limited to 'libs/hwui/ResourceCache.cpp')
-rw-r--r--libs/hwui/ResourceCache.cpp26
1 files changed, 13 insertions, 13 deletions
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) {