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

Unified Diff: src/lazy/SkDiscardablePixelRef.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/lazy/SkDiscardableMemoryPool.cpp ('k') | src/opts/SkBitmapProcState_arm_neon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lazy/SkDiscardablePixelRef.cpp
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
index 01bfd83eee25496fe633a5cbb1ff4095fd22637e..9ac9819e92baacaf0395a2663ca2161ecd96f87d 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -17,10 +17,10 @@ SkDiscardablePixelRef::SkDiscardablePixelRef(const SkImageInfo& info,
, fGenerator(generator)
, fDMFactory(fact)
, fRowBytes(rowBytes)
- , fDiscardableMemory(NULL)
+ , fDiscardableMemory(nullptr)
, fDiscardableMemoryIsLocked(false)
{
- SkASSERT(fGenerator != NULL);
+ SkASSERT(fGenerator != nullptr);
SkASSERT(fRowBytes > 0);
// The SkImageGenerator contract requires fGenerator to always
// decode the same image on each call to getPixels().
@@ -39,7 +39,7 @@ SkDiscardablePixelRef::~SkDiscardablePixelRef() {
}
bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
- if (fDiscardableMemory != NULL) {
+ if (fDiscardableMemory != nullptr) {
if (fDiscardableMemory->lock()) {
fDiscardableMemoryIsLocked = true;
rec->fPixels = fDiscardableMemory->data();
@@ -48,20 +48,20 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
return true;
}
delete fDiscardableMemory;
- fDiscardableMemory = NULL;
+ fDiscardableMemory = nullptr;
fDiscardableMemoryIsLocked = false;
}
const size_t size = this->info().getSafeSize(fRowBytes);
- if (fDMFactory != NULL) {
+ if (fDMFactory != nullptr) {
fDiscardableMemory = fDMFactory->create(size);
fDiscardableMemoryIsLocked = true;
} else {
fDiscardableMemory = SkDiscardableMemory::Create(size);
fDiscardableMemoryIsLocked = true;
}
- if (NULL == fDiscardableMemory) {
+ if (nullptr == fDiscardableMemory) {
fDiscardableMemoryIsLocked = false;
return false; // Memory allocation failed.
}
@@ -75,7 +75,7 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
fDiscardableMemory->unlock();
fDiscardableMemoryIsLocked = false;
delete fDiscardableMemory;
- fDiscardableMemory = NULL;
+ fDiscardableMemory = nullptr;
return false;
}
@@ -87,7 +87,7 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
if (colorCount > 0) {
fCTable.reset(new SkColorTable(colors, colorCount));
} else {
- fCTable.reset(NULL);
+ fCTable.reset(nullptr);
}
rec->fPixels = pixels;
@@ -104,7 +104,7 @@ void SkDiscardablePixelRef::onUnlockPixels() {
bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, const SkIRect* subset, SkBitmap* dst,
SkDiscardableMemory::Factory* factory) {
SkAutoTDelete<SkImageGenerator> autoGenerator(generator);
- if (NULL == autoGenerator.get()) {
+ if (nullptr == autoGenerator.get()) {
return false;
}
@@ -145,10 +145,10 @@ bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, const SkIRect* su
// These are the public API
bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, SkBitmap* dst) {
- return SkInstallDiscardablePixelRef(generator, NULL, dst, NULL);
+ return SkInstallDiscardablePixelRef(generator, nullptr, dst, nullptr);
}
bool SkInstallDiscardablePixelRef(SkData* encoded, SkBitmap* dst) {
SkImageGenerator* generator = SkImageGenerator::NewFromEncoded(encoded);
- return generator ? SkInstallDiscardablePixelRef(generator, NULL, dst, NULL) : false;
+ return generator ? SkInstallDiscardablePixelRef(generator, nullptr, dst, nullptr) : false;
}
« no previous file with comments | « src/lazy/SkDiscardableMemoryPool.cpp ('k') | src/opts/SkBitmapProcState_arm_neon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698