Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: src/core/SkWriteBuffer.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkVertState.cpp ('k') | src/core/SkWriter32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkWriteBuffer.cpp
diff --git a/src/core/SkWriteBuffer.cpp b/src/core/SkWriteBuffer.cpp
index faa7f00b08d35d9523d2381127b68b8937fd67d7..7ddc77f93beffab298ca8ac183a1b1570c9cff3e 100644
--- a/src/core/SkWriteBuffer.cpp
+++ b/src/core/SkWriteBuffer.cpp
@@ -17,19 +17,19 @@
SkWriteBuffer::SkWriteBuffer(uint32_t flags)
: fFlags(flags)
- , fFactorySet(NULL)
- , fNamedFactorySet(NULL)
- , fBitmapHeap(NULL)
- , fTFSet(NULL) {
+ , fFactorySet(nullptr)
+ , fNamedFactorySet(nullptr)
+ , fBitmapHeap(nullptr)
+ , fTFSet(nullptr) {
}
SkWriteBuffer::SkWriteBuffer(void* storage, size_t storageSize, uint32_t flags)
: fFlags(flags)
- , fFactorySet(NULL)
- , fNamedFactorySet(NULL)
+ , fFactorySet(nullptr)
+ , fNamedFactorySet(nullptr)
, fWriter(storage, storageSize)
- , fBitmapHeap(NULL)
- , fTFSet(NULL) {
+ , fBitmapHeap(nullptr)
+ , fTFSet(nullptr) {
}
SkWriteBuffer::~SkWriteBuffer() {
@@ -165,12 +165,12 @@ void SkWriteBuffer::writeBitmap(const SkBitmap& bitmap) {
// the size of the encoded data. A non-zero size signifies that encoded data was written.
// 3. Call SkBitmap::flatten. After writing a boolean value of false, signifying that a heap was
// not used, write a zero to signify that the data was not encoded.
- bool useBitmapHeap = fBitmapHeap != NULL;
+ bool useBitmapHeap = fBitmapHeap != nullptr;
// Write a bool: true if the SkBitmapHeap is to be used, in which case the reader must use an
// SkBitmapHeapReader to read the SkBitmap. False if the bitmap was serialized another way.
this->writeBool(useBitmapHeap);
if (useBitmapHeap) {
- SkASSERT(NULL == fPixelSerializer);
+ SkASSERT(nullptr == fPixelSerializer);
int32_t slot = fBitmapHeap->insert(bitmap);
fWriter.write32(slot);
// crbug.com/155875
@@ -187,7 +187,7 @@ void SkWriteBuffer::writeBitmap(const SkBitmap& bitmap) {
if (pixelRef) {
// see if the pixelref already has an encoded version
SkAutoDataUnref existingData(pixelRef->refEncodedData());
- if (existingData.get() != NULL) {
+ if (existingData.get() != nullptr) {
// Assumes that if the client did not set a serializer, they are
// happy to get the encoded data.
if (!fPixelSerializer || fPixelSerializer->useEncodedData(existingData->data(),
@@ -201,11 +201,11 @@ void SkWriteBuffer::writeBitmap(const SkBitmap& bitmap) {
SkAutoPixmapUnlock result;
if (fPixelSerializer && bitmap.requestLock(&result)) {
const SkPixmap& pmap = result.pixmap();
- SkASSERT(NULL == fBitmapHeap);
+ SkASSERT(nullptr == fBitmapHeap);
SkAutoDataUnref data(fPixelSerializer->encodePixels(pmap.info(),
pmap.addr(),
pmap.rowBytes()));
- if (data.get() != NULL) {
+ if (data.get() != nullptr) {
// if we have to "encode" the bitmap, then we assume there is no
// offset to share, since we are effectively creating a new pixelref
write_encoded_bitmap(this, data, SkIPoint::Make(0, 0));
@@ -247,7 +247,7 @@ void SkWriteBuffer::writeImage(const SkImage* image) {
}
void SkWriteBuffer::writeTypeface(SkTypeface* obj) {
- if (NULL == obj || NULL == fTFSet) {
+ if (nullptr == obj || nullptr == fTFSet) {
fWriter.write32(0);
} else {
fWriter.write32(fTFSet->add(obj));
@@ -256,18 +256,18 @@ void SkWriteBuffer::writeTypeface(SkTypeface* obj) {
SkFactorySet* SkWriteBuffer::setFactoryRecorder(SkFactorySet* rec) {
SkRefCnt_SafeAssign(fFactorySet, rec);
- if (fNamedFactorySet != NULL) {
+ if (fNamedFactorySet != nullptr) {
fNamedFactorySet->unref();
- fNamedFactorySet = NULL;
+ fNamedFactorySet = nullptr;
}
return rec;
}
SkNamedFactorySet* SkWriteBuffer::setNamedFactoryRecorder(SkNamedFactorySet* rec) {
SkRefCnt_SafeAssign(fNamedFactorySet, rec);
- if (fFactorySet != NULL) {
+ if (fFactorySet != nullptr) {
fFactorySet->unref();
- fFactorySet = NULL;
+ fFactorySet = nullptr;
}
return rec;
}
@@ -279,9 +279,9 @@ SkRefCntSet* SkWriteBuffer::setTypefaceRecorder(SkRefCntSet* rec) {
void SkWriteBuffer::setBitmapHeap(SkBitmapHeap* bitmapHeap) {
SkRefCnt_SafeAssign(fBitmapHeap, bitmapHeap);
- if (bitmapHeap != NULL) {
- SkASSERT(NULL == fPixelSerializer);
- fPixelSerializer.reset(NULL);
+ if (bitmapHeap != nullptr) {
+ SkASSERT(nullptr == fPixelSerializer);
+ fPixelSerializer.reset(nullptr);
}
}
@@ -289,9 +289,9 @@ void SkWriteBuffer::setPixelSerializer(SkPixelSerializer* serializer) {
fPixelSerializer.reset(serializer);
if (serializer) {
serializer->ref();
- SkASSERT(NULL == fBitmapHeap);
+ SkASSERT(nullptr == fBitmapHeap);
SkSafeUnref(fBitmapHeap);
- fBitmapHeap = NULL;
+ fBitmapHeap = nullptr;
}
}
@@ -306,19 +306,19 @@ void SkWriteBuffer::writeFlattenable(const SkFlattenable* flattenable) {
* The distinction is important, since 0-index is 32bits (always), but a
* 0-functionptr might be 32 or 64 bits.
*/
- if (NULL == flattenable) {
+ if (nullptr == flattenable) {
if (this->isValidating()) {
this->writeString("");
- } else if (fFactorySet != NULL || fNamedFactorySet != NULL) {
+ } else if (fFactorySet != nullptr || fNamedFactorySet != nullptr) {
this->write32(0);
} else {
- this->writeFunctionPtr(NULL);
+ this->writeFunctionPtr(nullptr);
}
return;
}
SkFlattenable::Factory factory = flattenable->getFactory();
- SkASSERT(factory != NULL);
+ SkASSERT(factory != nullptr);
/*
* We can write 1 of 3 versions of the flattenable:
« no previous file with comments | « src/core/SkVertState.cpp ('k') | src/core/SkWriter32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698