Convert NULL and 0 to nullptr.

This was created by looking at warnings produced by clang's
-Wzero-as-null-pointer-constant. This updates most issues in
Skia code. However, there are places where GL and Vulkan want
pointer values which are explicitly 0, external headers which
use NULL directly, and possibly more uses in un-compiled
sources (for other platforms).

Change-Id: Id22fbac04d5c53497a53d734f0896b4f06fe8345
Reviewed-on: https://skia-review.googlesource.com/39521
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
diff --git a/src/c/sk_effects.cpp b/src/c/sk_effects.cpp
index f3a31a5..d3bb62c 100644
--- a/src/c/sk_effects.cpp
+++ b/src/c/sk_effects.cpp
@@ -54,7 +54,7 @@
                                            const sk_matrix_t* cmatrix) {
     SkShader::TileMode mode;
     if (!from_c_tilemode(cmode, &mode)) {
-        return NULL;
+        return nullptr;
     }
     SkMatrix matrix;
     if (cmatrix) {
@@ -81,7 +81,7 @@
                                            const sk_matrix_t* cmatrix) {
     SkShader::TileMode mode;
     if (!from_c_tilemode(cmode, &mode)) {
-        return NULL;
+        return nullptr;
     }
     SkMatrix matrix;
     if (cmatrix) {
@@ -125,7 +125,7 @@
                                                       const sk_matrix_t* cmatrix) {
     SkShader::TileMode mode;
     if (!from_c_tilemode(cmode, &mode)) {
-        return NULL;
+        return nullptr;
     }
     SkMatrix matrix;
     if (cmatrix) {
@@ -180,7 +180,7 @@
 sk_maskfilter_t* sk_maskfilter_new_blur(sk_blurstyle_t cstyle, float sigma) {
     SkBlurStyle style;
     if (!find_blurstyle(cstyle, &style)) {
-        return NULL;
+        return nullptr;
     }
     return ToMaskFilter(SkBlurMaskFilter::Make(style, sigma).release());
 }
diff --git a/src/core/SkBuffer.cpp b/src/core/SkBuffer.cpp
index 7fd4170..b7cf8b2 100644
--- a/src/core/SkBuffer.cpp
+++ b/src/core/SkBuffer.cpp
@@ -45,7 +45,7 @@
 }
 
 void SkWBuffer::writeNoSizeCheck(const void* buffer, size_t size) {
-    SkASSERT(fData == 0 || fStop == 0 || fPos + size <= fStop);
+    SkASSERT(fData == nullptr || fStop == nullptr || fPos + size <= fStop);
     if (fData && buffer)
         memcpy(fPos, buffer, size);
     fPos += size;
diff --git a/src/core/SkBuffer.h b/src/core/SkBuffer.h
index c9c1a8e..dd7f95a 100644
--- a/src/core/SkBuffer.h
+++ b/src/core/SkBuffer.h
@@ -21,12 +21,12 @@
 */
 class SkRBuffer : SkNoncopyable {
 public:
-    SkRBuffer() : fData(0), fPos(0), fStop(0) {}
+    SkRBuffer() : fData(nullptr), fPos(nullptr), fStop(nullptr) {}
 
     /** Initialize RBuffer with a data point and length.
     */
     SkRBuffer(const void* data, size_t size) {
-        SkASSERT(data != 0 || size == 0);
+        SkASSERT(data != nullptr || size == 0);
         fData = (const char*)data;
         fPos = (const char*)data;
         fStop = (const char*)data + size;
@@ -77,18 +77,18 @@
 */
 class SkWBuffer : SkNoncopyable {
 public:
-    SkWBuffer() : fData(0), fPos(0), fStop(0) {}
+    SkWBuffer() : fData(nullptr), fPos(nullptr), fStop(nullptr) {}
     SkWBuffer(void* data) { reset(data); }
     SkWBuffer(void* data, size_t size) { reset(data, size); }
 
     void reset(void* data) {
         fData = (char*)data;
         fPos = (char*)data;
-        fStop = 0;  // no bounds checking
+        fStop = nullptr;  // no bounds checking
     }
 
     void reset(void* data, size_t size) {
-        SkASSERT(data != 0 || size == 0);
+        SkASSERT(data != nullptr || size == 0);
         fData = (char*)data;
         fPos = (char*)data;
         fStop = (char*)data + size;
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 6edaff9..f1b42e6 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1058,7 +1058,7 @@
     SaveLayerFlags saveLayerFlags = rec.fSaveLayerFlags;
 
     SkLazyPaint lazyP;
-    SkImageFilter* imageFilter = paint ? paint->getImageFilter() : NULL;
+    SkImageFilter* imageFilter = paint ? paint->getImageFilter() : nullptr;
     SkMatrix stashedMatrix = fMCRec->fMatrix;
     SkMatrix remainder;
     SkSize scale;
diff --git a/src/core/SkClipStack.h b/src/core/SkClipStack.h
index 466df6c..84acb3c 100644
--- a/src/core/SkClipStack.h
+++ b/src/core/SkClipStack.h
@@ -298,7 +298,7 @@
      */
     void getBounds(SkRect* canvFiniteBound,
                    BoundsType* boundType,
-                   bool* isIntersectionOfRects = NULL) const;
+                   bool* isIntersectionOfRects = nullptr) const;
 
     SkRect bounds(const SkIRect& deviceBounds) const;
     bool isEmpty(const SkIRect& deviceBounds) const;
@@ -464,7 +464,7 @@
                                int maxWidth,
                                int maxHeight,
                                SkRect* devBounds,
-                               bool* isIntersectionOfRects = NULL) const;
+                               bool* isIntersectionOfRects = nullptr) const;
 
 private:
     friend class Iter;
diff --git a/src/core/SkColorTable.h b/src/core/SkColorTable.h
index ef8712d..c56e6fe 100644
--- a/src/core/SkColorTable.h
+++ b/src/core/SkColorTable.h
@@ -37,7 +37,7 @@
      *  the index is in range (0 <= index < count).
      */
     SkPMColor operator[](int index) const {
-        SkASSERT(fColors != NULL && (unsigned)index < (unsigned)fCount);
+        SkASSERT(fColors != nullptr && (unsigned)index < (unsigned)fCount);
         return fColors[index];
     }
 
diff --git a/src/core/SkDevice.h b/src/core/SkDevice.h
index c531b1e..3bd12ab 100644
--- a/src/core/SkDevice.h
+++ b/src/core/SkDevice.h
@@ -198,7 +198,7 @@
      */
     virtual void drawPath(const SkPath& path,
                           const SkPaint& paint,
-                          const SkMatrix* prePathMatrix = NULL,
+                          const SkMatrix* prePathMatrix = nullptr,
                           bool pathIsMutable = false) = 0;
     virtual void drawBitmap(const SkBitmap& bitmap,
                             SkScalar x,
@@ -340,7 +340,7 @@
      *  it could not call drawDevice with it (but it could call drawSprite or drawBitmap).
      */
     virtual SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) {
-        return NULL;
+        return nullptr;
     }
 
     // A helper function used by derived classes to log the scale factor of a bitmap or image draw.
@@ -377,7 +377,7 @@
      */
     virtual void flush() {}
 
-    virtual SkImageFilterCache* getImageFilterCache() { return NULL; }
+    virtual SkImageFilterCache* getImageFilterCache() { return nullptr; }
 
     friend class SkNoPixelsDevice;
     friend class SkBitmapDevice;
diff --git a/src/core/SkDraw.h b/src/core/SkDraw.h
index f294194..ab1fda7 100644
--- a/src/core/SkDraw.h
+++ b/src/core/SkDraw.h
@@ -39,7 +39,7 @@
     void    drawRect(const SkRect& prePaintRect, const SkPaint&, const SkMatrix* paintMatrix,
                      const SkRect* postPaintRect) const;
     void    drawRect(const SkRect& rect, const SkPaint& paint) const {
-        this->drawRect(rect, paint, NULL, NULL);
+        this->drawRect(rect, paint, nullptr, nullptr);
     }
     void    drawRRect(const SkRRect&, const SkPaint&) const;
     /**
@@ -57,8 +57,8 @@
     }
 
     void drawPath(const SkPath& path, const SkPaint& paint,
-                  SkBlitter* customBlitter = NULL) const {
-        this->drawPath(path, paint, NULL, false, false, customBlitter);
+                  SkBlitter* customBlitter = nullptr) const {
+        this->drawPath(path, paint, nullptr, false, false, customBlitter);
     }
 
     /* If dstOrNull is null, computes a dst by mapping the bitmap's bounds through the matrix. */
@@ -83,10 +83,10 @@
      *  Only device A8 is supported right now.
      */
     void drawPathCoverage(const SkPath& src, const SkPaint& paint,
-                          SkBlitter* customBlitter = NULL) const {
+                          SkBlitter* customBlitter = nullptr) const {
         bool isHairline = paint.getStyle() == SkPaint::kStroke_Style &&
                           paint.getStrokeWidth() > 0;
-        this->drawPath(src, paint, NULL, false, !isHairline, customBlitter);
+        this->drawPath(src, paint, nullptr, false, !isHairline, customBlitter);
     }
 
     /** Helper function that creates a mask from a path and an optional maskfilter.
@@ -131,7 +131,7 @@
 
     void    drawPath(const SkPath&, const SkPaint&, const SkMatrix* preMatrix,
                      bool pathIsMutable, bool drawCoverage,
-                     SkBlitter* customBlitter = NULL) const;
+                     SkBlitter* customBlitter = nullptr) const;
 
     void drawLine(const SkPoint[2], const SkPaint&) const;
     void drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawCoverage,
diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp
index b3766e5..0d4aba7 100644
--- a/src/core/SkMipMap.cpp
+++ b/src/core/SkMipMap.cpp
@@ -791,7 +791,7 @@
 }
 
 bool SkMipMap::getLevel(int index, Level* levelPtr) const {
-    if (NULL == fLevels) {
+    if (nullptr == fLevels) {
         return false;
     }
     if (index < 0) {
diff --git a/src/core/SkOSFile.h b/src/core/SkOSFile.h
index 88ad958..ddbcc2b 100644
--- a/src/core/SkOSFile.h
+++ b/src/core/SkOSFile.h
@@ -80,10 +80,10 @@
     class Iter {
     public:
         Iter();
-        Iter(const char path[], const char suffix[] = NULL);
+        Iter(const char path[], const char suffix[] = nullptr);
         ~Iter();
 
-        void reset(const char path[], const char suffix[] = NULL);
+        void reset(const char path[], const char suffix[] = nullptr);
         /** If getDir is true, only returns directories.
             Results are undefined if true and false calls are
             interleaved on a single iterator.
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 8aecf1b..32ec2c5 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1877,8 +1877,8 @@
 void SkPath::Iter::consumeDegenerateSegments(bool exact) {
     // We need to step over anything that will not move the current draw point
     // forward before the next move is seen
-    const uint8_t* lastMoveVerb = 0;
-    const SkPoint* lastMovePt = 0;
+    const uint8_t* lastMoveVerb = nullptr;
+    const SkPoint* lastMovePt = nullptr;
     const SkScalar* lastMoveWeight = nullptr;
     SkPoint lastPt = fLastPt;
     while (fVerbs != fVerbStop) {
diff --git a/src/core/SkTInternalLList.h b/src/core/SkTInternalLList.h
index 00a8743..ef4b74f 100644
--- a/src/core/SkTInternalLList.h
+++ b/src/core/SkTInternalLList.h
@@ -15,7 +15,7 @@
  */
 template <typename T> class SkPtrWrapper {
   public:
-      SkPtrWrapper() : fPtr(NULL) {}
+      SkPtrWrapper() : fPtr(nullptr) {}
       SkPtrWrapper& operator =(T* ptr) { fPtr = ptr; return *this; }
       operator T*() const { return fPtr; }
       T* operator->() { return fPtr; }
@@ -41,8 +41,8 @@
 template <class T> class SkTInternalLList : SkNoncopyable {
 public:
     SkTInternalLList()
-        : fHead(NULL)
-        , fTail(NULL) {
+        : fHead(nullptr)
+        , fTail(nullptr) {
     }
 
     void remove(T* entry) {
@@ -63,25 +63,25 @@
             fTail = prev;
         }
 
-        entry->fPrev = NULL;
-        entry->fNext = NULL;
+        entry->fPrev = nullptr;
+        entry->fNext = nullptr;
 
 #ifdef SK_DEBUG
-        entry->fList = NULL;
+        entry->fList = nullptr;
 #endif
     }
 
     void addToHead(T* entry) {
-        SkASSERT(NULL == entry->fPrev && NULL == entry->fNext);
-        SkASSERT(NULL == entry->fList);
+        SkASSERT(nullptr == entry->fPrev && nullptr == entry->fNext);
+        SkASSERT(nullptr == entry->fList);
 
-        entry->fPrev = NULL;
+        entry->fPrev = nullptr;
         entry->fNext = fHead;
         if (fHead) {
             fHead->fPrev = entry;
         }
         fHead = entry;
-        if (NULL == fTail) {
+        if (nullptr == fTail) {
             fTail = entry;
         }
 
@@ -91,16 +91,16 @@
     }
 
     void addToTail(T* entry) {
-        SkASSERT(NULL == entry->fPrev && NULL == entry->fNext);
-        SkASSERT(NULL == entry->fList);
+        SkASSERT(nullptr == entry->fPrev && nullptr == entry->fNext);
+        SkASSERT(nullptr == entry->fList);
 
         entry->fPrev = fTail;
-        entry->fNext = NULL;
+        entry->fNext = nullptr;
         if (fTail) {
             fTail->fNext = entry;
         }
         fTail = entry;
-        if (NULL == fHead) {
+        if (nullptr == fHead) {
             fHead = entry;
         }
 
@@ -117,7 +117,7 @@
     void addBefore(T* newEntry, T* existingEntry) {
         SkASSERT(newEntry);
 
-        if (NULL == existingEntry) {
+        if (nullptr == existingEntry) {
             this->addToTail(newEntry);
             return;
         }
@@ -127,7 +127,7 @@
         T* prev = existingEntry->fPrev;
         existingEntry->fPrev = newEntry;
         newEntry->fPrev = prev;
-        if (NULL == prev) {
+        if (nullptr == prev) {
             SkASSERT(fHead == existingEntry);
             fHead = newEntry;
         } else {
@@ -146,7 +146,7 @@
     void addAfter(T* newEntry, T* existingEntry) {
         SkASSERT(newEntry);
 
-        if (NULL == existingEntry) {
+        if (nullptr == existingEntry) {
             this->addToHead(newEntry);
             return;
         }
@@ -156,7 +156,7 @@
         T* next = existingEntry->fNext;
         existingEntry->fNext = newEntry;
         newEntry->fNext = next;
-        if (NULL == next) {
+        if (nullptr == next) {
             SkASSERT(fTail == existingEntry);
             fTail = newEntry;
         } else {
@@ -207,7 +207,7 @@
             kTail_IterStart
         };
 
-        Iter() : fCurr(NULL) {}
+        Iter() : fCurr(nullptr) {}
         Iter(const Iter& iter) : fCurr(iter.fCurr) {}
         Iter& operator= (const Iter& iter) { fCurr = iter.fCurr; return *this; }
 
@@ -228,8 +228,8 @@
          * Return the next/previous element in the list or NULL if at the end.
          */
         T* next() {
-            if (NULL == fCurr) {
-                return NULL;
+            if (nullptr == fCurr) {
+                return nullptr;
             }
 
             fCurr = fCurr->fNext;
@@ -237,8 +237,8 @@
         }
 
         T* prev() {
-            if (NULL == fCurr) {
-                return NULL;
+            if (nullptr == fCurr) {
+                return nullptr;
             }
 
             fCurr = fCurr->fPrev;
@@ -255,12 +255,12 @@
         Iter iter;
         for (T* item = iter.init(*this, Iter::kHead_IterStart); item; item = iter.next()) {
             SkASSERT(this->isInList(item));
-            if (NULL == item->fPrev) {
+            if (nullptr == item->fPrev) {
                 SkASSERT(fHead == item);
             } else {
                 SkASSERT(item->fPrev->fNext == item);
             }
-            if (NULL == item->fNext) {
+            if (nullptr == item->fNext) {
                 SkASSERT(fTail == item);
             } else {
                 SkASSERT(item->fNext->fPrev == item);
diff --git a/src/core/SkTextBlob.cpp b/src/core/SkTextBlob.cpp
index 77ec429..c72399b 100644
--- a/src/core/SkTextBlob.cpp
+++ b/src/core/SkTextBlob.cpp
@@ -423,7 +423,7 @@
     SkAutoSTArray<16, SkRect> glyphBounds(run.glyphCount());
     paint.getTextWidths(run.glyphBuffer(),
                         run.glyphCount() * sizeof(uint16_t),
-                        NULL,
+                        nullptr,
                         glyphBounds.get());
 
     SkASSERT(SkTextBlob::kFull_Positioning == run.positioning() ||
diff --git a/src/core/SkUtils.h b/src/core/SkUtils.h
index 832bdbd..d894467 100644
--- a/src/core/SkUtils.h
+++ b/src/core/SkUtils.h
@@ -75,7 +75,7 @@
     into a utf8 sequence. Will be 1..kMaxBytesInUTF8Sequence,
     or 0 if uni is illegal.
 */
-size_t      SkUTF8_FromUnichar(SkUnichar uni, char utf8[] = NULL);
+size_t      SkUTF8_FromUnichar(SkUnichar uni, char utf8[] = nullptr);
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -88,10 +88,10 @@
 SkUnichar SkUTF16_NextUnichar(const uint16_t**);
 // this guy backs up to the previus unichar value, and returns it (*--p)
 SkUnichar SkUTF16_PrevUnichar(const uint16_t**);
-size_t SkUTF16_FromUnichar(SkUnichar uni, uint16_t utf16[] = NULL);
+size_t SkUTF16_FromUnichar(SkUnichar uni, uint16_t utf16[] = nullptr);
 
 size_t SkUTF16_ToUTF8(const uint16_t utf16[], int numberOf16BitValues,
-                      char utf8[] = NULL);
+                      char utf8[] = nullptr);
 
 inline bool SkUnichar_IsVariationSelector(SkUnichar uni) {
 /*  The 'true' ranges are:
diff --git a/src/gpu/GrAutoLocaleSetter.h b/src/gpu/GrAutoLocaleSetter.h
index 9cfa637..c373b78 100644
--- a/src/gpu/GrAutoLocaleSetter.h
+++ b/src/gpu/GrAutoLocaleSetter.h
@@ -54,11 +54,11 @@
             name = nullptr;
         }
 #endif
-        fLocale = newlocale(LC_ALL_MASK, name, 0);
+        fLocale = newlocale(LC_ALL_MASK, name, nullptr);
         if (fLocale) {
             fOldLocale = uselocale(fLocale);
         } else {
-            fOldLocale = static_cast<locale_t>(0);
+            fOldLocale = static_cast<locale_t>(nullptr);
         }
 #else
         (void) name; // suppress unused param warning.
diff --git a/src/gpu/GrDrawingManager.h b/src/gpu/GrDrawingManager.h
index 6a1ad19..0143783 100644
--- a/src/gpu/GrDrawingManager.h
+++ b/src/gpu/GrDrawingManager.h
@@ -60,7 +60,7 @@
     GrPathRenderer* getPathRenderer(const GrPathRenderer::CanDrawPathArgs& args,
                                     bool allowSW,
                                     GrPathRendererChain::DrawType drawType,
-                                    GrPathRenderer::StencilSupport* stencilSupport = NULL);
+                                    GrPathRenderer::StencilSupport* stencilSupport = nullptr);
 
     void flushIfNecessary() {
         if (fContext->getResourceCache()->requestsFlush()) {
diff --git a/src/gpu/GrGpuResourceRef.h b/src/gpu/GrGpuResourceRef.h
index a56674b..866521a 100644
--- a/src/gpu/GrGpuResourceRef.h
+++ b/src/gpu/GrGpuResourceRef.h
@@ -173,7 +173,7 @@
  */
 template <typename T, GrIOType IO_TYPE> class GrPendingIOResource : SkNoncopyable {
 public:
-    GrPendingIOResource(T* resource = NULL) : fResource(NULL) {
+    GrPendingIOResource(T* resource = nullptr) : fResource(nullptr) {
         this->reset(resource);
     }
 
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 1979570..a022808 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -287,7 +287,7 @@
         SkASSERT(texture);
         return texture;
     }
-    return NULL;
+    return nullptr;
 }
 
 void GrResourceProvider::assignUniqueKeyToTexture(const GrUniqueKey& key, GrTexture* texture) {
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 5943120..36c26dc 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -1543,7 +1543,7 @@
                                                       0,
                                                       externalFormat,
                                                       externalType,
-                                                      NULL));
+                                                      nullptr));
         if (GR_GL_NO_ERROR != CHECK_ALLOC_ERROR(this->glInterface())) {
             GL_CALL(DeleteTextures(1, &colorID));
             return -1;
diff --git a/src/gpu/vk/GrVkBuffer.cpp b/src/gpu/vk/GrVkBuffer.cpp
index b2af229..a93a16e 100644
--- a/src/gpu/vk/GrVkBuffer.cpp
+++ b/src/gpu/vk/GrVkBuffer.cpp
@@ -88,7 +88,7 @@
                                   bool byRegion) const {
     VkBufferMemoryBarrier bufferMemoryBarrier = {
         VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, // sType
-        NULL,                                    // pNext
+        nullptr,                                 // pNext
         srcAccessMask,                           // srcAccessMask
         dstAccesMask,                            // dstAccessMask
         VK_QUEUE_FAMILY_IGNORED,                 // srcQueueFamilyIndex
diff --git a/src/gpu/vk/GrVkCommandBuffer.cpp b/src/gpu/vk/GrVkCommandBuffer.cpp
index c44d121..8a17a4f 100644
--- a/src/gpu/vk/GrVkCommandBuffer.cpp
+++ b/src/gpu/vk/GrVkCommandBuffer.cpp
@@ -344,7 +344,7 @@
                                                            VkCommandPool cmdPool) {
     const VkCommandBufferAllocateInfo cmdInfo = {
         VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,   // sType
-        NULL,                                             // pNext
+        nullptr,                                          // pNext
         cmdPool,                                          // commandPool
         VK_COMMAND_BUFFER_LEVEL_PRIMARY,                  // level
         1                                                 // bufferCount
@@ -751,7 +751,7 @@
                                                                VkCommandPool cmdPool) {
     const VkCommandBufferAllocateInfo cmdInfo = {
         VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,   // sType
-        NULL,                                             // pNext
+        nullptr,                                          // pNext
         cmdPool,                                          // commandPool
         VK_COMMAND_BUFFER_LEVEL_SECONDARY,                // level
         1                                                 // bufferCount
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 83d28de..f32a83a 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -1070,7 +1070,7 @@
     VkImageAspectFlags aspectFlags = VK_IMAGE_ASPECT_COLOR_BIT;
     VkImageMemoryBarrier imageMemoryBarrier = {
         VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,          // sType
-        NULL,                                            // pNext
+        nullptr,                                         // pNext
         VK_ACCESS_TRANSFER_WRITE_BIT,                    // srcAccessMask
         VK_ACCESS_TRANSFER_READ_BIT,                     // dstAccessMask
         VK_IMAGE_LAYOUT_GENERAL,                         // oldLayout
@@ -1213,7 +1213,7 @@
 
     const VkImageCreateInfo imageCreateInfo = {
         VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,         // sType
-        NULL,                                        // pNext
+        nullptr,                                     // pNext
         0,                                           // VkImageCreateFlags
         VK_IMAGE_TYPE_2D,                            // VkImageType
         pixelFormat,                                 // VkFormat
@@ -1295,7 +1295,7 @@
 
         const VkCommandBufferAllocateInfo cmdInfo = {
             VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,   // sType
-            NULL,                                             // pNext
+            nullptr,                                          // pNext
             fCmdPool,                                         // commandPool
             VK_COMMAND_BUFFER_LEVEL_PRIMARY,                  // level
             1                                                 // bufferCount
diff --git a/src/gpu/vk/GrVkImage.cpp b/src/gpu/vk/GrVkImage.cpp
index 5a9f69d..c3a47dc 100644
--- a/src/gpu/vk/GrVkImage.cpp
+++ b/src/gpu/vk/GrVkImage.cpp
@@ -90,7 +90,7 @@
 
     const VkImageCreateInfo imageCreateInfo = {
         VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,         // sType
-        NULL,                                        // pNext
+        nullptr,                                     // pNext
         createFlags,                                 // VkImageCreateFlags
         imageDesc.fImageType,                        // VkImageType
         imageDesc.fFormat,                           // VkFormat
diff --git a/src/gpu/vk/GrVkInterface.cpp b/src/gpu/vk/GrVkInterface.cpp
index 4188943..dedc264 100644
--- a/src/gpu/vk/GrVkInterface.cpp
+++ b/src/gpu/vk/GrVkInterface.cpp
@@ -200,148 +200,148 @@
 
 bool GrVkInterface::validate(uint32_t extensionFlags) const {
     // functions that are always required
-    if (NULL == fFunctions.fCreateInstance ||
-        NULL == fFunctions.fDestroyInstance ||
-        NULL == fFunctions.fEnumeratePhysicalDevices ||
-        NULL == fFunctions.fGetPhysicalDeviceFeatures ||
-        NULL == fFunctions.fGetPhysicalDeviceFormatProperties ||
-        NULL == fFunctions.fGetPhysicalDeviceImageFormatProperties ||
-        NULL == fFunctions.fGetPhysicalDeviceProperties ||
-        NULL == fFunctions.fGetPhysicalDeviceQueueFamilyProperties ||
-        NULL == fFunctions.fGetPhysicalDeviceMemoryProperties ||
-        NULL == fFunctions.fCreateDevice ||
-        NULL == fFunctions.fDestroyDevice ||
-        NULL == fFunctions.fEnumerateInstanceExtensionProperties ||
-        NULL == fFunctions.fEnumerateDeviceExtensionProperties ||
-        NULL == fFunctions.fEnumerateInstanceLayerProperties ||
-        NULL == fFunctions.fEnumerateDeviceLayerProperties ||
-        NULL == fFunctions.fGetDeviceQueue ||
-        NULL == fFunctions.fQueueSubmit ||
-        NULL == fFunctions.fQueueWaitIdle ||
-        NULL == fFunctions.fDeviceWaitIdle ||
-        NULL == fFunctions.fAllocateMemory ||
-        NULL == fFunctions.fFreeMemory ||
-        NULL == fFunctions.fMapMemory ||
-        NULL == fFunctions.fUnmapMemory ||
-        NULL == fFunctions.fFlushMappedMemoryRanges ||
-        NULL == fFunctions.fInvalidateMappedMemoryRanges ||
-        NULL == fFunctions.fGetDeviceMemoryCommitment ||
-        NULL == fFunctions.fBindBufferMemory ||
-        NULL == fFunctions.fBindImageMemory ||
-        NULL == fFunctions.fGetBufferMemoryRequirements ||
-        NULL == fFunctions.fGetImageMemoryRequirements ||
-        NULL == fFunctions.fGetImageSparseMemoryRequirements ||
-        NULL == fFunctions.fGetPhysicalDeviceSparseImageFormatProperties ||
-        NULL == fFunctions.fQueueBindSparse ||
-        NULL == fFunctions.fCreateFence ||
-        NULL == fFunctions.fDestroyFence ||
-        NULL == fFunctions.fResetFences ||
-        NULL == fFunctions.fGetFenceStatus ||
-        NULL == fFunctions.fWaitForFences ||
-        NULL == fFunctions.fCreateSemaphore ||
-        NULL == fFunctions.fDestroySemaphore ||
-        NULL == fFunctions.fCreateEvent ||
-        NULL == fFunctions.fDestroyEvent ||
-        NULL == fFunctions.fGetEventStatus ||
-        NULL == fFunctions.fSetEvent ||
-        NULL == fFunctions.fResetEvent ||
-        NULL == fFunctions.fCreateQueryPool ||
-        NULL == fFunctions.fDestroyQueryPool ||
-        NULL == fFunctions.fGetQueryPoolResults ||
-        NULL == fFunctions.fCreateBuffer ||
-        NULL == fFunctions.fDestroyBuffer ||
-        NULL == fFunctions.fCreateBufferView ||
-        NULL == fFunctions.fDestroyBufferView ||
-        NULL == fFunctions.fCreateImage ||
-        NULL == fFunctions.fDestroyImage ||
-        NULL == fFunctions.fGetImageSubresourceLayout ||
-        NULL == fFunctions.fCreateImageView ||
-        NULL == fFunctions.fDestroyImageView ||
-        NULL == fFunctions.fCreateShaderModule ||
-        NULL == fFunctions.fDestroyShaderModule ||
-        NULL == fFunctions.fCreatePipelineCache ||
-        NULL == fFunctions.fDestroyPipelineCache ||
-        NULL == fFunctions.fGetPipelineCacheData ||
-        NULL == fFunctions.fMergePipelineCaches ||
-        NULL == fFunctions.fCreateGraphicsPipelines ||
-        NULL == fFunctions.fCreateComputePipelines ||
-        NULL == fFunctions.fDestroyPipeline ||
-        NULL == fFunctions.fCreatePipelineLayout ||
-        NULL == fFunctions.fDestroyPipelineLayout ||
-        NULL == fFunctions.fCreateSampler ||
-        NULL == fFunctions.fDestroySampler ||
-        NULL == fFunctions.fCreateDescriptorSetLayout ||
-        NULL == fFunctions.fDestroyDescriptorSetLayout ||
-        NULL == fFunctions.fCreateDescriptorPool ||
-        NULL == fFunctions.fDestroyDescriptorPool ||
-        NULL == fFunctions.fResetDescriptorPool ||
-        NULL == fFunctions.fAllocateDescriptorSets ||
-        NULL == fFunctions.fFreeDescriptorSets ||
-        NULL == fFunctions.fUpdateDescriptorSets ||
-        NULL == fFunctions.fCreateFramebuffer ||
-        NULL == fFunctions.fDestroyFramebuffer ||
-        NULL == fFunctions.fCreateRenderPass ||
-        NULL == fFunctions.fDestroyRenderPass ||
-        NULL == fFunctions.fGetRenderAreaGranularity ||
-        NULL == fFunctions.fCreateCommandPool ||
-        NULL == fFunctions.fDestroyCommandPool ||
-        NULL == fFunctions.fResetCommandPool ||
-        NULL == fFunctions.fAllocateCommandBuffers ||
-        NULL == fFunctions.fFreeCommandBuffers ||
-        NULL == fFunctions.fBeginCommandBuffer ||
-        NULL == fFunctions.fEndCommandBuffer ||
-        NULL == fFunctions.fResetCommandBuffer ||
-        NULL == fFunctions.fCmdBindPipeline ||
-        NULL == fFunctions.fCmdSetViewport ||
-        NULL == fFunctions.fCmdSetScissor ||
-        NULL == fFunctions.fCmdSetLineWidth ||
-        NULL == fFunctions.fCmdSetDepthBias ||
-        NULL == fFunctions.fCmdSetBlendConstants ||
-        NULL == fFunctions.fCmdSetDepthBounds ||
-        NULL == fFunctions.fCmdSetStencilCompareMask ||
-        NULL == fFunctions.fCmdSetStencilWriteMask ||
-        NULL == fFunctions.fCmdSetStencilReference ||
-        NULL == fFunctions.fCmdBindDescriptorSets ||
-        NULL == fFunctions.fCmdBindIndexBuffer ||
-        NULL == fFunctions.fCmdBindVertexBuffers ||
-        NULL == fFunctions.fCmdDraw ||
-        NULL == fFunctions.fCmdDrawIndexed ||
-        NULL == fFunctions.fCmdDrawIndirect ||
-        NULL == fFunctions.fCmdDrawIndexedIndirect ||
-        NULL == fFunctions.fCmdDispatch ||
-        NULL == fFunctions.fCmdDispatchIndirect ||
-        NULL == fFunctions.fCmdCopyBuffer ||
-        NULL == fFunctions.fCmdCopyImage ||
-        NULL == fFunctions.fCmdBlitImage ||
-        NULL == fFunctions.fCmdCopyBufferToImage ||
-        NULL == fFunctions.fCmdCopyImageToBuffer ||
-        NULL == fFunctions.fCmdUpdateBuffer ||
-        NULL == fFunctions.fCmdFillBuffer ||
-        NULL == fFunctions.fCmdClearColorImage ||
-        NULL == fFunctions.fCmdClearDepthStencilImage ||
-        NULL == fFunctions.fCmdClearAttachments ||
-        NULL == fFunctions.fCmdResolveImage ||
-        NULL == fFunctions.fCmdSetEvent ||
-        NULL == fFunctions.fCmdResetEvent ||
-        NULL == fFunctions.fCmdWaitEvents ||
-        NULL == fFunctions.fCmdPipelineBarrier ||
-        NULL == fFunctions.fCmdBeginQuery ||
-        NULL == fFunctions.fCmdEndQuery ||
-        NULL == fFunctions.fCmdResetQueryPool ||
-        NULL == fFunctions.fCmdWriteTimestamp ||
-        NULL == fFunctions.fCmdCopyQueryPoolResults ||
-        NULL == fFunctions.fCmdPushConstants ||
-        NULL == fFunctions.fCmdBeginRenderPass ||
-        NULL == fFunctions.fCmdNextSubpass ||
-        NULL == fFunctions.fCmdEndRenderPass ||
-        NULL == fFunctions.fCmdExecuteCommands) {
+    if (nullptr == fFunctions.fCreateInstance ||
+        nullptr == fFunctions.fDestroyInstance ||
+        nullptr == fFunctions.fEnumeratePhysicalDevices ||
+        nullptr == fFunctions.fGetPhysicalDeviceFeatures ||
+        nullptr == fFunctions.fGetPhysicalDeviceFormatProperties ||
+        nullptr == fFunctions.fGetPhysicalDeviceImageFormatProperties ||
+        nullptr == fFunctions.fGetPhysicalDeviceProperties ||
+        nullptr == fFunctions.fGetPhysicalDeviceQueueFamilyProperties ||
+        nullptr == fFunctions.fGetPhysicalDeviceMemoryProperties ||
+        nullptr == fFunctions.fCreateDevice ||
+        nullptr == fFunctions.fDestroyDevice ||
+        nullptr == fFunctions.fEnumerateInstanceExtensionProperties ||
+        nullptr == fFunctions.fEnumerateDeviceExtensionProperties ||
+        nullptr == fFunctions.fEnumerateInstanceLayerProperties ||
+        nullptr == fFunctions.fEnumerateDeviceLayerProperties ||
+        nullptr == fFunctions.fGetDeviceQueue ||
+        nullptr == fFunctions.fQueueSubmit ||
+        nullptr == fFunctions.fQueueWaitIdle ||
+        nullptr == fFunctions.fDeviceWaitIdle ||
+        nullptr == fFunctions.fAllocateMemory ||
+        nullptr == fFunctions.fFreeMemory ||
+        nullptr == fFunctions.fMapMemory ||
+        nullptr == fFunctions.fUnmapMemory ||
+        nullptr == fFunctions.fFlushMappedMemoryRanges ||
+        nullptr == fFunctions.fInvalidateMappedMemoryRanges ||
+        nullptr == fFunctions.fGetDeviceMemoryCommitment ||
+        nullptr == fFunctions.fBindBufferMemory ||
+        nullptr == fFunctions.fBindImageMemory ||
+        nullptr == fFunctions.fGetBufferMemoryRequirements ||
+        nullptr == fFunctions.fGetImageMemoryRequirements ||
+        nullptr == fFunctions.fGetImageSparseMemoryRequirements ||
+        nullptr == fFunctions.fGetPhysicalDeviceSparseImageFormatProperties ||
+        nullptr == fFunctions.fQueueBindSparse ||
+        nullptr == fFunctions.fCreateFence ||
+        nullptr == fFunctions.fDestroyFence ||
+        nullptr == fFunctions.fResetFences ||
+        nullptr == fFunctions.fGetFenceStatus ||
+        nullptr == fFunctions.fWaitForFences ||
+        nullptr == fFunctions.fCreateSemaphore ||
+        nullptr == fFunctions.fDestroySemaphore ||
+        nullptr == fFunctions.fCreateEvent ||
+        nullptr == fFunctions.fDestroyEvent ||
+        nullptr == fFunctions.fGetEventStatus ||
+        nullptr == fFunctions.fSetEvent ||
+        nullptr == fFunctions.fResetEvent ||
+        nullptr == fFunctions.fCreateQueryPool ||
+        nullptr == fFunctions.fDestroyQueryPool ||
+        nullptr == fFunctions.fGetQueryPoolResults ||
+        nullptr == fFunctions.fCreateBuffer ||
+        nullptr == fFunctions.fDestroyBuffer ||
+        nullptr == fFunctions.fCreateBufferView ||
+        nullptr == fFunctions.fDestroyBufferView ||
+        nullptr == fFunctions.fCreateImage ||
+        nullptr == fFunctions.fDestroyImage ||
+        nullptr == fFunctions.fGetImageSubresourceLayout ||
+        nullptr == fFunctions.fCreateImageView ||
+        nullptr == fFunctions.fDestroyImageView ||
+        nullptr == fFunctions.fCreateShaderModule ||
+        nullptr == fFunctions.fDestroyShaderModule ||
+        nullptr == fFunctions.fCreatePipelineCache ||
+        nullptr == fFunctions.fDestroyPipelineCache ||
+        nullptr == fFunctions.fGetPipelineCacheData ||
+        nullptr == fFunctions.fMergePipelineCaches ||
+        nullptr == fFunctions.fCreateGraphicsPipelines ||
+        nullptr == fFunctions.fCreateComputePipelines ||
+        nullptr == fFunctions.fDestroyPipeline ||
+        nullptr == fFunctions.fCreatePipelineLayout ||
+        nullptr == fFunctions.fDestroyPipelineLayout ||
+        nullptr == fFunctions.fCreateSampler ||
+        nullptr == fFunctions.fDestroySampler ||
+        nullptr == fFunctions.fCreateDescriptorSetLayout ||
+        nullptr == fFunctions.fDestroyDescriptorSetLayout ||
+        nullptr == fFunctions.fCreateDescriptorPool ||
+        nullptr == fFunctions.fDestroyDescriptorPool ||
+        nullptr == fFunctions.fResetDescriptorPool ||
+        nullptr == fFunctions.fAllocateDescriptorSets ||
+        nullptr == fFunctions.fFreeDescriptorSets ||
+        nullptr == fFunctions.fUpdateDescriptorSets ||
+        nullptr == fFunctions.fCreateFramebuffer ||
+        nullptr == fFunctions.fDestroyFramebuffer ||
+        nullptr == fFunctions.fCreateRenderPass ||
+        nullptr == fFunctions.fDestroyRenderPass ||
+        nullptr == fFunctions.fGetRenderAreaGranularity ||
+        nullptr == fFunctions.fCreateCommandPool ||
+        nullptr == fFunctions.fDestroyCommandPool ||
+        nullptr == fFunctions.fResetCommandPool ||
+        nullptr == fFunctions.fAllocateCommandBuffers ||
+        nullptr == fFunctions.fFreeCommandBuffers ||
+        nullptr == fFunctions.fBeginCommandBuffer ||
+        nullptr == fFunctions.fEndCommandBuffer ||
+        nullptr == fFunctions.fResetCommandBuffer ||
+        nullptr == fFunctions.fCmdBindPipeline ||
+        nullptr == fFunctions.fCmdSetViewport ||
+        nullptr == fFunctions.fCmdSetScissor ||
+        nullptr == fFunctions.fCmdSetLineWidth ||
+        nullptr == fFunctions.fCmdSetDepthBias ||
+        nullptr == fFunctions.fCmdSetBlendConstants ||
+        nullptr == fFunctions.fCmdSetDepthBounds ||
+        nullptr == fFunctions.fCmdSetStencilCompareMask ||
+        nullptr == fFunctions.fCmdSetStencilWriteMask ||
+        nullptr == fFunctions.fCmdSetStencilReference ||
+        nullptr == fFunctions.fCmdBindDescriptorSets ||
+        nullptr == fFunctions.fCmdBindIndexBuffer ||
+        nullptr == fFunctions.fCmdBindVertexBuffers ||
+        nullptr == fFunctions.fCmdDraw ||
+        nullptr == fFunctions.fCmdDrawIndexed ||
+        nullptr == fFunctions.fCmdDrawIndirect ||
+        nullptr == fFunctions.fCmdDrawIndexedIndirect ||
+        nullptr == fFunctions.fCmdDispatch ||
+        nullptr == fFunctions.fCmdDispatchIndirect ||
+        nullptr == fFunctions.fCmdCopyBuffer ||
+        nullptr == fFunctions.fCmdCopyImage ||
+        nullptr == fFunctions.fCmdBlitImage ||
+        nullptr == fFunctions.fCmdCopyBufferToImage ||
+        nullptr == fFunctions.fCmdCopyImageToBuffer ||
+        nullptr == fFunctions.fCmdUpdateBuffer ||
+        nullptr == fFunctions.fCmdFillBuffer ||
+        nullptr == fFunctions.fCmdClearColorImage ||
+        nullptr == fFunctions.fCmdClearDepthStencilImage ||
+        nullptr == fFunctions.fCmdClearAttachments ||
+        nullptr == fFunctions.fCmdResolveImage ||
+        nullptr == fFunctions.fCmdSetEvent ||
+        nullptr == fFunctions.fCmdResetEvent ||
+        nullptr == fFunctions.fCmdWaitEvents ||
+        nullptr == fFunctions.fCmdPipelineBarrier ||
+        nullptr == fFunctions.fCmdBeginQuery ||
+        nullptr == fFunctions.fCmdEndQuery ||
+        nullptr == fFunctions.fCmdResetQueryPool ||
+        nullptr == fFunctions.fCmdWriteTimestamp ||
+        nullptr == fFunctions.fCmdCopyQueryPoolResults ||
+        nullptr == fFunctions.fCmdPushConstants ||
+        nullptr == fFunctions.fCmdBeginRenderPass ||
+        nullptr == fFunctions.fCmdNextSubpass ||
+        nullptr == fFunctions.fCmdEndRenderPass ||
+        nullptr == fFunctions.fCmdExecuteCommands) {
         RETURN_FALSE_INTERFACE
     }
 
     if (extensionFlags & kEXT_debug_report_GrVkExtensionFlag) {
-        if (NULL == fFunctions.fCreateDebugReportCallbackEXT ||
-            NULL == fFunctions.fDebugReportMessageEXT ||
-            NULL == fFunctions.fDestroyDebugReportCallbackEXT) {
+        if (nullptr == fFunctions.fCreateDebugReportCallbackEXT ||
+            nullptr == fFunctions.fDebugReportMessageEXT ||
+            nullptr == fFunctions.fDestroyDebugReportCallbackEXT) {
             RETURN_FALSE_INTERFACE
         }
     }
diff --git a/src/gpu/vk/GrVkMemory.cpp b/src/gpu/vk/GrVkMemory.cpp
index 31dea10..0496a54 100644
--- a/src/gpu/vk/GrVkMemory.cpp
+++ b/src/gpu/vk/GrVkMemory.cpp
@@ -472,7 +472,7 @@
 
     VkMemoryAllocateInfo allocInfo = {
         VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,      // sType
-        NULL,                                        // pNext
+        nullptr,                                     // pNext
         size,                                        // allocationSize
         memoryTypeIndex,                             // memoryTypeIndex
     };
@@ -518,7 +518,7 @@
     if (alignedSize > fSubHeapSize) {
         VkMemoryAllocateInfo allocInfo = {
             VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,      // sType
-            NULL,                                        // pNext
+            nullptr,                                     // pNext
             size,                                        // allocationSize
             memoryTypeIndex,                             // memoryTypeIndex
         };
diff --git a/src/ports/SkOSFile_posix.cpp b/src/ports/SkOSFile_posix.cpp
index 48b5b95..448a5c8 100644
--- a/src/ports/SkOSFile_posix.cpp
+++ b/src/ports/SkOSFile_posix.cpp
@@ -110,7 +110,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 struct SkOSFileIterData {
-    SkOSFileIterData() : fDIR(0) { }
+    SkOSFileIterData() : fDIR(nullptr) { }
     DIR* fDIR;
     SkString fPath, fSuffix;
 };
@@ -135,7 +135,7 @@
     SkOSFileIterData& self = *static_cast<SkOSFileIterData*>(fSelf.get());
     if (self.fDIR) {
         ::closedir(self.fDIR);
-        self.fDIR = 0;
+        self.fDIR = nullptr;
     }
 
     self.fPath.set(path);
diff --git a/src/ports/SkOSFile_stdio.cpp b/src/ports/SkOSFile_stdio.cpp
index 68c2d3d..77f502a 100644
--- a/src/ports/SkOSFile_stdio.cpp
+++ b/src/ports/SkOSFile_stdio.cpp
@@ -29,8 +29,8 @@
     CFBundleRef mainBundle = CFBundleGetMainBundle();
 
     // Get a reference to the file's URL
-    CFStringRef pathRef = CFStringCreateWithCString(NULL, path, kCFStringEncodingUTF8);
-    CFURLRef imageURL = CFBundleCopyResourceURL(mainBundle, pathRef, NULL, NULL);
+    CFStringRef pathRef = CFStringCreateWithCString(nullptr, path, kCFStringEncodingUTF8);
+    CFURLRef imageURL = CFBundleCopyResourceURL(mainBundle, pathRef, nullptr, nullptr);
     CFRelease(pathRef);
     if (!imageURL) {
         return nullptr;
@@ -81,7 +81,7 @@
     }
 #endif
     if (nullptr == file && (flags & kWrite_SkFILE_Flag)) {
-        SkDEBUGF(("sk_fopen: fopen(\"%s\", \"%s\") returned NULL (errno:%d): %s\n",
+        SkDEBUGF(("sk_fopen: fopen(\"%s\", \"%s\") returned nullptr (errno:%d): %s\n",
                   path, perm, errno, strerror(errno)));
     }
     return file;
diff --git a/src/views/SkEventSink.cpp b/src/views/SkEventSink.cpp
index 5732feb..cd83111 100644
--- a/src/views/SkEventSink.cpp
+++ b/src/views/SkEventSink.cpp
@@ -233,7 +233,7 @@
 SkEventSink* SkEventSink::FindSink(SkEventSinkID sinkID)
 {
     if (sinkID == 0)
-        return 0;
+        return nullptr;
 
     SkEventSink_Globals&    globals = getGlobals();
     SkAutoMutexAcquire      ac(globals.fSinkMutex);
diff --git a/src/xml/SkDOM.h b/src/xml/SkDOM.h
index e72bcad..c3862a3 100644
--- a/src/xml/SkDOM.h
+++ b/src/xml/SkDOM.h
@@ -45,8 +45,8 @@
     Type getType(const Node*) const;
 
     const char* getName(const Node*) const;
-    const Node* getFirstChild(const Node*, const char elem[] = NULL) const;
-    const Node* getNextSibling(const Node*, const char elem[] = NULL) const;
+    const Node* getFirstChild(const Node*, const char elem[] = nullptr) const;
+    const Node* getNextSibling(const Node*, const char elem[] = nullptr) const;
 
     const char* findAttr(const Node*, const char attrName[]) const;
     const Attr* getFirstAttr(const Node*) const;
@@ -55,7 +55,7 @@
     const char* getAttrValue(const Node*, const Attr*) const;
 
     // helpers for walking children
-    int countChildren(const Node* node, const char elem[] = NULL) const;
+    int countChildren(const Node* node, const char elem[] = nullptr) const;
 
     // helpers for calling SkParse
     bool findS32(const Node*, const char name[], int32_t* value) const;
diff --git a/src/xml/SkXMLParser.h b/src/xml/SkXMLParser.h
index 3f69013..a20c763 100644
--- a/src/xml/SkXMLParser.h
+++ b/src/xml/SkXMLParser.h
@@ -53,7 +53,7 @@
 
 class SkXMLParser {
 public:
-            SkXMLParser(SkXMLParserError* parserError = NULL);
+    SkXMLParser(SkXMLParserError* parserError = nullptr);
     virtual ~SkXMLParser();
 
     /** Returns true for success