Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 3cefec2..05b6d45 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -35,10 +35,10 @@
 const void* SkImage::peekPixels(SkImageInfo* info, size_t* rowBytes) const {
     SkImageInfo infoStorage;
     size_t rowBytesStorage;
-    if (NULL == info) {
+    if (nullptr == info) {
         info = &infoStorage;
     }
-    if (NULL == rowBytes) {
+    if (nullptr == rowBytes) {
         rowBytes = &rowBytesStorage;
     }
     return as_IB(this)->onPeekPixels(info, rowBytes);
@@ -64,7 +64,7 @@
     if (as_IB(this)->getROPixels(&bm)) {
         return SkImageEncoder::EncodeData(bm, type, quality);
     }
-    return NULL;
+    return nullptr;
 }
 
 SkData* SkImage::refEncoded() const {
@@ -72,15 +72,15 @@
 }
 
 SkImage* SkImage::NewFromEncoded(SkData* encoded, const SkIRect* subset) {
-    if (NULL == encoded || 0 == encoded->size()) {
-        return NULL;
+    if (nullptr == encoded || 0 == encoded->size()) {
+        return nullptr;
     }
     SkImageGenerator* generator = SkImageGenerator::NewFromEncoded(encoded);
-    return generator ? SkImage::NewFromGenerator(generator, subset) : NULL;
+    return generator ? SkImage::NewFromGenerator(generator, subset) : nullptr;
 }
 
 SkSurface* SkImage::newSurface(const SkImageInfo& info, const SkSurfaceProps* props) const {
-    if (NULL == props) {
+    if (nullptr == props) {
         props = &as_IB(this)->props();
     }
     return as_IB(this)->onNewSurface(info, *props);
@@ -95,21 +95,21 @@
 SkImage* SkImage::newImage(int newWidth, int newHeight, const SkIRect* subset,
                            SkFilterQuality quality) const {
     if (newWidth <= 0 || newHeight <= 0) {
-        return NULL;
+        return nullptr;
     }
 
     const SkIRect bounds = SkIRect::MakeWH(this->width(), this->height());
 
     if (subset) {
         if (!bounds.contains(*subset)) {
-            return NULL;
+            return nullptr;
         }
         if (bounds == *subset) {
-            subset = NULL;  // and fall through to check below
+            subset = nullptr;  // and fall through to check below
         }
     }
 
-    if (NULL == subset && this->width() == newWidth && this->height() == newHeight) {
+    if (nullptr == subset && this->width() == newWidth && this->height() == newHeight) {
         return SkRef(const_cast<SkImage*>(this));
     }
 
@@ -140,7 +140,7 @@
 
 #else
 
-GrTexture* SkImage::getTexture() const { return NULL; }
+GrTexture* SkImage::getTexture() const { return nullptr; }
 
 bool SkImage::isTextureBacked() const { return false; }
 
@@ -186,9 +186,9 @@
     const bool opaque = this->isOpaque();
     const SkImageInfo info = SkImageInfo::Make(newWidth, newHeight, kN32_SkColorType,
                                                opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
-    SkAutoTUnref<SkSurface> surface(this->newSurface(info, NULL));
+    SkAutoTUnref<SkSurface> surface(this->newSurface(info, nullptr));
     if (!surface.get()) {
-        return NULL;
+        return nullptr;
     }
 
     SkRect src;
@@ -231,8 +231,8 @@
 
 SkImage* SkImage::NewFromBitmap(const SkBitmap& bm) {
     SkPixelRef* pr = bm.pixelRef();
-    if (NULL == pr) {
-        return NULL;
+    if (nullptr == pr) {
+        return nullptr;
     }
 
 #if SK_SUPPORT_GPU
@@ -241,8 +241,8 @@
         if (!bm.isImmutable()) {
             const bool notBudgeted = false;
             tex = GrDeepCopyTexture(tex, notBudgeted);
-            if (NULL == tex) {
-                return NULL;
+            if (nullptr == tex) {
+                return nullptr;
             }
             unrefCopy.reset(tex);
         }
@@ -297,15 +297,15 @@
 
 SkImage* SkImage::NewFromTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType,
                                  TextureReleaseProc, ReleaseContext) {
-    return NULL;
+    return nullptr;
 }
 
 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType) {
-    return NULL;
+    return nullptr;
 }
 
 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, SkAlphaType) {
-    return NULL;
+    return nullptr;
 }
 
 #endif
diff --git a/src/image/SkImagePriv.h b/src/image/SkImagePriv.h
index bc4a7b0..4b92e94 100644
--- a/src/image/SkImagePriv.h
+++ b/src/image/SkImagePriv.h
@@ -33,7 +33,7 @@
  *
  *  If the bitmap's colortype cannot be converted into a corresponding
  *  SkImageInfo, or the bitmap's pixels cannot be accessed, this will return
- *  NULL.
+ *  nullptr.
  */
 enum ForceCopyMode {
     kNo_ForceCopyMode,
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h
index 46cd3de..2e3fb9a 100644
--- a/src/image/SkImage_Base.h
+++ b/src/image/SkImage_Base.h
@@ -45,14 +45,14 @@
     virtual SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) const = 0;
 
     virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const {
-        return NULL;
+        return nullptr;
     }
 
     // Default impl calls onDraw
     virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
                               int srcX, int srcY) const;
     
-    virtual GrTexture* getTexture() const { return NULL; }
+    virtual GrTexture* getTexture() const { return nullptr; }
 
     // return a read-only copy of the pixels. We promise to not modify them,
     // but only inspect them (or encode them).
@@ -60,12 +60,12 @@
 
     virtual SkShader* onNewShader(SkShader::TileMode,
                                   SkShader::TileMode,
-                                  const SkMatrix* localMatrix) const { return NULL; }
+                                  const SkMatrix* localMatrix) const { return nullptr; }
 
-    // newWidth > 0, newHeight > 0, subset either NULL or a proper subset of this bounds
+    // newWidth > 0, newHeight > 0, subset either nullptr or a proper subset of this bounds
     virtual SkImage* onNewImage(int newWidth, int newHeight, const SkIRect* subset,
                                 SkFilterQuality) const;
-    virtual SkData* onRefEncoded() const { return NULL; }
+    virtual SkData* onRefEncoded() const { return nullptr; }
 
     virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const;
 
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index d758795..6655e39 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -16,7 +16,7 @@
 
 SkImage_Gpu::SkImage_Gpu(int w, int h, uint32_t uniqueID, SkAlphaType at, GrTexture* tex,
                          int sampleCountForNewSurfaces, SkSurface::Budgeted budgeted)
-    : INHERITED(w, h, uniqueID, NULL)
+    : INHERITED(w, h, uniqueID, nullptr)
     , fTexture(SkRef(tex))
     , fSampleCountForNewSurfaces(sampleCountForNewSurfaces)
     , fAlphaType(at)
@@ -36,7 +36,7 @@
     GrContext* ctx = tex->getContext();
     if (!ctx) {
         // the texture may have been abandoned, so we have to check
-        return NULL;
+        return nullptr;
     }
     // TODO: Change signature of onNewSurface to take a budgeted param.
     const SkSurface::Budgeted budgeted = SkSurface::kNo_Budgeted;
@@ -138,11 +138,11 @@
                                            SkImage::TextureReleaseProc releaseProc,
                                            SkImage::ReleaseContext releaseCtx) {
     if (desc.fWidth <= 0 || desc.fHeight <= 0) {
-        return NULL;
+        return nullptr;
     }
     SkAutoTUnref<GrTexture> tex(ctx->textureProvider()->wrapBackendTexture(desc, ownership));
     if (!tex) {
-        return NULL;
+        return nullptr;
     }
     if (releaseProc) {
         tex->setRelease(releaseProc, releaseCtx);
@@ -159,25 +159,25 @@
 
 SkImage* SkImage::NewFromAdoptedTexture(GrContext* ctx, const GrBackendTextureDesc& desc,
                                         SkAlphaType at) {
-    return new_wrapped_texture_common(ctx, desc, at, kAdopt_GrWrapOwnership, NULL, NULL);
+    return new_wrapped_texture_common(ctx, desc, at, kAdopt_GrWrapOwnership, nullptr, nullptr);
 }
 
 SkImage* SkImage::NewFromTextureCopy(GrContext* ctx, const GrBackendTextureDesc& desc,
                                      SkAlphaType at) {
     if (desc.fWidth <= 0 || desc.fHeight <= 0) {
-        return NULL;
+        return nullptr;
     }
 
     SkAutoTUnref<GrTexture> src(ctx->textureProvider()->wrapBackendTexture(
         desc, kBorrow_GrWrapOwnership));
     if (!src) {
-        return NULL;
+        return nullptr;
     }
 
     const bool isBudgeted = true;
     SkAutoTUnref<GrTexture> dst(GrDeepCopyTexture(src, isBudgeted));
     if (!dst) {
-        return NULL;
+        return nullptr;
     }
 
     const SkSurface::Budgeted budgeted = SkSurface::kYes_Budgeted;
@@ -195,7 +195,7 @@
     if (yuvSizes[0].fWidth <= 0 || yuvSizes[0].fHeight <= 0 ||
         yuvSizes[1].fWidth <= 0 || yuvSizes[1].fHeight <= 0 ||
         yuvSizes[2].fWidth <= 0 || yuvSizes[2].fHeight <= 0) {
-        return NULL;
+        return nullptr;
     }
     static const GrPixelConfig kConfig = kAlpha_8_GrPixelConfig;
     GrBackendTextureDesc yDesc;
@@ -229,7 +229,7 @@
     SkAutoTUnref<GrTexture> vTex(ctx->textureProvider()->wrapBackendTexture(
         vDesc, kBorrow_GrWrapOwnership));
     if (!yTex || !uTex || !vTex) {
-        return NULL;
+        return nullptr;
     }
 
     GrSurfaceDesc dstDesc;
@@ -243,7 +243,7 @@
 
     SkAutoTUnref<GrTexture> dst(ctx->textureProvider()->createTexture(dstDesc, true));
     if (!dst) {
-        return NULL;
+        return nullptr;
     }
 
     GrPaint paint;
@@ -267,9 +267,9 @@
     GrContext* ctx = src->getContext();
 
     GrSurfaceDesc desc = src->desc();
-    GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, NULL, 0);
+    GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullptr, 0);
     if (!dst) {
-        return NULL;
+        return nullptr;
     }
     
     const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight);
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index 3486114..015f98a 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -39,7 +39,7 @@
         }
 
         const bool needsCT = kIndex_8_SkColorType == info.colorType();
-        const bool hasCT = NULL != ctable;
+        const bool hasCT = nullptr != ctable;
         if (needsCT != hasCT) {
             return false;
         }
@@ -98,7 +98,7 @@
     }
 
 private:
-    SkImage_Raster() : INHERITED(0, 0, kNeedNewImageUniqueID, NULL) {
+    SkImage_Raster() : INHERITED(0, 0, kNeedNewImageUniqueID, nullptr) {
         fBitmap.setImmutable();
     }
 
@@ -156,7 +156,7 @@
 const void* SkImage_Raster::onPeekPixels(SkImageInfo* infoPtr, size_t* rowBytesPtr) const {
     const SkImageInfo info = fBitmap.info();
     if ((kUnknown_SkColorType == info.colorType()) || !fBitmap.getPixels()) {
-        return NULL;
+        return nullptr;
     }
     *infoPtr = info;
     *rowBytesPtr = fBitmap.rowBytes();
@@ -172,7 +172,7 @@
     if (prInfo.width() == bmInfo.width() && prInfo.height() == bmInfo.height()) {
         return pr->refEncodedData();
     }
-    return NULL;
+    return nullptr;
 }
 
 bool SkImage_Raster::getROPixels(SkBitmap* dst) const {
@@ -186,72 +186,72 @@
                                 SkColorTable* ctable) {
     size_t size;
     if (!SkImage_Raster::ValidArgs(info, rowBytes, ctable, &size) || !pixels) {
-        return NULL;
+        return nullptr;
     }
 
     // Here we actually make a copy of the caller's pixel data
     SkAutoDataUnref data(SkData::NewWithCopy(pixels, size));
-    return new SkImage_Raster(info, data, rowBytes, ctable, NULL);
+    return new SkImage_Raster(info, data, rowBytes, ctable, nullptr);
 }
 
 
 SkImage* SkImage::NewRasterData(const SkImageInfo& info, SkData* data, size_t rowBytes) {
     size_t size;
-    if (!SkImage_Raster::ValidArgs(info, rowBytes, NULL, &size) || !data) {
-        return NULL;
+    if (!SkImage_Raster::ValidArgs(info, rowBytes, nullptr, &size) || !data) {
+        return nullptr;
     }
 
     // did they give us enough data?
     if (data->size() < size) {
-        return NULL;
+        return nullptr;
     }
 
-    SkColorTable* ctable = NULL;
-    return new SkImage_Raster(info, data, rowBytes, ctable, NULL);
+    SkColorTable* ctable = nullptr;
+    return new SkImage_Raster(info, data, rowBytes, ctable, nullptr);
 }
 
 SkImage* SkImage::NewFromRaster(const SkImageInfo& info, const void* pixels, size_t rowBytes,
                                 RasterReleaseProc proc, ReleaseContext ctx) {
     size_t size;
-    if (!SkImage_Raster::ValidArgs(info, rowBytes, NULL, &size) || !pixels) {
-        return NULL;
+    if (!SkImage_Raster::ValidArgs(info, rowBytes, nullptr, &size) || !pixels) {
+        return nullptr;
     }
 
-    SkColorTable* ctable = NULL;
+    SkColorTable* ctable = nullptr;
     SkAutoDataUnref data(SkData::NewWithProc(pixels, size, proc, ctx));
-    return new SkImage_Raster(info, data, rowBytes, ctable, NULL);
+    return new SkImage_Raster(info, data, rowBytes, ctable, nullptr);
 }
 
 SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* subset) {
     SkBitmap bitmap;
-    if (!SkInstallDiscardablePixelRef(generator, subset, &bitmap, NULL)) {
-        return NULL;
+    if (!SkInstallDiscardablePixelRef(generator, subset, &bitmap, nullptr)) {
+        return nullptr;
     }
     if (0 == bitmap.width() || 0 == bitmap.height()) {
-        return NULL;
+        return nullptr;
     }
 
-    return new SkImage_Raster(bitmap, NULL);
+    return new SkImage_Raster(bitmap, nullptr);
 }
 
 SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr,
                                 const SkIPoint& pixelRefOrigin, size_t rowBytes,
                                 const SkSurfaceProps* props) {
-    if (!SkImage_Raster::ValidArgs(info, rowBytes, NULL, NULL)) {
-        return NULL;
+    if (!SkImage_Raster::ValidArgs(info, rowBytes, nullptr, nullptr)) {
+        return nullptr;
     }
     return new SkImage_Raster(info, pr, pixelRefOrigin, rowBytes, props);
 }
 
 SkImage* SkNewImageFromRasterBitmap(const SkBitmap& bm, const SkSurfaceProps* props,
                                     ForceCopyMode forceCopy) {
-    SkASSERT(NULL == bm.getTexture());
+    SkASSERT(nullptr == bm.getTexture());
 
-    if (!SkImage_Raster::ValidArgs(bm.info(), bm.rowBytes(), NULL, NULL)) {
-        return NULL;
+    if (!SkImage_Raster::ValidArgs(bm.info(), bm.rowBytes(), nullptr, nullptr)) {
+        return nullptr;
     }
 
-    SkImage* image = NULL;
+    SkImage* image = nullptr;
     if (kYes_ForceCopyMode == forceCopy || !bm.isImmutable()) {
         SkBitmap tmp(bm);
         tmp.lockPixels();
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index 8c356a8..0315f6c 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -57,21 +57,21 @@
 SkSurface_Base::SkSurface_Base(int width, int height, const SkSurfaceProps* props)
     : INHERITED(width, height, props)
 {
-    fCachedCanvas = NULL;
-    fCachedImage = NULL;
+    fCachedCanvas = nullptr;
+    fCachedImage = nullptr;
 }
 
 SkSurface_Base::SkSurface_Base(const SkImageInfo& info, const SkSurfaceProps* props)
     : INHERITED(info, props)
 {
-    fCachedCanvas = NULL;
-    fCachedImage = NULL;
+    fCachedCanvas = nullptr;
+    fCachedImage = nullptr;
 }
 
 SkSurface_Base::~SkSurface_Base() {
     // in case the canvas outsurvives us, we null the callback
     if (fCachedCanvas) {
-        fCachedCanvas->setSurfaceBase(NULL);
+        fCachedCanvas->setSurfaceBase(nullptr);
     }
 
     SkSafeUnref(fCachedImage);
@@ -107,7 +107,7 @@
         // regardless of copy-on-write, we must drop our cached image now, so
         // that the next request will get our new contents.
         fCachedImage->unref();
-        fCachedImage = NULL;
+        fCachedImage = nullptr;
 
         if (unique) {
             // Our content isn't held by any image now, so we can consider that content mutable.
@@ -200,22 +200,22 @@
 #if !SK_SUPPORT_GPU
 
 SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget*, const SkSurfaceProps*) {
-    return NULL;
+    return nullptr;
 }
 
 SkSurface* SkSurface::NewRenderTarget(GrContext*, Budgeted, const SkImageInfo&, int,
                                       const SkSurfaceProps*) {
-    return NULL;
+    return nullptr;
 }
 
 SkSurface* SkSurface::NewFromBackendTexture(GrContext*, const GrBackendTextureDesc&,
                                              const SkSurfaceProps*) {
-    return NULL;
+    return nullptr;
 }
 
 SkSurface* SkSurface::NewFromBackendRenderTarget(GrContext*, const GrBackendRenderTargetDesc&,
                                                  const SkSurfaceProps*) {
-    return NULL;
+    return nullptr;
 }
 
 #endif
diff --git a/src/image/SkSurface_Base.h b/src/image/SkSurface_Base.h
index 8f0eef3..7658409 100644
--- a/src/image/SkSurface_Base.h
+++ b/src/image/SkSurface_Base.h
@@ -77,7 +77,7 @@
     inline SkCanvas* getCachedCanvas();
     inline SkImage* getCachedImage(Budgeted);
 
-    bool hasCachedImage() const { return fCachedImage != NULL; }
+    bool hasCachedImage() const { return fCachedImage != nullptr; }
 
     // called by SkSurface to compute a new genID
     uint32_t newGenerationID();
@@ -99,7 +99,7 @@
 };
 
 SkCanvas* SkSurface_Base::getCachedCanvas() {
-    if (NULL == fCachedCanvas) {
+    if (nullptr == fCachedCanvas) {
         fCachedCanvas = this->onNewCanvas();
         if (fCachedCanvas) {
             fCachedCanvas->setSurfaceBase(this);
@@ -109,7 +109,7 @@
 }
 
 SkImage* SkSurface_Base::getCachedImage(Budgeted budgeted) {
-    if (NULL == fCachedImage) {
+    if (nullptr == fCachedImage) {
         fCachedImage = this->onNewImageSnapshot(budgeted);
         SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this);
     }
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 34671f7..c0c6b6e 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -81,7 +81,7 @@
 SkImage* SkSurface_Gpu::onNewImageSnapshot(Budgeted budgeted) {
     const SkImageInfo info = fDevice->imageInfo();
     const int sampleCount = fDevice->accessRenderTarget()->numColorSamples();
-    SkImage* image = NULL;
+    SkImage* image = nullptr;
     GrTexture* tex = fDevice->accessRenderTarget()->asTexture();
     if (tex) {
         image = new SkImage_Gpu(info.width(), info.height(), kNeedNewImageUniqueID,
@@ -120,7 +120,7 @@
     SkAutoTUnref<SkGpuDevice> device(
         SkGpuDevice::Create(target, props, SkGpuDevice::kUninit_InitContents));
     if (!device) {
-        return NULL;
+        return nullptr;
     }
     return new SkSurface_Gpu(device);
 }
@@ -130,28 +130,28 @@
     SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(ctx, budgeted, info, sampleCount, props,
                                                          SkGpuDevice::kClear_InitContents));
     if (!device) {
-        return NULL;
+        return nullptr;
     }
     return new SkSurface_Gpu(device);
 }
 
 SkSurface* SkSurface::NewFromBackendTexture(GrContext* context, const GrBackendTextureDesc& desc,
                                             const SkSurfaceProps* props) {
-    if (NULL == context) {
-        return NULL;
+    if (nullptr == context) {
+        return nullptr;
     }
     if (!SkToBool(desc.fFlags & kRenderTarget_GrBackendTextureFlag)) {
-        return NULL;
+        return nullptr;
     }
     SkAutoTUnref<GrSurface> surface(context->textureProvider()->wrapBackendTexture(desc,
                                     kBorrow_GrWrapOwnership));
     if (!surface) {
-        return NULL;
+        return nullptr;
     }
     SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(surface->asRenderTarget(), props,
                                                          SkGpuDevice::kUninit_InitContents));
     if (!device) {
-        return NULL;
+        return nullptr;
     }
     return new SkSurface_Gpu(device);
 }
@@ -159,17 +159,17 @@
 SkSurface* SkSurface::NewFromBackendRenderTarget(GrContext* context,
                                                  const GrBackendRenderTargetDesc& desc,
                                                  const SkSurfaceProps* props) {
-    if (NULL == context) {
-        return NULL;
+    if (nullptr == context) {
+        return nullptr;
     }
     SkAutoTUnref<GrRenderTarget> rt(context->textureProvider()->wrapBackendRenderTarget(desc));
     if (!rt) {
-        return NULL;
+        return nullptr;
     }
     SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props,
                                                          SkGpuDevice::kUninit_InitContents));
     if (!device) {
-        return NULL;
+        return nullptr;
     }
     return new SkSurface_Gpu(device);
 }
diff --git a/src/image/SkSurface_Raster.cpp b/src/image/SkSurface_Raster.cpp
index 3c88f7a..7ee09c1 100644
--- a/src/image/SkSurface_Raster.cpp
+++ b/src/image/SkSurface_Raster.cpp
@@ -87,7 +87,7 @@
                                    const SkSurfaceProps* props)
     : INHERITED(info, props)
 {
-    fBitmap.installPixels(info, pixels, rb, NULL, releaseProc, context);
+    fBitmap.installPixels(info, pixels, rb, nullptr, releaseProc, context);
     fWeOwnThePixels = false;    // We are "Direct"
 }
 
@@ -143,7 +143,7 @@
     if (SkBitmapImageGetPixelRef(this->getCachedImage(kNo_Budgeted)) == fBitmap.pixelRef()) {
         SkASSERT(fWeOwnThePixels);
         if (kDiscard_ContentChangeMode == mode) {
-            fBitmap.setPixelRef(NULL);
+            fBitmap.setPixelRef(nullptr);
             fBitmap.allocPixels();
         } else {
             SkBitmap prev(fBitmap);
@@ -162,14 +162,14 @@
 SkSurface* SkSurface::NewRasterDirectReleaseProc(const SkImageInfo& info, void* pixels, size_t rb,
                                                  void (*releaseProc)(void* pixels, void* context),
                                                  void* context, const SkSurfaceProps* props) {
-    if (NULL == releaseProc) {
-        context = NULL;
+    if (nullptr == releaseProc) {
+        context = nullptr;
     }
     if (!SkSurface_Raster::Valid(info, rb)) {
-        return NULL;
+        return nullptr;
     }
-    if (NULL == pixels) {
-        return NULL;
+    if (nullptr == pixels) {
+        return nullptr;
     }
 
     return new SkSurface_Raster(info, pixels, rb, releaseProc, context, props);
@@ -177,17 +177,17 @@
 
 SkSurface* SkSurface::NewRasterDirect(const SkImageInfo& info, void* pixels, size_t rowBytes,
                                       const SkSurfaceProps* props) {
-    return NewRasterDirectReleaseProc(info, pixels, rowBytes, NULL, NULL, props);
+    return NewRasterDirectReleaseProc(info, pixels, rowBytes, nullptr, nullptr, props);
 }
 
 SkSurface* SkSurface::NewRaster(const SkImageInfo& info, const SkSurfaceProps* props) {
     if (!SkSurface_Raster::Valid(info)) {
-        return NULL;
+        return nullptr;
     }
 
-    SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewAllocate(info, 0, NULL));
-    if (NULL == pr.get()) {
-        return NULL;
+    SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewAllocate(info, 0, nullptr));
+    if (nullptr == pr.get()) {
+        return nullptr;
     }
     return new SkSurface_Raster(pr, props);
 }