Index: src/core/SkMallocPixelRef.cpp |
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp |
index 491651080b0ebcd68a46367857b3a6b39de753f6..0196e046b17061505f63572e699c3552937791a3 100644 |
--- a/src/core/SkMallocPixelRef.cpp |
+++ b/src/core/SkMallocPixelRef.cpp |
@@ -27,7 +27,7 @@ static bool is_valid(const SkImageInfo& info, SkColorTable* ctable) { |
// that expect the pixelref to succeed even when there is a mismatch |
// with colortables. fix? |
#if 0 |
- if (kIndex8_SkColorType == info.fColorType && NULL == ctable) { |
+ if (kIndex8_SkColorType == info.fColorType && nullptr == ctable) { |
return false; |
} |
if (kIndex8_SkColorType != info.fColorType && ctable) { |
@@ -42,9 +42,9 @@ SkMallocPixelRef* SkMallocPixelRef::NewDirect(const SkImageInfo& info, |
size_t rowBytes, |
SkColorTable* ctable) { |
if (!is_valid(info, ctable)) { |
- return NULL; |
+ return nullptr; |
} |
- return new SkMallocPixelRef(info, addr, rowBytes, ctable, NULL, NULL); |
+ return new SkMallocPixelRef(info, addr, rowBytes, ctable, nullptr, nullptr); |
} |
@@ -52,16 +52,16 @@ SkMallocPixelRef* SkMallocPixelRef::NewAllocate(const SkImageInfo& info, |
size_t requestedRowBytes, |
SkColorTable* ctable) { |
if (!is_valid(info, ctable)) { |
- return NULL; |
+ return nullptr; |
} |
// only want to permit 31bits of rowBytes |
int64_t minRB = (int64_t)info.minRowBytes64(); |
if (minRB < 0 || !sk_64_isS32(minRB)) { |
- return NULL; // allocation will be too large |
+ return nullptr; // allocation will be too large |
} |
if (requestedRowBytes > 0 && (int32_t)requestedRowBytes < minRB) { |
- return NULL; // cannot meet requested rowbytes |
+ return nullptr; // cannot meet requested rowbytes |
} |
int32_t rowBytes; |
@@ -73,17 +73,17 @@ SkMallocPixelRef* SkMallocPixelRef::NewAllocate(const SkImageInfo& info, |
int64_t bigSize = (int64_t)info.height() * rowBytes; |
if (!sk_64_isS32(bigSize)) { |
- return NULL; |
+ return nullptr; |
} |
size_t size = sk_64_asS32(bigSize); |
SkASSERT(size >= info.getSafeSize(rowBytes)); |
void* addr = sk_malloc_flags(size, 0); |
- if (NULL == addr) { |
- return NULL; |
+ if (nullptr == addr) { |
+ return nullptr; |
} |
- return new SkMallocPixelRef(info, addr, rowBytes, ctable, sk_free_releaseproc, NULL); |
+ return new SkMallocPixelRef(info, addr, rowBytes, ctable, sk_free_releaseproc, nullptr); |
} |
SkMallocPixelRef* SkMallocPixelRef::NewWithProc(const SkImageInfo& info, |
@@ -93,7 +93,7 @@ SkMallocPixelRef* SkMallocPixelRef::NewWithProc(const SkImageInfo& info, |
SkMallocPixelRef::ReleaseProc proc, |
void* context) { |
if (!is_valid(info, ctable)) { |
- return NULL; |
+ return nullptr; |
} |
return new SkMallocPixelRef(info, addr, rowBytes, ctable, proc, context); |
} |
@@ -106,19 +106,19 @@ SkMallocPixelRef* SkMallocPixelRef::NewWithData(const SkImageInfo& info, |
size_t rowBytes, |
SkColorTable* ctable, |
SkData* data) { |
- SkASSERT(data != NULL); |
+ SkASSERT(data != nullptr); |
if (!is_valid(info, ctable)) { |
- return NULL; |
+ return nullptr; |
} |
if ((rowBytes < info.minRowBytes()) |
|| (data->size() < info.getSafeSize(rowBytes))) { |
- return NULL; |
+ return nullptr; |
} |
data->ref(); |
SkMallocPixelRef* pr = |
new SkMallocPixelRef(info, const_cast<void*>(data->data()), rowBytes, ctable, |
sk_data_releaseproc, static_cast<void*>(data)); |
- SkASSERT(pr != NULL); |
+ SkASSERT(pr != nullptr); |
// We rely on the immutability of the pixels to make the |
// const_cast okay. |
pr->setImmutable(); |
@@ -131,14 +131,14 @@ SkMallocPixelRef::SkMallocPixelRef(const SkImageInfo& info, void* storage, |
size_t rowBytes, SkColorTable* ctable, |
bool ownsPixels) |
: INHERITED(info) |
- , fReleaseProc(ownsPixels ? sk_free_releaseproc : NULL) |
- , fReleaseProcContext(NULL) { |
+ , fReleaseProc(ownsPixels ? sk_free_releaseproc : nullptr) |
+ , fReleaseProcContext(nullptr) { |
// This constructor is now DEPRICATED. |
SkASSERT(is_valid(info, ctable)); |
SkASSERT(rowBytes >= info.minRowBytes()); |
if (kIndex_8_SkColorType != info.colorType()) { |
- ctable = NULL; |
+ ctable = nullptr; |
} |
fStorage = storage; |
@@ -161,7 +161,7 @@ SkMallocPixelRef::SkMallocPixelRef(const SkImageInfo& info, void* storage, |
SkASSERT(rowBytes >= info.minRowBytes()); |
if (kIndex_8_SkColorType != info.colorType()) { |
- ctable = NULL; |
+ ctable = nullptr; |
} |
fStorage = storage; |
@@ -175,7 +175,7 @@ SkMallocPixelRef::SkMallocPixelRef(const SkImageInfo& info, void* storage, |
SkMallocPixelRef::~SkMallocPixelRef() { |
SkSafeUnref(fCTable); |
- if (fReleaseProc != NULL) { |
+ if (fReleaseProc != nullptr) { |
fReleaseProc(fStorage, fReleaseProcContext); |
} |
} |