| Index: src/core/SkReadBuffer.cpp
|
| diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp
|
| index 58a4ac42dbb40101a3e6fdf68ef0d59b48412a26..00e3e2c1ce1c5cdaa02fe86a7845ee2b125ac6c1 100644
|
| --- a/src/core/SkReadBuffer.cpp
|
| +++ b/src/core/SkReadBuffer.cpp
|
| @@ -24,16 +24,16 @@ static uint32_t default_flags() {
|
| SkReadBuffer::SkReadBuffer() {
|
| fFlags = default_flags();
|
| fVersion = 0;
|
| - fMemoryPtr = NULL;
|
| + fMemoryPtr = nullptr;
|
|
|
| - fBitmapStorage = NULL;
|
| - fTFArray = NULL;
|
| + fBitmapStorage = nullptr;
|
| + fTFArray = nullptr;
|
| fTFCount = 0;
|
|
|
| - fFactoryTDArray = NULL;
|
| - fFactoryArray = NULL;
|
| + fFactoryTDArray = nullptr;
|
| + fFactoryArray = nullptr;
|
| fFactoryCount = 0;
|
| - fBitmapDecoder = NULL;
|
| + fBitmapDecoder = nullptr;
|
| #ifdef DEBUG_NON_DETERMINISTIC_ASSERT
|
| fDecodedBitmapIndex = -1;
|
| #endif // DEBUG_NON_DETERMINISTIC_ASSERT
|
| @@ -43,16 +43,16 @@ SkReadBuffer::SkReadBuffer(const void* data, size_t size) {
|
| fFlags = default_flags();
|
| fVersion = 0;
|
| fReader.setMemory(data, size);
|
| - fMemoryPtr = NULL;
|
| + fMemoryPtr = nullptr;
|
|
|
| - fBitmapStorage = NULL;
|
| - fTFArray = NULL;
|
| + fBitmapStorage = nullptr;
|
| + fTFArray = nullptr;
|
| fTFCount = 0;
|
|
|
| - fFactoryTDArray = NULL;
|
| - fFactoryArray = NULL;
|
| + fFactoryTDArray = nullptr;
|
| + fFactoryArray = nullptr;
|
| fFactoryCount = 0;
|
| - fBitmapDecoder = NULL;
|
| + fBitmapDecoder = nullptr;
|
| #ifdef DEBUG_NON_DETERMINISTIC_ASSERT
|
| fDecodedBitmapIndex = -1;
|
| #endif // DEBUG_NON_DETERMINISTIC_ASSERT
|
| @@ -66,14 +66,14 @@ SkReadBuffer::SkReadBuffer(SkStream* stream) {
|
| stream->read(fMemoryPtr, length);
|
| fReader.setMemory(fMemoryPtr, length);
|
|
|
| - fBitmapStorage = NULL;
|
| - fTFArray = NULL;
|
| + fBitmapStorage = nullptr;
|
| + fTFArray = nullptr;
|
| fTFCount = 0;
|
|
|
| - fFactoryTDArray = NULL;
|
| - fFactoryArray = NULL;
|
| + fFactoryTDArray = nullptr;
|
| + fFactoryArray = nullptr;
|
| fFactoryCount = 0;
|
| - fBitmapDecoder = NULL;
|
| + fBitmapDecoder = nullptr;
|
| #ifdef DEBUG_NON_DETERMINISTIC_ASSERT
|
| fDecodedBitmapIndex = -1;
|
| #endif // DEBUG_NON_DETERMINISTIC_ASSERT
|
| @@ -223,7 +223,7 @@ bool SkReadBuffer::readBitmap(SkBitmap* bitmap) {
|
| const void* data = this->skip(length);
|
| const int32_t xOffset = this->readInt();
|
| const int32_t yOffset = this->readInt();
|
| - if (fBitmapDecoder != NULL && fBitmapDecoder(data, length, bitmap)) {
|
| + if (fBitmapDecoder != nullptr && fBitmapDecoder(data, length, bitmap)) {
|
| if (bitmap->width() == width && bitmap->height() == height) {
|
| #ifdef DEBUG_NON_DETERMINISTIC_ASSERT
|
| if (0 != xOffset || 0 != yOffset) {
|
| @@ -281,7 +281,7 @@ SkTypeface* SkReadBuffer::readTypeface() {
|
| if (index) {
|
| SkDebugf("====== typeface index %d\n", index);
|
| }
|
| - return NULL;
|
| + return nullptr;
|
| } else {
|
| SkASSERT(fTFArray);
|
| return fTFArray[index - 1];
|
| @@ -293,12 +293,12 @@ SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) {
|
| // TODO: confirm that ft matches the factory we decide to use
|
| //
|
|
|
| - SkFlattenable::Factory factory = NULL;
|
| + SkFlattenable::Factory factory = nullptr;
|
|
|
| if (fFactoryCount > 0) {
|
| int32_t index = fReader.readU32();
|
| if (0 == index) {
|
| - return NULL; // writer failed to give us the flattenable
|
| + return nullptr; // writer failed to give us the flattenable
|
| }
|
| index -= 1; // we stored the index-base-1
|
| SkASSERT(index < fFactoryCount);
|
| @@ -306,20 +306,20 @@ SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) {
|
| } else if (fFactoryTDArray) {
|
| int32_t index = fReader.readU32();
|
| if (0 == index) {
|
| - return NULL; // writer failed to give us the flattenable
|
| + return nullptr; // writer failed to give us the flattenable
|
| }
|
| index -= 1; // we stored the index-base-1
|
| factory = (*fFactoryTDArray)[index];
|
| } else {
|
| factory = (SkFlattenable::Factory)readFunctionPtr();
|
| - if (NULL == factory) {
|
| - return NULL; // writer failed to give us the flattenable
|
| + if (nullptr == factory) {
|
| + return nullptr; // writer failed to give us the flattenable
|
| }
|
| }
|
|
|
| // if we get here, factory may still be null, but if that is the case, the
|
| // failure was ours, not the writer.
|
| - SkFlattenable* obj = NULL;
|
| + SkFlattenable* obj = nullptr;
|
| uint32_t sizeRecorded = fReader.readU32();
|
| if (factory) {
|
| size_t offset = fReader.offset();
|
| @@ -351,7 +351,7 @@ void SkReadBuffer::skipFlattenable() {
|
| return;
|
| }
|
| } else {
|
| - if (NULL == this->readFunctionPtr()) {
|
| + if (nullptr == this->readFunctionPtr()) {
|
| return;
|
| }
|
| }
|
|
|