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

Review URL: https://codereview.chromium.org/1316233002
diff --git a/src/animator/SkAnimateActive.cpp b/src/animator/SkAnimateActive.cpp
index 8d8c268..0dbe9c9 100644
--- a/src/animator/SkAnimateActive.cpp
+++ b/src/animator/SkAnimateActive.cpp
@@ -152,7 +152,7 @@
 //      SkScriptValue value;
 //      value.fOperand = animate->getValues()[entries - 1];
 //      value.fType = animate->getValuesType();
-//      bool result = SkScriptEngine::ConvertTo(NULL, SkType_Int, &value);
+//      bool result = SkScriptEngine::ConvertTo(nullptr, SkType_Int, &value);
 //      SkASSERT(result);
 //      duration = value.fOperand.fS32 * SK_MSec1;
 //      break;
@@ -174,7 +174,7 @@
         if (animate->formula.size() > 0) {
             SkTDOperandArray values;
             values.setCount(count);
-            SkDEBUGCODE(bool success = ) animate->fFieldInfo->setValue(fMaker, &values, 0, 0, NULL,
+            SkDEBUGCODE(bool success = ) animate->fFieldInfo->setValue(fMaker, &values, 0, 0, nullptr,
                 animate->getValuesType(), animate->formula);
             SkASSERT(success);
             fApply.applyValues(index, values.begin(), count, animate->getValuesType(), time);
@@ -212,7 +212,7 @@
             if (animate->formula.size() > 0) {
                 SkTDOperandArray values;
                 values.setCount(count);
-                SkDEBUGCODE(bool success = ) animate->fFieldInfo->setValue(fMaker, &values, 0, 0, NULL,
+                SkDEBUGCODE(bool success = ) animate->fFieldInfo->setValue(fMaker, &values, 0, 0, nullptr,
                     animate->getValuesType(), animate->formula);
                 SkASSERT(success);
                 fApply.applyValues(index, values.begin(), count, animate->getValuesType(), time);
@@ -368,7 +368,7 @@
 }
 
 void SkActive::setInterpolator(int index, SkOperand* from) {
-    if (from == NULL) // legitimate for set string
+    if (from == nullptr) // legitimate for set string
         return;
     SkAnimateBase* animate = fAnimators[index];
     int entries = animate->entries();
diff --git a/src/animator/SkAnimateBase.cpp b/src/animator/SkAnimateBase.cpp
index 82f777e..a4b2c64 100644
--- a/src/animator/SkAnimateBase.cpp
+++ b/src/animator/SkAnimateBase.cpp
@@ -39,7 +39,7 @@
 DEFINE_GET_MEMBER(SkAnimateBase);
 
 SkAnimateBase::SkAnimateBase() : begin(0), dur(1), repeat(SK_Scalar1),
-        fApply(NULL), fFieldInfo(NULL), fFieldOffset(0), fStart((SkMSec) -1), fTarget(NULL),
+        fApply(nullptr), fFieldInfo(nullptr), fFieldOffset(0), fStart((SkMSec) -1), fTarget(nullptr),
         fChanged(0), fDelayed(0), fDynamic(0), fHasEndEvent(0), fHasValues(0),
         fMirror(0), fReset(0), fResetPending(0), fTargetIsScope(0) {
     blend.setCount(1);
@@ -116,7 +116,7 @@
             value->fType = SkType_Boolean;
             break;
         case SK_PROPERTY(step):
-            if (fApply == NULL)
+            if (fApply == nullptr)
                 return false;    // !!! notify there's an error?
             fApply->getStep(value);
             break;
@@ -148,7 +148,7 @@
         // lval must be of the form x[y]
         const char* lvalStr = lval.c_str();
         const char* arrayEnd = strchr(lvalStr, '[');
-        if (arrayEnd == NULL)
+        if (arrayEnd == nullptr)
             return; //should this return an error?
         size_t arrayNameLen = arrayEnd - lvalStr;
         SkString arrayStr(lvalStr, arrayNameLen);
diff --git a/src/animator/SkAnimateField.cpp b/src/animator/SkAnimateField.cpp
index c6676e5..0011382 100644
--- a/src/animator/SkAnimateField.cpp
+++ b/src/animator/SkAnimateField.cpp
@@ -63,7 +63,7 @@
 #endif
 
 bool SkAnimate::resolveCommon(SkAnimateMaker& maker) {
-    if (fTarget == NULL) // if NULL, recall onEndElement after apply closes and sets target to scope
+    if (fTarget == nullptr) // if nullptr, recall onEndElement after apply closes and sets target to scope
         return false;
     INHERITED::onEndElement(maker);
     return maker.hasError() == false;
@@ -71,16 +71,16 @@
 
 void SkAnimate::onEndElement(SkAnimateMaker& maker) {
     bool resolved = resolveCommon(maker);
-    if (resolved && fFieldInfo == NULL) {
+    if (resolved && fFieldInfo == nullptr) {
         maker.setErrorNoun(field);
         maker.setErrorCode(SkDisplayXMLParserError::kFieldNotInTarget);
     }
-    if (resolved == false || fFieldInfo == NULL)
+    if (resolved == false || fFieldInfo == nullptr)
         return;
     SkDisplayTypes outType = fFieldInfo->getType();
     if (fHasValues) {
         SkASSERT(to.size() > 0);
-        fFieldInfo->setValue(maker, &fValues, 0, 0, NULL, outType, to);
+        fFieldInfo->setValue(maker, &fValues, 0, 0, nullptr, outType, to);
         SkASSERT(0);
         // !!! this needs to set fComponents
         return;
diff --git a/src/animator/SkAnimateMaker.cpp b/src/animator/SkAnimateMaker.cpp
index 2565762..0c28c7b 100644
--- a/src/animator/SkAnimateMaker.cpp
+++ b/src/animator/SkAnimateMaker.cpp
@@ -28,8 +28,8 @@
 } gDefaultTimeline;
 
 SkAnimateMaker::SkAnimateMaker(SkAnimator* animator, SkCanvas* canvas, SkPaint* paint)
-    : fActiveEvent(NULL), fAdjustedStart(0), fCanvas(canvas), fEnableTime(0),
-        fHostEventSinkID(0), fMinimumInterval((SkMSec) -1), fPaint(paint), fParentMaker(NULL),
+    : fActiveEvent(nullptr), fAdjustedStart(0), fCanvas(canvas), fEnableTime(0),
+        fHostEventSinkID(0), fMinimumInterval((SkMSec) -1), fPaint(paint), fParentMaker(nullptr),
         fTimeline(&gDefaultTimeline), fInInclude(false), fInMovie(false),
         fFirstScriptError(false), fLoaded(false), fIDs(256), fAnimator(animator)
 {
@@ -66,8 +66,8 @@
     for (SkExtras** extraPtr = fExtras.begin(); extraPtr < end; extraPtr++) {
         SkExtras* extra = *extraPtr;
         if (extra->definesType(type)) {
-            extra->fExtraCallBack = NULL;
-            extra->fExtraStorage = NULL;
+            extra->fExtraCallBack = nullptr;
+            extra->fExtraStorage = nullptr;
             break;
         }
     }
@@ -84,7 +84,7 @@
     SkDisplayTypes type = SkDisplayType::GetType(this, name, len );
     if ((int)type >= 0)
         return SkDisplayType::CreateInstance(this, type);
-    return NULL;
+    return nullptr;
 }
 
 // differs from SkAnimator::decodeStream in that it does not reset error state
@@ -181,7 +181,7 @@
         SkTDict<SkDisplayable*>::Iter iter(fIDs);
         const char* name;
         SkDisplayable* result;
-        while ((name = iter.next(&result)) != NULL) {
+        while ((name = iter.next(&result)) != nullptr) {
             if (strcmp(match,name) == 0)
                 result->dump(this);
         }
@@ -213,7 +213,7 @@
     SkAnimateMaker* maker = this;
     while (maker->fParentMaker)
         maker = maker->fParentMaker;
-    return maker == this ? NULL : maker->fAnimator;
+    return maker == this ? nullptr : maker->fAnimator;
 }
 #endif
 
@@ -235,8 +235,8 @@
         SkASSERT(displayable->getType() == SkType_Movie);
         SkDisplayMovie* movie = (SkDisplayMovie*) displayable;
         SkAnimateMaker* movieMaker = movie->fMovie.fMaker;
-        movieMaker->fEvents.doEvent(*movieMaker, SkDisplayEvent::kOnload, NULL);
-        movieMaker->fEvents.removeEvent(SkDisplayEvent::kOnload, NULL);
+        movieMaker->fEvents.doEvent(*movieMaker, SkDisplayEvent::kOnload, nullptr);
+        movieMaker->fEvents.removeEvent(SkDisplayEvent::kOnload, nullptr);
         movieMaker->loadMovies();
     }
 }
@@ -271,14 +271,14 @@
 }
 
 void SkAnimateMaker::removeActive(SkActive* active) {
-    if (active == NULL)
+    if (active == nullptr)
         return;
     fDisplayList.remove(active);
 }
 
 bool SkAnimateMaker::resolveID(SkDisplayable* displayable, SkDisplayable* original) {
     SkString newID;
-    bool success = computeID(original, NULL, &newID);
+    bool success = computeID(original, nullptr, &newID);
     if (success)
         setID(displayable, newID);
     return success;
diff --git a/src/animator/SkAnimateSet.cpp b/src/animator/SkAnimateSet.cpp
index 6679a92..c05e029 100644
--- a/src/animator/SkAnimateSet.cpp
+++ b/src/animator/SkAnimateSet.cpp
@@ -48,14 +48,14 @@
 #endif
 
 void SkSet::refresh(SkAnimateMaker& maker) {
-    fFieldInfo->setValue(maker, &fValues, 0, fFieldInfo->fCount, NULL,
+    fFieldInfo->setValue(maker, &fValues, 0, fFieldInfo->fCount, nullptr,
         fFieldInfo->getType(), to);
 }
 
 void SkSet::onEndElement(SkAnimateMaker& maker) {
     if (resolveCommon(maker) == false)
         return;
-    if (fFieldInfo == NULL) {
+    if (fFieldInfo == nullptr) {
         maker.setErrorCode(SkDisplayXMLParserError::kFieldNotInTarget);
         return;
     }
diff --git a/src/animator/SkAnimator.cpp b/src/animator/SkAnimator.cpp
index 97f55af..ee75ab1 100644
--- a/src/animator/SkAnimator.cpp
+++ b/src/animator/SkAnimator.cpp
@@ -42,7 +42,7 @@
 
 #define gMathPrimer gMathPrimerText
 
-SkAnimator::SkAnimator() : fMaker(NULL) {
+SkAnimator::SkAnimator() : fMaker(nullptr) {
     initialize();
 }
 
@@ -144,7 +144,7 @@
 }
 
 SkAnimator::DifferenceType SkAnimator::draw(SkCanvas* canvas, SkPaint* paint, SkMSec time) {
-    if (paint == NULL)
+    if (paint == nullptr)
         return draw(canvas, time);
     fMaker->fScreenplay.time = time;
     fMaker->fCanvas = canvas;
@@ -179,7 +179,7 @@
 
 const SkAnimator* SkAnimator::getAnimator(const SkDisplayable* displayable) const {
     if (displayable->getType() != SkType_Movie)
-        return NULL;
+        return nullptr;
     const SkDisplayMovie* movie = (const SkDisplayMovie*) displayable;
     return movie->getAnimator();
 }
@@ -187,13 +187,13 @@
 const SkDisplayable* SkAnimator::getElement(const char* id) {
     SkDisplayable* element;
     if (fMaker->find(id, &element) == false)
-        return NULL;
+        return nullptr;
     return (const SkDisplayable*) element;
 }
 
 SkElementType SkAnimator::getElementType(const SkDisplayable* ae) {
     SkDisplayable* element = (SkDisplayable*) ae;
-    const SkMemberInfo* info = SkDisplayType::GetMembers(fMaker, element->getType(), NULL);
+    const SkMemberInfo* info = SkDisplayType::GetMembers(fMaker, element->getType(), nullptr);
     return (SkElementType) SkDisplayType::Find(fMaker, info);
 }
 
@@ -240,10 +240,10 @@
 
 int32_t SkAnimator::getArrayInt(const char* id, const char* fieldID, int index) {
     const SkDisplayable* element = getElement(id);
-    if (element == NULL)
+    if (element == nullptr)
         return SK_NaN32;
     const SkMemberInfo* field = getField(element, fieldID);
-    if (field == NULL)
+    if (field == nullptr)
         return SK_NaN32;
     return getArrayInt(element, field, index);
 }
@@ -257,10 +257,10 @@
 
 SkScalar SkAnimator::getArrayScalar(const char* id, const char* fieldID, int index) {
     const SkDisplayable* element = getElement(id);
-    if (element == NULL)
+    if (element == nullptr)
         return SK_ScalarNaN;
     const SkMemberInfo* field = getField(element, fieldID);
-    if (field == NULL)
+    if (field == nullptr)
         return SK_ScalarNaN;
     return getArrayScalar(element, field, index);
 }
@@ -269,16 +269,16 @@
         const SkMemberInfo* ai, int index) {
     SkOperand operand;
     bool result = getArrayCommon(ae, ai, index, &operand);
-    return result ? operand.fString->c_str() : NULL;
+    return result ? operand.fString->c_str() : nullptr;
 }
 
 const char* SkAnimator::getArrayString(const char* id, const char* fieldID, int index) {
     const SkDisplayable* element = getElement(id);
-    if (element == NULL)
-        return NULL;
+    if (element == nullptr)
+        return nullptr;
     const SkMemberInfo* field = getField(element, fieldID);
-    if (field == NULL)
-        return NULL;
+    if (field == nullptr)
+        return nullptr;
     return getArrayString(element, field, index);
 }
 
@@ -326,10 +326,10 @@
 
 int32_t SkAnimator::getInt(const char* id, const char* fieldID) {
     const SkDisplayable* element = getElement(id);
-    if (element == NULL)
+    if (element == nullptr)
         return SK_NaN32;
     const SkMemberInfo* field = getField(element, fieldID);
-    if (field == NULL)
+    if (field == nullptr)
         return SK_NaN32;
     return getInt(element, field);
 }
@@ -352,10 +352,10 @@
 
 SkScalar SkAnimator::getScalar(const char* id, const char* fieldID) {
     const SkDisplayable* element = getElement(id);
-    if (element == NULL)
+    if (element == nullptr)
         return SK_ScalarNaN;
     const SkMemberInfo* field = getField(element, fieldID);
-    if (field == NULL)
+    if (field == nullptr)
         return SK_ScalarNaN;
     return getScalar(element, field);
 }
@@ -371,11 +371,11 @@
 
 const char* SkAnimator::getString(const char* id, const char* fieldID) {
     const SkDisplayable* element = getElement(id);
-    if (element == NULL)
-        return NULL;
+    if (element == nullptr)
+        return nullptr;
     const SkMemberInfo* field = getField(element, fieldID);
-    if (field == NULL)
-        return NULL;
+    if (field == nullptr)
+        return nullptr;
     return getString(element, field);
 }
 
@@ -385,7 +385,7 @@
 
 void SkAnimator::initialize() {
     delete fMaker;
-    fMaker = new SkAnimateMaker(this, NULL, NULL);
+    fMaker = new SkAnimateMaker(this, nullptr, nullptr);
     decodeMemory(gMathPrimer, sizeof(gMathPrimer)-1);
 #ifdef SK_BUILD_FOR_ANDROID
     InitializeSkExtraPathEffects(this);
@@ -402,7 +402,7 @@
 bool SkAnimator::onEvent(const SkEvent& evt) {
 #ifdef SK_DEBUG
     SkAnimator* root = fMaker->getRoot();
-    if (root == NULL)
+    if (root == nullptr)
         root = this;
     if (root->isTrackingEvents())
         root->eventDone(evt);
@@ -424,7 +424,7 @@
     }
     {
         const char* id = evt.findString("id");
-        if (id == NULL)
+        if (id == nullptr)
             return false;
         SkDisplayable** firstMovie = fMaker->fMovies.begin();
         SkDisplayable** endMovie = fMaker->fMovies.end();
@@ -555,11 +555,11 @@
 
 bool SkAnimator::setArray(const char* id, const char* fieldID, SkTypedArray array) {
     SkDisplayable* element = (SkDisplayable*) getElement(id);
-    //should I go ahead and change all 'NULL's to 'NULL'?
-    if (element == NULL)
+    //should I go ahead and change all 'nullptr's to 'nullptr'?
+    if (element == nullptr)
         return false;
     const SkMemberInfo* field = getField(element, fieldID);
-    if (field == NULL)
+    if (field == nullptr)
         return false;
     return setArray(element, field, array);
 }
@@ -581,10 +581,10 @@
 
 bool SkAnimator::setInt(const char* id, const char* fieldID, int32_t s32) {
     SkDisplayable* element = (SkDisplayable*) getElement(id);
-    if (element == NULL)
+    if (element == nullptr)
         return false;
     const SkMemberInfo* field = getField(element, fieldID);
-    if (field == NULL)
+    if (field == nullptr)
         return false;
     return setInt(element, field, s32);
 }
@@ -606,10 +606,10 @@
 
 bool SkAnimator::setScalar(const char* id, const char* fieldID, SkScalar scalar) {
     SkDisplayable* element = (SkDisplayable*) getElement(id);
-    if (element == NULL)
+    if (element == nullptr)
         return false;
     const SkMemberInfo* field = getField(element, fieldID);
-    if (field == NULL)
+    if (field == nullptr)
         return false;
     return setScalar(element, field, scalar);
 }
@@ -617,16 +617,16 @@
 bool SkAnimator::setString(SkDisplayable* element,
         const SkMemberInfo* info, const char* str) {
     // !!! until this is fixed, can't call script with global references from here
-    info->setValue(*fMaker, NULL, 0, info->fCount, element, info->getType(), str, strlen(str));
+    info->setValue(*fMaker, nullptr, 0, info->fCount, element, info->getType(), str, strlen(str));
     return true;
 }
 
 bool SkAnimator::setString(const char* id, const char* fieldID, const char* str) {
     SkDisplayable* element = (SkDisplayable*) getElement(id);
-    if (element == NULL)
+    if (element == nullptr)
         return false;
     const SkMemberInfo* field = getField(element, fieldID);
-    if (field == NULL)
+    if (field == nullptr)
         return false;
     return setString(element, field, str);
 }
diff --git a/src/animator/SkAnimatorScript.cpp b/src/animator/SkAnimatorScript.cpp
index 051dc0d..cbe1d04 100644
--- a/src/animator/SkAnimatorScript.cpp
+++ b/src/animator/SkAnimatorScript.cpp
@@ -45,7 +45,7 @@
 static int gEnumMapCount = SK_ARRAY_COUNT(gEnumMaps);
 
 SkAnimatorScript::SkAnimatorScript(SkAnimateMaker& maker, SkDisplayable* working, SkDisplayTypes type)
-    : SkScriptEngine(SkScriptEngine::ToOpType(type)), fMaker(maker), fParent(NULL), fWorking(working)
+    : SkScriptEngine(SkScriptEngine::ToOpType(type)), fMaker(maker), fParent(nullptr), fWorking(working)
 {
     memberCallBack(EvalMember, (void*) this);
     memberFunctionCallBack(EvalMemberFunction, (void*) this);
@@ -165,7 +165,7 @@
         displayable = engine->fWorking;
         if (SK_LITERAL_STR_EQUAL("parent", token, len)) {
             SkDisplayable* parent = displayable->getParent();
-            if (parent == NULL)
+            if (parent == nullptr)
                 parent = engine->fParent;
             if (parent) {
                 value->fOperand.fDisplayable = parent;
@@ -175,7 +175,7 @@
         }
         if (displayable && EvalMember(token, len, displayable, engine, value))
             return true;
-        value->fOperand.fString = NULL;
+        value->fOperand.fString = nullptr;
         value->fType = SkType_String;
     } else {
         SkDisplayable* working = engine->fWorking;
@@ -194,7 +194,7 @@
 
 bool SkAnimatorScript::EvalNamedColor(const char* token, size_t len, void* callback, SkScriptValue* value) {
         value->fType = SkType_Int;
-    if (SkParse::FindNamedColor(token, len, (SkColor*) &value->fOperand.fS32) != NULL)
+    if (SkParse::FindNamedColor(token, len, (SkColor*) &value->fOperand.fS32) != nullptr)
         return true;
     return false;
 }
@@ -281,7 +281,7 @@
         return true;
     }
     const SkMemberInfo* info = displayable->getMember(name.c_str());
-    if (info == NULL)
+    if (info == nullptr)
         return false;
     if (info->fType == SkType_MemberProperty) {
         if (displayable->getProperty(info->propertyIndex(), value) == false) {
@@ -298,7 +298,7 @@
     SkDisplayable* displayable = (SkDisplayable*) object;
     SkString name(member, len);
     const SkMemberInfo* info = displayable->getMember(name.c_str());
-    SkASSERT(info != NULL); /* !!! error handling unimplemented */
+    SkASSERT(info != nullptr); /* !!! error handling unimplemented */
     if (info->fType != SkType_MemberFunction) {
         SkASSERT(0);
         return false;
@@ -401,7 +401,7 @@
     bool more = true;
     do {
         const char* last = strchr(ptr, '|');
-        if (last == NULL) {
+        if (last == nullptr) {
             last = &ptr[strlen(ptr)];
             more = false;
         }
@@ -465,7 +465,7 @@
             scriptValue->fOperand.fString = new SkString(boxedValue->value);
             } break;
         default: {
-            const char* id = NULL;
+            const char* id = nullptr;
             SkDEBUGCODE(bool success = ) maker->findKey(displayable, &id);
             SkASSERT(success);
             scriptValue->fOperand.fString = new SkString(id);
@@ -562,7 +562,7 @@
     animator.doUserEvent(evt);
     // set up animator with memory script above, then run value tests
     for (unsigned index = 0; index < SkScriptNAnswer_testCount; index++) {
-        SkAnimatorScript engine(*animator.fMaker, NULL, scriptTests[index].fType);
+        SkAnimatorScript engine(*animator.fMaker, nullptr, scriptTests[index].fType);
         SkScriptValue value;
         const char* script = scriptTests[index].fScript;
         bool success = engine.evaluateScript(&script, &value);
diff --git a/src/animator/SkAnimatorScript2.cpp b/src/animator/SkAnimatorScript2.cpp
index 700027a..d246130 100644
--- a/src/animator/SkAnimatorScript2.cpp
+++ b/src/animator/SkAnimatorScript2.cpp
@@ -205,7 +205,7 @@
             return true;
         }
         const SkMemberInfo* info = displayable->getMember(name.c_str());
-        if (info == NULL)
+        if (info == nullptr)
             return false;    // !!! add additional error info?
         ref->fType = SkAnimatorScript2::ToOpType(info->getType());
         ref->fOperand.fObject = (void*) info;
@@ -235,7 +235,7 @@
         SkDisplayable* displayable = (SkDisplayable*) object;
         SkString name(member, len);
         const SkMemberInfo* info = displayable->getMember(name.c_str());
-        if (info == NULL || info->fType != SkType_MemberFunction)
+        if (info == nullptr || info->fType != SkType_MemberFunction)
             return false;    // !!! add additional error info?
         ref->fType = SkAnimatorScript2::ToOpType(info->getType());
         ref->fOperand.fObject = (void*) info;
@@ -264,7 +264,7 @@
 class SkAnimatorScript_NamedColor : public SkScriptCallBackProperty {
 public:
     virtual bool getConstValue(const char* name, int len, SkOperand2* value) {
-        return SkParse::FindNamedColor(name, len, (SkColor*) &value->fS32) != NULL;
+        return SkParse::FindNamedColor(name, len, (SkColor*) &value->fS32) != nullptr;
     }
 };
 
@@ -474,9 +474,9 @@
 }
 
 SkOperand2::OpType SkAnimatorScript2::ToOpType(SkDisplayTypes type) {
-    if (SkDisplayType::IsDisplayable(NULL /* fMaker */, type))
+    if (SkDisplayType::IsDisplayable(nullptr /* fMaker */, type))
         return SkOperand2::kObject;
-    if (SkDisplayType::IsEnum(NULL /* fMaker */, type))
+    if (SkDisplayType::IsEnum(nullptr /* fMaker */, type))
         return SkOperand2::kS32;
     switch (type) {
         case SkType_ARGB:
@@ -506,7 +506,7 @@
     bool more = true;
     do {
         const char* last = strchr(ptr, '|');
-        if (last == NULL) {
+        if (last == nullptr) {
             last = &ptr[strlen(ptr)];
             more = false;
         }
@@ -591,7 +591,7 @@
     animator.doUserEvent(evt);
     // set up animator with memory script above, then run value tests
     for (int index = 0; index < SkScriptNAnswer_testCount; index++) {
-        SkAnimatorScript2 engine(*animator.fMaker, NULL, scriptTests[index].fType);
+        SkAnimatorScript2 engine(*animator.fMaker, nullptr, scriptTests[index].fType);
         SkScriptValue2 value;
         const char* script = scriptTests[index].fScript;
         bool success = engine.evaluateScript(&script, &value);
diff --git a/src/animator/SkBoundable.cpp b/src/animator/SkBoundable.cpp
index abc4f40..e784e9f 100644
--- a/src/animator/SkBoundable.cpp
+++ b/src/animator/SkBoundable.cpp
@@ -50,6 +50,6 @@
 SkBoundableAuto::~SkBoundableAuto() {
     if (fBoundable->hasBounds() == false)
         return;
-//    fMaker.fCanvas->setBounder(NULL);
+//    fMaker.fCanvas->setBounder(nullptr);
     fBoundable->setBounds(fMaker.fDisplayList.fBounds);
 }
diff --git a/src/animator/SkBuildCondensedInfo.cpp b/src/animator/SkBuildCondensedInfo.cpp
index 411be90..1ee1917 100644
--- a/src/animator/SkBuildCondensedInfo.cpp
+++ b/src/animator/SkBuildCondensedInfo.cpp
@@ -27,7 +27,7 @@
 SkTDIntArray gUnknownsCounts;
 
 static void AddInfo(SkDisplayTypes type, const SkMemberInfo* info, int infoCount) {
-    SkASSERT(gInfos[type] == NULL);
+    SkASSERT(gInfos[type] == nullptr);
     gInfos[type] = info;
     gInfosCounts[type] = infoCount;
     *gInfosTypeIDs.append() = type;
@@ -111,7 +111,7 @@
     int index, infoCount;
     for (index = 0; index < kTypeNamesSize; index++) {
         const SkMemberInfo* info = GetMembers(maker, gTypeNames[index].fType, &infoCount);
-        if (info == NULL)
+        if (info == nullptr)
             continue;
         AddInfo(gTypeNames[index].fType, info, infoCount);
     }
@@ -131,7 +131,7 @@
                 int typeIndex = 0;
                 for (; typeIndex < kNumberOfTypes; typeIndex++) {
                     const SkMemberInfo* temp = SkDisplayType::GetMembers(
-                        maker, (SkDisplayTypes) typeIndex, NULL);
+                        maker, (SkDisplayTypes) typeIndex, nullptr);
                     if (temp == info)
                         break;
                 }
@@ -160,7 +160,7 @@
     int unknown = 1;
     for (index = 0; index < gInfos.count(); index++) {
         const SkMemberInfo* info = gInfos[index];
-        if (info == NULL)
+        if (info == nullptr)
             continue;
         char scratch[64];
         bool drawPrefix, displayPrefix;
@@ -183,7 +183,7 @@
     unknown = 1;
     for (index = 0; index < gInfos.count(); index++) {
         const SkMemberInfo* info = gInfos[index];
-        if (info == NULL)
+        if (info == nullptr)
             continue;
         char scratch[64];
         bool drawPrefix, displayPrefix;
@@ -229,7 +229,7 @@
     unknown = 1;
     for (index = 0; index < gInfosCounts.count(); index++) {
         const SkMemberInfo* info = gInfos[index];
-        if (info == NULL)
+        if (info == nullptr)
             continue;
         typeIDCount++;
         char scratch[64];
@@ -251,7 +251,7 @@
     written = 0;
     for (index = 0; index < gInfosCounts.count(); index++) {
         const SkMemberInfo* info = gInfos[index];
-        if (info == NULL)
+        if (info == nullptr)
             continue;
         if (written > 0)
                 putc(',', condensed);
diff --git a/src/animator/SkDisplayAdd.cpp b/src/animator/SkDisplayAdd.cpp
index ffc9ba4..f5788a3 100644
--- a/src/animator/SkDisplayAdd.cpp
+++ b/src/animator/SkDisplayAdd.cpp
@@ -34,14 +34,14 @@
 DEFINE_GET_MEMBER(SkAdd);
 
 SkAdd::SkAdd() : mode(kMode_indirect),
-    offset(SK_MaxS32), use(NULL), where(NULL) {
+    offset(SK_MaxS32), use(nullptr), where(nullptr) {
 }
 
 SkDisplayable* SkAdd::deepCopy(SkAnimateMaker* maker) {
     SkADrawable* saveUse = use;
     SkADrawable* saveWhere = where;
-    use = NULL;
-    where = NULL;
+    use = nullptr;
+    where = nullptr;
     SkAdd* copy = (SkAdd*) INHERITED::deepCopy(maker);
     copy->use = use = saveUse;
     copy->where = where = saveWhere;
@@ -80,20 +80,20 @@
     SkDisplayList& displayList = maker.fDisplayList;
     SkTDDrawableArray* parentList = displayList.getDrawList();
     if (type == SkType_Add) {
-        if (use == NULL) // not set in apply yet
+        if (use == nullptr) // not set in apply yet
             return true;
     }
     bool skipAddToParent = true;
     SkASSERT(type != SkType_Replace || where);
     SkTDDrawableArray* grandList SK_INIT_TO_AVOID_WARNING;
-    SkGroup* parentGroup = NULL;
-    SkGroup* thisGroup = NULL;
+    SkGroup* parentGroup = nullptr;
+    SkGroup* thisGroup = nullptr;
     int index = where ? displayList.findGroup(where, &parentList, &parentGroup,
         &thisGroup, &grandList) : 0;
     if (index < 0)
         return true;
     int max = parentList->count();
-    if (where == NULL && type == SkType_Move)
+    if (where == nullptr && type == SkType_Move)
         index = max;
     if (offset != SK_MaxS32) {
         index += offset;
@@ -102,15 +102,15 @@
             return true;    // caller should not add
         }
     }
-    if (offset < 0 && where == NULL)
+    if (offset < 0 && where == nullptr)
         index += max + 1;
     switch (type) {
         case SkType_Add:
-            if (offset == SK_MaxS32 && where == NULL) {
+            if (offset == SK_MaxS32 && where == nullptr) {
                 if (use->isDrawable()) {
                     skipAddToParent = mode == kMode_immediate;
                     if (skipAddToParent) {
-                        if (where == NULL) {
+                        if (where == nullptr) {
                             SkTDDrawableArray* useParentList;
                             index = displayList.findGroup(this, &useParentList, &parentGroup,
                                 &thisGroup, &grandList);
@@ -194,7 +194,7 @@
 
 bool SkAdd::isDrawable() const {
     return getType() == SkType_Add && mode == kMode_indirect && offset == SK_MaxS32 &&
-        where == NULL && use != NULL && use->isDrawable();
+        where == nullptr && use != nullptr && use->isDrawable();
 }
 
 //SkDisplayable* SkAdd::resolveTarget(SkAnimateMaker& maker) {
diff --git a/src/animator/SkDisplayAdd.h b/src/animator/SkDisplayAdd.h
index c106d86..eb4610b 100644
--- a/src/animator/SkDisplayAdd.h
+++ b/src/animator/SkDisplayAdd.h
@@ -36,7 +36,7 @@
         Mode mode;
         int32_t offset;
         SkADrawable* use;
-        SkADrawable* where;  // if NULL, offset becomes index
+        SkADrawable* where;  // if nullptr, offset becomes index
 //  } A;
 private:
     typedef SkADrawable INHERITED;
diff --git a/src/animator/SkDisplayApply.cpp b/src/animator/SkDisplayApply.cpp
index 88f73ec..0d5f09d 100644
--- a/src/animator/SkDisplayApply.cpp
+++ b/src/animator/SkDisplayApply.cpp
@@ -56,7 +56,7 @@
 DEFINE_GET_MEMBER(SkApply);
 
 SkApply::SkApply() : begin(0), dontDraw(false), interval((SkMSec) -1), mode((Mode) -1), /*pickup(false), */
-    restore(false), scope(NULL), steps(-1), transition((Transition) -1), fActive(NULL), /*fCurrentScope(NULL),*/
+    restore(false), scope(nullptr), steps(-1), transition((Transition) -1), fActive(nullptr), /*fCurrentScope(nullptr),*/
     fLastTime(0), fAppended(false), fContainsScope(false), fDeleteScope(false), fEmbedded(false),
     fEnabled(false), fEnabling(false) {
 }
@@ -71,7 +71,7 @@
 }
 
 void SkApply::activate(SkAnimateMaker& maker) {
-    if (fActive != NULL) {
+    if (fActive != nullptr) {
         if (fActive->fDrawIndex == 0 && fActive->fDrawMax == 0)
             return; // if only one use, nothing more to do
         if (restore == false)
@@ -92,7 +92,7 @@
 }
 
 void SkApply::append(SkApply* apply) {
-    if (fActive == NULL)
+    if (fActive == nullptr)
         return;
     int oldCount = fActive->fAnimators.count();
     fActive->append(apply);
@@ -110,7 +110,7 @@
     SkAnimateBase* animator = fActive->fAnimators[animatorIndex];
     const SkMemberInfo * info = animator->fFieldInfo;
     SkASSERT(animator);
-    SkASSERT(info != NULL);
+    SkASSERT(info != nullptr);
     SkDisplayTypes type = (SkDisplayTypes) info->fType;
     SkDisplayable* target = getTarget(animator);
     if (animator->hasExecute() || type == SkType_MemberFunction || type == SkType_MemberProperty) {
@@ -123,7 +123,7 @@
                 temp.fOperand = values[index];
                 *typedValues.append() = temp;
             }
-            executor->executeFunction(target, info->functionIndex(), typedValues, info->getType(), NULL);
+            executor->executeFunction(target, info->functionIndex(), typedValues, info->getType(), nullptr);
         } else {
             SkScriptValue scriptValue;
             scriptValue.fOperand = values[0];
@@ -162,7 +162,7 @@
 
 SkDisplayable* SkApply::deepCopy(SkAnimateMaker* maker) {
     SkADrawable* saveScope = scope;
-    scope = NULL;
+    scope = nullptr;
     SkApply* result = (SkApply*) INHERITED::deepCopy(maker);
     result->scope = scope = saveScope;
     SkAnimateBase** end = fAnimators.end();
@@ -184,7 +184,7 @@
 }
 
 bool SkApply::draw(SkAnimateMaker& maker) {
-    if (scope ==NULL)
+    if (scope ==nullptr)
         return false;
     if (scope->isApply() || scope->isDrawable() == false)
         return false;
@@ -262,7 +262,7 @@
 
 bool SkApply::enable(SkAnimateMaker& maker) {
     fEnabled = true;
-    bool initialized = fActive != NULL;
+    bool initialized = fActive != nullptr;
     if (dynamicScope.size() > 0)
         enableDynamic(maker);
     if (maker.fError.hasError())
@@ -284,14 +284,14 @@
         }
         return true;
     }*/
-    if ((mode == kMode_immediate || mode == kMode_create) && scope == NULL)
+    if ((mode == kMode_immediate || mode == kMode_create) && scope == nullptr)
         return false;   // !!! error?
     bool enableMe = scope && (scope->hasEnable() || scope->isApply() || scope->isDrawable() == false);
     if ((mode == kMode_immediate && enableMe) || mode == kMode_create)
         activate(maker);    // for non-drawables like post, prime them here
     if (mode == kMode_immediate && enableMe)
         fActive->enable();
-    if (mode == kMode_create && scope != NULL) {
+    if (mode == kMode_create && scope != nullptr) {
         enableCreate(maker);
         return true;
     }
@@ -311,7 +311,7 @@
     debugOut.appendS32(maker.fEnableTime - maker.fDebugTimeBase);
     SkDebugf("%s\n", debugOut.c_str());
 #endif
-    if (scope == NULL || scope->isApply() || scope->getType() == SkType_Movie || scope->isDrawable() == false) {
+    if (scope == nullptr || scope->isApply() || scope->getType() == SkType_Movie || scope->isDrawable() == false) {
         activate(maker);    // for non-drawables like post, prime them here
         if (initialized) {
             append(this);
@@ -319,7 +319,7 @@
         fEnabling = true;
         interpolate(maker, maker.fEnableTime);
         fEnabling = false;
-        if (scope != NULL && dontDraw == false)
+        if (scope != nullptr && dontDraw == false)
             scope->enable(maker);
         return true;
     } else if (initialized && restore == false)
@@ -365,10 +365,10 @@
         SkASSERT(old < parentList->count());
         if ((*parentList)[old]->isApply()) {
             SkApply* apply = (SkApply*) (*parentList)[old];
-            if (apply != this && apply->fActive == NULL)
+            if (apply != this && apply->fActive == nullptr)
                 apply->activate(maker);
             apply->append(this);
-            parentGroup = NULL;
+            parentGroup = nullptr;
         } else {
             if (parentGroup)
                 parentGroup->markCopySize(old);
@@ -377,7 +377,7 @@
             int oldApply = displayList.findGroup(this, &parentList, &pGroup, &thisGroup, &grandList);
             if (oldApply >= 0) {
                 (*parentList)[oldApply] = (SkADrawable*) SkDisplayType::CreateInstance(&maker, SkType_Apply);
-                parentGroup = NULL;
+                parentGroup = nullptr;
                 fDeleteScope = true;
             }
             *newApplyLocation = this;
@@ -397,7 +397,7 @@
         bool success = maker.computeID(scope, this, &newID);
         if (success == false)
             return;
-        if (maker.find(newID.c_str(), NULL))
+        if (maker.find(newID.c_str(), nullptr))
             continue;
         SkApply* copy = (SkApply*) deepCopy(&maker); // work on copy of animator state
         if (mode == kMode_create)
@@ -429,11 +429,11 @@
         &newScope);
     if (success && scope != newScope) {
         SkTDDrawableArray* pList, * gList;
-        SkGroup* pGroup = NULL, * found = NULL;
+        SkGroup* pGroup = nullptr, * found = nullptr;
         int old = maker.fDisplayList.findGroup(scope, &pList, &pGroup, &found, &gList);
         if (pList && old >= 0 && (*pList)[old]->isApply() && (*pList)[old] != this) {
             if (fAppended == false) {
-                if (found != NULL) {
+                if (found != nullptr) {
                     SkDisplayable* oldChild = (*pList)[old];
                     if (oldChild->isApply() && found->copySet(old)) {
                         found->markCopyClear(old);
@@ -449,7 +449,7 @@
     }
     maker.removeActive(fActive);
     delete fActive;
-    fActive = NULL;
+    fActive = nullptr;
 }
 
 void SkApply::endSave(int index) {
@@ -528,11 +528,11 @@
 }
 
 bool SkApply::inactivate(SkAnimateMaker& maker) {
-    if (fActive == NULL)
+    if (fActive == nullptr)
         return false;
     maker.removeActive(fActive);
     delete fActive;
-    fActive = NULL;
+    fActive = nullptr;
     return true;
 }
 
@@ -541,14 +541,14 @@
 #endif
 
 bool SkApply::interpolate(SkAnimateMaker& maker, SkMSec rawTime) {
-    if (fActive == NULL)
+    if (fActive == nullptr)
         return false;
     bool result = false;
 #if defined SK_DEBUG && defined SK_DEBUG_ANIMATION_TIMING
     SkMSec time = maker.getAppTime();
     if (lastTime == (SkMSec) -1)
         lastTime = rawTime - 1;
-    if (fActive != NULL &&
+    if (fActive != nullptr &&
         strcmp(id, "a3") == 0 && rawTime > lastTime) {
         lastTime += 1000;
         SkString debugOut;
@@ -629,7 +629,7 @@
                 fLastTime = animate->dur;
             SkTypedArray formulaValues;
             formulaValues.setCount(count);
-            SkDEBUGCODE(bool success = ) animate->fFieldInfo->setValue(maker, &formulaValues, 0, 0, NULL,
+            SkDEBUGCODE(bool success = ) animate->fFieldInfo->setValue(maker, &formulaValues, 0, 0, nullptr,
                 animate->getValuesType(), animate->formula);
             SkASSERT(success);
             if (restore)
@@ -645,7 +645,7 @@
 }
 
 void SkApply::initialize() {
-    if (scope == NULL)
+    if (scope == nullptr)
         return;
     if (scope->isApply() || scope->isDrawable() == false)
         return;
@@ -665,12 +665,12 @@
     }
     if (mode == kMode_create)
         return;
-    if (scope != NULL && steps >= 0 && scope->isApply() == false && scope->isDrawable())
+    if (scope != nullptr && steps >= 0 && scope->isApply() == false && scope->isDrawable())
         scope->setSteps(steps);
     for (SkAnimateBase** animPtr = fAnimators.begin(); animPtr < fAnimators.end(); animPtr++) {
         SkAnimateBase* anim = *animPtr;
         //for reusing apply statements with dynamic scope
-        if (anim->fTarget == NULL || anim->fTargetIsScope) {
+        if (anim->fTarget == nullptr || anim->fTargetIsScope) {
             anim->fTargetIsScope = true;
             if (scope)
                 anim->fTarget = scope;
@@ -678,7 +678,7 @@
                 anim->setTarget(maker);
             anim->onEndElement(maker);  // allows animate->fFieldInfo to be set
         }
-        if (scope != NULL && steps >= 0 && anim->fTarget != scope && anim->fTarget->isDrawable())
+        if (scope != nullptr && steps >= 0 && anim->fTarget != scope && anim->fTarget->isDrawable())
             anim->fTarget->setSteps(steps);
     }
 }
@@ -748,7 +748,7 @@
 // !!! this all may be unneeded, at least in the dynamic case ??
     int activeIndex = fActive->fDrawIndex + index;
     SkTDOperandArray last;
-    if (fActive->fSaveRestore[activeIndex] == NULL) {
+    if (fActive->fSaveRestore[activeIndex] == nullptr) {
         fActive->fSaveRestore[activeIndex] = new SkOperand[count];
         useLast = false;
     } else {
diff --git a/src/animator/SkDisplayEvent.cpp b/src/animator/SkDisplayEvent.cpp
index b5dc8145..746780d 100644
--- a/src/animator/SkDisplayEvent.cpp
+++ b/src/animator/SkDisplayEvent.cpp
@@ -45,7 +45,7 @@
 DEFINE_GET_MEMBER(SkDisplayEvent);
 
 SkDisplayEvent::SkDisplayEvent() : code((SkKey) -1), disable(false),
-    kind(kUser), x(0), y(0), fLastCode((SkKey) -1), fMax((SkKey) -1), fTarget(NULL) {
+    kind(kUser), x(0), y(0), fLastCode((SkKey) -1), fMax((SkKey) -1), fTarget(nullptr) {
 }
 
 SkDisplayEvent::~SkDisplayEvent() {
@@ -71,7 +71,7 @@
         if (child->contains(match))
             return child;
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkDisplayEvent::deleteMembers() {
@@ -100,7 +100,7 @@
         else
             SkDebugf("key=\"%c\" ", code);
     }
-    if (fTarget != NULL) {
+    if (fTarget != nullptr) {
         SkDebugf("target=\"%s\" ", fTarget->id);
     }
     if (kind >= SkDisplayEvent::kMouseDown && kind <= SkDisplayEvent::kMouseUp) {
@@ -188,7 +188,7 @@
     SkMetaData::Type    type;
     int number;
     const char* name;
-    while ((name = iter.next(&type, &number)) != NULL) {
+    while ((name = iter.next(&type, &number)) != nullptr) {
         if (name[0] == '\0')
             continue;
         SkDisplayable* displayable;
diff --git a/src/animator/SkDisplayEvents.cpp b/src/animator/SkDisplayEvents.cpp
index 3c3791d..d367cf1 100644
--- a/src/animator/SkDisplayEvents.cpp
+++ b/src/animator/SkDisplayEvents.cpp
@@ -47,7 +47,7 @@
         if (kind != SkDisplayEvent::kOnload)
             movie->doEvent(kind, state);
     }
-    SkDisplayable* displayable = state ? state->fDisplayable : NULL;
+    SkDisplayable* displayable = state ? state->fDisplayable : nullptr;
     int keyCode = state ? state->fCode : 0;
     int count = fEvents.count();
     for (int index = 0; index < count; index++) {
@@ -61,9 +61,9 @@
                 continue;
             evt->fLastCode = (SkKey) keyCode;
         }
-        if (evt->fTarget != NULL && evt->fTarget != displayable)
+        if (evt->fTarget != nullptr && evt->fTarget != displayable)
             continue;
-        if (state == NULL || state->fDisable == 0) {
+        if (state == nullptr || state->fDisable == 0) {
             if (kind >= SkDisplayEvent::kMouseDown && kind <= SkDisplayEvent::kMouseUp) {
                 evt->x = state->fX;
                 evt->y = state->fY;
@@ -96,7 +96,7 @@
 // currently this only removes onLoad events
 void SkEvents::removeEvent(SkDisplayEvent::Kind kind, SkEventState* state) {
     int keyCode = state ? state->fCode : 0;
-    SkDisplayable* displayable = state ? state->fDisplayable : NULL;
+    SkDisplayable* displayable = state ? state->fDisplayable : nullptr;
     for (SkDisplayEvent** evtPtr = fEvents.begin(); evtPtr < fEvents.end(); evtPtr++) {
         SkDisplayEvent* evt = *evtPtr;
         if (evt->kind != kind)
@@ -105,7 +105,7 @@
             if ((int) evt->code > keyCode || (int) (evt->fMax != (SkKey) -1 ? evt->fMax : evt->code) < keyCode)
                 continue;
         }
-        if (evt->fTarget != NULL && evt->fTarget != displayable)
+        if (evt->fTarget != nullptr && evt->fTarget != displayable)
             continue;
         int index = fEvents.find(evt);
         fEvents.remove(index);
diff --git a/src/animator/SkDisplayInput.cpp b/src/animator/SkDisplayInput.cpp
index 7061aa8..facc703 100644
--- a/src/animator/SkDisplayInput.cpp
+++ b/src/animator/SkDisplayInput.cpp
@@ -30,7 +30,7 @@
 SkInput::SkInput() : fInt((int) SK_NaN32), fFloat(SK_ScalarNaN) {}
 
 SkDisplayable* SkInput::contains(const SkString& string) {
-    return string.equals(name) ? this : NULL;
+    return string.equals(name) ? this : nullptr;
 }
 
 bool SkInput::enable(SkAnimateMaker & ) {
diff --git a/src/animator/SkDisplayList.cpp b/src/animator/SkDisplayList.cpp
index f5f2c7f..fbba83f 100644
--- a/src/animator/SkDisplayList.cpp
+++ b/src/animator/SkDisplayList.cpp
@@ -52,7 +52,7 @@
 
 int SkDisplayList::findGroup(SkADrawable* match, SkTDDrawableArray** list,
         SkGroup** parent, SkGroup** found, SkTDDrawableArray**grandList) {
-    *parent = NULL;
+    *parent = nullptr;
     *list = &fDrawList;
     *grandList = &fDrawList;
     return SearchForMatch(match, list, parent, found, grandList);
@@ -70,7 +70,7 @@
 
 int SkDisplayList::SearchForMatch(SkADrawable* match, SkTDDrawableArray** list,
         SkGroup** parent, SkGroup** found, SkTDDrawableArray**grandList) {
-    *found = NULL;
+    *found = nullptr;
     for (int index = 0; index < (*list)->count(); index++) {
         SkADrawable* draw = (**list)[index];
         if (draw == match)
diff --git a/src/animator/SkDisplayMath.cpp b/src/animator/SkDisplayMath.cpp
index 7f406c1..f52cf19 100644
--- a/src/animator/SkDisplayMath.cpp
+++ b/src/animator/SkDisplayMath.cpp
@@ -131,7 +131,7 @@
 void SkDisplayMath::executeFunction(SkDisplayable* target, int index,
         SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type,
         SkScriptValue* scriptValue) {
-    if (scriptValue == NULL)
+    if (scriptValue == nullptr)
         return;
     SkASSERT(target == this);
     SkScriptValue* array = parameters.begin();
diff --git a/src/animator/SkDisplayMovie.cpp b/src/animator/SkDisplayMovie.cpp
index ea832dc..797d853 100644
--- a/src/animator/SkDisplayMovie.cpp
+++ b/src/animator/SkDisplayMovie.cpp
@@ -34,7 +34,7 @@
         return;
     SkAnimateMaker* movieMaker = fMovie.fMaker;
     SkAnimateMaker* parentMaker = movieMaker->fParentMaker;
-    if (src.size() == 0 || parentMaker == NULL)
+    if (src.size() == 0 || parentMaker == nullptr)
         return;
     movieMaker->fPrefix.set(parentMaker->fPrefix);
     fDecodedSuccessfully = fMovie.fMaker->decodeURI(src.c_str());
@@ -105,8 +105,8 @@
     if (fDecodedSuccessfully == false)
         return false;
     SkAnimateMaker* movieMaker = fMovie.fMaker;
-    movieMaker->fEvents.doEvent(*movieMaker, SkDisplayEvent::kOnload, NULL);
-    movieMaker->fEvents.removeEvent(SkDisplayEvent::kOnload, NULL);
+    movieMaker->fEvents.doEvent(*movieMaker, SkDisplayEvent::kOnload, nullptr);
+    movieMaker->fEvents.removeEvent(SkDisplayEvent::kOnload, nullptr);
     fLoaded = true;
     movieMaker->fLoaded = true;
     return false;
diff --git a/src/animator/SkDisplayPost.cpp b/src/animator/SkDisplayPost.cpp
index 0fd4a06..a30fd44 100644
--- a/src/animator/SkDisplayPost.cpp
+++ b/src/animator/SkDisplayPost.cpp
@@ -38,8 +38,8 @@
 
 DEFINE_GET_MEMBER(SkPost);
 
-SkPost::SkPost() : delay(0), /*initialized(SkBool(-1)), */ mode(kImmediate), fMaker(NULL),
-    fSinkID(0), fTargetMaker(NULL), fChildHasID(false), fDirty(false) {
+SkPost::SkPost() : delay(0), /*initialized(SkBool(-1)), */ mode(kImmediate), fMaker(nullptr),
+    fSinkID(0), fTargetMaker(nullptr), fChildHasID(false), fDirty(false) {
 }
 
 SkPost::~SkPost() {
@@ -104,7 +104,7 @@
     //SkDataInput** ptr = fParts.end();
     //SkDataInput* data;
     //const char* ID;
-    while ((name = iter.next(&type, &number)) != NULL) {
+    while ((name = iter.next(&type, &number)) != nullptr) {
         //ptr--;
         if (strcmp(name, "id") == 0)
             continue;
@@ -210,7 +210,7 @@
     bool isAnimatorEvent = true;
     SkAnimator* anim = maker.getAnimator();
     if (targetID == 0) {
-        isAnimatorEvent = fEvent.findString("id") != NULL;
+        isAnimatorEvent = fEvent.findString("id") != nullptr;
         if (isAnimatorEvent)
             targetID = anim->getSinkID();
         else if (maker.fHostEventSinkID)
@@ -236,7 +236,7 @@
     do {
         const char* end = strchr(ch, '.');
         size_t len = end ? (size_t) (end - ch) : strlen(ch);
-        SkDisplayable* displayable = NULL;
+        SkDisplayable* displayable = nullptr;
         if (SK_LITERAL_STR_EQUAL("parent", ch, len)) {
             if (fTargetMaker->fParentMaker)
                 fTargetMaker = fTargetMaker->fParentMaker;
@@ -246,14 +246,14 @@
             }
         } else {
             fTargetMaker->find(ch, len, &displayable);
-            if (displayable == NULL || displayable->getType() != SkType_Movie) {
+            if (displayable == nullptr || displayable->getType() != SkType_Movie) {
                 fTargetMaker->setErrorCode(SkDisplayXMLParserError::kExpectedMovie);
                 return;
             }
             SkDisplayMovie* movie = (SkDisplayMovie*) displayable;
             fTargetMaker = movie->fMovie.fMaker;
         }
-        if (end == NULL)
+        if (end == nullptr)
             break;
         ch = ++end;
     } while (true);
diff --git a/src/animator/SkDisplayType.cpp b/src/animator/SkDisplayType.cpp
index 87ea560..7ee8dab 100644
--- a/src/animator/SkDisplayType.cpp
+++ b/src/animator/SkDisplayType.cpp
@@ -62,7 +62,7 @@
     case SkType_##_class: result = new SkDisplay##_class(); break
 #ifdef SK_DEBUG
     #define CASE_DEBUG_RETURN_NIL(_class) \
-        case SkType_##_class: return NULL
+        case SkType_##_class: return nullptr
 #else
     #define CASE_DEBUG_RETURN_NIL(_class)
 #endif
@@ -71,7 +71,7 @@
 SkDisplayTypes SkDisplayType::gNewTypes = kNumberOfTypes;
 
 SkDisplayable* SkDisplayType::CreateInstance(SkAnimateMaker* maker, SkDisplayTypes type) {
-    SkDisplayable* result = NULL;
+    SkDisplayable* result = nullptr;
     switch (type) {
         // unknown
         CASE_DISPLAY_NEW(Math);
@@ -200,7 +200,7 @@
         default:
             SkExtras** end = maker->fExtras.end();
             for (SkExtras** extraPtr = maker->fExtras.begin(); extraPtr < end; extraPtr++) {
-                if ((result = (*extraPtr)->createInstance(type)) != NULL)
+                if ((result = (*extraPtr)->createInstance(type)) != nullptr)
                     return result;
             }
             SkASSERT(0);
@@ -224,7 +224,7 @@
 
 const SkMemberInfo* SkDisplayType::GetMembers(SkAnimateMaker* maker,
         SkDisplayTypes type, int* infoCountPtr) {
-    const SkMemberInfo* info = NULL;
+    const SkMemberInfo* info = nullptr;
     int infoCount = 0;
     switch (type) {
         // unknown
@@ -356,11 +356,11 @@
             if (maker) {
                 SkExtras** end = maker->fExtras.end();
                 for (SkExtras** extraPtr = maker->fExtras.begin(); extraPtr < end; extraPtr++) {
-                    if ((info = (*extraPtr)->getMembers(type, infoCountPtr)) != NULL)
+                    if ((info = (*extraPtr)->getMembers(type, infoCountPtr)) != nullptr)
                         return info;
                 }
             }
-            return NULL;
+            return nullptr;
     }
     if (infoCountPtr)
         *infoCountPtr = infoCount;
@@ -525,7 +525,7 @@
 SkDisplayTypes SkDisplayType::Find(SkAnimateMaker* maker, const SkMemberInfo* match) {
     for (int index = 0; index < kTypeNamesSize; index++) {
         SkDisplayTypes type = gTypeNames[index].fType;
-        const SkMemberInfo* info = SkDisplayType::GetMembers(maker, type, NULL);
+        const SkMemberInfo* info = SkDisplayType::GetMembers(maker, type, nullptr);
         if (info == match)
             return type;
     }
@@ -538,7 +538,7 @@
         return SkType_Displayable;
     if (base == SkType_Set)
         return SkType_Animate;  // another cheat until we have a lookup table
-    const SkMemberInfo* info = GetMembers(maker, base, NULL); // get info for this type
+    const SkMemberInfo* info = GetMembers(maker, base, nullptr); // get info for this type
     SkASSERT(info);
     if (info->fType != SkType_BaseClassInfo)
         return SkType_Unknown; // if no base, done
@@ -547,7 +547,7 @@
     const SkMemberInfo* inherited = info->getInherited();
     SkDisplayTypes result = (SkDisplayTypes) (SkType_Unknown + 1);
     for (; result <= SkType_Xfermode; result = (SkDisplayTypes) (result + 1)) {
-        const SkMemberInfo* match = GetMembers(maker, result, NULL);
+        const SkMemberInfo* match = GetMembers(maker, result, nullptr);
         if (match == inherited)
             break;
     }
@@ -710,10 +710,10 @@
     SkExtras** end = maker->fExtras.end();
     for (SkExtras** extraPtr = maker->fExtras.begin(); extraPtr < end; extraPtr++) {
         const char* result = (*extraPtr)->getName(type);
-        if (result != NULL)
+        if (result != nullptr)
             return result;
     }
-    return NULL;
+    return nullptr;
 }
 #endif
 
@@ -728,7 +728,7 @@
     }
     for (index = 0; index < kTypeNamesSize; index++) {
         SkDisplayable* test = CreateInstance(maker, gTypeNames[index].fType);
-        if (test == NULL)
+        if (test == nullptr)
             continue;
 #if defined _WIN32 && _MSC_VER >= 1300  && defined _INC_CRTDBG // only on windows, only if using "crtdbg.h"
     // we know that crtdbg puts 0xfdfdfdfd at the end of the block
@@ -744,7 +744,7 @@
     for (index = 0; index < kTypeNamesSize; index++) {
         int infoCount;
         const SkMemberInfo* info = GetMembers(maker, gTypeNames[index].fType, &infoCount);
-        if (info == NULL)
+        if (info == nullptr)
             continue;
 #if SK_USE_CONDENSED_INFO == 0
         for (int inner = 0; inner < infoCount - 1; inner++) {
diff --git a/src/animator/SkDisplayTypes.cpp b/src/animator/SkDisplayTypes.cpp
index 287ca6e..d3d8c68 100644
--- a/src/animator/SkDisplayTypes.cpp
+++ b/src/animator/SkDisplayTypes.cpp
@@ -121,7 +121,7 @@
 void SkDisplayString::executeFunction(SkDisplayable* target, int index,
         SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type,
         SkScriptValue* scriptValue) {
-    if (scriptValue == NULL)
+    if (scriptValue == nullptr)
         return;
     SkASSERT(target == this);
     switch (index) {
diff --git a/src/animator/SkDisplayXMLParser.cpp b/src/animator/SkDisplayXMLParser.cpp
index 3ebf9dc..1c8b67b 100644
--- a/src/animator/SkDisplayXMLParser.cpp
+++ b/src/animator/SkDisplayXMLParser.cpp
@@ -71,7 +71,7 @@
 
 SkDisplayXMLParser::SkDisplayXMLParser(SkAnimateMaker& maker)
     : INHERITED(&maker.fError), fMaker(maker), fInInclude(maker.fInInclude),
-        fInSkia(maker.fInInclude), fCurrDisplayable(NULL)
+        fInSkia(maker.fInInclude), fCurrDisplayable(nullptr)
 {
 }
 
@@ -97,13 +97,13 @@
 bool SkDisplayXMLParser::onAddAttributeLen(const char attrName[], const char attrValue[],
                                         size_t attrValueLen)
 {
-    if (fCurrDisplayable == NULL)    // this signals we should ignore attributes for this element
+    if (fCurrDisplayable == nullptr)    // this signals we should ignore attributes for this element
         return strncmp(attrName, "xmlns", sizeof("xmlns") - 1) != 0;
     SkDisplayable*  displayable = fCurrDisplayable;
     SkDisplayTypes  type = fCurrType;
 
     if (strcmp(attrName, "id") == 0) {
-        if (fMaker.find(attrValue, attrValueLen, NULL)) {
+        if (fMaker.find(attrValue, attrValueLen, nullptr)) {
             fError->setNoun(attrValue, attrValueLen);
             fError->setCode(SkXMLParserError::kDuplicateIDs);
             return true;
@@ -122,22 +122,22 @@
     }
     const char* name = attrName;
     const SkMemberInfo* info = SkDisplayType::GetMember(&fMaker, type, &name);
-    if (info == NULL) {
+    if (info == nullptr) {
         fError->setNoun(name);
         fError->setCode(SkXMLParserError::kUnknownAttributeName);
         return true;
     }
-    if (info->setValue(fMaker, NULL, 0, info->getCount(), displayable, info->getType(), attrValue,
+    if (info->setValue(fMaker, nullptr, 0, info->getCount(), displayable, info->getType(), attrValue,
             attrValueLen))
         return false;
     if (fMaker.fError.hasError()) {
         fError->setNoun(attrValue, attrValueLen);
         return true;
     }
-    SkDisplayable* ref = NULL;
+    SkDisplayable* ref = nullptr;
     if (fMaker.find(attrValue, attrValueLen, &ref) == false) {
         ref = fMaker.createInstance(attrValue, attrValueLen);
-        if (ref == NULL) {
+        if (ref == nullptr) {
             fError->setNoun(attrValue, attrValueLen);
             fError->setCode(SkXMLParserError::kErrorInAttributeValue);
             return true;
@@ -184,7 +184,7 @@
                 const SkMemberInfo* info =
                     SkDisplayType::GetMembers(&fMaker, fParents[parentIndex - 1].fType, &infoCount);
                 const SkMemberInfo* foundInfo;
-                if ((foundInfo = searchContainer(info, infoCount)) != NULL) {
+                if ((foundInfo = searchContainer(info, infoCount)) != nullptr) {
                     parent->setReference(foundInfo, displayable);
         //          if (displayable->isHelper() == false)
                         fMaker.helperAdd(displayable);
@@ -198,7 +198,7 @@
         }
         fParents.remove(parentIndex);
     }
-    fCurrDisplayable = NULL;
+    fCurrDisplayable = nullptr;
     if (fInInclude == false && SK_strcasecmp(elem, "screenplay") == 0) {
         if (fMaker.fInMovie == false) {
             fMaker.fEnableTime = fMaker.getAppTime();
@@ -212,10 +212,10 @@
             debugOut.appendS32(fMaker.fEnableTime - fMaker.fDebugTimeBase);
             SkDebugf("%s\n", debugOut.c_str());
 #endif
-            fMaker.fEvents.doEvent(fMaker, SkDisplayEvent::kOnload, NULL);
+            fMaker.fEvents.doEvent(fMaker, SkDisplayEvent::kOnload, nullptr);
             if (fMaker.fError.hasError())
                 return true;
-            fMaker.fEvents.removeEvent(SkDisplayEvent::kOnload, NULL);
+            fMaker.fEvents.removeEvent(SkDisplayEvent::kOnload, nullptr);
 
         }
         fInSkia = false;
@@ -229,7 +229,7 @@
 }
 
 bool SkDisplayXMLParser::onStartElementLen(const char name[], size_t len) {
-    fCurrDisplayable = NULL; // init so we'll ignore attributes if we exit early
+    fCurrDisplayable = nullptr; // init so we'll ignore attributes if we exit early
 
     if (SK_strncasecmp(name, "screenplay", len) == 0) {
         fInSkia = true;
@@ -241,7 +241,7 @@
         return false;
 
     SkDisplayable* displayable = fMaker.createInstance(name, len);
-    if (displayable == NULL) {
+    if (displayable == nullptr) {
         fError->setNoun(name, len);
         fError->setCode(SkXMLParserError::kUnknownElement);
         return true;
@@ -268,14 +268,14 @@
 
 const SkMemberInfo* SkDisplayXMLParser::searchContainer(const SkMemberInfo* infoBase,
                                                          int infoCount) {
-    const SkMemberInfo* bestDisplayable = NULL;
-    const SkMemberInfo* lastResort = NULL;
+    const SkMemberInfo* bestDisplayable = nullptr;
+    const SkMemberInfo* lastResort = nullptr;
     for (int index = 0; index < infoCount; index++) {
         const SkMemberInfo* info = &infoBase[index];
         if (info->fType == SkType_BaseClassInfo) {
             const SkMemberInfo* inherited = info->getInherited();
             const SkMemberInfo* result = searchContainer(inherited, info->fCount);
-            if (result != NULL)
+            if (result != nullptr)
                 return result;
             continue;
         }
@@ -312,5 +312,5 @@
         return bestDisplayable;
     if (lastResort)
         return lastResort;
-    return NULL;
+    return nullptr;
 }
diff --git a/src/animator/SkDisplayable.cpp b/src/animator/SkDisplayable.cpp
index 52532fe..dc3cecf 100644
--- a/src/animator/SkDisplayable.cpp
+++ b/src/animator/SkDisplayable.cpp
@@ -64,14 +64,14 @@
 }
 
 SkDisplayable* SkDisplayable::contains(const SkString& ) {
-    return NULL;
+    return nullptr;
 }
 
 SkDisplayable* SkDisplayable::deepCopy(SkAnimateMaker* maker) {
     SkDisplayTypes type = getType();
     if (type == SkType_Unknown) {
         SkASSERT(0);
-        return NULL;
+        return nullptr;
     }
     SkDisplayable* copy = SkDisplayType::CreateInstance(maker, type);
     int index = -1;
@@ -79,7 +79,7 @@
     const SkMemberInfo* info;
     do {
         info = copy->getMember(++index);
-        if (info == NULL)
+        if (info == nullptr)
             break;
         if (info->fType == SkType_MemberProperty) {
             SkScriptValue value;
@@ -93,7 +93,7 @@
         if (info->fType == SkType_Array) {
             SkTDOperandArray* array = (SkTDOperandArray*) info->memberData(this);
             int arrayCount;
-            if (array == NULL || (arrayCount = array->count()) == 0)
+            if (array == nullptr || (arrayCount = array->count()) == 0)
                 continue;
             SkTDOperandArray* copyArray = (SkTDOperandArray*) info->memberData(copy);
             copyArray->setCount(arrayCount);
@@ -110,7 +110,7 @@
         }
         if (SkDisplayType::IsDisplayable(maker, info->fType)) {
             SkDisplayable** displayable = (SkDisplayable**) info->memberData(this);
-            if (*displayable == NULL || *displayable == (SkDisplayable*) -1)
+            if (*displayable == nullptr || *displayable == (SkDisplayable*) -1)
                 continue;
             SkDisplayable* deeper = (*displayable)->deepCopy(maker);
             info->setMemberData(copy, deeper, sizeof(deeper));
@@ -160,7 +160,7 @@
     SkOperand blankValues[2];
     do {
         info = this->getMember(++index);
-        if (NULL == info) {
+        if (nullptr == info) {
             //SkDebugf("\n");
             break;
         }
@@ -185,7 +185,7 @@
         if (info->fType == SkType_Array) {
             SkTDOperandArray* array = (SkTDOperandArray*) info->memberData(this);
             int arrayCount;
-            if (array == NULL || (arrayCount = array->count()) == 0)
+            if (array == nullptr || (arrayCount = array->count()) == 0)
                 continue;
             SkDisplayTypes elementType;
             if (type == SkType_Array) {
@@ -259,12 +259,12 @@
     SkDisplayList::fIndent += 4;
     do {
         info = this->getMember(++index);
-        if (NULL == info) {
+        if (nullptr == info) {
             break;
         }
         if (SkDisplayType::IsDisplayable(maker, info->fType)) {
             SkDisplayable** displayable = (SkDisplayable**) info->memberData(this);
-            if (*displayable == NULL || *displayable == (SkDisplayable*) -1)
+            if (*displayable == nullptr || *displayable == (SkDisplayable*) -1)
                 continue;
             if (closedAngle == false) {
                 SkDebugf(">\n");
@@ -422,21 +422,21 @@
 }
 
 const SkFunctionParamType* SkDisplayable::getFunctionsParameters() {
-    return NULL;
+    return nullptr;
 }
 
 const SkMemberInfo* SkDisplayable::getMember(int index) {
-    return NULL;
+    return nullptr;
 }
 
 const SkMemberInfo* SkDisplayable::getMember(const char name[]) {
-    return NULL;
+    return nullptr;
 }
 
 const SkFunctionParamType* SkDisplayable::getParameters(const SkMemberInfo* info,
         int* paramCount) {
     const SkFunctionParamType* params = getFunctionsParameters();
-    SkASSERT(params != NULL);
+    SkASSERT(params != nullptr);
     int funcIndex = info->functionIndex();
     // !!! eventually break traversing params into an external function (maybe this whole function)
     int index = funcIndex;
@@ -456,7 +456,7 @@
 }
 
 SkDisplayable* SkDisplayable::getParent() const {
-    return NULL;
+    return nullptr;
 }
 
 bool SkDisplayable::getProperty(int index, SkScriptValue* ) const {
@@ -484,7 +484,7 @@
 void SkDisplayable::onEndElement(SkAnimateMaker& ) {}
 
 const SkMemberInfo* SkDisplayable::preferredChild(SkDisplayTypes type) {
-    return NULL;
+    return nullptr;
 }
 
 bool SkDisplayable::resolveIDs(SkAnimateMaker& maker, SkDisplayable* original, SkApply* apply) {
diff --git a/src/animator/SkDraw3D.cpp b/src/animator/SkDraw3D.cpp
index 9e1c2cc..e7e92df 100644
--- a/src/animator/SkDraw3D.cpp
+++ b/src/animator/SkDraw3D.cpp
@@ -44,7 +44,7 @@
 
 DEFINE_GET_MEMBER(Sk3D_Camera);
 
-Sk3D_Camera::Sk3D_Camera() : hackWidth(0), hackHeight(0), patch(NULL) {
+Sk3D_Camera::Sk3D_Camera() : hackWidth(0), hackHeight(0), patch(nullptr) {
 }
 
 Sk3D_Camera::~Sk3D_Camera() {
diff --git a/src/animator/SkDrawBitmap.cpp b/src/animator/SkDrawBitmap.cpp
index f41c152..ce7464d 100644
--- a/src/animator/SkDrawBitmap.cpp
+++ b/src/animator/SkDrawBitmap.cpp
@@ -130,8 +130,8 @@
 
 DEFINE_GET_MEMBER(SkImageBaseBitmap);
 
-SkImageBaseBitmap::SkImageBaseBitmap() : fDirty(true), fUriBase(NULL) {
-    base64.fData = NULL;
+SkImageBaseBitmap::SkImageBaseBitmap() : fDirty(true), fUriBase(nullptr) {
+    base64.fData = nullptr;
     base64.fLength = 0;
 }
 
diff --git a/src/animator/SkDrawBlur.cpp b/src/animator/SkDrawBlur.cpp
index 36d6452..14f34ac 100644
--- a/src/animator/SkDrawBlur.cpp
+++ b/src/animator/SkDrawBlur.cpp
@@ -27,7 +27,7 @@
 
 SkMaskFilter* SkDrawBlur::getMaskFilter() {
     if (fSigma <= 0) {
-        return NULL;
+        return nullptr;
     }
     return SkBlurMaskFilter::Create((SkBlurStyle)fBlurStyle, fSigma);
 }
diff --git a/src/animator/SkDrawClip.cpp b/src/animator/SkDrawClip.cpp
index e26a1bf..bca816f 100644
--- a/src/animator/SkDrawClip.cpp
+++ b/src/animator/SkDrawClip.cpp
@@ -25,14 +25,14 @@
 
 DEFINE_GET_MEMBER(SkDrawClip);
 
-SkDrawClip::SkDrawClip() : rect(NULL), path(NULL) {
+SkDrawClip::SkDrawClip() : rect(nullptr), path(nullptr) {
 }
 
 bool SkDrawClip::draw(SkAnimateMaker& maker ) {
-    if (rect != NULL)
+    if (rect != nullptr)
         maker.fCanvas->clipRect(rect->fRect);
     else {
-        SkASSERT(path != NULL);
+        SkASSERT(path != nullptr);
         maker.fCanvas->clipPath(path->fPath);
     }
     return false;
diff --git a/src/animator/SkDrawColor.cpp b/src/animator/SkDrawColor.cpp
index d86a2e9..c2d0dae 100644
--- a/src/animator/SkDrawColor.cpp
+++ b/src/animator/SkDrawColor.cpp
@@ -126,7 +126,7 @@
 }
 
 bool SkDrawColor::add() {
-    if (fPaint->color != NULL)
+    if (fPaint->color != nullptr)
         return true; // error (probably color in paint as attribute as well)
     fPaint->color = this;
     fPaint->fOwnsColor = true;
@@ -211,7 +211,7 @@
 }
 
 bool SkDrawColor::setParent(SkDisplayable* parent) {
-    SkASSERT(parent != NULL);
+    SkASSERT(parent != nullptr);
     if (parent->getType() == SkType_DrawLinearGradient || parent->getType() == SkType_DrawRadialGradient)
         return false;
     if (parent->isPaint() == false)
diff --git a/src/animator/SkDrawDash.cpp b/src/animator/SkDrawDash.cpp
index cfef303..d47db41 100644
--- a/src/animator/SkDrawDash.cpp
+++ b/src/animator/SkDrawDash.cpp
@@ -30,6 +30,6 @@
 SkPathEffect* SkDash::getPathEffect() {
     int count = intervals.count();
     if (count == 0)
-        return NULL;
+        return nullptr;
     return SkDashPathEffect::Create(intervals.begin(), count, phase);
 }
diff --git a/src/animator/SkDrawDiscrete.cpp b/src/animator/SkDrawDiscrete.cpp
index 9376435..1491783 100644
--- a/src/animator/SkDrawDiscrete.cpp
+++ b/src/animator/SkDrawDiscrete.cpp
@@ -28,7 +28,7 @@
 
 SkPathEffect* SkDiscrete::getPathEffect() {
     if (deviation <= 0 || segLength <= 0)
-        return NULL;
+        return nullptr;
     else
         return SkDiscretePathEffect::Create(segLength, deviation);
 }
diff --git a/src/animator/SkDrawEmboss.cpp b/src/animator/SkDrawEmboss.cpp
index 70a2826..a1cd4dc 100644
--- a/src/animator/SkDrawEmboss.cpp
+++ b/src/animator/SkDrawEmboss.cpp
@@ -28,7 +28,7 @@
 
 SkMaskFilter* SkDrawEmboss::getMaskFilter() {
     if (fSigma < 0 || fDirection.count() !=3)
-        return NULL;
+        return nullptr;
     return SkBlurMaskFilter::CreateEmboss(fSigma, fDirection.begin(),
                                           fAmbient, fSpecular);
 }
diff --git a/src/animator/SkDrawExtraPathEffect.cpp b/src/animator/SkDrawExtraPathEffect.cpp
index 68b5006..4fa76c6 100644
--- a/src/animator/SkDrawExtraPathEffect.cpp
+++ b/src/animator/SkDrawExtraPathEffect.cpp
@@ -90,12 +90,12 @@
     }
 
     // For serialization.  This will never be called.
-    Factory getFactory() const override { sk_throw(); return NULL; }
+    Factory getFactory() const override { sk_throw(); return nullptr; }
 
 protected:
     SkScalar begin(SkScalar contourLength) const override {
         SkScriptValue value;
-        SkAnimatorScript engine(*fMaker, NULL, SkType_Float);
+        SkAnimatorScript engine(*fMaker, nullptr, SkType_Float);
         engine.propertyCallBack(GetContourLength, &contourLength);
         value.fOperand.fScalar = 0;
         engine.evaluate(fDraw->phase.c_str(), &value, SkType_Float);
@@ -104,7 +104,7 @@
 
     SkScalar next(SkPath* dst, SkScalar distance, SkPathMeasure&) const override {
         fMaker->setExtraPropertyCallBack(fDraw->fType, GetDistance, &distance);
-        SkDrawPath* drawPath = NULL;
+        SkDrawPath* drawPath = nullptr;
         if (fDraw->addPath->isPath()) {
             drawPath = (SkDrawPath*) fDraw->addPath;
         } else {
@@ -132,7 +132,7 @@
             }
         }
         SkScalar result = 0;
-        SkAnimatorScript::EvaluateFloat(*fMaker, NULL, fDraw->spacing.c_str(), &result);
+        SkAnimatorScript::EvaluateFloat(*fMaker, nullptr, fDraw->spacing.c_str(), &result);
         if (drawPath)
             dst->addPath(drawPath->getPath(), m);
         fMaker->clearExtraPropertyCallBack(fDraw->fType);
@@ -185,7 +185,7 @@
 DEFINE_GET_MEMBER(SkDrawShapePathEffect);
 
 SkDrawShapePathEffect::SkDrawShapePathEffect() :
-    addPath(NULL), addMatrix(NULL), path(NULL), fPathEffect(NULL) {
+    addPath(nullptr), addMatrix(nullptr), path(nullptr), fPathEffect(nullptr) {
 }
 
 SkDrawShapePathEffect::~SkDrawShapePathEffect() {
@@ -223,7 +223,7 @@
 }
 
 void SkDrawShape1DPathEffect::onEndElement(SkAnimateMaker& maker) {
-    if (addPath == NULL || (addPath->isPath() == false && addPath->isApply() == false))
+    if (addPath == nullptr || (addPath->isPath() == false && addPath->isApply() == false))
         maker.setErrorCode(SkDisplayXMLParserError::kUnknownError); // !!! add error
     else
         fPathEffect = new SkShape1DPathEffect(this, &maker);
@@ -238,7 +238,7 @@
     }
 
     // For serialization.  This will never be called.
-    Factory getFactory() const override { sk_throw(); return NULL; }
+    Factory getFactory() const override { sk_throw(); return nullptr; }
 
 protected:
     void begin(const SkIRect& uvBounds, SkPath*) const override {
@@ -270,7 +270,7 @@
             apply->interpolate(*fMaker, v);
             drawPath = (SkDrawPath*) apply->getScope();
         }
-        if (drawPath == NULL)
+        if (drawPath == nullptr)
             goto clearCallBack;
         if (fDraw->matrix) {
             SkDrawMatrix* matrix;
@@ -341,8 +341,8 @@
 }
 
 void SkDrawShape2DPathEffect::onEndElement(SkAnimateMaker& maker) {
-    if (addPath == NULL || (addPath->isPath() == false && addPath->isApply() == false) ||
-            matrix == NULL)
+    if (addPath == nullptr || (addPath->isPath() == false && addPath->isApply() == false) ||
+            matrix == nullptr)
         maker.setErrorCode(SkDisplayXMLParserError::kUnknownError); // !!! add error
     else
         fPathEffect = new SkShape2DPathEffect(this, &maker, matrix->getMatrix());
@@ -362,7 +362,7 @@
 DEFINE_GET_MEMBER(SkDrawComposePathEffect);
 
 SkDrawComposePathEffect::SkDrawComposePathEffect(SkDisplayTypes type) : fType(type),
-    effect1(NULL), effect2(NULL) {
+    effect1(nullptr), effect2(nullptr) {
 }
 
 SkDrawComposePathEffect::~SkDrawComposePathEffect() {
@@ -371,7 +371,7 @@
 }
 
 bool SkDrawComposePathEffect::addChild(SkAnimateMaker& , SkDisplayable* child) {
-    if (effect1 == NULL)
+    if (effect1 == nullptr)
         effect1 = (SkDrawPathEffect*) child;
     else
         effect2 = (SkDrawPathEffect*) child;
@@ -433,7 +433,7 @@
     }
 
     virtual SkDisplayable* createInstance(SkDisplayTypes type) {
-        SkDisplayable* result = NULL;
+        SkDisplayable* result = nullptr;
         if (skDrawShape1DPathEffectType == type)
             result = new SkDrawShape1DPathEffect(type);
         else if (skDrawShape2DPathEffectType == type)
@@ -454,7 +454,7 @@
 
 #if SK_USE_CONDENSED_INFO == 0
     virtual const SkMemberInfo* getMembers(SkDisplayTypes type, int* infoCountPtr) {
-        const SkMemberInfo* info = NULL;
+        const SkMemberInfo* info = nullptr;
         int infoCount = 0;
         if (skDrawShape1DPathEffectType == type) {
             info = SkDrawShape1DPathEffect::fInfo;
@@ -485,12 +485,12 @@
             return kDrawComposePathEffectName;
         else if (skDrawCornerPathEffectType == type)
             return kDrawCornerPathEffectName;
-        return NULL;
+        return nullptr;
     }
 #endif
 
     virtual SkDisplayTypes getType(const char name[], size_t len ) {
-        SkDisplayTypes* type = NULL;
+        SkDisplayTypes* type = nullptr;
         if (SK_LITERAL_STR_EQUAL(kDrawShape1DPathEffectName, name, len))
             type = &skDrawShape1DPathEffectType;
         else if (SK_LITERAL_STR_EQUAL(kDrawShape2DPathEffectName, name, len))
@@ -521,5 +521,5 @@
 ////////////////
 
 
-SkExtras::SkExtras() : fExtraCallBack(NULL), fExtraStorage(NULL) {
+SkExtras::SkExtras() : fExtraCallBack(nullptr), fExtraStorage(nullptr) {
 }
diff --git a/src/animator/SkDrawGradient.cpp b/src/animator/SkDrawGradient.cpp
index 70e5e44..4aecbc3 100644
--- a/src/animator/SkDrawGradient.cpp
+++ b/src/animator/SkDrawGradient.cpp
@@ -127,7 +127,7 @@
 
 SkShader* SkDrawLinearGradient::getShader() {
     if (addPrelude() == 0 || points.count() != 4)
-        return NULL;
+        return nullptr;
     SkShader* shader = SkGradientShader::CreateLinear((SkPoint*)points.begin(),
         fColors.begin(), offsets.begin(), fColors.count(), (SkShader::TileMode) tileMode,
         0, getMatrix());
@@ -162,7 +162,7 @@
 
 SkShader* SkDrawRadialGradient::getShader() {
     if (addPrelude() == 0)
-        return NULL;
+        return nullptr;
     SkShader* shader = SkGradientShader::CreateRadial(center,
         radius, fColors.begin(), offsets.begin(), fColors.count(), (SkShader::TileMode) tileMode,
         0, getMatrix());
diff --git a/src/animator/SkDrawGroup.cpp b/src/animator/SkDrawGroup.cpp
index b1b7f0a..76807bf 100644
--- a/src/animator/SkDrawGroup.cpp
+++ b/src/animator/SkDrawGroup.cpp
@@ -28,7 +28,7 @@
 
 DEFINE_GET_MEMBER(SkGroup);
 
-SkGroup::SkGroup() : fParentList(NULL), fOriginal(NULL) {
+SkGroup::SkGroup() : fParentList(nullptr), fOriginal(nullptr) {
 }
 
 SkGroup::~SkGroup() {
@@ -55,7 +55,7 @@
     *fChildren.append() = (SkADrawable*) child;
     if (child->isGroup()) {
         SkGroup* groupie = (SkGroup*) child;
-        SkASSERT(groupie->fParentList == NULL);
+        SkASSERT(groupie->fParentList == nullptr);
         groupie->fParentList = &fChildren;
     }
     return true;
diff --git a/src/animator/SkDrawGroup.h b/src/animator/SkDrawGroup.h
index 83e6771..f1b7bb6 100644
--- a/src/animator/SkDrawGroup.h
+++ b/src/animator/SkDrawGroup.h
@@ -38,7 +38,7 @@
     SkGroup* getOriginal() { return fOriginal; }
     bool hasEnable() const override;
     void initialize() override;
-    SkBool isACopy() { return fOriginal != NULL; }
+    SkBool isACopy() { return fOriginal != nullptr; }
     void markCopyClear(int index);
     void markCopySet(int index);
     void markCopySize(int index);
diff --git a/src/animator/SkDrawPaint.cpp b/src/animator/SkDrawPaint.cpp
index f5d3388..d1af4f4 100644
--- a/src/animator/SkDrawPaint.cpp
+++ b/src/animator/SkDrawPaint.cpp
@@ -64,7 +64,7 @@
 
 DEFINE_GET_MEMBER(SkDrawPaint);
 
-SkDrawPaint::SkDrawPaint() : antiAlias(-1), color(NULL), fakeBold(-1), filterBitmap(-1),
+SkDrawPaint::SkDrawPaint() : antiAlias(-1), color(nullptr), fakeBold(-1), filterBitmap(-1),
     linearText(-1), maskFilter((SkDrawMaskFilter*) -1), pathEffect((SkDrawPathEffect*) -1),
     shader((SkDrawShader*) -1), strikeThru(-1), stroke(-1),
     strokeCap((SkPaint::Cap) -1), strokeJoin((SkPaint::Join) -1), strokeMiter(SK_ScalarNaN),
@@ -98,7 +98,7 @@
 
 SkDisplayable* SkDrawPaint::deepCopy(SkAnimateMaker* maker) {
     SkDrawColor* tempColor = color;
-    color = NULL;
+    color = nullptr;
     SkDrawPaint* copy = (SkDrawPaint*) INHERITED::deepCopy(maker);
     color = tempColor;
     tempColor = (SkDrawColor*) color->deepCopy(maker);
@@ -148,7 +148,7 @@
 void SkDrawPaint::executeFunction(SkDisplayable* target, int index,
         SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type,
         SkScriptValue* scriptValue) {
-        if (scriptValue == NULL)
+        if (scriptValue == nullptr)
             return;
     SkASSERT(target == this);
     switch (index) {
@@ -213,7 +213,7 @@
 void SkDrawPaint::setupPaint(SkPaint* paint) const {
     if (antiAlias != -1)
         paint->setAntiAlias(SkToBool(antiAlias));
-    if (color != NULL)
+    if (color != nullptr)
         paint->setColor(color->getColor());
     if (fakeBold != -1)
         paint->setFakeBoldText(SkToBool(fakeBold));
@@ -226,16 +226,16 @@
         paint->setStyle((SkPaint::Style) style);
     if (linearText != -1)
         paint->setLinearText(SkToBool(linearText));
-    if (maskFilter == NULL)
-        paint->setMaskFilter(NULL);
+    if (maskFilter == nullptr)
+        paint->setMaskFilter(nullptr);
     else if (maskFilter != (SkDrawMaskFilter*) -1)
         SkSafeUnref(paint->setMaskFilter(maskFilter->getMaskFilter()));
-    if (pathEffect == NULL)
-        paint->setPathEffect(NULL);
+    if (pathEffect == nullptr)
+        paint->setPathEffect(nullptr);
     else if (pathEffect != (SkDrawPathEffect*) -1)
         SkSafeUnref(paint->setPathEffect(pathEffect->getPathEffect()));
-    if (shader == NULL)
-        paint->setShader(NULL);
+    if (shader == nullptr)
+        paint->setShader(nullptr);
     else if (shader != (SkDrawShader*) -1)
         SkSafeUnref(paint->setShader(shader->getShader()));
     if (strikeThru != -1)
@@ -256,8 +256,8 @@
         paint->setTextSize(textSize);
     if (SkScalarIsNaN(textSkewX) == false)
         paint->setTextSkewX(textSkewX);
-    if (typeface == NULL)
-        paint->setTypeface(NULL);
+    if (typeface == nullptr)
+        paint->setTypeface(nullptr);
     else if (typeface != (SkDrawTypeface*) -1)
         SkSafeUnref(paint->setTypeface(typeface->getTypeface()));
     if (underline != -1)
diff --git a/src/animator/SkDrawPath.cpp b/src/animator/SkDrawPath.cpp
index f62f7c0..c4c6f5c 100644
--- a/src/animator/SkDrawPath.cpp
+++ b/src/animator/SkDrawPath.cpp
@@ -34,7 +34,7 @@
 
 SkDrawPath::SkDrawPath()
 {
-    fParent = NULL;
+    fParent = nullptr;
     fLength = SK_ScalarNaN;
     fChildHasID = false;
     fDirty = false;
diff --git a/src/animator/SkDrawRectangle.cpp b/src/animator/SkDrawRectangle.cpp
index c3fb7ff..a89b67c 100644
--- a/src/animator/SkDrawRectangle.cpp
+++ b/src/animator/SkDrawRectangle.cpp
@@ -36,7 +36,7 @@
 
 DEFINE_GET_MEMBER(SkDrawRect);
 
-SkDrawRect::SkDrawRect() : fParent(NULL) {
+SkDrawRect::SkDrawRect() : fParent(nullptr) {
     fRect.setEmpty();
 }
 
diff --git a/src/animator/SkDrawSaveLayer.cpp b/src/animator/SkDrawSaveLayer.cpp
index 9623c90..c9a4d9f 100644
--- a/src/animator/SkDrawSaveLayer.cpp
+++ b/src/animator/SkDrawSaveLayer.cpp
@@ -24,7 +24,7 @@
 
 DEFINE_GET_MEMBER(SkSaveLayer);
 
-SkSaveLayer::SkSaveLayer() : paint(NULL), bounds(NULL) {
+SkSaveLayer::SkSaveLayer() : paint(nullptr), bounds(nullptr) {
 }
 
 SkSaveLayer::~SkSaveLayer(){
diff --git a/src/animator/SkDrawShader.cpp b/src/animator/SkDrawShader.cpp
index 29e5251..9e3becc 100644
--- a/src/animator/SkDrawShader.cpp
+++ b/src/animator/SkDrawShader.cpp
@@ -23,7 +23,7 @@
 
 DEFINE_GET_MEMBER(SkDrawShader);
 
-SkDrawShader::SkDrawShader() : matrix(NULL),
+SkDrawShader::SkDrawShader() : matrix(nullptr),
     tileMode(SkShader::kClamp_TileMode) {
 }
 
@@ -36,7 +36,7 @@
 }
 
 SkMatrix* SkDrawShader::getMatrix() {
-    return matrix ? &matrix->getMatrix() : NULL;
+    return matrix ? &matrix->getMatrix() : nullptr;
 }
 
 #if SK_USE_CONDENSED_INFO == 0
@@ -51,7 +51,7 @@
 
 DEFINE_GET_MEMBER(SkDrawBitmapShader);
 
-SkDrawBitmapShader::SkDrawBitmapShader() : filterBitmap(-1), image(NULL) {}
+SkDrawBitmapShader::SkDrawBitmapShader() : filterBitmap(-1), image(nullptr) {}
 
 bool SkDrawBitmapShader::add() {
     if (fPaint->shader != (SkDrawShader*) -1)
@@ -62,8 +62,8 @@
 }
 
 SkShader* SkDrawBitmapShader::getShader() {
-    if (image == NULL)
-        return NULL;
+    if (image == nullptr)
+        return nullptr;
 
     // note: bitmap shader now supports independent tile modes for X and Y
     // we pass the same to both, but later we should extend this flexibility
diff --git a/src/animator/SkDrawTo.cpp b/src/animator/SkDrawTo.cpp
index ef084d1..7ae9ca5 100644
--- a/src/animator/SkDrawTo.cpp
+++ b/src/animator/SkDrawTo.cpp
@@ -23,7 +23,7 @@
 
 DEFINE_GET_MEMBER(SkDrawTo);
 
-SkDrawTo::SkDrawTo() : drawOnce(false), use(NULL), fDrawnOnce(false) {
+SkDrawTo::SkDrawTo() : drawOnce(false), use(nullptr), fDrawnOnce(false) {
 }
 
 #if 0
diff --git a/src/animator/SkDump.cpp b/src/animator/SkDump.cpp
index 9f297e9..346b30d 100644
--- a/src/animator/SkDump.cpp
+++ b/src/animator/SkDump.cpp
@@ -56,7 +56,7 @@
 }
 
 bool SkDump::evaluate(SkAnimateMaker &maker) {
-    SkAnimatorScript scriptEngine(maker, NULL, SkType_Int);
+    SkAnimatorScript scriptEngine(maker, nullptr, SkType_Int);
     SkScriptValue value;
     const char* cScript = script.c_str();
     bool success = scriptEngine.evaluateScript(&cScript, &value);
@@ -91,7 +91,7 @@
     const char* str  = map.fValues;
     while (--index >= 0) {
         str = strchr(str, '|');
-        if (str == NULL) {
+        if (str == nullptr) {
             result->reset();
             result->appendS32(badEnum);
             return;
@@ -99,7 +99,7 @@
         str += 1;
     }
     const char* end = strchr(str, '|');
-    if (end == NULL)
+    if (end == nullptr)
         end = str + strlen(str);
     result->set(str, end - str);
 }
diff --git a/src/animator/SkGetCondensedInfo.cpp b/src/animator/SkGetCondensedInfo.cpp
index f2471bb..de6fa18 100644
--- a/src/animator/SkGetCondensedInfo.cpp
+++ b/src/animator/SkGetCondensedInfo.cpp
@@ -53,7 +53,7 @@
 const SkMemberInfo* SkDisplayType::GetMembers(SkAnimateMaker* , SkDisplayTypes type, int* infoCountPtr) {
     int lookup = _searchByType(type);
     if (lookup < 0)
-        return NULL;
+        return nullptr;
     if (infoCountPtr)
         *infoCountPtr = gInfoCounts[lookup];
     return gInfoTables[lookup];
@@ -72,10 +72,10 @@
     if (info->fType == SkType_BaseClassInfo) {
         int baseTypeLookup = info->fOffset;
         const SkMemberInfo* result = _lookup(baseTypeLookup, matchPtr);
-        if (result != NULL)
+        if (result != nullptr)
             return result;
         if (--count == 0)
-            return NULL;
+            return nullptr;
         info++;
     }
     SkASSERT(info->fType != SkType_BaseClassInfo);
@@ -83,7 +83,7 @@
     const char* strings = gInfoNames[lookup];
     int index = _searchByName(&info->fName, count, strings, match);
     if (index < 0)
-        return NULL;
+        return nullptr;
     return &info[index];
 }
 
@@ -93,16 +93,16 @@
     if (info->fType == SkType_BaseClassInfo) {
         int baseTypeLookup = info->fOffset;
         const SkMemberInfo* result = Find(baseTypeLookup, index);
-        if (result != NULL)
+        if (result != nullptr)
             return result;
         if (--count == 0)
-            return NULL;
+            return nullptr;
         info++;
     }
     SkASSERT(info->fType != SkType_BaseClassInfo);
     if (*index >= count) {
         *index -= count;
-        return NULL;
+        return nullptr;
     }
     return &info[index];
 }
diff --git a/src/animator/SkMatrixParts.cpp b/src/animator/SkMatrixParts.cpp
index a2f3a9a..c607f25 100644
--- a/src/animator/SkMatrixParts.cpp
+++ b/src/animator/SkMatrixParts.cpp
@@ -13,7 +13,7 @@
 #include "SkDrawRectangle.h"
 #include "SkDrawPath.h"
 
-SkMatrixPart::SkMatrixPart() : fMatrix(NULL) {
+SkMatrixPart::SkMatrixPart() : fMatrix(nullptr) {
 }
 
 void SkMatrixPart::dirty() {
@@ -25,7 +25,7 @@
 }
 
 bool SkMatrixPart::setParent(SkDisplayable* parent) {
-    SkASSERT(parent != NULL);
+    SkASSERT(parent != nullptr);
     if (parent->isMatrix() == false)
         return true;
     fMatrix = (SkDrawMatrix*) parent;
@@ -131,14 +131,14 @@
 DEFINE_GET_MEMBER(SkFromPath);
 
 SkFromPath::SkFromPath() :
-    mode(0), offset(0), path(NULL) {
+    mode(0), offset(0), path(nullptr) {
 }
 
 SkFromPath::~SkFromPath() {
 }
 
 bool SkFromPath::add() {
-    if (path == NULL)
+    if (path == nullptr)
         return true;
     static const uint8_t gFlags[] = {
         SkPathMeasure::kGetPosAndTan_MatrixFlag,    // normal
@@ -167,14 +167,14 @@
 DEFINE_GET_MEMBER(SkRectToRect);
 
 SkRectToRect::SkRectToRect() :
-    source(NULL), destination(NULL) {
+    source(nullptr), destination(nullptr) {
 }
 
 SkRectToRect::~SkRectToRect() {
 }
 
 bool SkRectToRect::add() {
-    if (source == NULL || destination == NULL)
+    if (source == nullptr || destination == nullptr)
         return true;
     SkMatrix temp;
     temp.setRectToRect(source->fRect, destination->fRect,
@@ -208,10 +208,10 @@
 #endif
 
 const SkMemberInfo* SkRectToRect::preferredChild(SkDisplayTypes ) {
-    if (source == NULL)
+    if (source == nullptr)
         return getMember("source"); // !!! cwap! need to refer to member through enum like kScope instead
     else {
-        SkASSERT(destination == NULL);
+        SkASSERT(destination == nullptr);
         return getMember("destination");
     }
 }
@@ -228,7 +228,7 @@
 
 DEFINE_GET_MEMBER(SkPolyToPoly);
 
-SkPolyToPoly::SkPolyToPoly() : source(NULL), destination(NULL) {
+SkPolyToPoly::SkPolyToPoly() : source(nullptr), destination(nullptr) {
 }
 
 SkPolyToPoly::~SkPolyToPoly() {
@@ -283,10 +283,10 @@
 }
 
 const SkMemberInfo* SkPolyToPoly::preferredChild(SkDisplayTypes ) {
-    if (source == NULL)
+    if (source == nullptr)
         return getMember("source"); // !!! cwap! need to refer to member through enum like kScope instead
     else {
-        SkASSERT(destination == NULL);
+        SkASSERT(destination == nullptr);
         return getMember("destination");
     }
 }
diff --git a/src/animator/SkMemberInfo.cpp b/src/animator/SkMemberInfo.cpp
index 5cdc8d0..ea4c257 100644
--- a/src/animator/SkMemberInfo.cpp
+++ b/src/animator/SkMemberInfo.cpp
@@ -105,7 +105,7 @@
             break;
         case SkType_Array: {
             SkDisplayTypes type;
-            if (displayable == NULL)
+            if (displayable == nullptr)
                 return sizeof(int);
             if (displayable->getType() == SkType_Array) {
                 SkDisplayArray* dispArray = (SkDisplayArray*) displayable;
@@ -191,9 +191,9 @@
     SkDisplayTypes type = getType();
     SkAnimatorScript engine(maker, displayable, type);
     if (arrayStorage)
-        displayable = NULL;
+        displayable = nullptr;
     bool success = true;
-    void* untypedStorage = NULL;
+    void* untypedStorage = nullptr;
     if (displayable && fType != SkType_MemberProperty && fType != SkType_MemberFunction)
         untypedStorage = (SkTDOperandArray*) memberData(displayable);
 
@@ -201,7 +201,7 @@
         // for both SpiderMonkey and SkiaScript, substitute any #xyz or #xxyyzz first
             // it's enough to expand the colors into 0xFFxxyyzz
         const char* poundPos;
-        while ((poundPos = strchr(valueStr.c_str(), '#')) != NULL) {
+        while ((poundPos = strchr(valueStr.c_str(), '#')) != nullptr) {
             size_t offset = poundPos - valueStr.c_str();
             if (valueStr.size() - offset < 4)
                 break;
@@ -258,7 +258,7 @@
             SkASSERT(success);
             if (scriptValue.fType == SkType_Displayable) {
                 if (type == SkType_String) {
-                    const char* charPtr = NULL;
+                    const char* charPtr = nullptr;
                     maker.findKey(scriptValue.fOperand.fDisplayable, &charPtr);
                     scriptValue.fOperand.fString = new SkString(charPtr);
                     scriptValue.fType = SkType_String;
@@ -358,7 +358,7 @@
     SkScriptValue& scriptValue) const
 {
     SkOperand* storage = untypedStorage ? (SkOperand*) untypedStorage : arrayStorage ?
-        arrayStorage->begin() : NULL;
+        arrayStorage->begin() : nullptr;
     if (storage)
         storage += storageOffset;
     SkDisplayTypes type = getType();
@@ -386,7 +386,7 @@
     } else if (fType == SkType_MemberFunction) {
         SkASSERT(scriptValue.fType == SkType_Array);
         if (displayable)
-            displayable->executeFunction(displayable, this, scriptValue.fOperand.fArray, NULL);
+            displayable->executeFunction(displayable, this, scriptValue.fOperand.fArray, nullptr);
         else {
             int count = scriptValue.fOperand.fArray->count();
     //      SkASSERT(maxStorage == 0 || count == maxStorage);
@@ -426,7 +426,7 @@
         SkTypedArray* array = scriptValue.fOperand.fArray;
         SkASSERT(scriptValue.fType == SkType_Int || scriptValue.fType == SkType_ARGB ||
             scriptValue.fType == SkType_Array);
-        SkASSERT(scriptValue.fType != SkType_Array || (array != NULL &&
+        SkASSERT(scriptValue.fType != SkType_Array || (array != nullptr &&
             array->getType() == SkType_Int));
         int numberOfColors = scriptValue.fType == SkType_Array ? array->count() : 1;
         int numberOfComponents = numberOfColors * 4;
@@ -442,7 +442,7 @@
             storage[3].fScalar = SkIntToScalar(SkColorGetB(color));
             storage += 4;
         }
-    } else if (SkDisplayType::IsStruct(NULL /* !!! maker*/, type)) {
+    } else if (SkDisplayType::IsStruct(nullptr /* !!! maker*/, type)) {
         if (scriptValue.fType != SkType_Array)
             return true;    // error
         SkASSERT(sizeof(SkScalar) == sizeof(SkOperand)); // !!! no 64 bit pointer support yet
@@ -486,17 +486,17 @@
     if (info->fType == SkType_BaseClassInfo) {
         const SkMemberInfo* inherited = (SkMemberInfo*) info->fName;
         const SkMemberInfo* result = SkMemberInfo::Find(inherited, info->fCount, index);
-        if (result != NULL)
+        if (result != nullptr)
             return result;
         if (--count == 0)
-            return NULL;
+            return nullptr;
         info++;
     }
     SkASSERT(info->fName);
     SkASSERT(info->fType != SkType_BaseClassInfo);
     if (*index >= count) {
         *index -= count;
-        return NULL;
+        return nullptr;
     }
     return &info[*index];
 }
@@ -507,17 +507,17 @@
     if (info->fType == SkType_BaseClassInfo) {
         const SkMemberInfo* inherited = (SkMemberInfo*) info->fName;
         const SkMemberInfo* result = SkMemberInfo::Find(inherited, info->fCount, matchPtr);
-        if (result != NULL)
+        if (result != nullptr)
             return result;
         if (--count == 0)
-            return NULL;
+            return nullptr;
         info++;
     }
     SkASSERT(info->fName);
     SkASSERT(info->fType != SkType_BaseClassInfo);
     int index = SkStrSearch(&info->fName, count, match, sizeof(*info));
     if (index < 0 || index >= count)
-        return NULL;
+        return nullptr;
     return &info[index];
 }
 
diff --git a/src/animator/SkMemberInfo.h b/src/animator/SkMemberInfo.h
index 3588da2..b62de66 100644
--- a/src/animator/SkMemberInfo.h
+++ b/src/animator/SkMemberInfo.h
@@ -32,7 +32,7 @@
     // if fCount == 0, record is member property
     // then fType can be type, so caller doesn't have to check
 #if SK_USE_CONDENSED_INFO == 0
-    const char* fName;  // may be NULL for anonymous functions
+    const char* fName;  // may be nullptr for anonymous functions
     size_t fOffset; // if negative, is index into member pointer table (for properties and functions)
     SkDisplayTypes fType;
     int fCount;         // for properties, actual type (count is always assumed to be 1)
@@ -229,36 +229,36 @@
 #define DECLARE_MEMBER_INFO(_type) \
 public: \
     virtual const SkMemberInfo* getMember(int index) { \
-        return SkDisplayType::GetMember(NULL, SkType_##_type, &index); } \
+        return SkDisplayType::GetMember(nullptr, SkType_##_type, &index); } \
     virtual const SkMemberInfo* getMember(const char name[]) { \
-        return SkDisplayType::GetMember(NULL, SkType_##_type, &name); } \
+        return SkDisplayType::GetMember(nullptr, SkType_##_type, &name); } \
     virtual SkDisplayTypes getType() const { return SkType_##_type; } \
     typedef Sk##_type BASE_CLASS
 
 #define DECLARE_DRAW_MEMBER_INFO(_type) \
 public: \
     virtual const SkMemberInfo* getMember(int index) { \
-        return SkDisplayType::GetMember(NULL, SkType_##_type, &index); } \
+        return SkDisplayType::GetMember(nullptr, SkType_##_type, &index); } \
     virtual const SkMemberInfo* getMember(const char name[]) { \
-        return SkDisplayType::GetMember(NULL, SkType_##_type, &name); } \
+        return SkDisplayType::GetMember(nullptr, SkType_##_type, &name); } \
     virtual SkDisplayTypes getType() const { return SkType_##_type; } \
     typedef SkDraw##_type BASE_CLASS
 
 #define DECLARE_DISPLAY_MEMBER_INFO(_type) \
 public: \
     virtual const SkMemberInfo* getMember(int index) { \
-        return SkDisplayType::GetMember(NULL, SkType_##_type, &index); } \
+        return SkDisplayType::GetMember(nullptr, SkType_##_type, &index); } \
     virtual const SkMemberInfo* getMember(const char name[]) { \
-        return SkDisplayType::GetMember(NULL, SkType_##_type, &name); } \
+        return SkDisplayType::GetMember(nullptr, SkType_##_type, &name); } \
     virtual SkDisplayTypes getType() const { return SkType_##_type; } \
     typedef SkDisplay##_type BASE_CLASS
 
 #define DECLARE_EXTRAS_MEMBER_INFO(_type) \
 public: \
     virtual const SkMemberInfo* getMember(int index) { \
-        return SkDisplayType::GetMember(NULL, SkType_##_type, &index); } \
+        return SkDisplayType::GetMember(nullptr, SkType_##_type, &index); } \
     virtual const SkMemberInfo* getMember(const char name[]) { \
-        return SkDisplayType::GetMember(NULL, fType, &name); } \
+        return SkDisplayType::GetMember(nullptr, fType, &name); } \
     SkDisplayTypes fType; \
     virtual SkDisplayTypes getType() const { return fType; } \
     typedef _type BASE_CLASS
diff --git a/src/animator/SkOperandIterpolator.cpp b/src/animator/SkOperandIterpolator.cpp
index 84b3282..e6973e2 100644
--- a/src/animator/SkOperandIterpolator.cpp
+++ b/src/animator/SkOperandIterpolator.cpp
@@ -38,7 +38,7 @@
 
 bool SkOperandInterpolator::setKeyFrame(int index, SkMSec time, const SkOperand values[], SkScalar blend)
 {
-    SkASSERT(values != NULL);
+    SkASSERT(values != nullptr);
     blend = SkScalarPin(blend, 0, SK_Scalar1);
 
     bool success = ~index == SkTSearch<SkMSec>(&fTimes->fTime, index, time, sizeof(SkTimeCode));
diff --git a/src/animator/SkPaintPart.cpp b/src/animator/SkPaintPart.cpp
index 285b564..842dbc9 100644
--- a/src/animator/SkPaintPart.cpp
+++ b/src/animator/SkPaintPart.cpp
@@ -12,7 +12,7 @@
 #include "SkDump.h"
 #endif
 
-SkPaintPart::SkPaintPart() : fPaint(NULL) {
+SkPaintPart::SkPaintPart() : fPaint(nullptr) {
 }
 
 SkDisplayable* SkPaintPart::getParent() const {
@@ -20,7 +20,7 @@
 }
 
 bool SkPaintPart::setParent(SkDisplayable* parent) {
-    SkASSERT(parent != NULL);
+    SkASSERT(parent != nullptr);
     if (parent->isPaint() == false)
         return true;
     fPaint = (SkDrawPaint*) parent;
@@ -38,7 +38,7 @@
 }
 
 SkMaskFilter* SkDrawMaskFilter::getMaskFilter() {
-    return NULL;
+    return nullptr;
 }
 
 
@@ -51,18 +51,18 @@
         fPaint->fOwnsPathEffect = true;
         return false;
     }
-    fPaint->add(NULL, this);
+    fPaint->add(nullptr, this);
     return false;
 }
 
 SkPathEffect* SkDrawPathEffect::getPathEffect() {
-    return NULL;
+    return nullptr;
 }
 
 
 // SkDrawShader
 SkShader* SkDrawShader::getShader() {
-    return NULL;
+    return nullptr;
 }
 
 
diff --git a/src/animator/SkPaintPart.h b/src/animator/SkPaintPart.h
index 2907d81..a7e28ed 100644
--- a/src/animator/SkPaintPart.h
+++ b/src/animator/SkPaintPart.h
@@ -51,7 +51,7 @@
     virtual SkShader* getShader();
 protected:
     bool add() override;
-    SkMatrix* getMatrix(); // returns NULL if matrix is NULL
+    SkMatrix* getMatrix(); // returns nullptr if matrix is nullptr
     SkDrawMatrix* matrix;
     int /*SkShader::TileMode*/ tileMode;
 };
diff --git a/src/animator/SkParseSVGPath.cpp b/src/animator/SkParseSVGPath.cpp
index 4b548e2..7050f7c 100644
--- a/src/animator/SkParseSVGPath.cpp
+++ b/src/animator/SkParseSVGPath.cpp
@@ -218,7 +218,7 @@
                 break;
             case '~': {
                 SkPoint args[2];
-                data = find_points(data, args, 2, false, NULL);
+                data = find_points(data, args, 2, false, nullptr);
                 fPath.moveTo(args[0].fX, args[0].fY);
                 fPath.lineTo(args[1].fX, args[1].fY);
             }
diff --git a/src/animator/SkPathParts.cpp b/src/animator/SkPathParts.cpp
index efc7c33..b5407ce 100644
--- a/src/animator/SkPathParts.cpp
+++ b/src/animator/SkPathParts.cpp
@@ -13,7 +13,7 @@
 #include "SkDrawRectangle.h"
 #include "SkDrawPath.h"
 
-SkPathPart::SkPathPart() : fPath(NULL) {
+SkPathPart::SkPathPart() : fPath(nullptr) {
 }
 
 void SkPathPart::dirty() {
@@ -25,7 +25,7 @@
 }
 
 bool SkPathPart::setParent(SkDisplayable* parent) {
-    SkASSERT(parent != NULL);
+    SkASSERT(parent != nullptr);
     if (parent->isPath() == false)
         return true;
     fPath = (SkDrawPath*) parent;
@@ -305,11 +305,11 @@
 
 DEFINE_GET_MEMBER(SkAddPath);
 
-SkAddPath::SkAddPath() : matrix(NULL), path(NULL) {
+SkAddPath::SkAddPath() : matrix(nullptr), path(nullptr) {
 }
 
 bool SkAddPath::add() {
-    SkASSERT (path != NULL);
+    SkASSERT (path != nullptr);
     if (matrix)
         fPath->fPath.addPath(path->fPath, matrix->getMatrix());
     else
diff --git a/src/animator/SkPostParts.cpp b/src/animator/SkPostParts.cpp
index 7c0931e..bfd5385 100644
--- a/src/animator/SkPostParts.cpp
+++ b/src/animator/SkPostParts.cpp
@@ -20,7 +20,7 @@
 
 DEFINE_GET_MEMBER(SkDataInput);
 
-SkDataInput::SkDataInput() : fParent(NULL) {}
+SkDataInput::SkDataInput() : fParent(nullptr) {}
 
 bool SkDataInput::add() {
     SkASSERT(name.size() > 0);
diff --git a/src/animator/SkScript.cpp b/src/animator/SkScript.cpp
index 0694fc4..cd86414 100644
--- a/src/animator/SkScript.cpp
+++ b/src/animator/SkScript.cpp
@@ -386,7 +386,7 @@
         const char* field, size_t fieldLength) {
     void* object;
     if (suppressed)
-        object = NULL;
+        object = nullptr;
     else {
         if (fTypeStack.top() != kObject) {
             fError = kDotOperatorExpectsObject;
@@ -492,7 +492,7 @@
     SkBool suppressed = fSuppressStack.top().fSuppress;
     do {
         SkScriptValue value;
-        bool success = innerScript(scriptPtr, suppressed ? NULL : &value);
+        bool success = innerScript(scriptPtr, suppressed ? nullptr : &value);
         if (success == false) {
             fError = kErrorInFunctionParameters;
             return false;
@@ -559,7 +559,7 @@
                             if (convertTo(tokenInfo->getType(), &tokenValue) == false)
                                 return false;
                         }
-                        tokenInfo->writeValue(fDisplayable, NULL, 0, 0,
+                        tokenInfo->writeValue(fDisplayable, nullptr, 0, 0,
                             (void*) ((char*) fInfo->memberData(fDisplayable) + tokenInfo->fOffset + fArrayOffset),
                             tokenInfo->getType(), tokenValue);
                     }
@@ -635,7 +635,7 @@
             }
             script += 2;
             script = SkParse::FindHex(script, (uint32_t*)&operand.fS32);
-            if (script == NULL) {
+            if (script == nullptr) {
                 fError = kExpectedHex;
                 return false;
             }
@@ -711,7 +711,7 @@
         if (ch ==  '.') {
             if (fTokenLength == 0) {
                 SkScriptValue scriptValue;
-                SkDEBUGCODE(scriptValue.fOperand.fObject = NULL);
+                SkDEBUGCODE(scriptValue.fOperand.fObject = nullptr);
                 int tokenLength = token_length(++script);
                 const char* token = script;
                 script += tokenLength;
@@ -880,7 +880,7 @@
     *fBraceStack.push() = kArrayBrace;
     SkOpType saveType = fReturnType;
     fReturnType = kInt;
-    bool success = innerScript(scriptPtr, suppressed == false ? &scriptValue : NULL);
+    bool success = innerScript(scriptPtr, suppressed == false ? &scriptValue : nullptr);
     if (success == false)
         return false;
     fReturnType = saveType;
@@ -1037,7 +1037,7 @@
             success = (*callBack->fPropertyCallBack)(fToken, fTokenLength,
                 callBack->fUserStorage, &callbackResult);
             if (success) {
-                if (callbackResult.fType == SkType_String && callbackResult.fOperand.fString == NULL) {
+                if (callbackResult.fType == SkType_String && callbackResult.fOperand.fString == nullptr) {
                     callbackResult.fOperand.fString = new SkString(fToken, fTokenLength);
                     track(callbackResult.fOperand.fString);
                 }
@@ -1317,7 +1317,7 @@
         if ((type1 & attributes->fLeftType) == 0 || type1 != type2) {
             if (type1 == kString) {
                 const char* result = SkParse::FindScalar(operand1.fString->c_str(), &operand1.fScalar);
-                if (result == NULL) {
+                if (result == nullptr) {
                     fError = kExpectedNumber;
                     return false;
                 }
@@ -1332,7 +1332,7 @@
     if ((type2 & attributes->fRightType) == 0 || type1 != type2) {
         if (type2 == kString) {
             const char* result = SkParse::FindScalar(operand2.fString->c_str(), &operand2.fScalar);
-            if (result == NULL) {
+            if (result == nullptr) {
                 fError = kExpectedNumber;
                 return false;
             }
@@ -1487,7 +1487,7 @@
 
 bool SkScriptEngine::ConvertTo(SkScriptEngine* engine, SkDisplayTypes toType, SkScriptValue* value ) {
     SkASSERT(value);
-    if (SkDisplayType::IsEnum(NULL /* fMaker */, toType))
+    if (SkDisplayType::IsEnum(nullptr /* fMaker */, toType))
         toType = SkType_Int;
     if (toType == SkType_Point || toType == SkType_3D_Point)
         toType = SkType_Float;
@@ -1509,7 +1509,7 @@
                     success = false;
                     break; // error
                 }
-                success = SkParse::FindS32(operand.fString->c_str(), &operand.fS32) != NULL;
+                success = SkParse::FindS32(operand.fString->c_str(), &operand.fS32) != nullptr;
             }
             break;
         case SkType_Float:
@@ -1525,7 +1525,7 @@
                     success = false;
                     break; // error
                 }
-                success = SkParse::FindScalar(operand.fString->c_str(), &operand.fScalar) != NULL;
+                success = SkParse::FindScalar(operand.fString->c_str(), &operand.fScalar) != nullptr;
             }
             break;
         case SkType_String: {
@@ -1595,9 +1595,9 @@
 }
 
 SkScriptEngine::SkOpType SkScriptEngine::ToOpType(SkDisplayTypes type) {
-    if (SkDisplayType::IsDisplayable(NULL /* fMaker */, type))
+    if (SkDisplayType::IsDisplayable(nullptr /* fMaker */, type))
         return (SkOpType) kObject;
-    if (SkDisplayType::IsEnum(NULL /* fMaker */, type))
+    if (SkDisplayType::IsEnum(nullptr /* fMaker */, type))
         return kInt;
     switch (type) {
         case SkType_ARGB:
@@ -1647,7 +1647,7 @@
 #include "SkFloatingPoint.h"
 
 #define DEF_SCALAR_ANSWER   0
-#define DEF_STRING_ANSWER   NULL
+#define DEF_STRING_ANSWER   nullptr
 
 #define testInt(expression) { #expression, SkType_Int, expression, DEF_SCALAR_ANSWER, DEF_STRING_ANSWER }
     #define testScalar(expression) { #expression, SkType_Float, 0, (float) expression, DEF_STRING_ANSWER }
diff --git a/src/animator/SkScriptRuntime.cpp b/src/animator/SkScriptRuntime.cpp
index 5517b51..7cb35a6 100644
--- a/src/animator/SkScriptRuntime.cpp
+++ b/src/animator/SkScriptRuntime.cpp
@@ -200,13 +200,13 @@
             operand[0].fScalar = SkScriptEngine2::IntToScalar(operand[op - SkScriptEngine2::kIntToScalar].fS32);
             break;
         case SkScriptEngine2::kStringToInt:
-            if (SkParse::FindS32(operand[0].fString->c_str(), &operand[0].fS32) == NULL)
+            if (SkParse::FindS32(operand[0].fString->c_str(), &operand[0].fS32) == nullptr)
                 return false;
             break;
         case SkScriptEngine2::kStringToScalar:
         case SkScriptEngine2::kStringToScalar2:
             if (SkParse::FindScalar(operand[0].fString->c_str(),
-                    &operand[op - SkScriptEngine2::kStringToScalar].fScalar) == NULL)
+                    &operand[op - SkScriptEngine2::kStringToScalar].fScalar) == nullptr)
                 return false;
             break;
         case SkScriptEngine2::kScalarToInt:
@@ -341,11 +341,11 @@
 void SkScriptRuntime::untrack(SkOpArray* array) {
     int index = fTrackArray.find(array);
     SkASSERT(index >= 0);
-    fTrackArray.begin()[index] = NULL;
+    fTrackArray.begin()[index] = nullptr;
 }
 
 void SkScriptRuntime::untrack(SkString* string) {
     int index = fTrackString.find(string);
     SkASSERT(index >= 0);
-    fTrackString.begin()[index] = NULL;
+    fTrackString.begin()[index] = nullptr;
 }
diff --git a/src/animator/SkScriptTokenizer.cpp b/src/animator/SkScriptTokenizer.cpp
index 03ffaa4..4ab7584 100644
--- a/src/animator/SkScriptTokenizer.cpp
+++ b/src/animator/SkScriptTokenizer.cpp
@@ -815,7 +815,7 @@
             SkScriptValue2 callbackResult;
             success = (*callBack)->getReference(functionName, functionNameLen, &callbackResult);
             if (success) {
-                callbackResult.fType = (*callBack)->getReturnType(callbackResult.fOperand.fReference, NULL);
+                callbackResult.fType = (*callBack)->getReturnType(callbackResult.fOperand.fReference, nullptr);
                 callbackResult.fIsConstant = SkScriptValue2::kVariable;
                 fValueStack.push(callbackResult);
                 goto done;
@@ -877,7 +877,7 @@
         SkScriptValue2 callbackResult;
         success = (*callBack)->getReference(fToken, fTokenLength, &callbackResult);
         if (success) {
-            if (callbackResult.fType == SkOperand2::kString && callbackResult.fOperand.fString == NULL) {
+            if (callbackResult.fType == SkOperand2::kString && callbackResult.fOperand.fString == nullptr) {
                 callbackResult.fOperand.fString = new SkString(fToken, fTokenLength);
                 track(callbackResult.fOperand.fString);
             }
@@ -1203,7 +1203,7 @@
                 operand.fS32 = SkScalarFloorToInt(operand.fScalar);
             else {
                 SkASSERT(type == SkOperand2::kString);
-                success = SkParse::FindS32(operand.fString->c_str(), &operand.fS32) != NULL;
+                success = SkParse::FindS32(operand.fString->c_str(), &operand.fS32) != nullptr;
             }
                 break;
         case SkOperand2::kScalar:
@@ -1211,7 +1211,7 @@
                 operand.fScalar = IntToScalar(operand.fS32);
             else {
                 SkASSERT(type == SkOperand2::kString);
-                success = SkParse::FindScalar(operand.fString->c_str(), &operand.fScalar) != NULL;
+                success = SkParse::FindScalar(operand.fString->c_str(), &operand.fScalar) != nullptr;
             }
                 break;
         case SkOperand2::kString: {
@@ -1273,11 +1273,11 @@
 #ifdef SK_DEBUG
 #if defined(SK_SUPPORT_UNITTEST)
 
-#define testInt(expression) { #expression, SkOperand2::kS32, expression, 0, NULL }
-#define testScalar(expression) { #expression, SkOperand2::kScalar, 0, (float) (expression), NULL }
-#define testRemainder(exp1, exp2) { #exp1 "%" #exp2, SkOperand2::kScalar, 0, fmodf((float) exp1, (float) exp2), NULL }
-#define testTrue(expression) { #expression, SkOperand2::kS32, 1, 0, NULL }
-#define testFalse(expression) { #expression, SkOperand2::kS32, 0, 0, NULL }
+#define testInt(expression) { #expression, SkOperand2::kS32, expression, 0, nullptr }
+#define testScalar(expression) { #expression, SkOperand2::kScalar, 0, (float) (expression), nullptr }
+#define testRemainder(exp1, exp2) { #exp1 "%" #exp2, SkOperand2::kScalar, 0, fmodf((float) exp1, (float) exp2), nullptr }
+#define testTrue(expression) { #expression, SkOperand2::kS32, 1, 0, nullptr }
+#define testFalse(expression) { #expression, SkOperand2::kS32, 0, 0, nullptr }
 
 static const SkScriptNAnswer2 scriptTests[]  = {
     testInt(1||(0&&3)),
@@ -1308,12 +1308,12 @@
     {    "'123'+\"456\"", SkOperand2::kString, 0, 0, "123456" },
     {    "123+\"456\"", SkOperand2::kString, 0, 0, "123456" },
     {    "'123'+456", SkOperand2::kString, 0, 0, "123456" },
-    {    "'123'|\"456\"", SkOperand2::kS32, 123|456, 0, NULL },
-    {    "123|\"456\"", SkOperand2::kS32, 123|456, 0, NULL },
-    {    "'123'|456", SkOperand2::kS32, 123|456, 0, NULL },
-    {    "'2'<11", SkOperand2::kS32, 1, 0, NULL },
-    {    "2<'11'", SkOperand2::kS32, 1, 0, NULL },
-    {    "'2'<'11'", SkOperand2::kS32, 0, 0, NULL },
+    {    "'123'|\"456\"", SkOperand2::kS32, 123|456, 0, nullptr },
+    {    "123|\"456\"", SkOperand2::kS32, 123|456, 0, nullptr },
+    {    "'123'|456", SkOperand2::kS32, 123|456, 0, nullptr },
+    {    "'2'<11", SkOperand2::kS32, 1, 0, nullptr },
+    {    "2<'11'", SkOperand2::kS32, 1, 0, nullptr },
+    {    "'2'<'11'", SkOperand2::kS32, 0, 0, nullptr },
     testInt(123),
     testInt(-345),
     testInt(+678),
@@ -1465,7 +1465,7 @@
     testInt(0||(0&&3)),
     testInt(0||(1&&3)),
     testInt(0&&1?2:3)
-    , {    "123.5", SkOperand2::kScalar, 0, SkIntToScalar(123) + SK_Scalar1/2, NULL }
+    , {    "123.5", SkOperand2::kScalar, 0, SkIntToScalar(123) + SK_Scalar1/2, nullptr }
 };
 
 #define SkScriptNAnswer_testCount    SK_ARRAY_COUNT(scriptTests)
diff --git a/src/animator/SkTDArray_Experimental.h b/src/animator/SkTDArray_Experimental.h
index 4b3970f..ff693ac 100644
--- a/src/animator/SkTDArray_Experimental.h
+++ b/src/animator/SkTDArray_Experimental.h
@@ -35,8 +35,8 @@
     SkDS32Array(const int32_t src[], U16CPU count);
     SkDS32Array& operator=(const SkDS32Array& src);
     friend int operator==(const SkDS32Array& a, const SkDS32Array& b);
-    int32_t* append() { return this->append(1, NULL); }
-    int32_t* append(U16CPU count, const int32_t* src = NULL);
+    int32_t* append() { return this->append(1, nullptr); }
+    int32_t* append(U16CPU count, const int32_t* src = nullptr);
 
     int32_t* appendClear()
     {
@@ -65,9 +65,9 @@
         if (fArray)
         {
             sk_free(fArray);
-            fArray = NULL;
+            fArray = nullptr;
 #ifdef SK_DEBUG
-            fData = NULL;
+            fData = nullptr;
 #endif
             fReserve = fCount = 0;
         }
@@ -104,7 +104,7 @@
 
 template <typename T> class SkTDS32Array : public SkDS32Array {
 public:
-    SkTDS32Array() { SkDEBUGCODE(fTData=NULL); SkASSERT(sizeof(T) == sizeof(int32_t)); }
+    SkTDS32Array() { SkDEBUGCODE(fTData=nullptr); SkASSERT(sizeof(T) == sizeof(int32_t)); }
     SkTDS32Array(const SkTDS32Array<T>& src) : SkDS32Array(src) {}
     ~SkTDS32Array() { sk_free(fArray); }
     T&  operator[](int index) const { SYNC(); SkASSERT((unsigned)index < fCount); return ((T*) fArray)[index]; }
@@ -114,12 +114,12 @@
         return operator==((const SkDS32Array&) a, (const SkDS32Array&) b); }
     T* append() { return (T*) SkDS32Array::append(); }
     T* appendClear() { return (T*) SkDS32Array::appendClear(); }
-    T* append(U16CPU count, const T* src = NULL) { return (T*) SkDS32Array::append(count, (const int32_t*) src); }
+    T* append(U16CPU count, const T* src = nullptr) { return (T*) SkDS32Array::append(count, (const int32_t*) src); }
     T*  begin() const { SYNC(); return (T*) fArray; }
-    T*  end() const { return (T*) (fArray ? fArray + fCount : NULL); }
+    T*  end() const { return (T*) (fArray ? fArray + fCount : nullptr); }
     int find(const T& elem) const { return SkDS32Array::find((const int32_t&) elem); }
-    T* insert(U16CPU index) { return this->insert(index, 1, NULL); }
-    T* insert(U16CPU index, U16CPU count, const T* src = NULL) {
+    T* insert(U16CPU index) { return this->insert(index, 1, nullptr); }
+    T* insert(U16CPU index, U16CPU count, const T* src = nullptr) {
         return (T*) SkDS32Array::insert(index, count, (const int32_t*) src); }
     int rfind(const T& elem) const { return SkDS32Array::rfind((const int32_t&) elem); }
     T*          push() { return this->append(); }
diff --git a/src/animator/SkTextOnPath.cpp b/src/animator/SkTextOnPath.cpp
index 7bdb7fd..8647416 100644
--- a/src/animator/SkTextOnPath.cpp
+++ b/src/animator/SkTextOnPath.cpp
@@ -26,7 +26,7 @@
 
 DEFINE_GET_MEMBER(SkTextOnPath);
 
-SkTextOnPath::SkTextOnPath() : offset(0), path(NULL), text(NULL) {
+SkTextOnPath::SkTextOnPath() : offset(0), path(nullptr), text(nullptr) {
 }
 
 bool SkTextOnPath::draw(SkAnimateMaker& maker) {
diff --git a/src/animator/SkTextToPath.cpp b/src/animator/SkTextToPath.cpp
index 0c1b0e4..d4b525b 100644
--- a/src/animator/SkTextToPath.cpp
+++ b/src/animator/SkTextToPath.cpp
@@ -26,7 +26,7 @@
 
 DEFINE_GET_MEMBER(SkTextToPath);
 
-SkTextToPath::SkTextToPath() : paint(NULL), path(NULL), text(NULL) {
+SkTextToPath::SkTextToPath() : paint(nullptr), path(nullptr), text(nullptr) {
 }
 
 bool SkTextToPath::draw(SkAnimateMaker& maker) {
@@ -35,7 +35,7 @@
 }
 
 void SkTextToPath::onEndElement(SkAnimateMaker& maker) {
-    if (paint == NULL || path == NULL || text == NULL) {
+    if (paint == nullptr || path == nullptr || text == nullptr) {
         // !!! add error message here
         maker.setErrorCode(SkDisplayXMLParserError::kErrorInAttributeValue);
         return;
diff --git a/src/animator/SkTypedArray.cpp b/src/animator/SkTypedArray.cpp
index e94e57d..d9e2bc7 100644
--- a/src/animator/SkTypedArray.cpp
+++ b/src/animator/SkTypedArray.cpp
@@ -29,18 +29,18 @@
 SkDS32Array::SkDS32Array()
 {
     fReserve = fCount = 0;
-    fArray = NULL;
+    fArray = nullptr;
 #ifdef SK_DEBUG
-    fData = NULL;
+    fData = nullptr;
 #endif
 }
 
 SkDS32Array::SkDS32Array(const SkDS32Array& src)
 {
     fReserve = fCount = 0;
-    fArray = NULL;
+    fArray = nullptr;
 #ifdef SK_DEBUG
-    fData = NULL;
+    fData = nullptr;
 #endif
     SkDS32Array tmp(src.fArray, src.fCount);
     this->swap(tmp);
@@ -51,9 +51,9 @@
     SkASSERT(src || count == 0);
 
     fReserve = fCount = 0;
-    fArray = NULL;
+    fArray = nullptr;
 #ifdef SK_DEBUG
-    fData = NULL;
+    fData = nullptr;
 #endif
     if (count)
     {
@@ -105,7 +105,7 @@
     unsigned oldCount = fCount;
     if (count)
     {
-        SkASSERT(src == NULL || fArray == NULL ||
+        SkASSERT(src == nullptr || fArray == nullptr ||
                 src + count <= fArray || fArray + count <= src);
 
         this->growBy(count);
diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp
index b88c892..f2f6a8e 100644
--- a/src/codec/SkBmpCodec.cpp
+++ b/src/codec/SkBmpCodec.cpp
@@ -84,7 +84,7 @@
 /*
  * Read enough of the stream to initialize the SkBmpCodec. Returns a bool
  * representing success or failure. If it returned true, and codecOut was
- * not NULL, it will be set to a new SkBmpCodec.
+ * not nullptr, it will be set to a new SkBmpCodec.
  * Does *not* take ownership of the passed in SkStream.
  */
 bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
@@ -441,7 +441,7 @@
     // Check that input bit masks are valid and create the masks object
     SkAutoTDelete<SkMasks>
             masks(SkMasks::CreateMasks(inputMasks, bitsPerPixel));
-    if (NULL == masks) {
+    if (nullptr == masks) {
         SkCodecPrintf("Error: invalid input masks.\n");
         return false;
     }
@@ -514,7 +514,7 @@
  */
 SkCodec* SkBmpCodec::NewFromStream(SkStream* stream, bool inIco) {
     SkAutoTDelete<SkStream> streamDeleter(stream);
-    SkCodec* codec = NULL;
+    SkCodec* codec = nullptr;
     if (ReadHeader(stream, inIco, &codec)) {
         // codec has taken ownership of stream, so we do not need to
         // delete it.
@@ -522,7 +522,7 @@
         streamDeleter.detach();
         return codec;
     }
-    return NULL;
+    return nullptr;
 }
 
 SkBmpCodec::SkBmpCodec(const SkImageInfo& info, SkStream* stream,
@@ -533,7 +533,7 @@
 {}
 
 bool SkBmpCodec::onRewind() {
-    return SkBmpCodec::ReadHeader(this->stream(), this->inIco(), NULL);
+    return SkBmpCodec::ReadHeader(this->stream(), this->inIco(), nullptr);
 }
 
 /*
diff --git a/src/codec/SkBmpCodec.h b/src/codec/SkBmpCodec.h
index 71006f7..ee14f89 100644
--- a/src/codec/SkBmpCodec.h
+++ b/src/codec/SkBmpCodec.h
@@ -58,7 +58,7 @@
     /*
      * Read enough of the stream to initialize the SkBmpCodec. Returns a bool
      * representing success or failure. If it returned true, and codecOut was
-     * not NULL, it will be set to a new SkBmpCodec.
+     * not nullptr, it will be set to a new SkBmpCodec.
      * Does *not* take ownership of the passed in SkStream.
      */
     static bool ReadHeader(SkStream*, bool inIco, SkCodec** codecOut);
diff --git a/src/codec/SkBmpMaskCodec.cpp b/src/codec/SkBmpMaskCodec.cpp
index 90457b2..5684b68 100644
--- a/src/codec/SkBmpMaskCodec.cpp
+++ b/src/codec/SkBmpMaskCodec.cpp
@@ -17,8 +17,8 @@
                                SkBmpCodec::RowOrder rowOrder)
     : INHERITED(info, stream, bitsPerPixel, rowOrder)
     , fMasks(masks)
-    , fMaskSwizzler(NULL)
-    , fSrcBuffer(NULL)
+    , fMaskSwizzler(nullptr)
+    , fSrcBuffer(nullptr)
 {}
 
 /*
@@ -64,7 +64,7 @@
     fMaskSwizzler.reset(SkMaskSwizzler::CreateMaskSwizzler(
             dstInfo, fMasks, this->bitsPerPixel()));
 
-    if (NULL == fMaskSwizzler.get()) {
+    if (nullptr == fMaskSwizzler.get()) {
         return false;
     }
 
@@ -94,7 +94,7 @@
             if (kNo_ZeroInitialized == opts.fZeroInitialized || 0 != fillColor) {
                 void* dstStart = this->getDstStartRow(dst, dstRowBytes, y);
                 SkSwizzler::Fill(dstStart, dstInfo, dstRowBytes, dstInfo.height() - y, fillColor,
-                        NULL);
+                        nullptr);
             }
             return kIncompleteInput;
         }
diff --git a/src/codec/SkBmpRLECodec.cpp b/src/codec/SkBmpRLECodec.cpp
index ed0617f..9af19d1 100644
--- a/src/codec/SkBmpRLECodec.cpp
+++ b/src/codec/SkBmpRLECodec.cpp
@@ -24,7 +24,7 @@
                              SkBmpCodec::RowOrder rowOrder,
                              size_t RLEBytes)
     : INHERITED(info, stream, bitsPerPixel, rowOrder)
-    , fColorTable(NULL)
+    , fColorTable(nullptr)
     , fNumColors(this->computeNumColors(numColors))
     , fBytesPerColor(bytesPerColor)
     , fOffset(offset)
@@ -57,7 +57,7 @@
     }
 
     // Create the color table if necessary and prepare the stream for decode
-    // Note that if it is non-NULL, inputColorCount will be modified
+    // Note that if it is non-nullptr, inputColorCount will be modified
     if (!this->createColorTable(inputColorCount)) {
         SkCodecPrintf("Error: could not create color table.\n");
         return kInvalidInput;
@@ -86,7 +86,7 @@
     if (this->bitsPerPixel() <= 8) {
         // Inform the caller of the number of colors
         uint32_t maxColors = 1 << this->bitsPerPixel();
-        if (NULL != numColors) {
+        if (nullptr != numColors) {
             // We set the number of colors to maxColors in order to ensure
             // safe memory accesses.  Otherwise, an invalid pixel could
             // access memory outside of our color table array.
@@ -291,7 +291,7 @@
     // type that makes sense for the destination format.
     SkASSERT(kN32_SkColorType == dstInfo.colorType());
     if (kNo_ZeroInitialized == opts.fZeroInitialized) {
-        SkSwizzler::Fill(dst, dstInfo, dstRowBytes, height, SK_ColorTRANSPARENT, NULL);
+        SkSwizzler::Fill(dst, dstInfo, dstRowBytes, height, SK_ColorTRANSPARENT, nullptr);
     }
 
     while (true) {
diff --git a/src/codec/SkBmpRLECodec.h b/src/codec/SkBmpRLECodec.h
index ee8989b..65b0180 100644
--- a/src/codec/SkBmpRLECodec.h
+++ b/src/codec/SkBmpRLECodec.h
@@ -49,7 +49,7 @@
 
     /*
      * Creates the color table
-     * Sets colorCount to the new color count if it is non-NULL
+     * Sets colorCount to the new color count if it is non-nullptr
      */
     bool createColorTable(int* colorCount);
 
diff --git a/src/codec/SkBmpStandardCodec.cpp b/src/codec/SkBmpStandardCodec.cpp
index 8404aa6..210498e 100644
--- a/src/codec/SkBmpStandardCodec.cpp
+++ b/src/codec/SkBmpStandardCodec.cpp
@@ -20,12 +20,12 @@
                                        uint32_t bytesPerColor, uint32_t offset,
                                        SkBmpCodec::RowOrder rowOrder, bool inIco)
     : INHERITED(info, stream, bitsPerPixel, rowOrder)
-    , fColorTable(NULL)
+    , fColorTable(nullptr)
     , fNumColors(this->computeNumColors(numColors))
     , fBytesPerColor(bytesPerColor)
     , fOffset(offset)
-    , fSwizzler(NULL)
-    , fSrcBuffer(NULL)
+    , fSwizzler(nullptr)
+    , fSrcBuffer(nullptr)
     , fInIco(inIco)
 {}
 
@@ -54,7 +54,7 @@
     }
 
     // Create the color table if necessary and prepare the stream for decode
-    // Note that if it is non-NULL, inputColorCount will be modified
+    // Note that if it is non-nullptr, inputColorCount will be modified
     if (!this->createColorTable(dstInfo.alphaType(), inputColorCount)) {
         SkCodecPrintf("Error: could not create color table.\n");
         return kInvalidInput;
@@ -82,7 +82,7 @@
     if (this->bitsPerPixel() <= 8) {
         // Inform the caller of the number of colors
         uint32_t maxColors = 1 << this->bitsPerPixel();
-        if (NULL != numColors) {
+        if (nullptr != numColors) {
             // We set the number of colors to maxColors in order to ensure
             // safe memory accesses.  Otherwise, an invalid pixel could
             // access memory outside of our color table array.
@@ -112,7 +112,7 @@
                 // should fail if the alpha type is not one of the above
                 // values.
                 SkASSERT(false);
-                packARGB = NULL;
+                packARGB = nullptr;
                 break;
         }
 
@@ -210,7 +210,7 @@
     fSwizzler.reset(SkSwizzler::CreateSwizzler(config,
             colorPtr, dstInfo, opts.fZeroInitialized, this->getInfo()));
 
-    if (NULL == fSwizzler.get()) {
+    if (nullptr == fSwizzler.get()) {
         return false;
     }
     return true;
diff --git a/src/codec/SkBmpStandardCodec.h b/src/codec/SkBmpStandardCodec.h
index 45450e6..a7d48c8 100644
--- a/src/codec/SkBmpStandardCodec.h
+++ b/src/codec/SkBmpStandardCodec.h
@@ -52,7 +52,7 @@
 
     /*
      * Creates the color table
-     * Sets colorCount to the new color count if it is non-NULL
+     * Sets colorCount to the new color count if it is non-nullptr
      */
     bool createColorTable(SkAlphaType alphaType, int* colorCount);
 
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp
index 76abcda..d12de21 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -38,17 +38,17 @@
 
 SkCodec* SkCodec::NewFromStream(SkStream* stream) {
     if (!stream) {
-        return NULL;
+        return nullptr;
     }
 
     SkAutoTDelete<SkStream> streamDeleter(stream);
     
-    SkAutoTDelete<SkCodec> codec(NULL);
+    SkAutoTDelete<SkCodec> codec(nullptr);
     for (uint32_t i = 0; i < SK_ARRAY_COUNT(gDecoderProcs); i++) {
         DecoderProc proc = gDecoderProcs[i];
         const bool correctFormat = proc.IsFormat(stream);
         if (!stream->rewind()) {
-            return NULL;
+            return nullptr;
         }
         if (correctFormat) {
             codec.reset(proc.NewFromStream(streamDeleter.detach()));
@@ -62,7 +62,7 @@
     const int32_t maxSize = 1 << 27;
     if (codec && codec->getInfo().width() * codec->getInfo().height() > maxSize) {
         SkCodecPrintf("Error: Image size too large, cannot decode.\n");
-        return NULL;
+        return nullptr;
     } else {
         return codec.detach();
     }
@@ -70,7 +70,7 @@
 
 SkCodec* SkCodec::NewFromData(SkData* data) {
     if (!data) {
-        return NULL;
+        return nullptr;
     }
     return NewFromStream(new SkMemoryStream(data));
 }
@@ -104,7 +104,7 @@
     if (kUnknown_SkColorType == info.colorType()) {
         return kInvalidConversion;
     }
-    if (NULL == pixels) {
+    if (nullptr == pixels) {
         return kInvalidParameters;
     }
     if (rowBytes < info.minRowBytes()) {
@@ -112,15 +112,15 @@
     }
 
     if (kIndex_8_SkColorType == info.colorType()) {
-        if (NULL == ctable || NULL == ctableCount) {
+        if (nullptr == ctable || nullptr == ctableCount) {
             return kInvalidParameters;
         }
     } else {
         if (ctableCount) {
             *ctableCount = 0;
         }
-        ctableCount = NULL;
-        ctable = NULL;
+        ctableCount = nullptr;
+        ctable = nullptr;
     }
 
     {
@@ -134,7 +134,7 @@
 
     // Default options.
     Options optsStorage;
-    if (NULL == options) {
+    if (nullptr == options) {
         options = &optsStorage;
     }
     const Result result = this->onGetPixels(info, pixels, rowBytes, *options, ctable, ctableCount);
@@ -146,5 +146,5 @@
 }
 
 SkCodec::Result SkCodec::getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes) {
-    return this->getPixels(info, pixels, rowBytes, NULL, NULL, NULL);
+    return this->getPixels(info, pixels, rowBytes, nullptr, nullptr, nullptr);
 }
diff --git a/src/codec/SkCodecPriv.h b/src/codec/SkCodecPriv.h
index 450457f..9a28cfd 100644
--- a/src/codec/SkCodecPriv.h
+++ b/src/codec/SkCodecPriv.h
@@ -82,10 +82,10 @@
 }
 
 /*
- * If there is a color table, get a pointer to the colors, otherwise return NULL
+ * If there is a color table, get a pointer to the colors, otherwise return nullptr
  */
 static const SkPMColor* get_color_ptr(SkColorTable* colorTable) {
-     return NULL != colorTable ? colorTable->readColors() : NULL;
+     return nullptr != colorTable ? colorTable->readColors() : nullptr;
 }
 
 /*
@@ -95,9 +95,9 @@
 static inline void copy_color_table(const SkImageInfo& dstInfo, SkColorTable* colorTable,
         SkPMColor* inputColorPtr, int* inputColorCount) {
     if (kIndex_8_SkColorType == dstInfo.colorType()) {
-        SkASSERT(NULL != inputColorPtr);
-        SkASSERT(NULL != inputColorCount);
-        SkASSERT(NULL != colorTable);
+        SkASSERT(nullptr != inputColorPtr);
+        SkASSERT(nullptr != inputColorCount);
+        SkASSERT(nullptr != colorTable);
         memcpy(inputColorPtr, colorTable->readColors(), *inputColorCount * 4);
     }
 }
diff --git a/src/codec/SkCodec_libgif.cpp b/src/codec/SkCodec_libgif.cpp
index 40d159a..250a0d6 100644
--- a/src/codec/SkCodec_libgif.cpp
+++ b/src/codec/SkCodec_libgif.cpp
@@ -59,7 +59,7 @@
  * Open the gif file
  */
 static GifFileType* open_gif(SkStream* stream) {
-    return DGifOpen(stream, read_bytes_callback, NULL);
+    return DGifOpen(stream, read_bytes_callback, nullptr);
 }
 
  /*
@@ -67,7 +67,7 @@
  * It is used in a SkAutoTCallIProc template
  */
 void SkGifCodec::CloseGif(GifFileType* gif) {
-    DGifCloseFile(gif, NULL);
+    DGifCloseFile(gif, nullptr);
 }
 
 /*
@@ -75,7 +75,7 @@
  * decoder
  */
 void SkGifCodec::FreeExtension(SavedImage* image) {
-    if (NULL != image->ExtensionBlocks) {
+    if (nullptr != image->ExtensionBlocks) {
         GifFreeExtensions(&image->ExtensionBlockCount, &image->ExtensionBlocks);
     }
 }
@@ -123,12 +123,12 @@
  * Returns a bool representing success or failure.
  *
  * @param codecOut
- * If it returned true, and codecOut was not NULL,
+ * If it returned true, and codecOut was not nullptr,
  * codecOut will be set to a new SkGifCodec.
  *
  * @param gifOut
- * If it returned true, and codecOut was NULL,
- * gifOut must be non-NULL and gifOut will be set to a new
+ * If it returned true, and codecOut was nullptr,
+ * gifOut must be non-nullptr and gifOut will be set to a new
  * GifFileType pointer.
  *
  * @param stream
@@ -143,12 +143,12 @@
     // Read gif header, logical screen descriptor, and global color table
     SkAutoTCallVProc<GifFileType, CloseGif> gif(open_gif(stream));
 
-    if (NULL == gif) {
+    if (nullptr == gif) {
         gif_error("DGifOpen failed.\n");
         return false;
     }
 
-    if (NULL != codecOut) {
+    if (nullptr != codecOut) {
         // Get fields from header
         const int32_t width = gif->SWidth;
         const int32_t height = gif->SHeight;
@@ -172,7 +172,7 @@
                 kIndex_8_SkColorType, kPremul_SkAlphaType);
         *codecOut = new SkGifCodec(imageInfo, streamDeleter.detach(), gif.detach());
     } else {
-        SkASSERT(NULL != gifOut);
+        SkASSERT(nullptr != gifOut);
         streamDeleter.detach();
         *gifOut = gif.detach();
     }
@@ -185,11 +185,11 @@
  * Reads enough of the stream to determine the image format
  */
 SkCodec* SkGifCodec::NewFromStream(SkStream* stream) {
-    SkCodec* codec = NULL;
-    if (ReadHeader(stream, &codec, NULL)) {
+    SkCodec* codec = nullptr;
+    if (ReadHeader(stream, &codec, nullptr)) {
         return codec;
     }
-    return NULL;
+    return nullptr;
 }
 
 SkGifCodec::SkGifCodec(const SkImageInfo& srcInfo, SkStream* stream,
@@ -199,12 +199,12 @@
 {}
 
 bool SkGifCodec::onRewind() {
-    GifFileType* gifOut = NULL;
-    if (!ReadHeader(this->stream(), NULL, &gifOut)) {
+    GifFileType* gifOut = nullptr;
+    if (!ReadHeader(this->stream(), nullptr, &gifOut)) {
         return false;
     }
 
-    SkASSERT(NULL != gifOut);
+    SkASSERT(nullptr != gifOut);
     fGif.reset(gifOut);
     return true;
 }
@@ -239,7 +239,7 @@
     // blocks.  This generally stores transparency and animation instructions.
     SavedImage saveExt;
     SkAutoTCallVProc<SavedImage, FreeExtension> autoFreeExt(&saveExt);
-    saveExt.ExtensionBlocks = NULL;
+    saveExt.ExtensionBlocks = nullptr;
     saveExt.ExtensionBlockCount = 0;
     GifByteType* extData;
     int32_t extFunction;
@@ -309,8 +309,8 @@
                 SkPMColor* colorTable;
                 SkColorType dstColorType = dstInfo.colorType();
                 if (kIndex_8_SkColorType == dstColorType) {
-                    SkASSERT(NULL != inputColorPtr);
-                    SkASSERT(NULL != inputColorCount);
+                    SkASSERT(nullptr != inputColorPtr);
+                    SkASSERT(nullptr != inputColorCount);
                     colorTable = inputColorPtr;
                 } else {
                     colorTable = alternateColorPtr;
@@ -322,10 +322,10 @@
                 const uint32_t maxColors = 256;
                 ColorMapObject* colorMap = fGif->Image.ColorMap;
                 // If there is no local color table, use the global color table
-                if (NULL == colorMap) {
+                if (nullptr == colorMap) {
                     colorMap = fGif->SColorMap;
                 }
-                if (NULL != colorMap) {
+                if (nullptr != colorMap) {
                     colorCount = colorMap->ColorCount;
                     SkASSERT(colorCount ==
                             (unsigned) (1 << (colorMap->BitsPerPixel)));
@@ -380,7 +380,7 @@
                 } 
 
                 // Check if image is only a subset of the image frame
-                SkAutoTDelete<SkSwizzler> swizzler(NULL);
+                SkAutoTDelete<SkSwizzler> swizzler(nullptr);
                 if (innerWidth < width || innerHeight < height) {
 
                     // Modify the destination info
@@ -497,7 +497,7 @@
                 }
 
                 // Create an extension block with our data
-                while (NULL != extData) {
+                while (nullptr != extData) {
                     // Add a single block
                     if (GIF_ERROR ==
                             GifAddExtensionBlock(&saveExt.ExtensionBlockCount,
diff --git a/src/codec/SkCodec_libgif.h b/src/codec/SkCodec_libgif.h
index 109020b..df01088 100644
--- a/src/codec/SkCodec_libgif.h
+++ b/src/codec/SkCodec_libgif.h
@@ -38,12 +38,12 @@
      * Returns a bool representing success or failure.
      *
      * @param codecOut
-     * If it returned true, and codecOut was not NULL,
+     * If it returned true, and codecOut was not nullptr,
      * codecOut will be set to a new SkGifCodec.
      *
      * @param gifOut
-     * If it returned true, and codecOut was NULL,
-     * gifOut must be non-NULL and gifOut will be set to a new
+     * If it returned true, and codecOut was nullptr,
+     * gifOut must be non-nullptr and gifOut will be set to a new
      * GifFileType pointer.
      *
      * @param stream
diff --git a/src/codec/SkCodec_libico.cpp b/src/codec/SkCodec_libico.cpp
index e8e6531..6f34336 100644
--- a/src/codec/SkCodec_libico.cpp
+++ b/src/codec/SkCodec_libico.cpp
@@ -45,14 +45,14 @@
     if (inputStream.get()->read(dirBuffer.get(), kIcoDirectoryBytes) !=
             kIcoDirectoryBytes) {
         SkCodecPrintf("Error: unable to read ico directory header.\n");
-        return NULL;
+        return nullptr;
     }
 
     // Process the directory header
     const uint16_t numImages = get_short(dirBuffer.get(), 4);
     if (0 == numImages) {
         SkCodecPrintf("Error: No images embedded in ico.\n");
-        return NULL;
+        return nullptr;
     }
 
     // Ensure that we can read all of indicated directory entries
@@ -60,7 +60,7 @@
     if (inputStream.get()->read(entryBuffer.get(), numImages*kIcoDirEntryBytes) !=
             numImages*kIcoDirEntryBytes) {
         SkCodecPrintf("Error: unable to read ico directory entries.\n");
-        return NULL;
+        return nullptr;
     }
 
     // This structure is used to represent the vital information about entries
@@ -131,7 +131,7 @@
         // Create a new stream for the embedded codec
         SkAutoTUnref<SkData> data(
                 SkData::NewFromStream(inputStream.get(), size));
-        if (NULL == data.get()) {
+        if (nullptr == data.get()) {
             SkCodecPrintf("Warning: could not create embedded stream.\n");
             break;
         }
@@ -141,7 +141,7 @@
         // Check if the embedded codec is bmp or png and create the codec
         const bool isPng = SkPngCodec::IsPng(embeddedStream);
         SkAssertResult(embeddedStream->rewind());
-        SkCodec* codec = NULL;
+        SkCodec* codec = nullptr;
         if (isPng) {
             codec = SkPngCodec::NewFromStream(embeddedStream.detach());
         } else {
@@ -149,7 +149,7 @@
         }
 
         // Save a valid codec
-        if (NULL != codec) {
+        if (nullptr != codec) {
             codecs->push_back().reset(codec);
         }
     }
@@ -157,7 +157,7 @@
     // Recognize if there are no valid codecs
     if (0 == codecs->count()) {
         SkCodecPrintf("Error: could not find any valid embedded ico codecs.\n");
-        return NULL;
+        return nullptr;
     }
 
     // Use the largest codec as a "suggestion" for image info
@@ -195,7 +195,7 @@
  */
 SkIcoCodec::SkIcoCodec(const SkImageInfo& info,
                        SkTArray<SkAutoTDelete<SkCodec>, true>* codecs)
-    : INHERITED(info, NULL)
+    : INHERITED(info, nullptr)
     , fEmbeddedCodecs(codecs)
 {}
 
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp
index 31a4d2e..2e54342 100644
--- a/src/codec/SkCodec_libpng.cpp
+++ b/src/codec/SkCodec_libpng.cpp
@@ -27,19 +27,19 @@
 
 /* These were dropped in libpng >= 1.4 */
 #ifndef png_infopp_NULL
-    #define png_infopp_NULL NULL
+    #define png_infopp_NULL nullptr
 #endif
 
 #ifndef png_bytepp_NULL
-    #define png_bytepp_NULL NULL
+    #define png_bytepp_NULL nullptr
 #endif
 
 #ifndef int_p_NULL
-    #define int_p_NULL NULL
+    #define int_p_NULL nullptr
 #endif
 
 #ifndef png_flush_ptr_NULL
-    #define png_flush_ptr_NULL NULL
+    #define png_flush_ptr_NULL nullptr
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -75,24 +75,24 @@
 public:
     AutoCleanPng(png_structp png_ptr)
         : fPng_ptr(png_ptr)
-        , fInfo_ptr(NULL) {}
+        , fInfo_ptr(nullptr) {}
 
     ~AutoCleanPng() {
-        // fInfo_ptr will never be non-NULL unless fPng_ptr is.
+        // fInfo_ptr will never be non-nullptr unless fPng_ptr is.
         if (fPng_ptr) {
-            png_infopp info_pp = fInfo_ptr ? &fInfo_ptr : NULL;
+            png_infopp info_pp = fInfo_ptr ? &fInfo_ptr : nullptr;
             png_destroy_read_struct(&fPng_ptr, info_pp, png_infopp_NULL);
         }
     }
 
     void setInfoPtr(png_infop info_ptr) {
-        SkASSERT(NULL == fInfo_ptr);
+        SkASSERT(nullptr == fInfo_ptr);
         fInfo_ptr = info_ptr;
     }
 
     void detach() {
-        fPng_ptr = NULL;
-        fInfo_ptr = NULL;
+        fPng_ptr = nullptr;
+        fInfo_ptr = nullptr;
     }
 
 private:
@@ -111,7 +111,7 @@
 
     png_bytep trans;
     int num_trans;
-    png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, NULL);
+    png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, nullptr);
     return num_trans > 0;
 }
 
@@ -136,7 +136,7 @@
 
     int numTrans;
     if (png_get_valid(fPng_ptr, fInfo_ptr, PNG_INFO_tRNS)) {
-        png_get_tRNS(fPng_ptr, fInfo_ptr, &trans, &numTrans, NULL);
+        png_get_tRNS(fPng_ptr, fInfo_ptr, &trans, &numTrans, nullptr);
     } else {
         numTrans = 0;
     }
@@ -185,7 +185,7 @@
     }
 
     // Set the new color count
-    if (ctableCount != NULL) {
+    if (ctableCount != nullptr) {
         *ctableCount = colorCount;
     }
 
@@ -210,7 +210,7 @@
     return true;
 }
 
-// Reads the header, and initializes the passed in fields, if not NULL (except
+// Reads the header, and initializes the passed in fields, if not nullptr (except
 // stream, which is passed to the read function).
 // Returns true on success, in which case the caller is responsible for calling
 // png_destroy_read_struct. If it returns false, the passed in fields (except
@@ -218,7 +218,7 @@
 static bool read_header(SkStream* stream, png_structp* png_ptrp,
                         png_infop* info_ptrp, SkImageInfo* imageInfo, int* bitDepthPtr) {
     // The image is known to be a PNG. Decode enough to know the SkImageInfo.
-    png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL,
+    png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr,
                                                  sk_error_fn, sk_warning_fn);
     if (!png_ptr) {
         return false;
@@ -227,7 +227,7 @@
     AutoCleanPng autoClean(png_ptr);
 
     png_infop info_ptr = png_create_info_struct(png_ptr);
-    if (info_ptr == NULL) {
+    if (info_ptr == nullptr) {
         return false;
     }
 
@@ -358,7 +358,7 @@
     if (read_header(stream, &png_ptr, &info_ptr, &imageInfo, &bitDepth)) {
         return new SkPngCodec(imageInfo, streamDeleter.detach(), png_ptr, info_ptr, bitDepth);
     }
-    return NULL;
+    return nullptr;
 }
 
 #define INVALID_NUMBER_PASSES -1
@@ -379,11 +379,11 @@
 
 void SkPngCodec::destroyReadStruct() {
     if (fPng_ptr) {
-        // We will never have a NULL fInfo_ptr with a non-NULL fPng_ptr
+        // We will never have a nullptr fInfo_ptr with a non-nullptr fPng_ptr
         SkASSERT(fInfo_ptr);
         png_destroy_read_struct(&fPng_ptr, &fInfo_ptr, png_infopp_NULL);
-        fPng_ptr = NULL;
-        fInfo_ptr = NULL;
+        fPng_ptr = nullptr;
+        fInfo_ptr = nullptr;
     }
 }
 
@@ -450,16 +450,16 @@
 
 
 bool SkPngCodec::onRewind() {
-    // This sets fPng_ptr and fInfo_ptr to NULL. If read_header
+    // This sets fPng_ptr and fInfo_ptr to nullptr. If read_header
     // succeeds, they will be repopulated, and if it fails, they will
-    // remain NULL. Any future accesses to fPng_ptr and fInfo_ptr will
+    // remain nullptr. Any future accesses to fPng_ptr and fInfo_ptr will
     // come through this function which will rewind and again attempt
     // to reinitialize them.
     this->destroyReadStruct();
 
     png_structp png_ptr;
     png_infop info_ptr;
-    if (!read_header(this->stream(), &png_ptr, &info_ptr, NULL, NULL)) {
+    if (!read_header(this->stream(), &png_ptr, &info_ptr, nullptr, nullptr)) {
         return false;
     }
 
@@ -771,7 +771,7 @@
 SkScanlineDecoder* SkPngCodec::NewSDFromStream(SkStream* stream) {
     SkAutoTDelete<SkPngCodec> codec (static_cast<SkPngCodec*>(SkPngCodec::NewFromStream(stream)));
     if (!codec) {
-        return NULL;
+        return nullptr;
     }
 
     codec->fNumberPasses = png_set_interlace_handling(codec->fPng_ptr);
diff --git a/src/codec/SkCodec_wbmp.cpp b/src/codec/SkCodec_wbmp.cpp
index 16cdbea..22f2bac 100644
--- a/src/codec/SkCodec_wbmp.cpp
+++ b/src/codec/SkCodec_wbmp.cpp
@@ -68,7 +68,7 @@
 }
 
 bool SkWbmpCodec::onRewind() {
-    return read_header(this->stream(), NULL);
+    return read_header(this->stream(), nullptr);
 }
 
 SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info,
@@ -82,7 +82,7 @@
             return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info, opts.fZeroInitialized, 
                                               this->getInfo());
         default:
-            return NULL;
+            return nullptr;
     }
 }
 
@@ -129,7 +129,7 @@
 
     // Initialize the swizzler
     SkAutoTDelete<SkSwizzler> swizzler(this->initializeSwizzler(info, ctable, options));
-    if (NULL == swizzler.get()) {
+    if (nullptr == swizzler.get()) {
         return kInvalidConversion;
     }
 
@@ -149,14 +149,14 @@
 }
 
 bool SkWbmpCodec::IsWbmp(SkStream* stream) {
-    return read_header(stream, NULL);
+    return read_header(stream, nullptr);
 }
 
 SkCodec* SkWbmpCodec::NewFromStream(SkStream* stream) {
     SkAutoTDelete<SkStream> streamDeleter(stream);
     SkISize size;
     if (!read_header(stream, &size)) {
-        return NULL;
+        return nullptr;
     }
     SkImageInfo info = SkImageInfo::Make(size.width(), size.height(),
             kGray_8_SkColorType, kOpaque_SkAlphaType);
@@ -171,8 +171,8 @@
     SkWbmpScanlineDecoder(SkWbmpCodec* codec)
         : INHERITED(codec->getInfo())
         , fCodec(codec)
-        , fColorTable(NULL)
-        , fSwizzler(NULL)
+        , fColorTable(nullptr)
+        , fSwizzler(nullptr)
         , fSrcBuffer(codec->fSrcRowBytes)
     {}
 
@@ -220,7 +220,7 @@
         // Initialize the swizzler
         fSwizzler.reset(fCodec->initializeSwizzler(dstInfo,
                 get_color_ptr(fColorTable.get()), options));
-        if (NULL == fSwizzler.get()) {
+        if (nullptr == fSwizzler.get()) {
             return SkCodec::kInvalidConversion;
         }
 
@@ -244,7 +244,7 @@
     SkAutoTDelete<SkWbmpCodec> codec(static_cast<SkWbmpCodec*>(
             SkWbmpCodec::NewFromStream(stream)));
     if (!codec) {
-        return NULL;
+        return nullptr;
     }
 
     // Return the new scanline decoder
diff --git a/src/codec/SkCodec_wbmp.h b/src/codec/SkCodec_wbmp.h
index 8c54661..0891eb8 100644
--- a/src/codec/SkCodec_wbmp.h
+++ b/src/codec/SkCodec_wbmp.h
@@ -36,7 +36,7 @@
     bool onRewind() override;
 private:
     /*
-     * Returns a swizzler on success, NULL on failure
+     * Returns a swizzler on success, nullptr on failure
      */
     SkSwizzler* initializeSwizzler(const SkImageInfo& info, const SkPMColor* ctable,
                                    const Options& opts);
diff --git a/src/codec/SkGifInterlaceIter.cpp b/src/codec/SkGifInterlaceIter.cpp
index 268a142..3a87f69 100644
--- a/src/codec/SkGifInterlaceIter.cpp
+++ b/src/codec/SkGifInterlaceIter.cpp
@@ -28,8 +28,8 @@
                 SK_ARRAY_COUNT(kStartingInterlaceYValues) == fStartYPtr) {
             // Now we have iterated over the entire image.  Forbid any
             // subsequent calls to nextY().
-            SkDEBUGCODE(fStartYPtr = NULL;)
-            SkDEBUGCODE(fDeltaYPtr = NULL;)
+            SkDEBUGCODE(fStartYPtr = nullptr;)
+            SkDEBUGCODE(fDeltaYPtr = nullptr;)
             y = 0;
         } else {
             y = *fStartYPtr++;
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index 4988dca..ed3944c 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -116,7 +116,7 @@
         return decoderMgr->returnFalse("read_header");
     }
 
-    if (NULL != codecOut) {
+    if (nullptr != codecOut) {
         // Recommend the color type to decode to
         const SkColorType colorType = decoderMgr->getColorType();
 
@@ -125,7 +125,7 @@
                 decoderMgr->dinfo()->image_height, colorType, kOpaque_SkAlphaType);
         *codecOut = new SkJpegCodec(imageInfo, stream, decoderMgr.detach());
     } else {
-        SkASSERT(NULL != decoderMgrOut);
+        SkASSERT(nullptr != decoderMgrOut);
         *decoderMgrOut = decoderMgr.detach();
     }
     return true;
@@ -133,14 +133,14 @@
 
 SkCodec* SkJpegCodec::NewFromStream(SkStream* stream) {
     SkAutoTDelete<SkStream> streamDeleter(stream);
-    SkCodec* codec = NULL;
-    if (ReadHeader(stream,  &codec, NULL)) {
+    SkCodec* codec = nullptr;
+    if (ReadHeader(stream,  &codec, nullptr)) {
         // Codec has taken ownership of the stream, we do not need to delete it
         SkASSERT(codec);
         streamDeleter.detach();
         return codec;
     }
-    return NULL;
+    return nullptr;
 }
 
 SkJpegCodec::SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream,
@@ -199,11 +199,11 @@
 }
 
 bool SkJpegCodec::onRewind() {
-    JpegDecoderMgr* decoderMgr = NULL;
-    if (!ReadHeader(this->stream(), NULL, &decoderMgr)) {
+    JpegDecoderMgr* decoderMgr = nullptr;
+    if (!ReadHeader(this->stream(), nullptr, &decoderMgr)) {
         return fDecoderMgr->returnFalse("could not rewind");
     }
-    SkASSERT(NULL != decoderMgr);
+    SkASSERT(nullptr != decoderMgr);
     fDecoderMgr.reset(decoderMgr);
     return true;
 }
@@ -358,7 +358,7 @@
             if (kNo_ZeroInitialized == options.fZeroInitialized ||
                     kN32_SkColorType == dstInfo.colorType()) {
                 SkSwizzler::Fill(dstRow, dstInfo, dstRowBytes, dstHeight - y,
-                        SK_ColorBLACK, NULL);
+                        SK_ColorBLACK, nullptr);
             }
 
             // Prevent libjpeg from failing on incomplete decode
@@ -425,7 +425,7 @@
                 SkASSERT(false);
         }
 
-        fSwizzler.reset(SkSwizzler::CreateSwizzler(srcConfig, NULL, info, options.fZeroInitialized, 
+        fSwizzler.reset(SkSwizzler::CreateSwizzler(srcConfig, nullptr, info, options.fZeroInitialized, 
                                                    this->getInfo()));
         if (!fSwizzler) {
             // FIXME: CreateSwizzler could fail for another reason.
@@ -469,8 +469,8 @@
             fStorage.reset(get_row_bytes(fCodec->fDecoderMgr->dinfo()));
             fSrcRow = static_cast<uint8_t*>(fStorage.get());
         } else {
-            fSrcRow = NULL;
-            fSwizzler.reset(NULL);
+            fSrcRow = nullptr;
+            fSwizzler.reset(nullptr);
         }
 
         // Now, given valid output dimensions, we can start the decompress
@@ -519,7 +519,7 @@
                 if (SkCodec::kNo_ZeroInitialized == fOpts.fZeroInitialized ||
                         kN32_SkColorType == this->dstInfo().colorType()) {
                     SkSwizzler::Fill(dstRow, this->dstInfo(), rowBytes,
-                            count - y, SK_ColorBLACK, NULL);
+                            count - y, SK_ColorBLACK, nullptr);
                 }
                 fCodec->fDecoderMgr->dinfo()->output_scanline = this->dstInfo().height();
                 return SkCodec::kIncompleteInput;
@@ -580,7 +580,7 @@
 SkScanlineDecoder* SkJpegCodec::NewSDFromStream(SkStream* stream) {
     SkAutoTDelete<SkJpegCodec> codec(static_cast<SkJpegCodec*>(SkJpegCodec::NewFromStream(stream)));
     if (!codec) {
-        return NULL;
+        return nullptr;
     }
 
     const SkImageInfo& srcInfo = codec->getInfo();
diff --git a/src/codec/SkJpegCodec.h b/src/codec/SkJpegCodec.h
index fac7d96..ce4fe56 100644
--- a/src/codec/SkJpegCodec.h
+++ b/src/codec/SkJpegCodec.h
@@ -74,12 +74,12 @@
      * Returns a bool representing success or failure.
      *
      * @param codecOut
-     * If this returns true, and codecOut was not NULL,
+     * If this returns true, and codecOut was not nullptr,
      * codecOut will be set to a new SkJpegCodec.
      *
      * @param decoderMgrOut
-     * If this returns true, and codecOut was NULL,
-     * decoderMgrOut must be non-NULL and decoderMgrOut will be set to a new
+     * If this returns true, and codecOut was nullptr,
+     * decoderMgrOut must be non-nullptr and decoderMgrOut will be set to a new
      * JpegDecoderMgr pointer.
      *
      * @param stream
diff --git a/src/codec/SkMaskSwizzler.cpp b/src/codec/SkMaskSwizzler.cpp
index 95f3627..58be0c6 100644
--- a/src/codec/SkMaskSwizzler.cpp
+++ b/src/codec/SkMaskSwizzler.cpp
@@ -225,7 +225,7 @@
         const SkImageInfo& info, SkMasks* masks, uint32_t bitsPerPixel) {
 
     // Choose the appropriate row procedure
-    RowProc proc = NULL;
+    RowProc proc = nullptr;
     switch (bitsPerPixel) {
         case 16:
             switch (info.colorType()) {
@@ -319,7 +319,7 @@
             break;
         default:
             SkASSERT(false);
-            return NULL;
+            return nullptr;
     }
     return new SkMaskSwizzler(info, masks, proc);
 }
@@ -342,6 +342,6 @@
  *
  */
 SkSwizzler::ResultAlpha SkMaskSwizzler::swizzle(void* dst, const uint8_t* SK_RESTRICT src) {
-    SkASSERT(NULL != dst && NULL != src);
+    SkASSERT(nullptr != dst && nullptr != src);
     return fRowProc(dst, src, fDstInfo.width(), fMasks);
 }
diff --git a/src/codec/SkMasks.cpp b/src/codec/SkMasks.cpp
index b136c59..b860314 100644
--- a/src/codec/SkMasks.cpp
+++ b/src/codec/SkMasks.cpp
@@ -139,7 +139,7 @@
     if (((masks.red & masks.green) | (masks.red & masks.blue) |
             (masks.red & masks.alpha) | (masks.green & masks.blue) |
             (masks.green & masks.alpha) | (masks.blue & masks.alpha)) != 0) {
-        return NULL;
+        return nullptr;
     }
 
     // Collect information about the masks
diff --git a/src/codec/SkScaledCodec.cpp b/src/codec/SkScaledCodec.cpp
index bf09b4b..7ff279c 100644
--- a/src/codec/SkScaledCodec.cpp
+++ b/src/codec/SkScaledCodec.cpp
@@ -14,7 +14,7 @@
 SkCodec* SkScaledCodec::NewFromStream(SkStream* stream) {
     bool isWebp = SkWebpCodec::IsWebp(stream);
     if (!stream->rewind()) {
-        return NULL;
+        return nullptr;
     }
     if (isWebp) {
         // Webp codec supports scaling and subsetting natively
@@ -22,8 +22,8 @@
     }
 
     SkAutoTDelete<SkScanlineDecoder> scanlineDecoder(SkScanlineDecoder::NewFromStream(stream));
-    if (NULL == scanlineDecoder) {
-        return NULL;
+    if (nullptr == scanlineDecoder) {
+        return nullptr;
     }
 
     // wrap in new SkScaledCodec
@@ -32,13 +32,13 @@
 
 SkCodec* SkScaledCodec::NewFromData(SkData* data) {
     if (!data) {
-        return NULL;
+        return nullptr;
     }
     return NewFromStream(new SkMemoryStream(data));
 }
 
 SkScaledCodec::SkScaledCodec(SkScanlineDecoder* scanlineDecoder)
-    : INHERITED(scanlineDecoder->getInfo(), NULL)
+    : INHERITED(scanlineDecoder->getInfo(), nullptr)
     , fScanlineDecoder(scanlineDecoder)
 {}
 
diff --git a/src/codec/SkScanlineDecoder.cpp b/src/codec/SkScanlineDecoder.cpp
index 5c94a6d..859956f 100644
--- a/src/codec/SkScanlineDecoder.cpp
+++ b/src/codec/SkScanlineDecoder.cpp
@@ -28,17 +28,17 @@
 
 SkScanlineDecoder* SkScanlineDecoder::NewFromStream(SkStream* stream) {
     if (!stream) {
-        return NULL;
+        return nullptr;
     }
 
     SkAutoTDelete<SkStream> streamDeleter(stream);
 
-    SkAutoTDelete<SkScanlineDecoder> codec(NULL);
+    SkAutoTDelete<SkScanlineDecoder> codec(nullptr);
     for (uint32_t i = 0; i < SK_ARRAY_COUNT(gDecoderProcs); i++) {
         DecoderProc proc = gDecoderProcs[i];
         const bool correctFormat = proc.IsFormat(stream);
         if (!stream->rewind()) {
-            return NULL;
+            return nullptr;
         }
         if (correctFormat) {
             codec.reset(proc.NewFromStream(streamDeleter.detach()));
@@ -52,7 +52,7 @@
     const int32_t maxSize = 1 << 27;
     if (codec && codec->getInfo().width() * codec->getInfo().height() > maxSize) {
         SkCodecPrintf("Error: Image size too large, cannot decode.\n");
-        return NULL;
+        return nullptr;
     } else {
         return codec.detach();
     }
@@ -60,7 +60,7 @@
 
 SkScanlineDecoder* SkScanlineDecoder::NewFromData(SkData* data) {
     if (!data) {
-        return NULL;
+        return nullptr;
     }
     return NewFromStream(new SkMemoryStream(data));
 }
@@ -70,20 +70,20 @@
         const SkCodec::Options* options, SkPMColor ctable[], int* ctableCount) {
     // Ensure that valid color ptrs are passed in for kIndex8 color type
     if (kIndex_8_SkColorType == dstInfo.colorType()) {
-        if (NULL == ctable || NULL == ctableCount) {
+        if (nullptr == ctable || nullptr == ctableCount) {
             return SkCodec::kInvalidParameters;
         }
     } else {
         if (ctableCount) {
             *ctableCount = 0;
         }
-        ctableCount = NULL;
-        ctable = NULL;
+        ctableCount = nullptr;
+        ctable = nullptr;
     }
 
     // Set options.
     SkCodec::Options optsStorage;
-    if (NULL == options) {
+    if (nullptr == options) {
         options = &optsStorage;
     }
 
@@ -98,6 +98,6 @@
 }
 
 SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo) {
-    return this->start(dstInfo, NULL, NULL, NULL);
+    return this->start(dstInfo, nullptr, nullptr, nullptr);
 }
 
diff --git a/src/codec/SkSwizzler.cpp b/src/codec/SkSwizzler.cpp
index db49fb1..54d9764 100644
--- a/src/codec/SkSwizzler.cpp
+++ b/src/codec/SkSwizzler.cpp
@@ -517,13 +517,13 @@
                                        SkCodec::ZeroInitialized zeroInit, 
                                        const SkImageInfo& srcInfo) {
     if (dstInfo.colorType() == kUnknown_SkColorType || kUnknown == sc) {
-        return NULL;
+        return nullptr;
     }
     if ((kIndex == sc || kIndex4 == sc || kIndex2 == sc || kIndex1 == sc)
-            && NULL == ctable) {
-        return NULL;
+            && nullptr == ctable) {
+        return nullptr;
     }
-    RowProc proc = NULL;
+    RowProc proc = nullptr;
 
     switch (sc) {
         case kBit:
@@ -679,8 +679,8 @@
         default:
             break;
     }
-    if (NULL == proc) {
-        return NULL;
+    if (nullptr == proc) {
+        return nullptr;
     }
 
     // Store deltaSrc in bytes if it is an even multiple, otherwise use bits
@@ -688,7 +688,7 @@
 
     // get sampleX based on srcInfo and dstInfo dimensions
     int sampleX;
-    SkScaledCodec::ComputeSampleSize(dstInfo, srcInfo, &sampleX, NULL);
+    SkScaledCodec::ComputeSampleSize(dstInfo, srcInfo, &sampleX, nullptr);
 
     return new SkSwizzler(proc, ctable, deltaSrc, dstInfo, sampleX);
 }
@@ -707,13 +707,13 @@
 }
 
 SkSwizzler::ResultAlpha SkSwizzler::swizzle(void* dst, const uint8_t* SK_RESTRICT src) {
-    SkASSERT(NULL != dst && NULL != src);
+    SkASSERT(nullptr != dst && nullptr != src);
     return fRowProc(dst, src, fDstInfo.width(), fSampleX * fDeltaSrc, fX0 * fDeltaSrc, fColorTable);
 }
 
 void SkSwizzler::Fill(void* dstStartRow, const SkImageInfo& dstInfo, size_t dstRowBytes,
         uint32_t numRows, uint32_t colorOrIndex, const SkPMColor* colorTable) {
-    SkASSERT(dstStartRow != NULL);
+    SkASSERT(dstStartRow != nullptr);
     SkASSERT(numRows <= (uint32_t) dstInfo.height());
 
     // Calculate bytes to fill.  We use getSafeSize since the last row may not be padded.
@@ -724,7 +724,7 @@
         case kN32_SkColorType:
             // Assume input is an index if we have a color table
             uint32_t color;
-            if (NULL != colorTable) {
+            if (nullptr != colorTable) {
                 SkASSERT(colorOrIndex == (uint8_t) colorOrIndex);
                 color = colorTable[colorOrIndex];
             // Otherwise, assume the input is a color
diff --git a/src/codec/SkSwizzler.h b/src/codec/SkSwizzler.h
index b7132ce..3d57205 100644
--- a/src/codec/SkSwizzler.h
+++ b/src/codec/SkSwizzler.h
@@ -128,7 +128,7 @@
                         Sampling in Y can be done by a client with a scanline decoder, 
                         but sampling in X allows the swizzler to skip swizzling pixels and
                         reading from and writing to memory.
-     *  @return A new SkSwizzler or NULL on failure.
+     *  @return A new SkSwizzler or nullptr on failure.
      */
     static SkSwizzler* CreateSwizzler(SrcConfig, const SkPMColor* ctable,
                                       const SkImageInfo& dstInfo, SkCodec::ZeroInitialized, 
@@ -149,13 +149,13 @@
      * index.
      *
      * If dstInfo.colorType() is kN32, colorOrIndex is treated differently depending on
-     * whether colorTable is NULL:
+     * whether colorTable is nullptr:
      *
-     * A NULL colorTable means colorOrIndex is treated as an SkPMColor (premul or
+     * A nullptr colorTable means colorOrIndex is treated as an SkPMColor (premul or
      * unpremul, depending on dstInfo.alphaType()). Each 4-byte pixel will be set to
      * colorOrIndex.
 
-     * A non-NULL colorTable means colorOrIndex is treated as a uint8_t index into
+     * A non-nullptr colorTable means colorOrIndex is treated as a uint8_t index into
      * the colorTable. i.e. each 4-byte pixel will be set to
      * colorTable[(uint8_t) colorOrIndex].
      *
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp
index e17aa7e..ccf4964 100644
--- a/src/codec/SkWebpCodec.cpp
+++ b/src/codec/SkWebpCodec.cpp
@@ -79,7 +79,7 @@
     if (webp_parse_header(stream, &info)) {
         return new SkWebpCodec(info, streamDeleter.detach());
     }
-    return NULL;
+    return nullptr;
 }
 
 // This version is slightly different from SkCodecPriv's version of conversion_possible. It
@@ -221,7 +221,7 @@
     config.output.u.RGBA.size = dstInfo.getSafeSize(rowBytes);
     config.output.is_external_memory = 1;
 
-    SkAutoTCallVProc<WebPIDecoder, WebPIDelete> idec(WebPIDecode(NULL, 0, &config));
+    SkAutoTCallVProc<WebPIDecoder, WebPIDelete> idec(WebPIDecode(nullptr, 0, &config));
     if (!idec) {
         return kInvalidInput;
     }
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp
index 902b87a..bbd1f55 100644
--- a/src/core/SkAAClip.cpp
+++ b/src/core/SkAAClip.cpp
@@ -136,9 +136,9 @@
     if (clip.isEmpty()) {
         fDone = true;
         fTop = fBottom = clip.fBounds.fBottom;
-        fData = NULL;
-        fCurrYOff = NULL;
-        fStopYOff = NULL;
+        fData = nullptr;
+        fCurrYOff = nullptr;
+        fStopYOff = nullptr;
         return;
     }
 
@@ -163,7 +163,7 @@
         if (curr >= fStopYOff) {
             fDone = true;
             fBottom = kMaxInt32;
-            fData = NULL;
+            fData = nullptr;
         } else {
             fBottom += curr->fY - prev->fY;
             fData += curr->fOffset - prev->fOffset;
@@ -188,7 +188,7 @@
 }
 
 void SkAAClip::validate() const {
-    if (NULL == fRunHead) {
+    if (nullptr == fRunHead) {
         SkASSERT(fBounds.isEmpty());
         return;
     }
@@ -625,12 +625,12 @@
 
 SkAAClip::SkAAClip() {
     fBounds.setEmpty();
-    fRunHead = NULL;
+    fRunHead = nullptr;
 }
 
 SkAAClip::SkAAClip(const SkAAClip& src) {
     SkDEBUGCODE(fBounds.setEmpty();)    // need this for validate
-    fRunHead = NULL;
+    fRunHead = nullptr;
     *this = src;
 }
 
@@ -698,7 +698,7 @@
 bool SkAAClip::setEmpty() {
     this->freeRuns();
     fBounds.setEmpty();
-    fRunHead = NULL;
+    fRunHead = nullptr;
     return false;
 }
 
@@ -763,7 +763,7 @@
 
     SkPath path;
     path.addRect(r);
-    return this->setPath(path, NULL, doAA);
+    return this->setPath(path, nullptr, doAA);
 }
 
 static void append_run(SkTDArray<uint8_t>& array, uint8_t value, int count) {
@@ -810,7 +810,7 @@
     SkRegion::Iterator iter(rgn);
     int prevRight = 0;
     int prevBot = 0;
-    YOffset* currY = NULL;
+    YOffset* currY = nullptr;
 
     for (; !iter.done(); iter.next()) {
         const SkIRect& r = iter.rect();
@@ -869,7 +869,7 @@
     SkASSERT(fRunHead);
 
     if (!y_in_rect(y, fBounds)) {
-        return NULL;
+        return nullptr;
     }
     y -= fBounds.y();  // our yoffs values are relative to the top
 
@@ -960,7 +960,7 @@
     Builder(const SkIRect& bounds) : fBounds(bounds) {
         fPrevY = -1;
         fWidth = bounds.width();
-        fCurrRow = NULL;
+        fCurrRow = nullptr;
         fMinY = bounds.fTop;
     }
 
@@ -1181,7 +1181,7 @@
     }
 
     Row* flushRow(bool readyForAnother) {
-        Row* next = NULL;
+        Row* next = nullptr;
         int count = fRows.count();
         if (count > 0) {
             this->flushRowH(&fRows[count - 1]);
@@ -1298,7 +1298,7 @@
         { unexpected(); }
 
     const SkPixmap* justAnOpaqueColor(uint32_t*) override {
-        return NULL;
+        return nullptr;
     }
 
     void blitH(int x, int y, int width) override {
@@ -1381,7 +1381,7 @@
     path.getBounds().roundOut(&ibounds);
 
     SkRegion tmpClip;
-    if (NULL == clip) {
+    if (nullptr == clip) {
         tmpClip.setRect(ibounds);
         clip = &tmpClip;
     }
@@ -1608,8 +1608,8 @@
     int botB = iterB.bottom();
 
     do {
-        const uint8_t* rowA = NULL;
-        const uint8_t* rowB = NULL;
+        const uint8_t* rowA = nullptr;
+        const uint8_t* rowB = nullptr;
         int top, bot;
 
         if (topA < topB) {
@@ -1803,7 +1803,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 bool SkAAClip::translate(int dx, int dy, SkAAClip* dst) const {
-    if (NULL == dst) {
+    if (nullptr == dst) {
         return !this->isEmpty();
     }
 
@@ -1839,7 +1839,7 @@
     mask->fFormat = SkMask::kA8_Format;
     if (this->isEmpty()) {
         mask->fBounds.setEmpty();
-        mask->fImage = NULL;
+        mask->fImage = nullptr;
         mask->fRowBytes = 0;
         return;
     }
@@ -1898,7 +1898,7 @@
 }
 
 void SkAAClipBlitter::ensureRunsAndAA() {
-    if (NULL == fScanlineScratch) {
+    if (nullptr == fScanlineScratch) {
         // add 1 so we can store the terminating run count of 0
         int count = fAAClipBounds.width() + 1;
         // we use this either for fRuns + fAA, or a scaline of a mask
@@ -2092,7 +2092,7 @@
     switch (format) {
         case SkMask::kBW_Format:
             SkDEBUGFAIL("unsupported");
-            return NULL;
+            return nullptr;
         case SkMask::kA8_Format:
         case SkMask::k3D_Format: {
             void (*proc8)(const uint8_t*, int, const uint8_t*, int, uint8_t*) = mergeT;
@@ -2104,7 +2104,7 @@
         }
         default:
             SkDEBUGFAIL("unsupported");
-            return NULL;
+            return nullptr;
     }
 }
 
@@ -2168,7 +2168,7 @@
 
     // if we're BW, we need to upscale to A8 (ugh)
     SkMask  grayMask;
-    grayMask.fImage = NULL;
+    grayMask.fImage = nullptr;
     if (SkMask::kBW_Format == origMask.fFormat) {
         grayMask.fFormat = SkMask::kA8_Format;
         grayMask.fBounds = origMask.fBounds;
@@ -2220,5 +2220,5 @@
 }
 
 const SkPixmap* SkAAClipBlitter::justAnOpaqueColor(uint32_t* value) {
-    return NULL;
+    return nullptr;
 }
diff --git a/src/core/SkAAClip.h b/src/core/SkAAClip.h
index 9f6a3d6..0207233 100644
--- a/src/core/SkAAClip.h
+++ b/src/core/SkAAClip.h
@@ -26,7 +26,7 @@
 
     void swap(SkAAClip&);
 
-    bool isEmpty() const { return NULL == fRunHead; }
+    bool isEmpty() const { return nullptr == fRunHead; }
     const SkIRect& getBounds() const { return fBounds; }
 
     // Returns true iff the clip is not empty, and is just a hard-edged rect (no partial alpha).
@@ -36,7 +36,7 @@
     bool setEmpty();
     bool setRect(const SkIRect&);
     bool setRect(const SkRect&, bool doAA = true);
-    bool setPath(const SkPath&, const SkRegion* clip = NULL, bool doAA = true);
+    bool setPath(const SkPath&, const SkRegion* clip = nullptr, bool doAA = true);
     bool setRegion(const SkRegion&);
     bool set(const SkAAClip&);
 
@@ -65,8 +65,8 @@
         return this->quickContains(r.fLeft, r.fTop, r.fRight, r.fBottom);
     }
 
-    const uint8_t* findRow(int y, int* lastYForRow = NULL) const;
-    const uint8_t* findX(const uint8_t data[], int x, int* initialCount = NULL) const;
+    const uint8_t* findRow(int y, int* lastYForRow = nullptr) const;
+    const uint8_t* findX(const uint8_t data[], int x, int* initialCount = nullptr) const;
 
     class Iter;
     struct RunHead;
@@ -99,7 +99,7 @@
 
 class SkAAClipBlitter : public SkBlitter {
 public:
-    SkAAClipBlitter() : fScanlineScratch(NULL) {}
+    SkAAClipBlitter() : fScanlineScratch(nullptr) {}
     virtual ~SkAAClipBlitter();
 
     void init(SkBlitter* blitter, const SkAAClip* aaclip) {
diff --git a/src/core/SkAdvancedTypefaceMetrics.cpp b/src/core/SkAdvancedTypefaceMetrics.cpp
index 81e98f3..56a557c 100644
--- a/src/core/SkAdvancedTypefaceMetrics.cpp
+++ b/src/core/SkAdvancedTypefaceMetrics.cpp
@@ -148,7 +148,7 @@
 
     SkAutoTDelete<SkAdvancedTypefaceMetrics::AdvanceMetric<Data> > result;
     SkAdvancedTypefaceMetrics::AdvanceMetric<Data>* curRange;
-    SkAdvancedTypefaceMetrics::AdvanceMetric<Data>* prevRange = NULL;
+    SkAdvancedTypefaceMetrics::AdvanceMetric<Data>* prevRange = nullptr;
     Data lastAdvance = kInvalidAdvance;
     int repeatedAdvances = 0;
     int wildCardsInRun = 0;
@@ -168,7 +168,7 @@
     for (int gId = firstIndex; gId <= lastIndex; gId++) {
         Data advance = kInvalidAdvance;
         if (gId < lastIndex) {
-            // Get glyph id only when subset is NULL, or the id is in subset.
+            // Get glyph id only when subset is nullptr, or the id is in subset.
             SkASSERT(!subsetGlyphIDs || (subsetIndex < subsetGlyphIDsLength &&
                     static_cast<uint32_t>(gId) <= subsetGlyphIDs[subsetIndex]));
             if (!subsetGlyphIDs ||
diff --git a/src/core/SkAdvancedTypefaceMetrics.h b/src/core/SkAdvancedTypefaceMetrics.h
index 44a6854..b2c9ac3 100644
--- a/src/core/SkAdvancedTypefaceMetrics.h
+++ b/src/core/SkAdvancedTypefaceMetrics.h
@@ -147,9 +147,9 @@
     @param num_glyphs    Total number of glyphs in the given font.
     @param glyphIDs      For per-glyph info, specify subset of the font by
                          giving glyph ids.  Each integer represents a glyph
-                         id.  Passing NULL means all glyphs in the font.
+                         id.  Passing nullptr means all glyphs in the font.
     @param glyphIDsCount Number of elements in subsetGlyphIds. Ignored if
-                         glyphIDs is NULL.
+                         glyphIDs is nullptr.
 */
 template <typename Data, typename FontHandle>
 SkAdvancedTypefaceMetrics::AdvanceMetric<Data>* getAdvanceData(
diff --git a/src/core/SkAnnotation.cpp b/src/core/SkAnnotation.cpp
index aa7a02a..84d41fc 100644
--- a/src/core/SkAnnotation.cpp
+++ b/src/core/SkAnnotation.cpp
@@ -13,7 +13,7 @@
 #include "SkWriteBuffer.h"
 
 SkAnnotation::SkAnnotation(const char key[], SkData* value) : fKey(key) {
-    if (NULL == value) {
+    if (nullptr == value) {
         value = SkData::NewEmpty();
     } else {
         value->ref();
@@ -26,7 +26,7 @@
 }
 
 SkData* SkAnnotation::find(const char key[]) const {
-    return fKey.equals(key) ? fData : NULL;
+    return fKey.equals(key) ? fData : nullptr;
 }
 
 SkAnnotation::SkAnnotation(SkReadBuffer& buffer) {
@@ -60,7 +60,7 @@
 }
 
 void SkAnnotateRectWithURL(SkCanvas* canvas, const SkRect& rect, SkData* value) {
-    if (NULL == value) {
+    if (nullptr == value) {
         return;
     }
     SkPaint paint;
@@ -69,7 +69,7 @@
 }
 
 void SkAnnotateNamedDestination(SkCanvas* canvas, const SkPoint& point, SkData* name) {
-    if (NULL == name) {
+    if (nullptr == name) {
         return;
     }
     SkPaint paint;
@@ -78,7 +78,7 @@
 }
 
 void SkAnnotateLinkToDestination(SkCanvas* canvas, const SkRect& rect, SkData* name) {
-    if (NULL == name) {
+    if (nullptr == name) {
         return;
     }
     SkPaint paint;
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 03d1f42..7cc7344 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -56,8 +56,8 @@
 
         if (fPixelRef) {
             // ignore the values from the memcpy
-            fPixels = NULL;
-            fColorTable = NULL;
+            fPixels = nullptr;
+            fColorTable = nullptr;
             // Note that what to for genID is somewhat arbitrary. We have no
             // way to track changes to raw pixels across multiple SkBitmaps.
             // Would benefit from an SkRawPixelRef type created by
@@ -165,8 +165,8 @@
             fColorTable = fPixelRef->colorTable();
         } else {
             SkASSERT(0 == fPixelLockCount);
-            fPixels = NULL;
-            fColorTable = NULL;
+            fPixels = nullptr;
+            fColorTable = nullptr;
         }
     }
 }
@@ -207,7 +207,7 @@
 
     if (fPixelRef != pr) {
         this->freePixels();
-        SkASSERT(NULL == fPixelRef);
+        SkASSERT(nullptr == fPixelRef);
 
         SkSafeRef(pr);
         fPixelRef = pr;
@@ -227,7 +227,7 @@
 }
 
 void SkBitmap::unlockPixels() const {
-    SkASSERT(NULL == fPixelRef || fPixelLockCount > 0);
+    SkASSERT(nullptr == fPixelRef || fPixelLockCount > 0);
 
     if (fPixelRef && 1 == sk_atomic_dec(&fPixelLockCount)) {
         fPixelRef->unlockPixels();
@@ -241,19 +241,19 @@
 }
 
 void SkBitmap::setPixels(void* p, SkColorTable* ctable) {
-    if (NULL == p) {
-        this->setPixelRef(NULL);
+    if (nullptr == p) {
+        this->setPixelRef(nullptr);
         return;
     }
 
     if (kUnknown_SkColorType == fInfo.colorType()) {
-        this->setPixelRef(NULL);
+        this->setPixelRef(nullptr);
         return;
     }
 
     SkPixelRef* pr = SkMallocPixelRef::NewDirect(fInfo, p, fRowBytes, ctable);
-    if (NULL == pr) {
-        this->setPixelRef(NULL);
+    if (nullptr == pr) {
+        this->setPixelRef(nullptr);
         return;
     }
 
@@ -267,7 +267,7 @@
 bool SkBitmap::tryAllocPixels(Allocator* allocator, SkColorTable* ctable) {
     HeapAllocator stdalloc;
 
-    if (NULL == allocator) {
+    if (nullptr == allocator) {
         allocator = &stdalloc;
     }
     return allocator->allocPixelRef(this, ctable);
@@ -290,15 +290,15 @@
 
     SkMallocPixelRef::PRFactory defaultFactory;
 
-    SkPixelRef* pr = defaultFactory.create(correctedInfo, rowBytes, NULL);
-    if (NULL == pr) {
+    SkPixelRef* pr = defaultFactory.create(correctedInfo, rowBytes, nullptr);
+    if (nullptr == pr) {
         return reset_return_false(this);
     }
     this->setPixelRef(pr)->unref();
 
-    // TODO: lockPixels could/should return bool or void*/NULL
+    // TODO: lockPixels could/should return bool or void*/nullptr
     this->lockPixels();
-    if (NULL == this->getPixels()) {
+    if (nullptr == this->getPixels()) {
         return reset_return_false(this);
     }
     return true;
@@ -306,7 +306,7 @@
 
 bool SkBitmap::tryAllocPixels(const SkImageInfo& requestedInfo, SkPixelRefFactory* factory,
                                 SkColorTable* ctable) {
-    if (kIndex_8_SkColorType == requestedInfo.colorType() && NULL == ctable) {
+    if (kIndex_8_SkColorType == requestedInfo.colorType() && nullptr == ctable) {
         return reset_return_false(this);
     }
     if (!this->setInfo(requestedInfo)) {
@@ -317,19 +317,19 @@
     const SkImageInfo& correctedInfo = this->info();
 
     SkMallocPixelRef::PRFactory defaultFactory;
-    if (NULL == factory) {
+    if (nullptr == factory) {
         factory = &defaultFactory;
     }
 
     SkPixelRef* pr = factory->create(correctedInfo, correctedInfo.minRowBytes(), ctable);
-    if (NULL == pr) {
+    if (nullptr == pr) {
         return reset_return_false(this);
     }
     this->setPixelRef(pr)->unref();
 
-    // TODO: lockPixels could/should return bool or void*/NULL
+    // TODO: lockPixels could/should return bool or void*/nullptr
     this->lockPixels();
-    if (NULL == this->getPixels()) {
+    if (nullptr == this->getPixels()) {
         return reset_return_false(this);
     }
     return true;
@@ -349,7 +349,7 @@
         this->reset();
         return false;
     }
-    if (NULL == pixels) {
+    if (nullptr == pixels) {
         invoke_release_proc(releaseProc, pixels, context);
         return true;    // we behaved as if they called setInfo()
     }
@@ -390,12 +390,12 @@
             fPixelRef->unlockPixels();
         }
         fPixelRef->unref();
-        fPixelRef = NULL;
+        fPixelRef = nullptr;
         fPixelRefOrigin.setZero();
     }
     fPixelLockCount = 0;
-    fPixels = NULL;
-    fColorTable = NULL;
+    fPixels = nullptr;
+    fColorTable = nullptr;
 }
 
 uint32_t SkBitmap::getGenerationID() const {
@@ -410,7 +410,7 @@
 }
 
 GrTexture* SkBitmap::getTexture() const {
-    return fPixelRef ? fPixelRef->getTexture() : NULL;
+    return fPixelRef ? fPixelRef->getTexture() : nullptr;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -427,7 +427,7 @@
     }
 
     SkPixelRef* pr = SkMallocPixelRef::NewAllocate(info, dst->rowBytes(), ctable);
-    if (NULL == pr) {
+    if (nullptr == pr) {
         return false;
     }
 
@@ -482,7 +482,7 @@
 }
 
 bool SkBitmap::copyPixelsTo(void* dst, size_t dstSize, size_t dstRB, bool preserveDstPad) const {
-    if (NULL == dst) {
+    if (nullptr == dst) {
         return false;
     }
     SkAutoPixmapUnlock result;
@@ -539,7 +539,7 @@
                 break;
             default:
                 SkDEBUGFAIL("Can't return addr for config");
-                base = NULL;
+                base = nullptr;
                 break;
         }
     }
@@ -605,7 +605,7 @@
         } break;
         case kIndex_8_SkColorType: {
             const SkColorTable* ctable = pmap.ctable();
-            if (NULL == ctable) {
+            if (nullptr == ctable) {
                 return false;
             }
             const SkPMColor* table = ctable->readColors();
@@ -696,7 +696,7 @@
 bool SkBitmap::extractSubset(SkBitmap* result, const SkIRect& subset) const {
     SkDEBUGCODE(this->validate();)
 
-    if (NULL == result || NULL == fPixelRef) {
+    if (nullptr == result || nullptr == fPixelRef) {
         return false;   // no src pixels
     }
 
@@ -706,10 +706,10 @@
         return false;   // r is empty (i.e. no intersection)
     }
 
-    if (fPixelRef->getTexture() != NULL) {
+    if (fPixelRef->getTexture() != nullptr) {
         // Do a deep copy
         SkPixelRef* pixelRef = fPixelRef->deepCopy(this->colorType(), this->profileType(), &subset);
-        if (pixelRef != NULL) {
+        if (pixelRef != nullptr) {
             SkBitmap dst;
             dst.setInfo(SkImageInfo::Make(subset.width(), subset.height(),
                                           this->colorType(), this->alphaType()));
@@ -816,7 +816,7 @@
             SkASSERT(tmpSrc.height() == this->height());
 
             // did we get lucky and we can just return tmpSrc?
-            if (tmpSrc.colorType() == dstColorType && NULL == alloc) {
+            if (tmpSrc.colorType() == dstColorType && nullptr == alloc) {
                 dst->swap(tmpSrc);
                 // If the result is an exact copy, clone the gen ID.
                 if (dst->pixelRef() && dst->pixelRef()->info() == fPixelRef->info()) {
@@ -888,7 +888,7 @@
     // If we have a PixelRef, and it supports deep copy, use it.
     // Currently supported only by texture-backed bitmaps.
     if (fPixelRef) {
-        SkPixelRef* pixelRef = fPixelRef->deepCopy(dstCT, dstPT, NULL);
+        SkPixelRef* pixelRef = fPixelRef->deepCopy(dstCT, dstPT, nullptr);
         if (pixelRef) {
             uint32_t rowBytes;
             if (this->colorType() == dstCT && this->profileType() == dstPT) {
@@ -915,7 +915,7 @@
     if (this->getTexture()) {
         return false;
     } else {
-        return this->copyTo(dst, dstCT, NULL);
+        return this->copyTo(dst, dstCT, nullptr);
     }
 }
 
@@ -978,7 +978,7 @@
 }
 
 static bool GetBitmapAlpha(const SkBitmap& src, uint8_t* SK_RESTRICT alpha, int alphaRowBytes) {
-    SkASSERT(alpha != NULL);
+    SkASSERT(alpha != nullptr);
     SkASSERT(alphaRowBytes >= src.width());
 
     SkAutoPixmapUnlock apl;
@@ -1006,20 +1006,20 @@
     srcM.fRowBytes = SkAlign4(this->width());
     srcM.fFormat = SkMask::kA8_Format;
 
-    SkMaskFilter* filter = paint ? paint->getMaskFilter() : NULL;
+    SkMaskFilter* filter = paint ? paint->getMaskFilter() : nullptr;
 
     // compute our (larger?) dst bounds if we have a filter
     if (filter) {
         identity.reset();
-        srcM.fImage = NULL;
-        if (!filter->filterMask(&dstM, srcM, identity, NULL)) {
+        srcM.fImage = nullptr;
+        if (!filter->filterMask(&dstM, srcM, identity, nullptr)) {
             goto NO_FILTER_CASE;
         }
         dstM.fRowBytes = SkAlign4(dstM.fBounds.width());
     } else {
     NO_FILTER_CASE:
         tmpBitmap.setInfo(SkImageInfo::MakeA8(this->width(), this->height()), srcM.fRowBytes);
-        if (!tmpBitmap.tryAllocPixels(allocator, NULL)) {
+        if (!tmpBitmap.tryAllocPixels(allocator, nullptr)) {
             // Allocation of pixels for alpha bitmap failed.
             SkDebugf("extractAlpha failed to allocate (%d,%d) alpha bitmap\n",
                     tmpBitmap.width(), tmpBitmap.height());
@@ -1036,14 +1036,14 @@
     SkAutoMaskFreeImage srcCleanup(srcM.fImage);
 
     GetBitmapAlpha(*this, srcM.fImage, srcM.fRowBytes);
-    if (!filter->filterMask(&dstM, srcM, identity, NULL)) {
+    if (!filter->filterMask(&dstM, srcM, identity, nullptr)) {
         goto NO_FILTER_CASE;
     }
     SkAutoMaskFreeImage dstCleanup(dstM.fImage);
 
     tmpBitmap.setInfo(SkImageInfo::MakeA8(dstM.fBounds.width(), dstM.fBounds.height()),
                       dstM.fRowBytes);
-    if (!tmpBitmap.tryAllocPixels(allocator, NULL)) {
+    if (!tmpBitmap.tryAllocPixels(allocator, nullptr)) {
         // Allocation of pixels for alpha bitmap failed.
         SkDebugf("extractAlpha failed to allocate (%d,%d) alpha bitmap\n",
                 tmpBitmap.width(), tmpBitmap.height());
@@ -1091,7 +1091,7 @@
 
 void SkBitmap::WriteRawPixels(SkWriteBuffer* buffer, const SkBitmap& bitmap) {
     const SkImageInfo info = bitmap.info();
-    if (0 == info.width() || 0 == info.height() || NULL == bitmap.pixelRef()) {
+    if (0 == info.width() || 0 == info.height() || nullptr == bitmap.pixelRef()) {
         buffer->writeUInt(0); // instead of snugRB, signaling no pixels
         return;
     }
@@ -1210,7 +1210,7 @@
         SkASSERT(fPixelRef->info().height() >= (int)this->height() + fPixelRefOrigin.fY);
         SkASSERT(fPixelRef->rowBytes() >= fInfo.minRowBytes());
     } else {
-        SkASSERT(NULL == fColorTable);
+        SkASSERT(nullptr == fColorTable);
     }
 }
 #endif
@@ -1240,7 +1240,7 @@
     str->append(")");
 
     SkPixelRef* pr = this->pixelRef();
-    if (NULL == pr) {
+    if (nullptr == pr) {
         // show null or the explicit pixel address (rare)
         str->appendf(" pixels:%p", this->getPixels());
     } else {
@@ -1262,7 +1262,7 @@
     SkASSERT(result);
 
     SkPixelRef* pr = fPixelRef;
-    if (NULL == pr) {
+    if (nullptr == pr) {
         return false;
     }
 
diff --git a/src/core/SkBitmapCache.cpp b/src/core/SkBitmapCache.cpp
index 66075d4..2b11b81 100644
--- a/src/core/SkBitmapCache.cpp
+++ b/src/core/SkBitmapCache.cpp
@@ -202,7 +202,7 @@
         const SkMipMap* mm = SkRef(rec.fMipMap);
         // the call to ref() above triggers a "lock" in the case of discardable memory,
         // which means we can now check for null (in case the lock failed).
-        if (NULL == mm->data()) {
+        if (nullptr == mm->data()) {
             mm->unref();    // balance our call to ref()
             return false;
         }
@@ -222,7 +222,7 @@
     const SkMipMap* result;
 
     if (!CHECK_LOCAL(localCache, find, Find, key, MipMapRec::Finder, &result)) {
-        result = NULL;
+        result = nullptr;
     }
     return result;
 }
diff --git a/src/core/SkBitmapCache.h b/src/core/SkBitmapCache.h
index c758942..3e541ee 100644
--- a/src/core/SkBitmapCache.h
+++ b/src/core/SkBitmapCache.h
@@ -22,7 +22,7 @@
 public:
     /**
      * Use this allocator for bitmaps, so they can use ashmem when available.
-     * Returns NULL if the ResourceCache has not been initialized with a DiscardableFactory.
+     * Returns nullptr if the ResourceCache has not been initialized with a DiscardableFactory.
      */
     static SkBitmap::Allocator* GetAllocator();
 
@@ -31,37 +31,37 @@
      *  result will be set to the matching bitmap with its pixels already locked.
      */
     static bool Find(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY, SkBitmap* result,
-                     SkResourceCache* localCache = NULL);
+                     SkResourceCache* localCache = nullptr);
 
     /*
      *  result must be marked isImmutable()
      */
     static void Add(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY,
-            const SkBitmap& result, SkResourceCache* localCache = NULL);
+            const SkBitmap& result, SkResourceCache* localCache = nullptr);
 
     /**
      *  Search based on the bitmap's genID and subset. If found, returns true and
      *  result will be set to the matching bitmap with its pixels already locked.
      */
     static bool Find(uint32_t genID, const SkIRect& subset, SkBitmap* result,
-                     SkResourceCache* localCache = NULL);
+                     SkResourceCache* localCache = nullptr);
 
     /**
      * The width and the height of the provided subset must be the same as the result bitmap ones.
      * result must be marked isImmutable()
      */
     static bool Add(SkPixelRef*, const SkIRect& subset, const SkBitmap& result,
-                    SkResourceCache* localCache = NULL);
+                    SkResourceCache* localCache = nullptr);
 
-    static bool Find(uint32_t genID, SkBitmap* result, SkResourceCache* localCache = NULL);
+    static bool Find(uint32_t genID, SkBitmap* result, SkResourceCache* localCache = nullptr);
     // todo: eliminate the need to specify ID, since it should == the bitmap's
-    static void Add(uint32_t genID, const SkBitmap&, SkResourceCache* localCache = NULL);
+    static void Add(uint32_t genID, const SkBitmap&, SkResourceCache* localCache = nullptr);
 };
 
 class SkMipMapCache {
 public:
-    static const SkMipMap* FindAndRef(const SkBitmap& src, SkResourceCache* localCache = NULL);
-    static const SkMipMap* AddAndRef(const SkBitmap& src, SkResourceCache* localCache = NULL);
+    static const SkMipMap* FindAndRef(const SkBitmap& src, SkResourceCache* localCache = nullptr);
+    static const SkMipMap* AddAndRef(const SkBitmap& src, SkResourceCache* localCache = nullptr);
 };
 
 #endif
diff --git a/src/core/SkBitmapController.cpp b/src/core/SkBitmapController.cpp
index fb54388..e4b4199 100644
--- a/src/core/SkBitmapController.cpp
+++ b/src/core/SkBitmapController.cpp
@@ -16,7 +16,7 @@
     if (0 == bm.width() || 0 == bm.height()) {
         return false;   // nothing to draw
     }
-    if (NULL == bm.pixelRef()) {
+    if (nullptr == bm.pixelRef()) {
         return false;   // no pixels to read
     }
     if (bm.getTexture()) {
@@ -38,14 +38,14 @@
                                                              void* storage, size_t storageSize) {
     
     if (!valid_for_drawing(bm)) {
-        return NULL;
+        return nullptr;
     }
 
     State* state = this->onRequestBitmap(bm, inv, quality, storage, storageSize);
     if (state) {
-        if (NULL == state->fPixmap.addr()) {
+        if (nullptr == state->fPixmap.addr()) {
             SkInPlaceDeleteCheck(state, storage);
-            state = NULL;
+            state = nullptr;
         }
     }
     return state;
@@ -161,21 +161,21 @@
     fQuality = kLow_SkFilterQuality;
     
     SkSize invScaleSize;
-    if (!fInvMatrix.decomposeScale(&invScaleSize, NULL)) {
+    if (!fInvMatrix.decomposeScale(&invScaleSize, nullptr)) {
         return false;
     }
     SkScalar invScale = SkScalarSqrt(invScaleSize.width() * invScaleSize.height());
     
     if (invScale > SK_Scalar1) {
         fCurrMip.reset(SkMipMapCache::FindAndRef(origBitmap));
-        if (NULL == fCurrMip.get()) {
+        if (nullptr == fCurrMip.get()) {
             fCurrMip.reset(SkMipMapCache::AddAndRef(origBitmap));
-            if (NULL == fCurrMip.get()) {
+            if (nullptr == fCurrMip.get()) {
                 return false;
             }
         }
         // diagnostic for a crasher...
-        if (NULL == fCurrMip->data()) {
+        if (nullptr == fCurrMip->data()) {
             sk_throw();
         }
         
@@ -191,7 +191,7 @@
             return fResultBitmap.installPixels(info, level.fPixels, level.fRowBytes);
         } else {
             // failed to extract, so release the mipmap
-            fCurrMip.reset(NULL);
+            fCurrMip.reset(nullptr);
         }
     }
     return false;
@@ -213,7 +213,7 @@
     SkASSERT(fQuality <= kLow_SkFilterQuality);
 
     // fResultBitmap.getPixels() may be null, but our caller knows to check fPixmap.addr()
-    // and will destroy us if it is NULL.
+    // and will destroy us if it is nullptr.
     fPixmap.reset(fResultBitmap.info(), fResultBitmap.getPixels(), fResultBitmap.rowBytes(),
                   fResultBitmap.getColorTable());
 }
diff --git a/src/core/SkBitmapController.h b/src/core/SkBitmapController.h
index ead4b78..aa663e8 100644
--- a/src/core/SkBitmapController.h
+++ b/src/core/SkBitmapController.h
@@ -40,7 +40,7 @@
                          void* storage, size_t storageSize);
 
     State* requestBitmap(const SkBitmap& bm, const SkMatrix& inverse, SkFilterQuality quality) {
-        return this->requestBitmap(bm, inverse, quality, NULL, 0);
+        return this->requestBitmap(bm, inverse, quality, nullptr, 0);
     }
 
 protected:
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index d4445fa..b7df9a4 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -67,7 +67,7 @@
 SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap)
     : INHERITED(SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType))
     , fBitmap(bitmap) {
-    SkASSERT(valid_for_bitmap_device(bitmap.info(), NULL));
+    SkASSERT(valid_for_bitmap_device(bitmap.info(), nullptr));
 }
 
 SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& info) {
@@ -77,14 +77,14 @@
 SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap, const SkSurfaceProps& surfaceProps)
     : INHERITED(surfaceProps)
     , fBitmap(bitmap) {
-    SkASSERT(valid_for_bitmap_device(bitmap.info(), NULL));
+    SkASSERT(valid_for_bitmap_device(bitmap.info(), nullptr));
 }
 
 SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& origInfo,
                                        const SkSurfaceProps& surfaceProps) {
     SkAlphaType newAT = origInfo.alphaType();
     if (!valid_for_bitmap_device(origInfo, &newAT)) {
-        return NULL;
+        return nullptr;
     }
 
     const SkImageInfo info = origInfo.makeAlphaType(newAT);
@@ -92,11 +92,11 @@
 
     if (kUnknown_SkColorType == info.colorType()) {
         if (!bitmap.setInfo(info)) {
-            return NULL;
+            return nullptr;
         }
     } else {
         if (!bitmap.tryAllocPixels(info)) {
-            return NULL;
+            return nullptr;
         }
         if (!bitmap.info().isOpaque()) {
             bitmap.eraseColor(SK_ColorTRANSPARENT);
@@ -142,7 +142,7 @@
 bool SkBitmapDevice::onPeekPixels(SkPixmap* pmap) {
     const SkImageInfo info = fBitmap.info();
     if (fBitmap.getPixels() && (kUnknown_SkColorType != info.colorType())) {
-        SkColorTable* ctable = NULL;
+        SkColorTable* ctable = nullptr;
         pmap->reset(fBitmap.info(), fBitmap.getPixels(), fBitmap.rowBytes(), ctable);
         return true;
     }
@@ -152,7 +152,7 @@
 bool SkBitmapDevice::onWritePixels(const SkImageInfo& srcInfo, const void* srcPixels,
                                    size_t srcRowBytes, int x, int y) {
     // since we don't stop creating un-pixeled devices yet, check for no pixels here
-    if (NULL == fBitmap.getPixels()) {
+    if (nullptr == fBitmap.getPixels()) {
         return false;
     }
 
@@ -211,7 +211,7 @@
     path.addOval(oval);
     // call the VIRTUAL version, so any subclasses who do handle drawPath aren't
     // required to override drawOval.
-    this->drawPath(draw, path, paint, NULL, true);
+    this->drawPath(draw, path, paint, nullptr, true);
 }
 
 void SkBitmapDevice::drawRRect(const SkDraw& draw, const SkRRect& rrect, const SkPaint& paint) {
@@ -223,7 +223,7 @@
     path.addRRect(rrect);
     // call the VIRTUAL version, so any subclasses who do handle drawPath aren't
     // required to override drawRRect.
-    this->drawPath(draw, path, paint, NULL, true);
+    this->drawPath(draw, path, paint, nullptr, true);
 #else
     draw.drawRRect(rrect, paint);
 #endif
@@ -238,7 +238,7 @@
 
 void SkBitmapDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap,
                                 const SkMatrix& matrix, const SkPaint& paint) {
-    draw.drawBitmap(bitmap, matrix, NULL, paint);
+    draw.drawBitmap(bitmap, matrix, nullptr, paint);
 }
 
 void SkBitmapDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
@@ -319,7 +319,7 @@
                                                SkShader::kClamp_TileMode,
                                                SkShader::kClamp_TileMode,
                                                &matrix);
-    if (NULL == s) {
+    if (nullptr == s) {
         return;
     }
 
diff --git a/src/core/SkBitmapFilter.cpp b/src/core/SkBitmapFilter.cpp
index 4c1e9c6..55a7092 100644
--- a/src/core/SkBitmapFilter.cpp
+++ b/src/core/SkBitmapFilter.cpp
@@ -35,6 +35,6 @@
         SkDEBUGFAIL("Unknown filter type");
     }
 
-    return NULL;
+    return nullptr;
 }
 
diff --git a/src/core/SkBitmapHeap.cpp b/src/core/SkBitmapHeap.cpp
index 5b16d21..c65a704 100644
--- a/src/core/SkBitmapHeap.cpp
+++ b/src/core/SkBitmapHeap.cpp
@@ -65,9 +65,9 @@
 
 SkBitmapHeap::SkBitmapHeap(int32_t preferredSize, int32_t ownerCount)
     : INHERITED()
-    , fExternalStorage(NULL)
-    , fMostRecentlyUsed(NULL)
-    , fLeastRecentlyUsed(NULL)
+    , fExternalStorage(nullptr)
+    , fMostRecentlyUsed(nullptr)
+    , fLeastRecentlyUsed(nullptr)
     , fPreferredCount(preferredSize)
     , fOwnerCount(ownerCount)
     , fBytesAllocated(0)
@@ -77,8 +77,8 @@
 SkBitmapHeap::SkBitmapHeap(ExternalStorage* storage, int32_t preferredSize)
     : INHERITED()
     , fExternalStorage(storage)
-    , fMostRecentlyUsed(NULL)
-    , fLeastRecentlyUsed(NULL)
+    , fMostRecentlyUsed(nullptr)
+    , fLeastRecentlyUsed(nullptr)
     , fPreferredCount(preferredSize)
     , fOwnerCount(IGNORE_OWNERS)
     , fBytesAllocated(0)
@@ -111,39 +111,39 @@
 void SkBitmapHeap::removeFromLRU(SkBitmapHeap::LookupEntry* entry) {
     if (fMostRecentlyUsed == entry) {
         fMostRecentlyUsed = entry->fLessRecentlyUsed;
-        if (NULL == fMostRecentlyUsed) {
+        if (nullptr == fMostRecentlyUsed) {
             SkASSERT(fLeastRecentlyUsed == entry);
-            fLeastRecentlyUsed = NULL;
+            fLeastRecentlyUsed = nullptr;
         } else {
-            fMostRecentlyUsed->fMoreRecentlyUsed = NULL;
+            fMostRecentlyUsed->fMoreRecentlyUsed = nullptr;
         }
     } else {
         // Remove entry from its prior place, and make sure to cover the hole.
         if (fLeastRecentlyUsed == entry) {
-            SkASSERT(entry->fMoreRecentlyUsed != NULL);
+            SkASSERT(entry->fMoreRecentlyUsed != nullptr);
             fLeastRecentlyUsed = entry->fMoreRecentlyUsed;
         }
         // Since we have already considered the case where entry is the most recently used, it must
         // have a more recently used at this point.
-        SkASSERT(entry->fMoreRecentlyUsed != NULL);
+        SkASSERT(entry->fMoreRecentlyUsed != nullptr);
         entry->fMoreRecentlyUsed->fLessRecentlyUsed = entry->fLessRecentlyUsed;
 
-        if (entry->fLessRecentlyUsed != NULL) {
+        if (entry->fLessRecentlyUsed != nullptr) {
             SkASSERT(fLeastRecentlyUsed != entry);
             entry->fLessRecentlyUsed->fMoreRecentlyUsed = entry->fMoreRecentlyUsed;
         }
     }
-    entry->fMoreRecentlyUsed = NULL;
+    entry->fMoreRecentlyUsed = nullptr;
 }
 
 void SkBitmapHeap::appendToLRU(SkBitmapHeap::LookupEntry* entry) {
-    if (fMostRecentlyUsed != NULL) {
-        SkASSERT(NULL == fMostRecentlyUsed->fMoreRecentlyUsed);
+    if (fMostRecentlyUsed != nullptr) {
+        SkASSERT(nullptr == fMostRecentlyUsed->fMoreRecentlyUsed);
         fMostRecentlyUsed->fMoreRecentlyUsed = entry;
         entry->fLessRecentlyUsed = fMostRecentlyUsed;
     }
     fMostRecentlyUsed = entry;
-    if (NULL == fLeastRecentlyUsed) {
+    if (nullptr == fLeastRecentlyUsed) {
         fLeastRecentlyUsed = entry;
     }
 }
@@ -154,13 +154,13 @@
     SkASSERT(fStorage.count() >= fPreferredCount);
 
     SkBitmapHeap::LookupEntry* iter = fLeastRecentlyUsed;
-    while (iter != NULL) {
+    while (iter != nullptr) {
         SkBitmapHeapEntry* heapEntry = fStorage[iter->fStorageSlot];
         if (heapEntry->fRefCount > 0) {
             // If the least recently used bitmap has not been unreferenced
             // by its owner, then according to our LRU specifications a more
             // recently used one can not have used all its references yet either.
-            return NULL;
+            return nullptr;
         }
         if (replacement.getGenerationID() == iter->fGenerationId) {
             // Do not replace a bitmap with a new one using the same
@@ -171,7 +171,7 @@
             return iter;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 size_t SkBitmapHeap::freeMemoryIfPossible(size_t bytesToFree) {
@@ -182,7 +182,7 @@
     size_t origBytesAllocated = fBytesAllocated;
     // Purge starting from LRU until a non-evictable bitmap is found or until
     // everything is evicted.
-    while (iter != NULL) {
+    while (iter != nullptr) {
         SkBitmapHeapEntry* heapEntry = fStorage[iter->fStorageSlot];
         if (heapEntry->fRefCount > 0) {
             break;
@@ -203,15 +203,15 @@
     if (fLeastRecentlyUsed != iter) {
         // There was at least one eviction.
         fLeastRecentlyUsed = iter;
-        if (NULL == fLeastRecentlyUsed) {
+        if (nullptr == fLeastRecentlyUsed) {
             // Everything was evicted
-            fMostRecentlyUsed = NULL;
+            fMostRecentlyUsed = nullptr;
             fBytesAllocated -= (fStorage.count() * sizeof(SkBitmapHeapEntry));
             fStorage.deleteAll();
             fUnusedSlots.reset();
             SkASSERT(0 == fBytesAllocated);
         } else {
-            fLeastRecentlyUsed->fLessRecentlyUsed = NULL;
+            fLeastRecentlyUsed->fLessRecentlyUsed = nullptr;
         }
     }
 
@@ -228,7 +228,7 @@
         // insert ourselves into the bitmapIndex
         index = ~index;
         *fLookupTable.insert(index) = new LookupEntry(indexEntry);
-    } else if (entry != NULL) {
+    } else if (entry != nullptr) {
         // populate the entry if needed
         *entry = fStorage[fLookupTable[index]->fStorageSlot];
     }
@@ -244,7 +244,7 @@
     if (originalBitmap.isImmutable()) {
         copiedBitmap = originalBitmap;
 // TODO if we have the pixel ref in the heap we could pass it here to avoid a potential deep copy
-//    else if (sharedPixelRef != NULL) {
+//    else if (sharedPixelRef != nullptr) {
 //        copiedBitmap = orig;
 //        copiedBitmap.setPixelRef(sharedPixelRef, originalBitmap.pixelRefOffset());
     } else if (originalBitmap.empty()) {
@@ -259,7 +259,7 @@
 int SkBitmapHeap::removeEntryFromLookupTable(LookupEntry* entry) {
     // remove the bitmap index for the deleted entry
     SkDEBUGCODE(int count = fLookupTable.count();)
-    int index = this->findInLookupTable(*entry, NULL);
+    int index = this->findInLookupTable(*entry, nullptr);
     // Verify that findInLookupTable found an existing entry rather than adding
     // a new entry to the lookup table.
     SkASSERT(count == fLookupTable.count());
@@ -270,7 +270,7 @@
 }
 
 int32_t SkBitmapHeap::insert(const SkBitmap& originalBitmap) {
-    SkBitmapHeapEntry* entry = NULL;
+    SkBitmapHeapEntry* entry = nullptr;
     int searchIndex = this->findInLookupTable(LookupEntry(originalBitmap), &entry);
 
     if (entry) {
@@ -296,7 +296,7 @@
     if (fPreferredCount != UNLIMITED_SIZE && fStorage.count() >= fPreferredCount) {
         // iterate through our LRU cache and try to find an entry to evict
         LookupEntry* lookupEntry = this->findEntryToReplace(originalBitmap);
-        if (lookupEntry != NULL) {
+        if (lookupEntry != nullptr) {
             // we found an entry to evict
             entry = fStorage[lookupEntry->fStorageSlot];
             // Remove it from the LRU. The new entry will be added to the LRU later.
@@ -383,7 +383,7 @@
         for (int i = 0; i < fDeferredEntries.count(); i++) {
             SkASSERT(fOwnerCount != IGNORE_OWNERS);
             SkBitmapHeapEntry* heapEntry = this->getEntry(fDeferredEntries[i]);
-            SkASSERT(heapEntry != NULL);
+            SkASSERT(heapEntry != nullptr);
             heapEntry->addReferences(fOwnerCount);
         }
     }
diff --git a/src/core/SkBitmapHeap.h b/src/core/SkBitmapHeap.h
index 1e1979f..22c31a0 100644
--- a/src/core/SkBitmapHeap.h
+++ b/src/core/SkBitmapHeap.h
@@ -116,24 +116,24 @@
     /**
      * Retrieves the bitmap from the specified slot in the heap
      *
-     * @return  The bitmap located at that slot or NULL if external storage is being used.
+     * @return  The bitmap located at that slot or nullptr if external storage is being used.
      */
     SkBitmap* getBitmap(int32_t slot) const override {
-        SkASSERT(fExternalStorage == NULL);
+        SkASSERT(fExternalStorage == nullptr);
         SkBitmapHeapEntry* entry = getEntry(slot);
         if (entry) {
             return &entry->fBitmap;
         }
-        return NULL;
+        return nullptr;
     }
 
     /**
      * Retrieves the bitmap from the specified slot in the heap
      *
-     * @return  The bitmap located at that slot or NULL if external storage is being used.
+     * @return  The bitmap located at that slot or nullptr if external storage is being used.
      */
     void releaseRef(int32_t slot) override {
-        SkASSERT(fExternalStorage == NULL);
+        SkASSERT(fExternalStorage == nullptr);
         if (fOwnerCount != IGNORE_OWNERS) {
             SkBitmapHeapEntry* entry = getEntry(slot);
             if (entry) {
@@ -158,12 +158,12 @@
      * Retrieves an entry from the heap at a given slot.
      *
      * @param slot  the slot in the heap where a bitmap was stored.
-     * @return  a SkBitmapHeapEntry that wraps the bitmap or NULL if external storage is used.
+     * @return  a SkBitmapHeapEntry that wraps the bitmap or nullptr if external storage is used.
      */
     SkBitmapHeapEntry* getEntry(int32_t slot) const {
         SkASSERT(slot <= fStorage.count());
-        if (fExternalStorage != NULL) {
-            return NULL;
+        if (fExternalStorage != nullptr) {
+            return nullptr;
         }
         return fStorage[slot];
     }
@@ -172,7 +172,7 @@
      * Returns a count of the number of items currently in the heap
      */
     int count() const {
-        SkASSERT(fExternalStorage != NULL ||
+        SkASSERT(fExternalStorage != nullptr ||
                  fStorage.count() - fUnusedSlots.count() == fLookupTable.count());
         return fLookupTable.count();
     }
@@ -215,8 +215,8 @@
         , fPixelOrigin(bm.pixelRefOrigin())
         , fWidth(bm.width())
         , fHeight(bm.height())
-        , fMoreRecentlyUsed(NULL)
-        , fLessRecentlyUsed(NULL){}
+        , fMoreRecentlyUsed(nullptr)
+        , fLessRecentlyUsed(nullptr){}
 
         const uint32_t fGenerationId; // SkPixelRef GenerationID.
         const SkIPoint fPixelOrigin;
@@ -260,7 +260,7 @@
     /**
      * Remove a LookupEntry from the LRU, in preparation for either deleting or appending as most
      * recent. Points the LookupEntry's old neighbors at each other, and sets fLeastRecentlyUsed
-     * (if there is still an entry left). Sets LookupEntry's fMoreRecentlyUsed to NULL and leaves
+     * (if there is still an entry left). Sets LookupEntry's fMoreRecentlyUsed to nullptr and leaves
      * its fLessRecentlyUsed unmodified.
      */
     void removeFromLRU(LookupEntry* entry);
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index ef9cfd4..e382d09 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -47,7 +47,7 @@
     buffer.readMatrix(&lm);
     SkBitmap bm;
     if (!buffer.readBitmap(&bm)) {
-        return NULL;
+        return nullptr;
     }
     bm.setImmutable();
     TileMode mx = (TileMode)buffer.readUInt();
@@ -75,7 +75,7 @@
     SkMatrix totalInverse;
     // Do this first, so we know the matrix can be inverted.
     if (!this->computeTotalInverse(rec, &totalInverse)) {
-        return NULL;
+        return nullptr;
     }
 
     void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext);
@@ -87,7 +87,7 @@
     state->fOrigBitmap = fRawBitmap;
     if (!state->chooseProcs(totalInverse, *rec.fPaint)) {
         state->~SkBitmapProcState();
-        return NULL;
+        return nullptr;
     }
 
     return new (storage) BitmapProcShaderContext(*this, rec, state);
@@ -212,7 +212,7 @@
         *ctx = fState;
         return (ShadeProc)fState->getShaderProc32();
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkBitmapProcShader::BitmapProcShaderContext::shadeSpan16(int x, int y, uint16_t dstC[],
@@ -301,19 +301,19 @@
     SkShader* shader;
     SkColor color;
     if (src.isNull() || bitmap_is_too_big(src)) {
-        if (NULL == allocator) {
+        if (nullptr == allocator) {
             shader = new SkEmptyShader;
         } else {
             shader = allocator->createT<SkEmptyShader>();
         }
     } else if (can_use_color_shader(src, &color)) {
-        if (NULL == allocator) {
+        if (nullptr == allocator) {
             shader = new SkColorShader(color);
         } else {
             shader = allocator->createT<SkColorShader>(color);
         }
     } else {
-        if (NULL == allocator) {
+        if (nullptr == allocator) {
             shader = new SkBitmapProcShader(src, tmx, tmy, localMatrix);
         } else {
             shader = allocator->createT<SkBitmapProcShader>(src, tmx, tmy, localMatrix);
diff --git a/src/core/SkBitmapProcShader.h b/src/core/SkBitmapProcShader.h
index 5179ff8..30f860a 100644
--- a/src/core/SkBitmapProcShader.h
+++ b/src/core/SkBitmapProcShader.h
@@ -18,7 +18,7 @@
 class SkBitmapProcShader : public SkShader {
 public:
     SkBitmapProcShader(const SkBitmap& src, TileMode tx, TileMode ty,
-                       const SkMatrix* localMatrix = NULL);
+                       const SkMatrix* localMatrix = nullptr);
 
     // overrides from SkShader
     bool isOpaque() const override;
@@ -72,7 +72,7 @@
 // yet found a situation where the size below isn't big enough.
 typedef SkSmallAllocator<3, 1152> SkTBlitterAllocator;
 
-// If alloc is non-NULL, it will be used to allocate the returned SkShader, and MUST outlive
+// If alloc is non-nullptr, it will be used to allocate the returned SkShader, and MUST outlive
 // the SkShader.
 SkShader* SkCreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader::TileMode,
                                const SkMatrix* localMatrix, SkTBlitterAllocator* alloc);
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index 2227010..31109aa 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -37,7 +37,7 @@
 #include "SkBitmapProcState_filter.h"
 #include "SkBitmapProcState_procs.h"
 
-SkBitmapProcState::SkBitmapProcState() : fBMState(NULL) {}
+SkBitmapProcState::SkBitmapProcState() : fBMState(nullptr) {}
 
 SkBitmapProcState::~SkBitmapProcState() {
     SkInPlaceDeleteCheck(fBMState, fBMStateStorage.get());
@@ -122,7 +122,7 @@
     fBMState = controller.requestBitmap(fOrigBitmap, inv, paint.getFilterQuality(),
                                         fBMStateStorage.get(), fBMStateStorage.size());
     // Note : we allow the controller to return an empty (zero-dimension) result. Should we?
-    if (NULL == fBMState || fBMState->pixmap().info().isEmpty()) {
+    if (nullptr == fBMState || fBMState->pixmap().info().isEmpty()) {
         return false;
     }
     fPixmap = fBMState->pixmap();
@@ -174,10 +174,10 @@
 
     fAlphaScale = SkAlpha255To256(paint.getAlpha());
 
-    fShaderProc32 = NULL;
-    fShaderProc16 = NULL;
-    fSampleProc32 = NULL;
-    fSampleProc16 = NULL;
+    fShaderProc32 = nullptr;
+    fShaderProc16 = nullptr;
+    fSampleProc32 = nullptr;
+    fSampleProc16 = nullptr;
 
     // recompute the triviality of the matrix here because we may have
     // changed it!
@@ -201,8 +201,8 @@
 bool SkBitmapProcState::chooseScanlineProcs(bool trivialMatrix, bool clampClamp,
                                             const SkPaint& paint) {
     fMatrixProc = this->chooseMatrixProc(trivialMatrix);
-    // TODO(dominikg): SkASSERT(fMatrixProc) instead? chooseMatrixProc never returns NULL.
-    if (NULL == fMatrixProc) {
+    // TODO(dominikg): SkASSERT(fMatrixProc) instead? chooseMatrixProc never returns nullptr.
+    if (nullptr == fMatrixProc) {
         return false;
     }
 
@@ -338,11 +338,11 @@
             SI8_D16_filter_DX,
 
             // Don't support 4444 -> 565
-            NULL, NULL, NULL, NULL,
+            nullptr, nullptr, nullptr, nullptr,
             // Don't support A8 -> 565
-            NULL, NULL, NULL, NULL,
+            nullptr, nullptr, nullptr, nullptr,
             // Don't support G8 -> 565 (but we could)
-            NULL, NULL, NULL, NULL
+            nullptr, nullptr, nullptr, nullptr
         };
 #endif
 
@@ -364,7 +364,7 @@
             fShaderProc32 = Clamp_S32_opaque_D32_nofilter_DX_shaderproc;
         }
 
-        if (NULL == fShaderProc32) {
+        if (nullptr == fShaderProc32) {
             fShaderProc32 = this->chooseShaderProc32();
         }
     }
@@ -381,7 +381,7 @@
                                                     int count) {
     SkASSERT(((s.fInvType & ~SkMatrix::kTranslate_Mask)) == 0);
     SkASSERT(s.fInvKy == 0);
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
 
     const int maxX = s.fPixmap.width() - 1;
@@ -455,7 +455,7 @@
                                                      int count) {
     SkASSERT(((s.fInvType & ~SkMatrix::kTranslate_Mask)) == 0);
     SkASSERT(s.fInvKy == 0);
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
 
     const int stopX = s.fPixmap.width();
@@ -495,7 +495,7 @@
                                       int count) {
     SkASSERT((s.fInvType & ~(SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)) == 0);
     SkASSERT(s.fInvKy == 0);
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(1 == s.fPixmap.width());
 
     int iY0;
@@ -633,7 +633,7 @@
 SkBitmapProcState::ShaderProc32 SkBitmapProcState::chooseShaderProc32() {
 
     if (kN32_SkColorType != fPixmap.colorType()) {
-        return NULL;
+        return nullptr;
     }
 
     static const unsigned kMask = SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask;
@@ -648,13 +648,13 @@
     }
 
     if (fAlphaScale < 256) {
-        return NULL;
+        return nullptr;
     }
     if (fInvType > SkMatrix::kTranslate_Mask) {
-        return NULL;
+        return nullptr;
     }
     if (kNone_SkFilterQuality != fFilterLevel) {
-        return NULL;
+        return nullptr;
     }
 
     SkShader::TileMode tx = (SkShader::TileMode)fTileModeX;
@@ -672,7 +672,7 @@
         }
         return DoNothing_shaderproc;
     }
-    return NULL;
+    return nullptr;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/SkBitmapProcState.h b/src/core/SkBitmapProcState.h
index 57fd273..814c79a 100644
--- a/src/core/SkBitmapProcState.h
+++ b/src/core/SkBitmapProcState.h
@@ -123,7 +123,7 @@
 
     ShaderProc32        fShaderProc32;      // chooseProcs
     ShaderProc16        fShaderProc16;      // chooseProcs
-    // These are used if the shaderproc is NULL
+    // These are used if the shaderproc is nullptr
     MatrixProc          fMatrixProc;        // chooseProcs
     SampleProc32        fSampleProc32;      // chooseProcs
     SampleProc16        fSampleProc16;      // chooseProcs
diff --git a/src/core/SkBitmapProcState_sample.h b/src/core/SkBitmapProcState_sample.h
index 5322a36..f70b758 100644
--- a/src/core/SkBitmapProcState_sample.h
+++ b/src/core/SkBitmapProcState_sample.h
@@ -41,7 +41,7 @@
 void MAKENAME(_nofilter_DXDY)(const SkBitmapProcState& s,
                               const uint32_t* SK_RESTRICT xy,
                               int count, DSTTYPE* SK_RESTRICT colors) {
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
     SkDEBUGCODE(CHECKSTATE(s);)
 
@@ -83,7 +83,7 @@
 void MAKENAME(_nofilter_DX)(const SkBitmapProcState& s,
                             const uint32_t* SK_RESTRICT xy,
                             int count, DSTTYPE* SK_RESTRICT colors) {
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
     SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
     SkDEBUGCODE(CHECKSTATE(s);)
@@ -138,7 +138,7 @@
 void MAKENAME(_filter_DX)(const SkBitmapProcState& s,
                           const uint32_t* SK_RESTRICT xy,
                            int count, DSTTYPE* SK_RESTRICT colors) {
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
     SkDEBUGCODE(CHECKSTATE(s);)
 
@@ -184,7 +184,7 @@
 void MAKENAME(_filter_DXDY)(const SkBitmapProcState& s,
                             const uint32_t* SK_RESTRICT xy,
                             int count, DSTTYPE* SK_RESTRICT colors) {
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
     SkDEBUGCODE(CHECKSTATE(s);)
 
diff --git a/src/core/SkBitmapProcState_shaderproc.h b/src/core/SkBitmapProcState_shaderproc.h
index 2708b01..94b2d3b 100644
--- a/src/core/SkBitmapProcState_shaderproc.h
+++ b/src/core/SkBitmapProcState_shaderproc.h
@@ -20,7 +20,7 @@
     SkASSERT((s.fInvType & ~(SkMatrix::kTranslate_Mask |
                              SkMatrix::kScale_Mask)) == 0);
     SkASSERT(s.fInvKy == 0);
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
     SkDEBUGCODE(CHECKSTATE(s);)
 
diff --git a/src/core/SkBitmapScaler.cpp b/src/core/SkBitmapScaler.cpp
index be79857..ff053a9 100644
--- a/src/core/SkBitmapScaler.cpp
+++ b/src/core/SkBitmapScaler.cpp
@@ -251,7 +251,7 @@
 bool SkBitmapScaler::Resize(SkBitmap* resultPtr, const SkPixmap& source, ResizeMethod method,
                             float destWidth, float destHeight,
                             SkBitmap::Allocator* allocator) {
-    if (NULL == source.addr() || source.colorType() != kN32_SkColorType ||
+    if (nullptr == source.addr() || source.colorType() != kN32_SkColorType ||
         source.width() < 1 || source.height() < 1)
     {
         return false;
@@ -263,7 +263,7 @@
         return false;
     }
 
-    SkConvolutionProcs convolveProcs= { 0, NULL, NULL, NULL, NULL };
+    SkConvolutionProcs convolveProcs= { 0, nullptr, nullptr, nullptr, nullptr };
     PlatformConvolutionProcs(&convolveProcs);
 
     SkRect destSubset = { 0, 0, destWidth, destHeight };
@@ -293,7 +293,7 @@
     result.setInfo(SkImageInfo::MakeN32(SkScalarCeilToInt(destSubset.width()),
                                       SkScalarCeilToInt(destSubset.height()),
                                       source.alphaType()));
-    result.allocPixels(allocator, NULL);
+    result.allocPixels(allocator, nullptr);
     if (!result.readyToDraw()) {
       return false;
     }
diff --git a/src/core/SkBitmapScaler.h b/src/core/SkBitmapScaler.h
index c4c7f0a..1b7eef5 100644
--- a/src/core/SkBitmapScaler.h
+++ b/src/core/SkBitmapScaler.h
@@ -80,7 +80,7 @@
     };
 
     static bool Resize(SkBitmap* result, const SkPixmap& src, ResizeMethod method,
-                       float dest_width, float dest_height, SkBitmap::Allocator* = NULL);
+                       float dest_width, float dest_height, SkBitmap::Allocator* = nullptr);
 
      /** Platforms can also optionally overwrite the convolution functions
         if we have SIMD versions of them.
diff --git a/src/core/SkBlitMask.h b/src/core/SkBlitMask.h
index d39c094..f36f9f3 100644
--- a/src/core/SkBlitMask.h
+++ b/src/core/SkBlitMask.h
@@ -54,7 +54,7 @@
 
     /**
      *  Return either platform specific optimized blitcolor BlitLCD16RowProc,
-     *  or NULL if no optimized routine is available.
+     *  or nullptr if no optimized routine is available.
      */
     static BlitLCD16RowProc PlatformBlitRowProcs16(bool isOpaque);
 
@@ -64,13 +64,13 @@
 
     /**
      *  Public entry-point to return a blitmask RowProc.
-     *  May return NULL if config or format are not supported.
+     *  May return nullptr if config or format are not supported.
      */
     static RowProc RowFactory(SkColorType, SkMask::Format, RowFlags);
 
     /**
      *  Return either platform specific optimized blitmask RowProc,
-     *  or NULL if no optimized routine is available.
+     *  or nullptr if no optimized routine is available.
      */
     static RowProc PlatformRowProcs(SkColorType, SkMask::Format, RowFlags);
 };
diff --git a/src/core/SkBlitMask_D32.cpp b/src/core/SkBlitMask_D32.cpp
index fb2991c..3cc791a 100644
--- a/src/core/SkBlitMask_D32.cpp
+++ b/src/core/SkBlitMask_D32.cpp
@@ -31,10 +31,10 @@
     const uint16_t* srcRow = (const uint16_t*)mask;
     SkPMColor       opaqueDst;
 
-    SkBlitMask::BlitLCD16RowProc proc = NULL;
+    SkBlitMask::BlitLCD16RowProc proc = nullptr;
     bool isOpaque = (0xFF == SkColorGetA(color));
     proc = SkBlitMask::BlitLCD16RowFactory(isOpaque);
-    SkASSERT(proc != NULL);
+    SkASSERT(proc != nullptr);
 
     if (isOpaque) {
         opaqueDst = SkPreMultiplyColor(color);
@@ -283,8 +283,8 @@
 
     static const RowProc gProcs[] = {
         // need X coordinate to handle BW
-        false ? (RowProc)BW_RowProc_Blend : NULL, // suppress unused warning
-        false ? (RowProc)BW_RowProc_Opaque : NULL, // suppress unused warning
+        false ? (RowProc)BW_RowProc_Blend : nullptr, // suppress unused warning
+        false ? (RowProc)BW_RowProc_Opaque : nullptr, // suppress unused warning
         (RowProc)A8_RowProc_Blend,      (RowProc)A8_RowProc_Opaque,
         (RowProc)LCD16_RowProc_Blend,   (RowProc)LCD16_RowProc_Opaque,
     };
@@ -297,7 +297,7 @@
                 case SkMask::kA8_Format:    index = 2; break;
                 case SkMask::kLCD16_Format: index = 4; break;
                 default:
-                    return NULL;
+                    return nullptr;
             }
             if (flags & kSrcIsOpaque_RowFlag) {
                 index |= 1;
@@ -307,5 +307,5 @@
         default:
             break;
     }
-    return NULL;
+    return nullptr;
 }
diff --git a/src/core/SkBlitRow_D16.cpp b/src/core/SkBlitRow_D16.cpp
index 5aaa7a5..9ac84c6 100644
--- a/src/core/SkBlitRow_D16.cpp
+++ b/src/core/SkBlitRow_D16.cpp
@@ -246,7 +246,7 @@
     flags &= kFlags16_Mask;
 
     SkBlitRow::Proc16 proc = PlatformFactory565(flags);
-    if (NULL == proc) {
+    if (nullptr == proc) {
         proc = gDefault_565_Procs[flags];
     }
     return proc;
@@ -274,7 +274,7 @@
     SkASSERT(flags < SK_ARRAY_COUNT(gDefault_565_ColorProcs));
 
     SkBlitRow::ColorProc16 proc = PlatformColorFactory565(flags);
-    if (NULL == proc) {
+    if (nullptr == proc) {
         proc = gDefault_565_ColorProcs[flags];
     }
     return proc;
diff --git a/src/core/SkBlitRow_D32.cpp b/src/core/SkBlitRow_D32.cpp
index 559ee18..0f8cbe8 100644
--- a/src/core/SkBlitRow_D32.cpp
+++ b/src/core/SkBlitRow_D32.cpp
@@ -124,7 +124,7 @@
     flags &= kFlags32_Mask;
 
     SkBlitRow::Proc32 proc = PlatformProcs32(flags);
-    if (NULL == proc) {
+    if (nullptr == proc) {
         proc = gDefault_Procs32[flags];
     }
     SkASSERT(proc);
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index 62cd73e..1bc9963 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -29,11 +29,11 @@
 }
 
 SkShader::Context* SkBlitter::getShaderContext() const {
-    return NULL;
+    return nullptr;
 }
 
 const SkPixmap* SkBlitter::justAnOpaqueColor(uint32_t* value) {
-    return NULL;
+    return nullptr;
 }
 
 void SkBlitter::blitH(int x, int y, int width) {
@@ -243,7 +243,7 @@
 void SkNullBlitter::blitMask(const SkMask& mask, const SkIRect& clip) {}
 
 const SkPixmap* SkNullBlitter::justAnOpaqueColor(uint32_t* value) {
-    return NULL;
+    return nullptr;
 }
 
 bool SkNullBlitter::isNullBlitter() const { return true; }
@@ -553,7 +553,7 @@
         if (clip->isEmpty() || (ir && !SkIRect::Intersects(clipR, *ir))) {
             blitter = &fNullBlitter;
         } else if (clip->isRect()) {
-            if (ir == NULL || !clipR.contains(*ir)) {
+            if (ir == nullptr || !clipR.contains(*ir)) {
                 fRectBlitter.init(blitter, clipR);
                 blitter = &fRectBlitter;
             }
@@ -589,12 +589,12 @@
     }
 
     Context* onCreateContext(const ContextRec& rec, void* storage) const override {
-        SkShader::Context* proxyContext = NULL;
+        SkShader::Context* proxyContext = nullptr;
         if (fProxy) {
             char* proxyContextStorage = (char*) storage + sizeof(Sk3DShaderContext);
             proxyContext = fProxy->createContext(rec, proxyContextStorage);
             if (!proxyContext) {
-                return NULL;
+                return nullptr;
             }
         }
         return new (storage) Sk3DShaderContext(*this, rec, proxyContext);
@@ -606,7 +606,7 @@
         Sk3DShaderContext(const Sk3DShader& shader, const ContextRec& rec,
                           SkShader::Context* proxyContext)
             : INHERITED(shader, rec)
-            , fMask(NULL)
+            , fMask(nullptr)
             , fProxyContext(proxyContext)
         {
             if (!fProxyContext) {
@@ -627,8 +627,8 @@
                 fProxyContext->shadeSpan(x, y, span, count);
             }
 
-            if (fMask == NULL) {
-                if (fProxyContext == NULL) {
+            if (fMask == nullptr) {
+                if (fProxyContext == nullptr) {
                     sk_memset32(span, fPMColor, count);
                 }
                 return;
@@ -761,7 +761,7 @@
             fProxy->blitMask(mask, clip);
             ((SkMask*)&mask)->fFormat = SkMask::k3D_Format;
 
-            fShaderContext->set3DMask(NULL);
+            fShaderContext->set3DMask(nullptr);
         } else {
             fProxy->blitMask(mask, clip);
         }
@@ -782,7 +782,7 @@
                              const SkPaint& origPaint,
                              SkTBlitterAllocator* allocator,
                              bool drawCoverage) {
-    SkASSERT(allocator != NULL);
+    SkASSERT(allocator != nullptr);
 
     // which check, in case we're being called by a client with a dummy device
     // (e.g. they have a bounder that always aborts the draw)
@@ -794,11 +794,11 @@
     SkShader* shader = origPaint.getShader();
     SkColorFilter* cf = origPaint.getColorFilter();
     SkXfermode* mode = origPaint.getXfermode();
-    Sk3DShader* shader3D = NULL;
+    Sk3DShader* shader3D = nullptr;
 
     SkTCopyOnFirstWrite<SkPaint> paint(origPaint);
 
-    if (origPaint.getMaskFilter() != NULL &&
+    if (origPaint.getMaskFilter() != nullptr &&
             origPaint.getMaskFilter()->getFormat() == SkMask::k3D_Format) {
         shader3D = new Sk3DShader(shader);
         // we know we haven't initialized lazyPaint yet, so just do it
@@ -810,8 +810,8 @@
         bool deviceIsOpaque = kRGB_565_SkColorType == device.colorType();
         switch (SkInterpretXfermode(*paint, deviceIsOpaque)) {
             case kSrcOver_SkXfermodeInterpretation:
-                mode = NULL;
-                paint.writable()->setXfermode(NULL);
+                mode = nullptr;
+                paint.writable()->setXfermode(nullptr);
                 break;
             case kSkipDrawing_SkXfermodeInterpretation:{
                 return allocator->createT<SkNullBlitter>();
@@ -828,13 +828,13 @@
      */
     if (SkXfermode::IsMode(mode, SkXfermode::kClear_Mode)) {
         SkPaint* p = paint.writable();
-        shader = p->setShader(NULL);
-        cf = p->setColorFilter(NULL);
+        shader = p->setShader(nullptr);
+        cf = p->setColorFilter(nullptr);
         mode = p->setXfermodeMode(SkXfermode::kSrc_Mode);
         p->setColor(0);
     }
 
-    if (NULL == shader) {
+    if (nullptr == shader) {
         if (mode) {
             // xfermodes (and filters) require shaders for our current blitters
             shader = new SkColorShader(paint->getColor());
@@ -845,8 +845,8 @@
             // our color and move on.
             SkPaint* writablePaint = paint.writable();
             writablePaint->setColor(cf->filterColor(paint->getColor()));
-            writablePaint->setColorFilter(NULL);
-            cf = NULL;
+            writablePaint->setColorFilter(nullptr);
+            cf = nullptr;
         }
     }
 
@@ -861,9 +861,9 @@
     /*
      *  We create a SkShader::Context object, and store it on the blitter.
      */
-    SkShader::Context* shaderContext = NULL;
+    SkShader::Context* shaderContext = nullptr;
     if (shader) {
-        SkShader::ContextRec rec(*paint, matrix, NULL);
+        SkShader::ContextRec rec(*paint, matrix, nullptr);
         size_t contextSize = shader->contextSize();
         if (contextSize) {
             // Try to create the ShaderContext
@@ -880,12 +880,12 @@
         }
     }
 
-    SkBlitter*  blitter = NULL;
+    SkBlitter*  blitter = nullptr;
     switch (device.colorType()) {
         case kAlpha_8_SkColorType:
             if (drawCoverage) {
-                SkASSERT(NULL == shader);
-                SkASSERT(NULL == paint->getXfermode());
+                SkASSERT(nullptr == shader);
+                SkASSERT(nullptr == paint->getXfermode());
                 blitter = allocator->createT<SkA8_Coverage_Blitter>(device, *paint);
             } else if (shader) {
                 blitter = allocator->createT<SkA8_Shader_Blitter>(device, *paint, shaderContext);
@@ -933,7 +933,7 @@
 public:
     SkZeroShaderContext(const SkShader& shader, const SkShader::ContextRec& rec)
         // Override rec with the identity matrix, so it is guaranteed to be invertible.
-        : INHERITED(shader, SkShader::ContextRec(*rec.fPaint, SkMatrix::I(), NULL)) {}
+        : INHERITED(shader, SkShader::ContextRec(*rec.fPaint, SkMatrix::I(), nullptr)) {}
 
     void shadeSpan(int x, int y, SkPMColor colors[], int count) override {
         sk_bzero(colors, count * sizeof(SkPMColor));
@@ -967,7 +967,7 @@
     // shader to create it. It is therefore safe to re-use the storage.
     fShaderContext->~Context();
     SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext);
-    if (NULL == ctx) {
+    if (nullptr == ctx) {
         // Need a valid context in fShaderContext's storage, so we can later (or our caller) call
         // the in-place destructor.
         new (fShaderContext) SkZeroShaderContext(*fShader, rec);
diff --git a/src/core/SkBlitter.h b/src/core/SkBlitter.h
index baa9ccc..5740a5e 100644
--- a/src/core/SkBlitter.h
+++ b/src/core/SkBlitter.h
@@ -50,7 +50,7 @@
     virtual void blitMask(const SkMask&, const SkIRect& clip);
 
     /** If the blitter just sets a single value for each pixel, return the
-        bitmap it draws into, and assign value. If not, return NULL and ignore
+        bitmap it draws into, and assign value. If not, return nullptr and ignore
         the value parameter.
     */
     virtual const SkPixmap* justAnOpaqueColor(uint32_t* value);
@@ -109,7 +109,7 @@
      * This function allocates memory for the blitter that the blitter then owns.
      * The memory can be used by the calling function at will, but it will be
      * released when the blitter's destructor is called. This function returns
-     * NULL if no persistent memory is needed by the blitter.
+     * nullptr if no persistent memory is needed by the blitter.
      */
     virtual void* allocBlitMemory(size_t sz) {
         return fBlitMemory.reset(sz, SkAutoMalloc::kReuse_OnShrink);
@@ -229,7 +229,7 @@
 class SkBlitterClipper {
 public:
     SkBlitter*  apply(SkBlitter* blitter, const SkRegion* clip,
-                      const SkIRect* bounds = NULL);
+                      const SkIRect* bounds = nullptr);
 
 private:
     SkNullBlitter       fNullBlitter;
diff --git a/src/core/SkBlitter_A8.cpp b/src/core/SkBlitter_A8.cpp
index ce7d6e7..51748b0 100644
--- a/src/core/SkBlitter_A8.cpp
+++ b/src/core/SkBlitter_A8.cpp
@@ -21,7 +21,7 @@
         *value = 255;
         return &fDevice;
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkA8_Blitter::blitH(int x, int y, int width) {
@@ -231,7 +231,7 @@
                                          SkShader::Context* shaderContext)
     : INHERITED(device, paint, shaderContext)
 {
-    if ((fXfermode = paint.getXfermode()) != NULL) {
+    if ((fXfermode = paint.getXfermode()) != nullptr) {
         fXfermode->ref();
         SkASSERT(fShaderContext);
     }
@@ -260,7 +260,7 @@
 
         shaderContext->shadeSpan(x, y, span, width);
         if (fXfermode) {
-            fXfermode->xferA8(device, span, width, NULL);
+            fXfermode->xferA8(device, span, width, nullptr);
         } else {
             for (int i = width - 1; i >= 0; --i) {
                 unsigned    srcA = SkGetPackedA32(span[i]);
@@ -298,7 +298,7 @@
         }
         int aa = *antialias;
         if (aa) {
-            if (opaque && aa == 255 && mode == NULL) {
+            if (opaque && aa == 255 && mode == nullptr) {
                 memset(device, 0xFF, count);
             } else {
                 shaderContext->shadeSpan(x, y, span, count);
@@ -355,9 +355,9 @@
 
 SkA8_Coverage_Blitter::SkA8_Coverage_Blitter(const SkPixmap& device,
                              const SkPaint& paint) : SkRasterBlitter(device) {
-    SkASSERT(NULL == paint.getShader());
-    SkASSERT(NULL == paint.getXfermode());
-    SkASSERT(NULL == paint.getColorFilter());
+    SkASSERT(nullptr == paint.getShader());
+    SkASSERT(nullptr == paint.getXfermode());
+    SkASSERT(nullptr == paint.getColorFilter());
 }
 
 void SkA8_Coverage_Blitter::blitAntiH(int x, int y, const SkAlpha antialias[],
@@ -430,5 +430,5 @@
 }
 
 const SkPixmap* SkA8_Coverage_Blitter::justAnOpaqueColor(uint32_t*) {
-    return NULL;
+    return nullptr;
 }
diff --git a/src/core/SkBlitter_ARGB32.cpp b/src/core/SkBlitter_ARGB32.cpp
index 683acf0..e44ad02 100644
--- a/src/core/SkBlitter_ARGB32.cpp
+++ b/src/core/SkBlitter_ARGB32.cpp
@@ -59,7 +59,7 @@
         *value = fPMColor;
         return &fDevice;
     }
-    return NULL;
+    return nullptr;
 }
 
 #if defined _WIN32 && _MSC_VER >= 1300  // disable warning : local variable used without having been initialized
@@ -338,7 +338,7 @@
     fProc32Blend = SkBlitRow::Factory32(flags | SkBlitRow::kGlobalAlpha_Flag32);
 
     fShadeDirectlyIntoDevice = false;
-    if (fXfermode == NULL) {
+    if (fXfermode == nullptr) {
         if (shaderContext->getFlags() & SkShader::kOpaqueAlpha_Flag) {
             fShadeDirectlyIntoDevice = true;
         }
@@ -371,7 +371,7 @@
         SkPMColor*  span = fBuffer;
         fShaderContext->shadeSpan(x, y, span, width);
         if (fXfermode) {
-            fXfermode->xfer32(device, span, width, NULL);
+            fXfermode->xfer32(device, span, width, nullptr);
         } else {
             fProc32(device, span, width, 255);
         }
@@ -401,7 +401,7 @@
             SkXfermode* xfer = fXfermode;
             if (xfer) {
                 do {
-                    xfer->xfer32(device, span, width, NULL);
+                    xfer->xfer32(device, span, width, nullptr);
                     y += 1;
                     device = (uint32_t*)((char*)device + deviceRB);
                 } while (--height > 0);
@@ -438,7 +438,7 @@
         if (xfer) {
             do {
                 shaderContext->shadeSpan(x, y, span, width);
-                xfer->xfer32(device, span, width, NULL);
+                xfer->xfer32(device, span, width, nullptr);
                 y += 1;
                 device = (uint32_t*)((char*)device + deviceRB);
             } while (--height > 0);
@@ -471,7 +471,7 @@
             if (aa) {
                 shaderContext->shadeSpan(x, y, span, count);
                 if (aa == 255) {
-                    xfer->xfer32(device, span, count, NULL);
+                    xfer->xfer32(device, span, count, nullptr);
                 } else {
                     // count is almost always 1
                     for (int i = count - 1; i >= 0; --i) {
@@ -539,7 +539,7 @@
     SkASSERT(mask.fBounds.contains(clip));
 
     SkShader::Context*  shaderContext = fShaderContext;
-    SkBlitMask::RowProc proc = NULL;
+    SkBlitMask::RowProc proc = nullptr;
     if (!fXfermode) {
         unsigned flags = 0;
         if (shaderContext->getFlags() & SkShader::kOpaqueAlpha_Flag) {
@@ -547,7 +547,7 @@
         }
         proc = SkBlitMask::RowFactory(kN32_SkColorType, mask.fFormat,
                                       (SkBlitMask::RowFlags)flags);
-        if (NULL == proc) {
+        if (nullptr == proc) {
             this->INHERITED::blitMask(mask, clip);
             return;
         }
diff --git a/src/core/SkBlitter_RGB16.cpp b/src/core/SkBlitter_RGB16.cpp
index d87c636..06dfeea 100644
--- a/src/core/SkBlitter_RGB16.cpp
+++ b/src/core/SkBlitter_RGB16.cpp
@@ -172,9 +172,9 @@
 #ifdef USE_BLACK_BLITTER
 SkRGB16_Black_Blitter::SkRGB16_Black_Blitter(const SkPixmap& device, const SkPaint& paint)
     : INHERITED(device, paint) {
-    SkASSERT(paint.getShader() == NULL);
-    SkASSERT(paint.getColorFilter() == NULL);
-    SkASSERT(paint.getXfermode() == NULL);
+    SkASSERT(paint.getShader() == nullptr);
+    SkASSERT(paint.getColorFilter() == nullptr);
+    SkASSERT(paint.getXfermode() == nullptr);
     SkASSERT(paint.getColor() == SK_ColorBLACK);
 }
 
@@ -568,7 +568,7 @@
         *value = fRawColor16;
         return &fDevice;
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkRGB16_Blitter::blitH(int x, int y, int width) {
@@ -822,7 +822,7 @@
                                                SkShader::Context* shaderContext)
     : INHERITED(device, paint, shaderContext)
 {
-    SkASSERT(paint.getXfermode() == NULL);
+    SkASSERT(paint.getXfermode() == nullptr);
 
     fBuffer = (SkPMColor*)sk_malloc_throw(device.width() * sizeof(SkPMColor));
 
@@ -970,7 +970,7 @@
     SkPMColor*  span = fBuffer;
 
     fShaderContext->shadeSpan(x, y, span, width);
-    fXfermode->xfer16(device, span, width, NULL);
+    fXfermode->xfer16(device, span, width, nullptr);
 }
 
 void SkRGB16_Shader_Xfermode_Blitter::blitAntiH(int x, int y,
@@ -1006,7 +1006,7 @@
         SkPMColor* localSpan = span;
         for (;;) {
             if (aa == 0xFF) {
-                mode->xfer16(device, localSpan, count, NULL);
+                mode->xfer16(device, localSpan, count, nullptr);
             } else {
                 SkASSERT(aa);
                 memset(aaExpand, aa, count);
@@ -1033,17 +1033,17 @@
 SkBlitter* SkBlitter_ChooseD565(const SkPixmap& device, const SkPaint& paint,
         SkShader::Context* shaderContext,
         SkTBlitterAllocator* allocator) {
-    SkASSERT(allocator != NULL);
+    SkASSERT(allocator != nullptr);
 
     SkBlitter* blitter;
     SkShader* shader = paint.getShader();
     SkXfermode* mode = paint.getXfermode();
 
     // we require a shader if there is an xfermode, handled by our caller
-    SkASSERT(NULL == mode || shader);
+    SkASSERT(nullptr == mode || shader);
 
     if (shader) {
-        SkASSERT(shaderContext != NULL);
+        SkASSERT(shaderContext != nullptr);
         if (mode) {
             blitter = allocator->createT<SkRGB16_Shader_Xfermode_Blitter>(device, paint,
                                                                           shaderContext);
diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp
index 6dc5785..605fa43 100644
--- a/src/core/SkBlitter_Sprite.cpp
+++ b/src/core/SkBlitter_Sprite.cpp
@@ -51,7 +51,7 @@
         paint and return null if it is set, forcing the client to take the slow shader case
         (which does respect soft edges).
     */
-    SkASSERT(allocator != NULL);
+    SkASSERT(allocator != nullptr);
 
     SkSpriteBlitter* blitter;
 
@@ -63,7 +63,7 @@
             blitter = SkSpriteBlitter::ChooseD32(source, paint, allocator);
             break;
         default:
-            blitter = NULL;
+            blitter = nullptr;
             break;
     }
 
diff --git a/src/core/SkBuffer.cpp b/src/core/SkBuffer.cpp
index 51c368a..86c3bed 100644
--- a/src/core/SkBuffer.cpp
+++ b/src/core/SkBuffer.cpp
@@ -22,7 +22,7 @@
 const void* SkRBuffer::skip(size_t size)
 {
     const void* result = fPos;
-    readNoSizeCheck(NULL, size);
+    readNoSizeCheck(nullptr, size);
     return result;
 }
 
@@ -45,8 +45,8 @@
 void* SkWBuffer::skip(size_t size)
 {
     void* result = fPos;
-    writeNoSizeCheck(NULL, size);
-    return fData == NULL ? NULL : result;
+    writeNoSizeCheck(nullptr, size);
+    return fData == nullptr ? nullptr : result;
 }
 
 void SkWBuffer::writeNoSizeCheck(const void* buffer, size_t size)
diff --git a/src/core/SkCachedData.cpp b/src/core/SkCachedData.cpp
index 439c2ff..cfa4c61 100644
--- a/src/core/SkCachedData.cpp
+++ b/src/core/SkCachedData.cpp
@@ -151,7 +151,7 @@
                 SkASSERT(ptr);
                 this->setData(ptr);
             } else {
-                this->setData(NULL);   // signal failure to lock, contents are gone
+                this->setData(nullptr);   // signal failure to lock, contents are gone
             }
             break;
     }
@@ -173,7 +173,7 @@
             }
             break;
     }
-    this->setData(NULL);   // signal that we're in an unlocked state
+    this->setData(nullptr);   // signal that we're in an unlocked state
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -192,7 +192,7 @@
         }
     } else {
         SkASSERT((fInCache && 1 == fRefCnt) || (0 == fRefCnt));
-        SkASSERT(NULL == fData);
+        SkASSERT(nullptr == fData);
     }
 }
 #endif
diff --git a/src/core/SkCachedData.h b/src/core/SkCachedData.h
index d44fbc5..739be72 100644
--- a/src/core/SkCachedData.h
+++ b/src/core/SkCachedData.h
@@ -36,7 +36,7 @@
     }
 
 protected:
-    // called when fData changes. could be NULL.
+    // called when fData changes. could be nullptr.
     virtual void onDataChange(void* oldData, void* newData) {}
 
 private:
@@ -93,7 +93,7 @@
      *  ref's the data (typically from a find(key, visitor) call).
      *
      *  Thus the data will always be "locked" when a non-cache has a ref on it (whether or not
-     *  the lock succeeded to recover the memory -- check data() to see if it is NULL).
+     *  the lock succeeded to recover the memory -- check data() to see if it is nullptr).
      */
 
     /*
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 03c5173..7043ec3 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -194,16 +194,16 @@
 
     DeviceCM(SkBaseDevice* device, const SkPaint* paint, SkCanvas* canvas,
              bool conservativeRasterClip, bool deviceIsBitmapDevice)
-        : fNext(NULL)
+        : fNext(nullptr)
         , fClip(conservativeRasterClip)
         , fDeviceIsBitmapDevice(deviceIsBitmapDevice)
     {
-        if (NULL != device) {
+        if (nullptr != device) {
             device->ref();
             device->onAttachToCanvas(canvas);
         }
         fDevice = device;
-        fPaint = paint ? new SkPaint(*paint) : NULL;
+        fPaint = paint ? new SkPaint(*paint) : nullptr;
     }
 
     ~DeviceCM() {
@@ -284,9 +284,9 @@
     int             fDeferredSaveCount;
 
     MCRec(bool conservativeRasterClip) : fRasterClip(conservativeRasterClip) {
-        fFilter     = NULL;
-        fLayer      = NULL;
-        fTopLayer   = NULL;
+        fFilter     = nullptr;
+        fLayer      = nullptr;
+        fTopLayer   = nullptr;
         fMatrix.reset();
         fDeferredSaveCount = 0;
 
@@ -295,7 +295,7 @@
     }
     MCRec(const MCRec& prev) : fRasterClip(prev.fRasterClip), fMatrix(prev.fMatrix) {
         fFilter = SkSafeRef(prev.fFilter);
-        fLayer = NULL;
+        fLayer = nullptr;
         fTopLayer = prev.fTopLayer;
         fDeferredSaveCount = 0;
 
@@ -346,13 +346,13 @@
             fRC     = &rec->fClip;
             fDevice = rec->fDevice;
             if (!fDevice->accessPixels(&fDst)) {
-                fDst.reset(fDevice->imageInfo(), NULL, 0);
+                fDst.reset(fDevice->imageInfo(), nullptr, 0);
             }
             fPaint  = rec->fPaint;
             SkDEBUGCODE(this->validate();)
 
             fCurrLayer = rec->fNext;
-            // fCurrLayer may be NULL now
+            // fCurrLayer may be nullptr now
 
             return true;
         }
@@ -383,21 +383,21 @@
 
 /**
  *  If the paint has an imagefilter, but it can be simplified to just a colorfilter, return that
- *  colorfilter, else return NULL.
+ *  colorfilter, else return nullptr.
  */
 static SkColorFilter* image_to_color_filter(const SkPaint& paint) {
     SkImageFilter* imgf = paint.getImageFilter();
     if (!imgf) {
-        return NULL;
+        return nullptr;
     }
 
     SkColorFilter* imgCF;
     if (!imgf->asAColorFilter(&imgCF)) {
-        return NULL;
+        return nullptr;
     }
 
     SkColorFilter* paintCF = paint.getColorFilter();
-    if (NULL == paintCF) {
+    if (nullptr == paintCF) {
         // there is no existing paint colorfilter, so we can just return the imagefilter's
         return imgCF;
     }
@@ -412,7 +412,7 @@
 public:
     AutoDrawLooper(SkCanvas* canvas, const SkSurfaceProps& props, const SkPaint& paint,
                    bool skipLayerForImageFilter = false,
-                   const SkRect* bounds = NULL) : fOrigPaint(paint) {
+                   const SkRect* bounds = nullptr) : fOrigPaint(paint) {
         fCanvas = canvas;
         fFilter = canvas->getDrawFilter();
         fPaint = &fOrigPaint;
@@ -424,7 +424,7 @@
         if (simplifiedCF) {
             SkPaint* paint = set_if_needed(&fLazyPaintInit, fOrigPaint);
             paint->setColorFilter(simplifiedCF)->unref();
-            paint->setImageFilter(NULL);
+            paint->setImageFilter(nullptr);
             fPaint = paint;
         }
 
@@ -459,7 +459,7 @@
             fLooperContext = looper->createContext(canvas, buffer);
             fIsSimple = false;
         } else {
-            fLooperContext = NULL;
+            fLooperContext = nullptr;
             // can we be marked as simple?
             fIsSimple = !fFilter && !fTempLayerForImageFilter;
         }
@@ -516,7 +516,7 @@
 };
 
 bool AutoDrawLooper::doNext(SkDrawFilter::Type drawType) {
-    fPaint = NULL;
+    fPaint = nullptr;
     SkASSERT(!fIsSimple);
     SkASSERT(fLooperContext || fFilter || fTempLayerForImageFilter);
 
@@ -525,8 +525,8 @@
     paint->setFlags(fNewPaintFlags);
 
     if (fTempLayerForImageFilter) {
-        paint->setImageFilter(NULL);
-        paint->setXfermode(NULL);
+        paint->setImageFilter(nullptr);
+        paint->setXfermode(nullptr);
     }
 
     if (fLooperContext && !fLooperContext->next(fCanvas, paint)) {
@@ -538,7 +538,7 @@
             fDone = true;
             return false;
         }
-        if (NULL == fLooperContext) {
+        if (nullptr == fLooperContext) {
             // no looper means we only draw once
             fDone = true;
         }
@@ -552,7 +552,7 @@
 
     // call this after any possible paint modifiers
     if (fPaint->nothingToDraw()) {
-        fPaint = NULL;
+        fPaint = nullptr;
         return false;
     }
     return true;
@@ -602,7 +602,7 @@
     fAllowSimplifyClip = false;
     fDeviceCMDirty = true;
     fSaveCount = 1;
-    fMetaData = NULL;
+    fMetaData = nullptr;
 
     fClipStack.reset(new SkClipStack);
 
@@ -611,11 +611,11 @@
 
     SkASSERT(sizeof(DeviceCM) <= sizeof(fDeviceCMStorage));
     fMCRec->fLayer = (DeviceCM*)fDeviceCMStorage;
-    new (fDeviceCMStorage) DeviceCM(NULL, NULL, NULL, fConservativeRasterClip, false);
+    new (fDeviceCMStorage) DeviceCM(nullptr, nullptr, nullptr, fConservativeRasterClip, false);
 
     fMCRec->fTopLayer = fMCRec->fLayer;
 
-    fSurfaceBase = NULL;
+    fSurfaceBase = nullptr;
 
     if (device) {
         // The root device and the canvas should always have the same pixel geometry
@@ -636,7 +636,7 @@
 {
     inc_canvas();
 
-    this->init(NULL, kDefault_InitFlags);
+    this->init(nullptr, kDefault_InitFlags);
 }
 
 static SkBitmap make_nopixels(int width, int height) {
@@ -739,7 +739,7 @@
 SkMetaData& SkCanvas::getMetaData() {
     // metadata users are rare, so we lazily allocate it. If that changes we
     // can decide to just make it a field in the device (rather than a ptr)
-    if (NULL == fMetaData) {
+    if (nullptr == fMetaData) {
         fMetaData = new SkMetaData;
     }
     return *fMetaData;
@@ -789,7 +789,7 @@
     }
 
     bool weAllocated = false;
-    if (NULL == bitmap->pixelRef()) {
+    if (nullptr == bitmap->pixelRef()) {
         if (!bitmap->tryAllocPixels()) {
             return false;
         }
@@ -805,7 +805,7 @@
     }
 
     if (weAllocated) {
-        bitmap->setPixelRef(NULL);
+        bitmap->setPixelRef(nullptr);
     }
     return false;
 }
@@ -867,7 +867,7 @@
         default:
             break;
     }
-    if (NULL == pixels || rowBytes < origInfo.minRowBytes()) {
+    if (nullptr == pixels || rowBytes < origInfo.minRowBytes()) {
         return false;
     }
 
@@ -915,13 +915,13 @@
         const SkRasterClip& totalClip = fMCRec->fRasterClip;
         DeviceCM*       layer = fMCRec->fTopLayer;
 
-        if (NULL == layer->fNext) {   // only one layer
-            layer->updateMC(totalMatrix, totalClip, *fClipStack, NULL);
+        if (nullptr == layer->fNext) {   // only one layer
+            layer->updateMC(totalMatrix, totalClip, *fClipStack, nullptr);
         } else {
             SkRasterClip clip(totalClip);
             do {
                 layer->updateMC(totalMatrix, clip, *fClipStack, &clip);
-            } while ((layer = layer->fNext) != NULL);
+            } while ((layer = layer->fNext) != nullptr);
         }
         fDeviceCMDirty = false;
     }
@@ -1056,7 +1056,7 @@
 
 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint) {
     if (gIgnoreSaveLayerBounds) {
-        bounds = NULL;
+        bounds = nullptr;
     }
     SaveLayerStrategy strategy = this->willSaveLayer(bounds, paint, kARGB_ClipLayer_SaveFlag);
     fSaveCount += 1;
@@ -1066,7 +1066,7 @@
 
 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags) {
     if (gIgnoreSaveLayerBounds) {
-        bounds = NULL;
+        bounds = nullptr;
     }
     SaveLayerStrategy strategy = this->willSaveLayer(bounds, paint, flags);
     fSaveCount += 1;
@@ -1087,7 +1087,7 @@
     fDeviceCMDirty = true;
 
     SkIRect ir;
-    if (!this->clipRectBounds(bounds, flags, &ir, paint ? paint->getImageFilter() : NULL)) {
+    if (!this->clipRectBounds(bounds, flags, &ir, paint ? paint->getImageFilter() : nullptr)) {
         return;
     }
 
@@ -1110,7 +1110,7 @@
                         isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
 
     SkBaseDevice* device = this->getTopDevice();
-    if (NULL == device) {
+    if (nullptr == device) {
         SkDebugf("Unable to find device for layer.");
         return;
     }
@@ -1120,11 +1120,11 @@
         const SkBaseDevice::TileUsage usage = SkBaseDevice::kNever_TileUsage;
         const SkBaseDevice::CreateInfo createInfo = SkBaseDevice::CreateInfo(info, usage, geo);
         SkBaseDevice* newDev = device->onCreateDevice(createInfo, paint);
-        if (NULL == newDev) {
+        if (nullptr == newDev) {
             // If onCreateDevice didn't succeed, try raster (e.g. PDF couldn't handle the paint)
             const SkSurfaceProps surfaceProps(fProps.flags(), createInfo.fPixelGeometry);
             newDev = SkBitmapDevice::Create(createInfo.fInfo, surfaceProps);
-            if (NULL == newDev) {
+            if (nullptr == newDev) {
                 SkErrorInternals::SetError(kInternalError_SkError,
                                            "Unable to create device for layer.");
                 return;
@@ -1151,7 +1151,7 @@
 int SkCanvas::saveLayerAlpha(const SkRect* bounds, U8CPU alpha,
                              SaveFlags flags) {
     if (0xFF == alpha) {
-        return this->saveLayer(bounds, NULL, flags);
+        return this->saveLayer(bounds, nullptr, flags);
     } else {
         SkPaint tmpPaint;
         tmpPaint.setAlpha(alpha);
@@ -1170,7 +1170,7 @@
     // reserve our layer (if any)
     DeviceCM* layer = fMCRec->fLayer;   // may be null
     // now detach it from fMCRec so we can pop(). Gets freed after its drawn
-    fMCRec->fLayer = NULL;
+    fMCRec->fLayer = nullptr;
 
     // now do the normal restore()
     fMCRec->~MCRec();       // balanced in save()
@@ -1198,7 +1198,7 @@
 }
 
 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* props) {
-    if (NULL == props) {
+    if (nullptr == props) {
         props = &fProps;
     }
     return this->onNewSurface(info, *props);
@@ -1206,7 +1206,7 @@
 
 SkSurface* SkCanvas::onNewSurface(const SkImageInfo& info, const SkSurfaceProps& props) {
     SkBaseDevice* dev = this->getDevice();
-    return dev ? dev->newSurface(info, props) : NULL;
+    return dev ? dev->newSurface(info, props) : nullptr;
 }
 
 SkImageInfo SkCanvas::imageInfo() const {
@@ -1221,7 +1221,7 @@
 const void* SkCanvas::peekPixels(SkImageInfo* info, size_t* rowBytes) {
     SkPixmap pmap;
     if (!this->onPeekPixels(&pmap)) {
-        return NULL;
+        return nullptr;
     }
     if (info) {
         *info = pmap.info();
@@ -1240,7 +1240,7 @@
 void* SkCanvas::accessTopLayerPixels(SkImageInfo* info, size_t* rowBytes, SkIPoint* origin) {
     SkPixmap pmap;
     if (!this->onAccessTopLayerPixels(&pmap)) {
-        return NULL;
+        return nullptr;
     }
     if (info) {
         *info = pmap.info();
@@ -1261,13 +1261,13 @@
 
 SkAutoROCanvasPixels::SkAutoROCanvasPixels(SkCanvas* canvas) {
     fAddr = canvas->peekPixels(&fInfo, &fRowBytes);
-    if (NULL == fAddr) {
+    if (nullptr == fAddr) {
         fInfo = canvas->imageInfo();
         if (kUnknown_SkColorType == fInfo.colorType() || !fBitmap.tryAllocPixels(fInfo)) {
-            return; // failure, fAddr is NULL
+            return; // failure, fAddr is nullptr
         }
         if (!canvas->readPixels(&fBitmap, 0, 0)) {
-            return; // failure, fAddr is NULL
+            return; // failure, fAddr is nullptr
         }
         fAddr = fBitmap.getPixels();
         fRowBytes = fBitmap.rowBytes();
@@ -1292,14 +1292,14 @@
     }
 
     SkLazyPaint lazy;
-    if (NULL == paint) {
+    if (nullptr == paint) {
         paint = lazy.init();
     }
 
     SkDEBUGCODE(bitmap.validate();)
 
     SkRect storage;
-    const SkRect* bounds = NULL;
+    const SkRect* bounds = nullptr;
     if (paint && paint->canComputeFastBounds()) {
         bitmap.getBounds(&storage);
         matrix.mapRect(&storage);
@@ -1318,7 +1318,7 @@
 void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y,
                                   const SkPaint* paint, bool deviceIsBitmapDevice) {
     SkPaint tmp;
-    if (NULL == paint) {
+    if (nullptr == paint) {
         paint = &tmp;
     }
 
@@ -1340,7 +1340,7 @@
             SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
             if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) {
                 SkPaint tmpUnfiltered(*paint);
-                tmpUnfiltered.setImageFilter(NULL);
+                tmpUnfiltered.setImageFilter(nullptr);
                 dstDev->drawSprite(iter, dst, pos.x() + offset.x(), pos.y() + offset.y(),
                                    tmpUnfiltered);
             }
@@ -1370,7 +1370,7 @@
     SkDEBUGCODE(bitmap.validate();)
 
     SkPaint tmp;
-    if (NULL == paint) {
+    if (nullptr == paint) {
         paint = &tmp;
     }
 
@@ -1391,7 +1391,7 @@
             SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
             if (filter->filterImage(&proxy, bitmap, ctx, &dst, &offset)) {
                 SkPaint tmpUnfiltered(*paint);
-                tmpUnfiltered.setImageFilter(NULL);
+                tmpUnfiltered.setImageFilter(nullptr);
                 iter.fDevice->drawSprite(iter, dst, pos.x() + offset.x(), pos.y() + offset.y(),
                                          tmpUnfiltered);
             }
@@ -1648,7 +1648,7 @@
 
     SkClipStack::B2TIter                iter(*fClipStack);
     const SkClipStack::Element* element;
-    while ((element = iter.next()) != NULL) {
+    while ((element = iter.next()) != nullptr) {
         switch (element->getType()) {
             case SkClipStack::Element::kRect_Type:
                 element->getRect().round(&ir);
@@ -1672,7 +1672,7 @@
     SkClipStack::B2TIter                iter(*fClipStack);
     const SkClipStack::Element*         element;
 
-    while ((element = iter.next()) != NULL) {
+    while ((element = iter.next()) != nullptr) {
         element->replay(visitor);
     }
 }
@@ -1770,7 +1770,7 @@
 
 GrRenderTarget* SkCanvas::internal_private_accessTopLayerRenderTarget() {
     SkBaseDevice* dev = this->getTopDevice();
-    return dev ? dev->accessRenderTarget() : NULL;
+    return dev ? dev->accessRenderTarget() : nullptr;
 }
 
 GrContext* SkCanvas::getGrContext() {
@@ -1784,7 +1784,7 @@
     }
 #endif
 
-    return NULL;
+    return nullptr;
 
 }
 
@@ -1967,7 +1967,7 @@
 }
 
 void SkCanvas::internalDrawPaint(const SkPaint& paint) {
-    LOOPER_BEGIN_CHECK_COMPLETE_OVERWRITE(paint, SkDrawFilter::kPaint_Type, NULL, false)
+    LOOPER_BEGIN_CHECK_COMPLETE_OVERWRITE(paint, SkDrawFilter::kPaint_Type, nullptr, false)
 
     while (iter.next()) {
         iter.fDevice->drawPaint(iter, looper.paint());
@@ -1984,7 +1984,7 @@
     }
 
     SkRect r, storage;
-    const SkRect* bounds = NULL;
+    const SkRect* bounds = nullptr;
     if (paint.canComputeFastBounds()) {
         // special-case 2 points (common for drawing a single line)
         if (2 == count) {
@@ -1998,7 +1998,7 @@
         }
     }
 
-    SkASSERT(pts != NULL);
+    SkASSERT(pts != nullptr);
 
     LOOPER_BEGIN(paint, SkDrawFilter::kPoint_Type, bounds)
 
@@ -2012,7 +2012,7 @@
 void SkCanvas::onDrawRect(const SkRect& r, const SkPaint& paint) {
     TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawRect()");
     SkRect storage;
-    const SkRect* bounds = NULL;
+    const SkRect* bounds = nullptr;
     if (paint.canComputeFastBounds()) {
         // Skia will draw an inverted rect, because it explicitly "sorts" it downstream.
         // To prevent accidental rejecting at this stage, we have to sort it before we check.
@@ -2037,7 +2037,7 @@
 void SkCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) {
     TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawOval()");
     SkRect storage;
-    const SkRect* bounds = NULL;
+    const SkRect* bounds = nullptr;
     if (paint.canComputeFastBounds()) {
         bounds = &paint.computeFastBounds(oval, &storage);
         if (this->quickReject(*bounds)) {
@@ -2057,7 +2057,7 @@
 void SkCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
     TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawRRect()");
     SkRect storage;
-    const SkRect* bounds = NULL;
+    const SkRect* bounds = nullptr;
     if (paint.canComputeFastBounds()) {
         bounds = &paint.computeFastBounds(rrect.getBounds(), &storage);
         if (this->quickReject(*bounds)) {
@@ -2087,7 +2087,7 @@
 void SkCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
                             const SkPaint& paint) {
     SkRect storage;
-    const SkRect* bounds = NULL;
+    const SkRect* bounds = nullptr;
     if (paint.canComputeFastBounds()) {
         bounds = &paint.computeFastBounds(outer.getBounds(), &storage);
         if (this->quickReject(*bounds)) {
@@ -2111,7 +2111,7 @@
     }
 
     SkRect storage;
-    const SkRect* bounds = NULL;
+    const SkRect* bounds = nullptr;
     if (!path.isInverseFillType() && paint.canComputeFastBounds()) {
         const SkRect& pathBounds = path.getBounds();
         bounds = &paint.computeFastBounds(pathBounds, &storage);
@@ -2141,7 +2141,7 @@
     TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawImage()");
     SkRect bounds = SkRect::MakeXYWH(x, y,
                                      SkIntToScalar(image->width()), SkIntToScalar(image->height()));
-    if (NULL == paint || paint->canComputeFastBounds()) {
+    if (nullptr == paint || paint->canComputeFastBounds()) {
         if (paint) {
             paint->computeFastBounds(bounds, &bounds);
         }
@@ -2151,7 +2151,7 @@
     }
     
     SkLazyPaint lazy;
-    if (NULL == paint) {
+    if (nullptr == paint) {
         paint = lazy.init();
     }
     
@@ -2169,7 +2169,7 @@
     TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawImageRect()");
     SkRect storage;
     const SkRect* bounds = &dst;
-    if (NULL == paint || paint->canComputeFastBounds()) {
+    if (nullptr == paint || paint->canComputeFastBounds()) {
         if (paint) {
             bounds = &paint->computeFastBounds(dst, &storage);
         }
@@ -2178,7 +2178,7 @@
         }
     }
     SkLazyPaint lazy;
-    if (NULL == paint) {
+    if (nullptr == paint) {
         paint = lazy.init();
     }
     
@@ -2196,7 +2196,7 @@
     TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawBitmap()");
     SkDEBUGCODE(bitmap.validate();)
 
-    if (NULL == paint || paint->canComputeFastBounds()) {
+    if (nullptr == paint || paint->canComputeFastBounds()) {
         SkRect bounds = {
             x, y,
             x + SkIntToScalar(bitmap.width()),
@@ -2225,7 +2225,7 @@
 
     SkRect storage;
     const SkRect* bounds = &dst;
-    if (NULL == paint || paint->canComputeFastBounds()) {
+    if (nullptr == paint || paint->canComputeFastBounds()) {
         if (paint) {
             bounds = &paint->computeFastBounds(dst, &storage);
         }
@@ -2235,7 +2235,7 @@
     }
 
     SkLazyPaint lazy;
-    if (NULL == paint) {
+    if (nullptr == paint) {
         paint = lazy.init();
     }
 
@@ -2262,7 +2262,7 @@
     
     SkRect storage;
     const SkRect* bounds = &dst;
-    if (NULL == paint || paint->canComputeFastBounds()) {
+    if (nullptr == paint || paint->canComputeFastBounds()) {
         if (paint) {
             bounds = &paint->computeFastBounds(dst, &storage);
         }
@@ -2272,7 +2272,7 @@
     }
     
     SkLazyPaint lazy;
-    if (NULL == paint) {
+    if (nullptr == paint) {
         paint = lazy.init();
     }
     
@@ -2292,7 +2292,7 @@
 
     SkRect storage;
     const SkRect* bounds = &dst;
-    if (NULL == paint || paint->canComputeFastBounds()) {
+    if (nullptr == paint || paint->canComputeFastBounds()) {
         if (paint) {
             bounds = &paint->computeFastBounds(dst, &storage);
         }
@@ -2302,7 +2302,7 @@
     }
     
     SkLazyPaint lazy;
-    if (NULL == paint) {
+    if (nullptr == paint) {
         paint = lazy.init();
     }
     
@@ -2349,12 +2349,12 @@
 void SkCanvas::DrawTextDecorations(const SkDraw& draw, const SkPaint& paint,
                                    const char text[], size_t byteLength,
                                    SkScalar x, SkScalar y) {
-    SkASSERT(byteLength == 0 || text != NULL);
+    SkASSERT(byteLength == 0 || text != nullptr);
 
     // nothing to draw
-    if (text == NULL || byteLength == 0 ||
+    if (text == nullptr || byteLength == 0 ||
         draw.fClip->isEmpty() ||
-        (paint.getAlpha() == 0 && paint.getXfermode() == NULL)) {
+        (paint.getAlpha() == 0 && paint.getXfermode() == nullptr)) {
         return;
     }
 
@@ -2409,7 +2409,7 @@
 
 void SkCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
                           const SkPaint& paint) {
-    LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
+    LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, nullptr)
 
     while (iter.next()) {
         SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint());
@@ -2425,7 +2425,7 @@
                              const SkPaint& paint) {
     SkPoint textOffset = SkPoint::Make(0, 0);
 
-    LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
+    LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, nullptr)
 
     while (iter.next()) {
         SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint());
@@ -2441,7 +2441,7 @@
 
     SkPoint textOffset = SkPoint::Make(0, constY);
 
-    LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
+    LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, nullptr)
 
     while (iter.next()) {
         SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint());
@@ -2454,7 +2454,7 @@
 
 void SkCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
                                 const SkMatrix* matrix, const SkPaint& paint) {
-    LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
+    LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, nullptr)
 
     while (iter.next()) {
         iter.fDevice->drawTextOnPath(iter, text, byteLength, path,
@@ -2468,7 +2468,7 @@
                               const SkPaint& paint) {
 
     SkRect storage;
-    const SkRect* bounds = NULL;
+    const SkRect* bounds = nullptr;
     if (paint.canComputeFastBounds()) {
         storage = blob->bounds().makeOffset(x, y);
         bounds = &paint.computeFastBounds(storage, &storage);
@@ -2481,7 +2481,7 @@
     // We cannot filter in the looper as we normally do, because the paint is
     // incomplete at this point (text-related attributes are embedded within blob run paints).
     SkDrawFilter* drawFilter = fMCRec->fFilter;
-    fMCRec->fFilter = NULL;
+    fMCRec->fFilter = nullptr;
 
     LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, bounds)
 
@@ -2530,7 +2530,7 @@
                               const uint16_t indices[], int indexCount,
                               const SkPaint& paint) {
     TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawVertices()");
-    LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL)
+    LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, nullptr)
 
     while (iter.next()) {
         iter.fDevice->drawVertices(iter, vmode, vertexCount, verts, texs,
@@ -2544,7 +2544,7 @@
 void SkCanvas::drawPatch(const SkPoint cubics[12], const SkColor colors[4],
                          const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) {
     TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPatch()");
-    if (NULL == cubics) {
+    if (nullptr == cubics) {
         return;
     }
 
@@ -2562,7 +2562,7 @@
 void SkCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
                            const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) {
 
-    LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL)
+    LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, nullptr)
 
     while (iter.next()) {
         iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint);
@@ -2577,7 +2577,7 @@
             SkMatrix matrix = SkMatrix::MakeTrans(x, y);
             this->onDrawDrawable(dr, &matrix);
         } else {
-            this->onDrawDrawable(dr, NULL);
+            this->onDrawDrawable(dr, nullptr);
         }
     }
 }
@@ -2585,7 +2585,7 @@
 void SkCanvas::drawDrawable(SkDrawable* dr, const SkMatrix* matrix) {
     if (dr) {
         if (matrix && matrix->isIdentity()) {
-            matrix = NULL;
+            matrix = nullptr;
         }
         this->onDrawDrawable(dr, matrix);
     }
@@ -2614,7 +2614,7 @@
         pnt = *paint;
     }
     
-    LOOPER_BEGIN(pnt, SkDrawFilter::kPath_Type, NULL)
+    LOOPER_BEGIN(pnt, SkDrawFilter::kPath_Type, nullptr)
     while (iter.next()) {
         iter.fDevice->drawAtlas(iter, atlas, xform, tex, colors, count, mode, pnt);
     }
@@ -2761,7 +2761,7 @@
     TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPicture()");
     if (picture) {
         if (matrix && matrix->isIdentity()) {
-            matrix = NULL;
+            matrix = nullptr;
         }
         if (picture->approximateOpCount() <= kMaxPictureOpsToUnrollInsteadOfRef) {
             SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect());
@@ -2830,7 +2830,7 @@
 
 const SkPaint& SkCanvas::LayerIter::paint() const {
     const SkPaint* paint = fImpl->getPaint();
-    if (NULL == paint) {
+    if (nullptr == paint) {
         paint = &fDefaultPaint;
     }
     return *paint;
@@ -2869,12 +2869,12 @@
 
 SkCanvas* SkCanvas::NewRasterDirect(const SkImageInfo& info, void* pixels, size_t rowBytes) {
     if (!supported_for_raster_canvas(info)) {
-        return NULL;
+        return nullptr;
     }
 
     SkBitmap bitmap;
     if (!bitmap.installPixels(info, pixels, rowBytes)) {
-        return NULL;
+        return nullptr;
     }
     return new SkCanvas(bitmap);
 }
diff --git a/src/core/SkChunkAlloc.cpp b/src/core/SkChunkAlloc.cpp
index 4a71c2d..3f30276 100644
--- a/src/core/SkChunkAlloc.cpp
+++ b/src/core/SkChunkAlloc.cpp
@@ -30,7 +30,7 @@
     }
 
     void reset() {
-        fNext = NULL;
+        fNext = nullptr;
         fFreeSize = this->blockSize();
         fFreePtr = this->startOfData();
     }
@@ -60,7 +60,7 @@
         minSize = MIN_CHUNKALLOC_BLOCK_SIZE;
     }
 
-    fBlock = NULL;
+    fBlock = nullptr;
     fMinSize = minSize;
     fChunkSize = fMinSize;
     fTotalCapacity = 0;
@@ -75,7 +75,7 @@
 
 void SkChunkAlloc::reset() {
     Block::FreeChain(fBlock);
-    fBlock = NULL;
+    fBlock = nullptr;
     fChunkSize = fMinSize;  // reset to our initial minSize
     fTotalCapacity = 0;
     fTotalUsed = 0;
@@ -142,7 +142,7 @@
     if (!fBlock || bytes > fBlock->fFreeSize) {
         Block* block = this->newBlock(bytes, ftype);
         if (!block) {
-            return NULL;
+            return nullptr;
         }
 #ifdef SK_DEBUG
         if (fBlock) {
@@ -164,7 +164,7 @@
 
     Block* block = this->addBlockIfNecessary(bytes, ftype);
     if (!block) {
-        return NULL;
+        return nullptr;
     }
 
     char* ptr = block->fFreePtr;
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index 9541cc6..f54d57f 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -395,7 +395,7 @@
             fFiniteBoundType = kNormal_BoundsType;
 
             if (SkRegion::kReplace_Op == fOp ||
-                (SkRegion::kIntersect_Op == fOp && NULL == prior) ||
+                (SkRegion::kIntersect_Op == fOp && nullptr == prior) ||
                 (SkRegion::kIntersect_Op == fOp && prior->fIsIntersectionOfRects &&
                     prior->rectRectIntersectAllowed(this->getRect(), fDoAA))) {
                 fIsIntersectionOfRects = true;
@@ -431,7 +431,7 @@
     SkRect prevFinite;
     SkClipStack::BoundsType prevType;
 
-    if (NULL == prior) {
+    if (nullptr == prior) {
         // no prior clip means the entire plane is writable
         prevFinite.setEmpty();   // there are no pixels that cannot be drawn to
         prevType = kInsideOut_BoundsType;
@@ -529,7 +529,7 @@
     fSaveCount = b.fSaveCount;
     SkDeque::F2BIter recIter(b.fDeque);
     for (const Element* element = (const Element*)recIter.next();
-         element != NULL;
+         element != nullptr;
          element = (const Element*)recIter.next()) {
         new (fDeque.push_back()) Element(*element);
     }
@@ -550,14 +550,14 @@
     const Element* myElement = (const Element*)myIter.next();
     const Element* bElement = (const Element*)bIter.next();
 
-    while (myElement != NULL && bElement != NULL) {
+    while (myElement != nullptr && bElement != nullptr) {
         if (*myElement != *bElement) {
             return false;
         }
         myElement = (const Element*)myIter.next();
         bElement = (const Element*)bIter.next();
     }
-    return myElement == NULL && bElement == NULL;
+    return myElement == nullptr && bElement == nullptr;
 }
 
 void SkClipStack::reset() {
@@ -599,7 +599,7 @@
 
     Element* element = (Element*)fDeque.back();
 
-    if (NULL == element) {
+    if (nullptr == element) {
         // the clip is wide open - the infinite plane w/ no pixels un-writeable
         canvFiniteBound->setEmpty();
         *boundType = kInsideOut_BoundsType;
@@ -620,7 +620,7 @@
 
     Iter iter(*this, Iter::kTop_IterStart);
     const Element* element = iter.prev();
-    while (element != NULL) {
+    while (element != nullptr) {
         if (SkRegion::kIntersect_Op != element->getOp() && SkRegion::kReplace_Op != element->getOp())
             return false;
         if (element->isInverseFilled()) {
@@ -747,7 +747,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-SkClipStack::Iter::Iter() : fStack(NULL) {
+SkClipStack::Iter::Iter() : fStack(nullptr) {
 }
 
 SkClipStack::Iter::Iter(const SkClipStack& stack, IterStart startLoc)
@@ -765,13 +765,13 @@
 
 const SkClipStack::Element* SkClipStack::Iter::skipToTopmost(SkRegion::Op op) {
 
-    if (NULL == fStack) {
-        return NULL;
+    if (nullptr == fStack) {
+        return nullptr;
     }
 
     fIter.reset(fStack->fDeque, SkDeque::Iter::kBack_IterStart);
 
-    const SkClipStack::Element* element = NULL;
+    const SkClipStack::Element* element = nullptr;
 
     for (element = (const SkClipStack::Element*) fIter.prev();
          element;
@@ -784,7 +784,7 @@
             // return on the next "next" or "prev" call) the element
             // in front of it in the deque. Bump the iterator forward a
             // step so we get the expected result.
-            if (NULL == fIter.next()) {
+            if (nullptr == fIter.next()) {
                 // The reverse iterator has run off the front of the deque
                 // (i.e., the "op" clip is the first clip) and can't
                 // recover. Reset the iterator to start at the front.
@@ -794,7 +794,7 @@
         }
     }
 
-    if (NULL == element) {
+    if (nullptr == element) {
         // There were no "op" clips
         fIter.reset(fStack->fDeque, SkDeque::Iter::kFront_IterStart);
     }
@@ -899,7 +899,7 @@
             SkDebugf("\n");
             break;
         case kPath_Type:
-            this->getPath().dump(NULL, true, false);
+            this->getPath().dump(nullptr, true, false);
             break;
     }
 }
diff --git a/src/core/SkColorFilter.cpp b/src/core/SkColorFilter.cpp
index e1670b8..c67869f 100644
--- a/src/core/SkColorFilter.cpp
+++ b/src/core/SkColorFilter.cpp
@@ -130,7 +130,7 @@
 
     int count = inner->privateComposedFilterCount() + outer->privateComposedFilterCount();
     if (count > SK_MAX_COMPOSE_COLORFILTER_COUNT) {
-        return NULL;
+        return nullptr;
     }
     return new SkComposeColorFilter(outer, inner, count);
 }
diff --git a/src/core/SkColorTable.cpp b/src/core/SkColorTable.cpp
index 5a4e0a4..13c4795 100644
--- a/src/core/SkColorTable.cpp
+++ b/src/core/SkColorTable.cpp
@@ -76,7 +76,7 @@
         SkDEBUGCODE(success =) buffer.readColorArray(fColors, fCount);
     } else {
         fCount = 0;
-        fColors = NULL;
+        fColors = nullptr;
     }
 #ifdef SK_DEBUG
     SkASSERT((unsigned)fCount <= 256);
diff --git a/src/core/SkComposeShader.cpp b/src/core/SkComposeShader.cpp
index 094dfdb..853e157 100644
--- a/src/core/SkComposeShader.cpp
+++ b/src/core/SkComposeShader.cpp
@@ -58,7 +58,7 @@
     SkAutoTUnref<SkShader> shaderB(buffer.readShader());
     SkAutoTUnref<SkXfermode> mode(buffer.readXfermode());
     if (!shaderA.get() || !shaderB.get()) {
-        return NULL;
+        return nullptr;
     }
     return new SkComposeShader(shaderA, shaderB, mode);
 }
@@ -99,7 +99,7 @@
     if (!contextA || !contextB) {
         safe_call_destructor(contextA);
         safe_call_destructor(contextB);
-        return NULL;
+        return nullptr;
     }
 
     return new (storage) ComposeShaderContext(*this, rec, contextA, contextB);
@@ -143,7 +143,7 @@
 
     SkPMColor   tmp[TMP_COLOR_COUNT];
 
-    if (NULL == mode) {   // implied SRC_OVER
+    if (nullptr == mode) {   // implied SRC_OVER
         // TODO: when we have a good test-case, should use SkBlitRow::Proc32
         // for these loops
         do {
@@ -179,7 +179,7 @@
 
             shaderContextA->shadeSpan(x, y, result, n);
             shaderContextB->shadeSpan(x, y, tmp, n);
-            mode->xfer32(result, tmp, n, NULL);
+            mode->xfer32(result, tmp, n, nullptr);
 
             if (256 != scale) {
                 for (int i = 0; i < n; i++) {
diff --git a/src/core/SkConfig8888.cpp b/src/core/SkConfig8888.cpp
index f49ab45..53f35c3 100644
--- a/src/core/SkConfig8888.cpp
+++ b/src/core/SkConfig8888.cpp
@@ -237,9 +237,9 @@
             return false;
         }
 
-        const SkPMColor* table = NULL;
+        const SkPMColor* table = nullptr;
         if (kIndex_8_SkColorType == srcInfo.colorType()) {
-            if (NULL == ctable) {
+            if (nullptr == ctable) {
                 return false;
             }
             table = ctable->readColors();
@@ -276,11 +276,11 @@
     // TODO: switch the allocation of tmpDst to call sk_calloc_throw
     {
         SkBitmap bm;
-        if (!bm.installPixels(srcInfo, const_cast<void*>(srcPixels), srcRB, ctable, NULL, NULL)) {
+        if (!bm.installPixels(srcInfo, const_cast<void*>(srcPixels), srcRB, ctable, nullptr, nullptr)) {
             return false;
         }
         SkAutoTUnref<SkCanvas> canvas(SkCanvas::NewRasterDirect(dstInfo, dstPixels, dstRB));
-        if (NULL == canvas.get()) {
+        if (nullptr == canvas.get()) {
             return false;
         }
 
diff --git a/src/core/SkConfig8888.h b/src/core/SkConfig8888.h
index 954f2b5..ff28726 100644
--- a/src/core/SkConfig8888.h
+++ b/src/core/SkConfig8888.h
@@ -19,7 +19,7 @@
 
     static bool CopyPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
                            const SkImageInfo& srcInfo, const void* srcPixels, size_t srcRowBytes,
-                           SkColorTable* srcCTable = NULL);
+                           SkColorTable* srcCTable = nullptr);
 };
 
 struct SkDstPixelInfo : SkPixelInfo {
diff --git a/src/core/SkConvolver.cpp b/src/core/SkConvolver.cpp
index bf00956..3a088aa 100644
--- a/src/core/SkConvolver.cpp
+++ b/src/core/SkConvolver.cpp
@@ -352,7 +352,7 @@
     *filterLength = filter.fTrimmedLength;
     *specifiedFilterlength = filter.fLength;
     if (filter.fTrimmedLength == 0) {
-        return NULL;
+        return nullptr;
     }
 
     return &fFilterValues[filter.fDataLocation];
diff --git a/src/core/SkConvolver.h b/src/core/SkConvolver.h
index 4beb755..4e4d806 100644
--- a/src/core/SkConvolver.h
+++ b/src/core/SkConvolver.h
@@ -91,7 +91,7 @@
         *filterOffset = filter.fOffset;
         *filterLength = filter.fTrimmedLength;
         if (filter.fTrimmedLength == 0) {
-            return NULL;
+            return nullptr;
         }
         return &fFilterValues[filter.fDataLocation];
     }
@@ -102,7 +102,7 @@
   // |specifiedFilterLength| may be different if leading/trailing zeros of the
   // original floating point form were clipped.
   // There will be |filterLength| values in the return array.
-  // Returns NULL if the filter is 0-length (for instance when all floating
+  // Returns nullptr if the filter is 0-length (for instance when all floating
   // point values passed to AddFilter were clipped to 0).
     SK_API const ConvolutionFixed* GetSingleFilter(int* specifiedFilterLength,
         int* filterOffset,
diff --git a/src/core/SkData.cpp b/src/core/SkData.cpp
index 4590e3b..9e65d2a 100644
--- a/src/core/SkData.cpp
+++ b/src/core/SkData.cpp
@@ -26,8 +26,8 @@
 SkData::SkData(size_t size) {
     fPtr = (char*)(this + 1);   // contents are immediately after this
     fSize = size;
-    fReleaseProc = NULL;
-    fReleaseProcContext = NULL;
+    fReleaseProc = nullptr;
+    fReleaseProcContext = nullptr;
 }
 
 SkData::~SkData() {
@@ -37,7 +37,7 @@
 }
 
 bool SkData::equals(const SkData* other) const {
-    if (NULL == other) {
+    if (nullptr == other) {
         return false;
     }
 
@@ -81,7 +81,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 // As a template argument these must have external linkage.
-SkData* sk_new_empty_data() { return new SkData(NULL, 0, NULL, NULL); }
+SkData* sk_new_empty_data() { return new SkData(nullptr, 0, nullptr, nullptr); }
 namespace { void sk_unref_data(SkData* ptr) { return SkSafeUnref(ptr); } }
 
 SK_DECLARE_STATIC_LAZY_PTR(SkData, empty, sk_new_empty_data, sk_unref_data);
@@ -96,7 +96,7 @@
 }
 
 SkData* SkData::NewFromMalloc(const void* data, size_t length) {
-    return new SkData(data, length, sk_free_releaseproc, NULL);
+    return new SkData(data, length, sk_free_releaseproc, nullptr);
 }
 
 SkData* SkData::NewWithCopy(const void* src, size_t length) {
@@ -105,7 +105,7 @@
 }
 
 SkData* SkData::NewUninitialized(size_t length) {
-    return PrivateNewWithCopy(NULL, length);
+    return PrivateNewWithCopy(nullptr, length);
 }
 
 SkData* SkData::NewWithProc(const void* ptr, size_t length, ReleaseProc proc, void* context) {
@@ -121,17 +121,17 @@
 SkData* SkData::NewFromFILE(SkFILE* f) {
     size_t size;
     void* addr = sk_fmmap(f, &size);
-    if (NULL == addr) {
-        return NULL;
+    if (nullptr == addr) {
+        return nullptr;
     }
 
     return SkData::NewWithProc(addr, size, sk_mmap_releaseproc, reinterpret_cast<void*>(size));
 }
 
 SkData* SkData::NewFromFileName(const char path[]) {
-    SkFILE* f = path ? sk_fopen(path, kRead_SkFILE_Flag) : NULL;
-    if (NULL == f) {
-        return NULL;
+    SkFILE* f = path ? sk_fopen(path, kRead_SkFILE_Flag) : nullptr;
+    if (nullptr == f) {
+        return nullptr;
     }
     SkData* data = NewFromFILE(f);
     sk_fclose(f);
@@ -141,11 +141,11 @@
 SkData* SkData::NewFromFD(int fd) {
     size_t size;
     void* addr = sk_fdmmap(fd, &size);
-    if (NULL == addr) {
-        return NULL;
+    if (nullptr == addr) {
+        return nullptr;
     }
 
-    return SkData::NewWithProc(addr, size, sk_mmap_releaseproc, NULL);
+    return SkData::NewWithProc(addr, size, sk_mmap_releaseproc, nullptr);
 }
 
 // assumes context is a SkData
@@ -178,7 +178,7 @@
 
 SkData* SkData::NewWithCString(const char cstr[]) {
     size_t size;
-    if (NULL == cstr) {
+    if (nullptr == cstr) {
         cstr = "";
         size = 1;
     } else {
@@ -192,7 +192,7 @@
 SkData* SkData::NewFromStream(SkStream* stream, size_t size) {
     SkAutoDataUnref data(SkData::NewUninitialized(size));
     if (stream->read(data->writable_data(), size) != size) {
-        return NULL;
+        return nullptr;
     }
     return data.detach();
 }
diff --git a/src/core/SkDataTable.cpp b/src/core/SkDataTable.cpp
index 20bc430..32e30af 100644
--- a/src/core/SkDataTable.cpp
+++ b/src/core/SkDataTable.cpp
@@ -16,9 +16,9 @@
 SkDataTable::SkDataTable() {
     fCount = 0;
     fElemSize = 0;   // 0 signals that we use fDir instead of fElems
-    fU.fDir = NULL;
-    fFreeProc = NULL;
-    fFreeProcContext = NULL;
+    fU.fDir = nullptr;
+    fFreeProc = nullptr;
+    fFreeProcContext = nullptr;
 }
 
 SkDataTable::SkDataTable(const void* array, size_t elemSize, int count,
@@ -78,7 +78,7 @@
 
 SkDataTable* SkDataTable::NewEmpty() {
     static SkDataTable* gEmpty;
-    if (NULL == gEmpty) {
+    if (nullptr == gEmpty) {
         gEmpty = new SkDataTable;
     }
     gEmpty->ref();
@@ -137,7 +137,7 @@
 static void chunkalloc_freeproc(void* context) { delete (SkChunkAlloc*)context; }
 
 SkDataTableBuilder::SkDataTableBuilder(size_t minChunkSize)
-    : fHeap(NULL)
+    : fHeap(nullptr)
     , fMinChunkSize(minChunkSize) {}
 
 SkDataTableBuilder::~SkDataTableBuilder() { this->reset(); }
@@ -147,12 +147,12 @@
     fDir.reset();
     if (fHeap) {
         delete fHeap;
-        fHeap = NULL;
+        fHeap = nullptr;
     }
 }
 
 void SkDataTableBuilder::append(const void* src, size_t size) {
-    if (NULL == fHeap) {
+    if (nullptr == fHeap) {
         fHeap = new SkChunkAlloc(fMinChunkSize);
     }
 
@@ -177,7 +177,7 @@
 
     SkDataTable* table = new SkDataTable((SkDataTable::Dir*)dir, count, chunkalloc_freeproc, fHeap);
     // we have to detach our fHeap, since we are giving that to the table
-    fHeap = NULL;
+    fHeap = nullptr;
     fDir.reset();
     return table;
 }
diff --git a/src/core/SkDeque.cpp b/src/core/SkDeque.cpp
index 27f3efc..2e469d1 100644
--- a/src/core/SkDeque.cpp
+++ b/src/core/SkDeque.cpp
@@ -20,20 +20,20 @@
     const char* start() const { return (const char*)(this + 1); }
 
     void init(size_t size) {
-        fNext   = fPrev = NULL;
-        fBegin  = fEnd = NULL;
+        fNext   = fPrev = nullptr;
+        fBegin  = fEnd = nullptr;
         fStop   = (char*)this + size;
     }
 };
 
 SkDeque::SkDeque(size_t elemSize, int allocCount)
         : fElemSize(elemSize)
-        , fInitialStorage(NULL)
+        , fInitialStorage(nullptr)
         , fCount(0)
         , fAllocCount(allocCount) {
     SkASSERT(allocCount >= 1);
-    fFrontBlock = fBackBlock = NULL;
-    fFront = fBack = NULL;
+    fFrontBlock = fBackBlock = nullptr;
+    fFront = fBack = nullptr;
 }
 
 SkDeque::SkDeque(size_t elemSize, void* storage, size_t storageSize, int allocCount)
@@ -41,17 +41,17 @@
         , fInitialStorage(storage)
         , fCount(0)
         , fAllocCount(allocCount) {
-    SkASSERT(storageSize == 0 || storage != NULL);
+    SkASSERT(storageSize == 0 || storage != nullptr);
     SkASSERT(allocCount >= 1);
 
     if (storageSize >= sizeof(Block) + elemSize) {
         fFrontBlock = (Block*)storage;
         fFrontBlock->init(storageSize);
     } else {
-        fFrontBlock = NULL;
+        fFrontBlock = nullptr;
     }
     fBackBlock = fFrontBlock;
-    fFront = fBack = NULL;
+    fFront = fBack = nullptr;
 }
 
 SkDeque::~SkDeque() {
@@ -70,7 +70,7 @@
 void* SkDeque::push_front() {
     fCount += 1;
 
-    if (NULL == fFrontBlock) {
+    if (nullptr == fFrontBlock) {
         fFrontBlock = this->allocateBlock(fAllocCount);
         fBackBlock = fFrontBlock;     // update our linklist
     }
@@ -78,7 +78,7 @@
     Block*  first = fFrontBlock;
     char*   begin;
 
-    if (NULL == first->fBegin) {
+    if (nullptr == first->fBegin) {
     INIT_CHUNK:
         first->fEnd = first->fStop;
         begin = first->fStop - fElemSize;
@@ -96,8 +96,8 @@
 
     first->fBegin = begin;
 
-    if (NULL == fFront) {
-        SkASSERT(NULL == fBack);
+    if (nullptr == fFront) {
+        SkASSERT(nullptr == fBack);
         fFront = fBack = begin;
     } else {
         SkASSERT(fBack);
@@ -110,7 +110,7 @@
 void* SkDeque::push_back() {
     fCount += 1;
 
-    if (NULL == fBackBlock) {
+    if (nullptr == fBackBlock) {
         fBackBlock = this->allocateBlock(fAllocCount);
         fFrontBlock = fBackBlock; // update our linklist
     }
@@ -118,7 +118,7 @@
     Block*  last = fBackBlock;
     char*   end;
 
-    if (NULL == last->fBegin) {
+    if (nullptr == last->fBegin) {
     INIT_CHUNK:
         last->fBegin = last->start();
         end = last->fBegin + fElemSize;
@@ -137,8 +137,8 @@
     last->fEnd = end;
     end -= fElemSize;
 
-    if (NULL == fBack) {
-        SkASSERT(NULL == fFront);
+    if (nullptr == fBack) {
+        SkASSERT(nullptr == fFront);
         fFront = fBack = end;
     } else {
         SkASSERT(fFront);
@@ -154,14 +154,14 @@
 
     Block*  first = fFrontBlock;
 
-    SkASSERT(first != NULL);
+    SkASSERT(first != nullptr);
 
-    if (first->fBegin == NULL) {  // we were marked empty from before
+    if (first->fBegin == nullptr) {  // we were marked empty from before
         first = first->fNext;
-        first->fPrev = NULL;
+        first->fPrev = nullptr;
         this->freeBlock(fFrontBlock);
         fFrontBlock = first;
-        SkASSERT(first != NULL);    // else we popped too far
+        SkASSERT(first != nullptr);    // else we popped too far
     }
 
     char* begin = first->fBegin + fElemSize;
@@ -172,9 +172,9 @@
         SkASSERT(first->fBegin);
         fFront = first->fBegin;
     } else {
-        first->fBegin = first->fEnd = NULL;  // mark as empty
-        if (NULL == first->fNext) {
-            fFront = fBack = NULL;
+        first->fBegin = first->fEnd = nullptr;  // mark as empty
+        if (nullptr == first->fNext) {
+            fFront = fBack = nullptr;
         } else {
             SkASSERT(first->fNext->fBegin);
             fFront = first->fNext->fBegin;
@@ -188,14 +188,14 @@
 
     Block* last = fBackBlock;
 
-    SkASSERT(last != NULL);
+    SkASSERT(last != nullptr);
 
-    if (last->fEnd == NULL) {  // we were marked empty from before
+    if (last->fEnd == nullptr) {  // we were marked empty from before
         last = last->fPrev;
-        last->fNext = NULL;
+        last->fNext = nullptr;
         this->freeBlock(fBackBlock);
         fBackBlock = last;
-        SkASSERT(last != NULL);  // else we popped too far
+        SkASSERT(last != nullptr);  // else we popped too far
     }
 
     char* end = last->fEnd - fElemSize;
@@ -206,9 +206,9 @@
         SkASSERT(last->fEnd);
         fBack = last->fEnd - fElemSize;
     } else {
-        last->fBegin = last->fEnd = NULL;    // mark as empty
-        if (NULL == last->fPrev) {
-            fFront = fBack = NULL;
+        last->fBegin = last->fEnd = nullptr;    // mark as empty
+        if (nullptr == last->fPrev) {
+            fFront = fBack = nullptr;
         } else {
             SkASSERT(last->fPrev->fEnd);
             fBack = last->fPrev->fEnd - fElemSize;
@@ -238,7 +238,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-SkDeque::Iter::Iter() : fCurBlock(NULL), fPos(NULL), fElemSize(0) {}
+SkDeque::Iter::Iter() : fCurBlock(nullptr), fPos(nullptr), fElemSize(0) {}
 
 SkDeque::Iter::Iter(const SkDeque& d, IterStart startLoc) {
     this->reset(d, startLoc);
@@ -255,8 +255,8 @@
         if (next == fCurBlock->fEnd) { // exhausted this chunk, move to next
             do {
                 fCurBlock = fCurBlock->fNext;
-            } while (fCurBlock != NULL && fCurBlock->fBegin == NULL);
-            next = fCurBlock ? fCurBlock->fBegin : NULL;
+            } while (fCurBlock != nullptr && fCurBlock->fBegin == nullptr);
+            next = fCurBlock ? fCurBlock->fBegin : nullptr;
         }
         fPos = next;
     }
@@ -274,8 +274,8 @@
         if (prev < fCurBlock->fBegin) { // exhausted this chunk, move to prior
             do {
                 fCurBlock = fCurBlock->fPrev;
-            } while (fCurBlock != NULL && fCurBlock->fEnd == NULL);
-            prev = fCurBlock ? fCurBlock->fEnd - fElemSize : NULL;
+            } while (fCurBlock != nullptr && fCurBlock->fEnd == nullptr);
+            prev = fCurBlock ? fCurBlock->fEnd - fElemSize : nullptr;
         }
         fPos = prev;
     }
@@ -286,23 +286,23 @@
 // of the doubly linked list until a non-empty one is found. The fPos
 // member is then set to the first (or last) element in the block. If
 // there are no elements in the deque both fCurBlock and fPos will come
-// out of this routine NULL.
+// out of this routine nullptr.
 void SkDeque::Iter::reset(const SkDeque& d, IterStart startLoc) {
     fElemSize = d.fElemSize;
 
     if (kFront_IterStart == startLoc) {
         // initialize the iterator to start at the front
         fCurBlock = d.fFrontBlock;
-        while (fCurBlock && NULL == fCurBlock->fBegin) {
+        while (fCurBlock && nullptr == fCurBlock->fBegin) {
             fCurBlock = fCurBlock->fNext;
         }
-        fPos = fCurBlock ? fCurBlock->fBegin : NULL;
+        fPos = fCurBlock ? fCurBlock->fBegin : nullptr;
     } else {
         // initialize the iterator to start at the back
         fCurBlock = d.fBackBlock;
-        while (fCurBlock && NULL == fCurBlock->fEnd) {
+        while (fCurBlock && nullptr == fCurBlock->fEnd) {
             fCurBlock = fCurBlock->fPrev;
         }
-        fPos = fCurBlock ? fCurBlock->fEnd - fElemSize : NULL;
+        fPos = fCurBlock ? fCurBlock->fEnd - fElemSize : nullptr;
     }
 }
diff --git a/src/core/SkDescriptor.h b/src/core/SkDescriptor.h
index e559215..1f6f4a8 100644
--- a/src/core/SkDescriptor.h
+++ b/src/core/SkDescriptor.h
@@ -37,10 +37,10 @@
 
     uint32_t getLength() const { return fLength; }
 
-    void* addEntry(uint32_t tag, size_t length, const void* data = NULL) {
+    void* addEntry(uint32_t tag, size_t length, const void* data = nullptr) {
         SkASSERT(tag);
         SkASSERT(SkAlign4(length) == length);
-        SkASSERT(this->findEntry(tag, NULL) == NULL);
+        SkASSERT(this->findEntry(tag, nullptr) == nullptr);
 
         Entry* entry = (Entry*)((char*)this + fLength);
         entry->fTag = tag;
@@ -77,7 +77,7 @@
             }
             entry = (const Entry*)((const char*)(entry + 1) + entry->fLen);
         }
-        return NULL;
+        return nullptr;
     }
 
     SkDescriptor* copy() const {
@@ -134,9 +134,9 @@
 
 class SkAutoDescriptor : SkNoncopyable {
 public:
-    SkAutoDescriptor() : fDesc(NULL) {}
-    SkAutoDescriptor(size_t size) : fDesc(NULL) { this->reset(size); }
-    SkAutoDescriptor(const SkDescriptor& desc) : fDesc(NULL) {
+    SkAutoDescriptor() : fDesc(nullptr) {}
+    SkAutoDescriptor(size_t size) : fDesc(nullptr) { this->reset(size); }
+    SkAutoDescriptor(const SkDescriptor& desc) : fDesc(nullptr) {
         size_t size = desc.getLength();
         this->reset(size);
         memcpy(fDesc, &desc, size);
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index f8275fa..a76a2ff 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -27,7 +27,7 @@
 #endif
 {
     fOrigin.setZero();
-    fMetaData = NULL;
+    fMetaData = nullptr;
 }
 
 SkBaseDevice::~SkBaseDevice() { delete fMetaData; }
@@ -35,7 +35,7 @@
 SkMetaData& SkBaseDevice::getMetaData() {
     // metadata users are rare, so we lazily allocate it. If that changes we
     // can decide to just make it a field in the device (rather than a ptr)
-    if (NULL == fMetaData) {
+    if (nullptr == fMetaData) {
         fMetaData = new SkMetaData;
     }
     return *fMetaData;
@@ -78,7 +78,7 @@
     path.addRRect(inner);
     path.setFillType(SkPath::kEvenOdd_FillType);
 
-    const SkMatrix* preMatrix = NULL;
+    const SkMatrix* preMatrix = nullptr;
     const bool pathIsMutable = true;
     this->drawPath(draw, path, paint, preMatrix, pathIsMutable);
 }
@@ -212,7 +212,7 @@
         path.rewind();
         path.addPoly(quad, 4, true);
         path.setConvexity(SkPath::kConvex_Convexity);
-        this->drawPath(draw, path, pnt, NULL, true);
+        this->drawPath(draw, path, pnt, nullptr, true);
     }
 }
 
@@ -263,7 +263,7 @@
 
 bool SkBaseDevice::accessPixels(SkPixmap* pmap) {
     SkPixmap tempStorage;
-    if (NULL == pmap) {
+    if (nullptr == pmap) {
         pmap = &tempStorage;
     }
     return this->onAccessPixels(pmap);
@@ -271,7 +271,7 @@
 
 bool SkBaseDevice::peekPixels(SkPixmap* pmap) {
     SkPixmap tempStorage;
-    if (NULL == pmap) {
+    if (nullptr == pmap) {
         pmap = &tempStorage;
     }
     return this->onPeekPixels(pmap);
@@ -357,10 +357,10 @@
 void SkBaseDevice::drawTextOnPath(const SkDraw& draw, const void* text, size_t byteLength,
                                   const SkPath& follow, const SkMatrix* matrix,
                                   const SkPaint& paint) {
-    SkASSERT(byteLength == 0 || text != NULL);
+    SkASSERT(byteLength == 0 || text != nullptr);
     
     // nothing to draw
-    if (text == NULL || byteLength == 0 || draw.fRC->isEmpty()) {
+    if (text == nullptr || byteLength == 0 || draw.fRC->isEmpty()) {
         return;
     }
     
@@ -395,7 +395,7 @@
                 m.postConcat(*matrix);
             }
             morphpath(&tmp, *iterPath, meas, m);
-            this->drawPath(draw, tmp, iter.getPaint(), NULL, true);
+            this->drawPath(draw, tmp, iter.getPaint(), nullptr, true);
         }
     }
 }
diff --git a/src/core/SkDeviceLooper.cpp b/src/core/SkDeviceLooper.cpp
index 840a050..c4e4013 100644
--- a/src/core/SkDeviceLooper.cpp
+++ b/src/core/SkDeviceLooper.cpp
@@ -16,8 +16,8 @@
 {
     // sentinels that next() has not yet been called, and so our mapper functions
     // should not be called either.
-    fCurrDst = NULL;
-    fCurrRC = NULL;
+    fCurrDst = nullptr;
+    fCurrRC = nullptr;
 
     if (!rc.isEmpty()) {
         // clip must be contained by the bitmap
@@ -102,7 +102,7 @@
 
         case kSimple_State:
             // first time for simple
-            if (NULL == fCurrDst) {
+            if (nullptr == fCurrDst) {
                 fCurrDst = &fBaseDst;
                 fCurrRC = &fBaseRC;
                 fCurrOffset.set(0, 0);
diff --git a/src/core/SkDeviceProfile.cpp b/src/core/SkDeviceProfile.cpp
index 11d5c85..e1c10c8 100644
--- a/src/core/SkDeviceProfile.cpp
+++ b/src/core/SkDeviceProfile.cpp
@@ -51,7 +51,7 @@
 SkDeviceProfile* SkDeviceProfile::GetDefault() {
     SkAutoMutexAcquire amc(gMutex);
 
-    if (NULL == gDefaultProfile) {
+    if (nullptr == gDefaultProfile) {
         gDefaultProfile = SkDeviceProfile::Create(DEFAULT_GAMMAEXP,
                                                   DEFAULT_CONTRASTSCALE,
                                                   DEFAULT_LCDCONFIG,
@@ -63,7 +63,7 @@
 SkDeviceProfile* SkDeviceProfile::RefGlobal() {
     SkAutoMutexAcquire amc(gMutex);
 
-    if (NULL == gGlobalProfile) {
+    if (nullptr == gGlobalProfile) {
         gGlobalProfile = SkDeviceProfile::GetDefault();
     }
     gGlobalProfile->ref();
diff --git a/src/core/SkDeviceProfile.h b/src/core/SkDeviceProfile.h
index d949444..2872b13 100644
--- a/src/core/SkDeviceProfile.h
+++ b/src/core/SkDeviceProfile.h
@@ -52,7 +52,7 @@
 
     /**
      *  Returns the global default profile, that is used if no global profile is
-     *  specified with SetGlobal(), or if NULL is specified to SetGlobal().
+     *  specified with SetGlobal(), or if nullptr is specified to SetGlobal().
      *  The references count is *not* incremented, and the caller should not
      *  call unref().
      */
@@ -69,7 +69,7 @@
      *  Make the specified profile be the global value for all subsequently
      *  instantiated devices. Does not affect any existing devices.
      *  Increments the reference count on the profile.
-     *  Specify NULL for the "identity" profile (where there is no gamma or
+     *  Specify nullptr for the "identity" profile (where there is no gamma or
      *  contrast correction).
      */
     static void SetGlobal(SkDeviceProfile*);
diff --git a/src/core/SkDiscardableMemory.h b/src/core/SkDiscardableMemory.h
index f3159fe..8952b8d 100644
--- a/src/core/SkDiscardableMemory.h
+++ b/src/core/SkDiscardableMemory.h
@@ -19,13 +19,13 @@
 public:
     /**
      *  Factory method that creates, initializes and locks an SkDiscardableMemory
-     *  object. If either of these steps fails, a NULL pointer will be returned.
+     *  object. If either of these steps fails, a nullptr pointer will be returned.
      */
     static SkDiscardableMemory* Create(size_t bytes);
 
     /**
      *  Factory class that creates, initializes and locks an SkDiscardableMemory
-     *  object. If either of these steps fails, a NULL pointer will be returned.
+     *  object. If either of these steps fails, a nullptr pointer will be returned.
      */
     class Factory : public SkRefCnt {
     public:
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 6464d4a..8e1a132 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -42,7 +42,7 @@
 class SkAutoBlitterChoose : SkNoncopyable {
 public:
     SkAutoBlitterChoose() {
-        fBlitter = NULL;
+        fBlitter = nullptr;
     }
     SkAutoBlitterChoose(const SkPixmap& dst, const SkMatrix& matrix,
                         const SkPaint& paint, bool drawCoverage = false) {
@@ -73,7 +73,7 @@
 class SkAutoBitmapShaderInstall : SkNoncopyable {
 public:
     SkAutoBitmapShaderInstall(const SkBitmap& src, const SkPaint& paint,
-                              const SkMatrix* localMatrix = NULL)
+                              const SkMatrix* localMatrix = nullptr)
             : fPaint(paint) /* makes a copy of the paint */ {
         fPaint.setShader(SkCreateBitmapShader(src, SkShader::kClamp_TileMode,
                                               SkShader::kClamp_TileMode,
@@ -86,7 +86,7 @@
         // since fAllocator will destroy shader, we insist that owners == 2
         SkASSERT(2 == fPaint.getShader()->getRefCnt());
 
-        fPaint.setShader(NULL); // unref the shader by 1
+        fPaint.setShader(nullptr); // unref the shader by 1
 
     }
 
@@ -155,12 +155,12 @@
     // todo: we can apply colorfilter up front if no shader, so we wouldn't
     // need to abort this fastpath
     if (paint.getShader() || paint.getColorFilter()) {
-        return NULL;
+        return nullptr;
     }
 
     SkXfermode::Mode mode;
     if (!SkXfermode::AsMode(paint.getXfermode(), &mode)) {
-        return NULL;
+        return nullptr;
     }
 
     SkColor color = paint.getColor();
@@ -214,7 +214,7 @@
         default:
             break;
     }
-    return NULL;
+    return nullptr;
 }
 
 static void CallBitmapXferProc(const SkPixmap& dst, const SkIRect& rect, BitmapXferProc proc,
@@ -451,7 +451,7 @@
     if (0 == width) {
         fMode = mode;
         fPaint = &paint;
-        fClip = NULL;
+        fClip = nullptr;
         fRC = rc;
         fRadius = SK_FixedHalf;
         return true;
@@ -467,7 +467,7 @@
 
             fMode = mode;
             fPaint = &paint;
-            fClip = NULL;
+            fClip = nullptr;
             fRC = rc;
             fRadius = SkScalarToFixed(SkScalarMul(width, sx)) >> 1;
             return true;
@@ -477,7 +477,7 @@
 }
 
 PtProcRec::Proc PtProcRec::chooseProc(SkBlitter** blitterPtr) {
-    Proc proc = NULL;
+    Proc proc = nullptr;
 
     SkBlitter* blitter = *blitterPtr;
     if (fRC->isBW()) {
@@ -546,7 +546,7 @@
         return;
     }
 
-    SkASSERT(pts != NULL);
+    SkASSERT(pts != nullptr);
     SkDEBUGCODE(this->validate();)
 
      // nothing to draw
@@ -642,7 +642,7 @@
                         // 'asPoints' managed to find some fast path
 
                         SkPaint newP(paint);
-                        newP.setPathEffect(NULL);
+                        newP.setPathEffect(nullptr);
                         newP.setStyle(SkPaint::kFill_Style);
 
                         if (!pointData.fFirst.isEmpty()) {
@@ -720,9 +720,9 @@
                     path.moveTo(pts[i]);
                     path.lineTo(pts[i+1]);
                     if (fDevice) {
-                        fDevice->drawPath(*this, path, p, NULL, true);
+                        fDevice->drawPath(*this, path, p, nullptr, true);
                     } else {
-                        this->drawPath(path, p, NULL, true);
+                        this->drawPath(path, p, nullptr, true);
                     }
                     path.rewind();
                 }
@@ -820,7 +820,7 @@
         SkPath  tmp;
         tmp.addRect(prePaintRect);
         tmp.setFillType(SkPath::kWinding_FillType);
-        draw.drawPath(tmp, paint, NULL, true);
+        draw.drawPath(tmp, paint, nullptr, true);
         return;
     }
 
@@ -901,10 +901,10 @@
 
     SkMask dstM;
     if (paint.getMaskFilter() &&
-            paint.getMaskFilter()->filterMask(&dstM, srcM, *fMatrix, NULL)) {
+            paint.getMaskFilter()->filterMask(&dstM, srcM, *fMatrix, nullptr)) {
         mask = &dstM;
     } else {
-        dstM.fImage = NULL;
+        dstM.fImage = nullptr;
     }
     SkAutoMaskFreeImage ami(dstM.fImage);
 
@@ -998,7 +998,7 @@
     // Now fall back to the default case of using a path.
     SkPath path;
     path.addRRect(rrect);
-    this->drawPath(path, paint, NULL, true);
+    this->drawPath(path, paint, nullptr, true);
 }
 
 static SkScalar compute_res_scale_for_stroking(const SkMatrix& matrix) {
@@ -1076,7 +1076,7 @@
 
     if (paint->getPathEffect() || paint->getStyle() != SkPaint::kFill_Style) {
         SkRect cullRect;
-        const SkRect* cullRectPtr = NULL;
+        const SkRect* cullRectPtr = nullptr;
         if (this->computeConservativeLocalClipBounds(&cullRect)) {
             cullRectPtr = &cullRect;
         }
@@ -1102,9 +1102,9 @@
     // transform the path into device space
     pathPtr->transform(*matrix, devPathPtr);
 
-    SkBlitter* blitter = NULL;
+    SkBlitter* blitter = nullptr;
     SkAutoBlitterChoose blitterStorage;
-    if (NULL == customBlitter) {
+    if (nullptr == customBlitter) {
         blitterStorage.choose(fDst, *fMatrix, *paint, drawCoverage);
         blitter = blitterStorage.get();
     } else {
@@ -1333,7 +1333,7 @@
     }
     const SkPixmap& pmap = unlocker.pixmap();
 
-    if (NULL == paint.getColorFilter() && clipHandlesSprite(*fRC, x, y, pmap)) {
+    if (nullptr == paint.getColorFilter() && clipHandlesSprite(*fRC, x, y, pmap)) {
         SkTBlitterAllocator allocator;
         // blitter will be owned by the allocator.
         SkBlitter* blitter = SkBlitter::ChooseSprite(fDst, paint, pmap, x, y, &allocator);
@@ -1453,8 +1453,8 @@
     int left = Sk48Dot16FloorToInt(fx);
     int top = Sk48Dot16FloorToInt(fy);
     SkASSERT(glyph.fWidth > 0 && glyph.fHeight > 0);
-    SkASSERT((NULL == state.fClip && state.fAAClip) ||
-             (state.fClip && NULL == state.fAAClip && state.fClip->isRect()));
+    SkASSERT((nullptr == state.fClip && state.fAAClip) ||
+             (state.fClip && nullptr == state.fAAClip && state.fClip->isRect()));
 
     left += glyph.fLeft;
     top  += glyph.fTop;
@@ -1477,9 +1477,9 @@
     }
 
     uint8_t* aa = (uint8_t*)glyph.fImage;
-    if (NULL == aa) {
+    if (nullptr == aa) {
         aa = (uint8_t*)state.fCache->findImage(glyph);
-        if (NULL == aa) {
+        if (nullptr == aa) {
             return; // can't rasterize glyph
         }
     }
@@ -1507,9 +1507,9 @@
     if (!clipper.done()) {
         const SkIRect&  cr = clipper.rect();
         const uint8_t*  aa = (const uint8_t*)glyph.fImage;
-        if (NULL == aa) {
+        if (nullptr == aa) {
             aa = (uint8_t*)state.fCache->findImage(glyph);
-            if (NULL == aa) {
+            if (nullptr == aa) {
                 return;
             }
         }
@@ -1553,7 +1553,7 @@
     }
 
     if (draw->fRC->isBW()) {
-        fAAClip = NULL;
+        fAAClip = nullptr;
         fClip = &draw->fRC->bwRgn();
         fClipBounds = fClip->getBounds();
         if (fClip->isRect()) {
@@ -1563,7 +1563,7 @@
         }
     } else {    // aaclip
         fAAClip = &draw->fRC->aaRgn();
-        fClip = NULL;
+        fClip = nullptr;
         fClipBounds = fAAClip->getBounds();
         return D1G_RectClip;
     }
@@ -1583,12 +1583,12 @@
 
 void SkDraw::drawText(const char text[], size_t byteLength,
                       SkScalar x, SkScalar y, const SkPaint& paint) const {
-    SkASSERT(byteLength == 0 || text != NULL);
+    SkASSERT(byteLength == 0 || text != nullptr);
 
     SkDEBUGCODE(this->validate();)
 
     // nothing to draw
-    if (text == NULL || byteLength == 0 || fRC->isEmpty()) {
+    if (text == nullptr || byteLength == 0 || fRC->isEmpty()) {
         return;
     }
 
@@ -1633,7 +1633,7 @@
 
     SkAAClipBlitter     aaBlitter;
     SkAutoBlitterChoose blitterChooser;
-    SkBlitter*          blitter = NULL;
+    SkBlitter*          blitter = nullptr;
     if (needsRasterTextBlit(*this)) {
         blitterChooser.choose(fDst, *fMatrix, paint);
         blitter = blitterChooser.get();
@@ -1691,10 +1691,10 @@
 
     // Temporarily jam in kFill, so we only ever ask for the raw outline from the cache.
     paint.setStyle(SkPaint::kFill_Style);
-    paint.setPathEffect(NULL);
+    paint.setPathEffect(nullptr);
 
     SkDrawCacheProc     glyphCacheProc = paint.getDrawCacheProc();
-    SkAutoGlyphCache    autoCache(paint, &fDevice->surfaceProps(), NULL);
+    SkAutoGlyphCache    autoCache(paint, &fDevice->surfaceProps(), nullptr);
     SkGlyphCache*       cache = autoCache.getCache();
 
     const char*        stop = text + byteLength;
@@ -1731,13 +1731,13 @@
 void SkDraw::drawPosText(const char text[], size_t byteLength,
                          const SkScalar pos[], int scalarsPerPosition,
                          const SkPoint& offset, const SkPaint& paint) const {
-    SkASSERT(byteLength == 0 || text != NULL);
+    SkASSERT(byteLength == 0 || text != nullptr);
     SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition);
 
     SkDEBUGCODE(this->validate();)
 
     // nothing to draw
-    if (text == NULL || byteLength == 0 || fRC->isEmpty()) {
+    if (text == nullptr || byteLength == 0 || fRC->isEmpty()) {
         return;
     }
 
@@ -1752,7 +1752,7 @@
 
     SkAAClipBlitterWrapper wrapper;
     SkAutoBlitterChoose blitterChooser;
-    SkBlitter* blitter = NULL;
+    SkBlitter* blitter = nullptr;
     if (needsRasterTextBlit(*this)) {
         blitterChooser.choose(fDst, *fMatrix, paint);
         blitter = blitterChooser.get();
@@ -1915,7 +1915,7 @@
     SK_TO_STRING_OVERRIDE()
 
     // For serialization.  This will never be called.
-    Factory getFactory() const override { sk_throw(); return NULL; }
+    Factory getFactory() const override { sk_throw(); return nullptr; }
 
 protected:
     Context* onCreateContext(const ContextRec& rec, void* storage) const override {
@@ -2053,26 +2053,26 @@
     SkPaint p(paint);
 
     SkShader* shader = p.getShader();
-    if (NULL == shader) {
+    if (nullptr == shader) {
         // if we have no shader, we ignore the texture coordinates
-        textures = NULL;
-    } else if (NULL == textures) {
+        textures = nullptr;
+    } else if (nullptr == textures) {
         // if we don't have texture coordinates, ignore the shader
-        p.setShader(NULL);
-        shader = NULL;
+        p.setShader(nullptr);
+        shader = nullptr;
     }
 
     // setup the custom shader (if needed)
     SkAutoTUnref<SkComposeShader> composeShader;
     if (colors) {
-        if (NULL == textures) {
+        if (nullptr == textures) {
             // just colors (no texture)
             shader = p.setShader(&triShader);
         } else {
             // colors * texture
             SkASSERT(shader);
             bool releaseMode = false;
-            if (NULL == xmode) {
+            if (nullptr == xmode) {
                 xmode = SkXfermode::Create(SkXfermode::kModulate_Mode);
                 releaseMode = true;
             }
@@ -2155,9 +2155,9 @@
 #ifdef SK_DEBUG
 
 void SkDraw::validate() const {
-    SkASSERT(fMatrix != NULL);
-    SkASSERT(fClip != NULL);
-    SkASSERT(fRC != NULL);
+    SkASSERT(fMatrix != nullptr);
+    SkASSERT(fClip != nullptr);
+    SkASSERT(fRC != nullptr);
 
     const SkIRect&  cr = fRC->getBounds();
     SkIRect         br;
@@ -2193,7 +2193,7 @@
 
         srcM.fBounds = *bounds;
         srcM.fFormat = SkMask::kA8_Format;
-        srcM.fImage = NULL;
+        srcM.fImage = nullptr;
         if (!filter->filterMask(&dstM, srcM, *filterMatrix, &margin)) {
             return false;
         }
diff --git a/src/core/SkDrawLooper.cpp b/src/core/SkDrawLooper.cpp
index 1af68a2..aa53f2e 100644
--- a/src/core/SkDrawLooper.cpp
+++ b/src/core/SkDrawLooper.cpp
@@ -21,7 +21,7 @@
     for (;;) {
         SkPaint p(paint);
         if (context->next(&canvas, &p)) {
-            p.setLooper(NULL);
+            p.setLooper(nullptr);
             if (!p.canComputeFastBounds()) {
                 return false;
             }
@@ -48,7 +48,7 @@
         if (context->next(&canvas, &p)) {
             SkRect r(src);
 
-            p.setLooper(NULL);
+            p.setLooper(nullptr);
             p.computeFastBounds(r, &r);
             canvas.getTotalMatrix().mapRect(&r);
 
diff --git a/src/core/SkDrawable.cpp b/src/core/SkDrawable.cpp
index 5052270..8fea38b 100644
--- a/src/core/SkDrawable.cpp
+++ b/src/core/SkDrawable.cpp
@@ -76,7 +76,7 @@
     SkPictureRecorder recorder;
 
     const SkRect bounds = this->getBounds();
-    SkCanvas* canvas = recorder.beginRecording(bounds, NULL, 0);
+    SkCanvas* canvas = recorder.beginRecording(bounds, nullptr, 0);
     this->draw(canvas);
     if (false) {
         draw_bbox(canvas, bounds);
diff --git a/src/core/SkEdgeBuilder.cpp b/src/core/SkEdgeBuilder.cpp
index 43181fd..92c8330 100644
--- a/src/core/SkEdgeBuilder.cpp
+++ b/src/core/SkEdgeBuilder.cpp
@@ -19,7 +19,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SkEdgeBuilder::SkEdgeBuilder() : fAlloc(16*1024) {
-    fEdgeList = NULL;
+    fEdgeList = nullptr;
 }
 
 void SkEdgeBuilder::addLine(const SkPoint pts[]) {
diff --git a/src/core/SkEmptyShader.h b/src/core/SkEmptyShader.h
index 7b87c28..6453e0e 100644
--- a/src/core/SkEmptyShader.h
+++ b/src/core/SkEmptyShader.h
@@ -14,14 +14,14 @@
 
 /**
  *  \class SkEmptyShader
- *  A Shader that always draws nothing. Its createContext always returns NULL.
+ *  A Shader that always draws nothing. Its createContext always returns nullptr.
  */
 class SK_API SkEmptyShader : public SkShader {
 public:
     SkEmptyShader() {}
 
     size_t contextSize() const override {
-        // Even though createContext returns NULL we have to return a value of at least
+        // Even though createContext returns nullptr we have to return a value of at least
         // sizeof(SkShader::Context) to satisfy SkSmallAllocator.
         return sizeof(SkShader::Context);
     }
@@ -31,7 +31,7 @@
 
 protected:
     SkShader::Context* onCreateContext(const ContextRec&, void*) const override {
-        return NULL;
+        return nullptr;
     }
 
     void flatten(SkWriteBuffer& buffer) const override {
diff --git a/src/core/SkEndian.h b/src/core/SkEndian.h
index 0955fcc..954afb0 100644
--- a/src/core/SkEndian.h
+++ b/src/core/SkEndian.h
@@ -39,7 +39,7 @@
     low two bytes of each value in the array.
 */
 static inline void SkEndianSwap16s(uint16_t array[], int count) {
-    SkASSERT(count == 0 || array != NULL);
+    SkASSERT(count == 0 || array != nullptr);
 
     while (--count >= 0) {
         *array = SkEndianSwap16(*array);
@@ -68,7 +68,7 @@
     bytes of each value in the array.
 */
 static inline void SkEndianSwap32s(uint32_t array[], int count) {
-    SkASSERT(count == 0 || array != NULL);
+    SkASSERT(count == 0 || array != nullptr);
 
     while (--count >= 0) {
         *array = SkEndianSwap32(*array);
@@ -104,7 +104,7 @@
     bytes of each value in the array.
 */
 static inline void SkEndianSwap64s(uint64_t array[], int count) {
-    SkASSERT(count == 0 || array != NULL);
+    SkASSERT(count == 0 || array != nullptr);
 
     while (--count >= 0) {
         *array = SkEndianSwap64(*array);
diff --git a/src/core/SkError.cpp b/src/core/SkError.cpp
index 23db8ac..9e4385b 100644
--- a/src/core/SkError.cpp
+++ b/src/core/SkError.cpp
@@ -31,7 +31,7 @@
         *(reinterpret_cast<SkErrorCallbackFunction *>(SkTLS::Get(CreateThreadErrorCallback,   \
                                                                  DeleteThreadErrorCallback)))
 
-    void *CreateThreadErrorContext() { return new void **(NULL); }
+    void *CreateThreadErrorContext() { return new void **(nullptr); }
     void DeleteThreadErrorContext(void *v) { delete reinterpret_cast<void **>(v); }
     #define THREAD_ERROR_CONTEXT \
         (*reinterpret_cast<void **>(SkTLS::Get(CreateThreadErrorContext, DeleteThreadErrorContext)))
@@ -60,7 +60,7 @@
 // ------------ Private Error functions ---------
 
 void SkErrorInternals::SetErrorCallback(SkErrorCallbackFunction cb, void *context) {
-    if (cb == NULL) {
+    if (cb == nullptr) {
         THREAD_ERROR_CALLBACK = SkErrorInternals::DefaultErrorCallback;
     } else {
         THREAD_ERROR_CALLBACK = cb;
@@ -89,7 +89,7 @@
     va_list args;
 
     char *str = THREAD_ERROR_STRING;
-    const char *error_name = NULL;
+    const char *error_name = nullptr;
     switch( code ) {
         case kNoError_SkError:
             error_name = "No Error";
diff --git a/src/core/SkFilterShader.cpp b/src/core/SkFilterShader.cpp
index d972489..b52c2be 100644
--- a/src/core/SkFilterShader.cpp
+++ b/src/core/SkFilterShader.cpp
@@ -30,7 +30,7 @@
     SkAutoTUnref<SkShader> shader(buffer.readShader());
     SkAutoTUnref<SkColorFilter> filter(buffer.readColorFilter());
     if (!shader.get() || !filter.get()) {
-        return NULL;
+        return nullptr;
     }
     return new SkFilterShader(shader, filter);
 }
@@ -59,8 +59,8 @@
 SkShader::Context* SkFilterShader::onCreateContext(const ContextRec& rec, void* storage) const {
     char* shaderContextStorage = (char*)storage + sizeof(FilterShaderContext);
     SkShader::Context* shaderContext = fShader->createContext(rec, shaderContextStorage);
-    if (NULL == shaderContext) {
-        return NULL;
+    if (nullptr == shaderContext) {
+        return nullptr;
     }
     return new (storage) FilterShaderContext(*this, shaderContext, rec);
 }
diff --git a/src/core/SkFlattenable.cpp b/src/core/SkFlattenable.cpp
index 27efe7e..87e720e 100644
--- a/src/core/SkFlattenable.cpp
+++ b/src/core/SkFlattenable.cpp
@@ -17,7 +17,7 @@
         return index;
     }
     const char* name = SkFlattenable::FactoryToName(factory);
-    if (NULL == name) {
+    if (nullptr == name) {
         return 0;
     }
     *fNames.append() = name;
@@ -28,7 +28,7 @@
     if (fNextAddedFactory < fNames.count()) {
         return fNames[fNextAddedFactory++];
     }
-    return NULL;
+    return nullptr;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -98,7 +98,7 @@
             return entries[i].fFactory;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 bool SkFlattenable::NameToType(const char name[], SkFlattenable::Type* type) {
@@ -128,5 +128,5 @@
             return entries[i].fName;
         }
     }
-    return NULL;
+    return nullptr;
 }
diff --git a/src/core/SkFont.cpp b/src/core/SkFont.cpp
index d6895a4..c39cc18 100644
--- a/src/core/SkFont.cpp
+++ b/src/core/SkFont.cpp
@@ -31,13 +31,13 @@
 SkFont* SkFont::Create(SkTypeface* face, SkScalar size, SkScalar scaleX, SkScalar skewX,
                        MaskType mt, uint32_t flags) {
     if (size <= 0 || !SkScalarIsFinite(size)) {
-        return NULL;
+        return nullptr;
     }
     if (scaleX <= 0 || !SkScalarIsFinite(scaleX)) {
-        return NULL;
+        return nullptr;
     }
     if (!SkScalarIsFinite(skewX)) {
-        return NULL;
+        return nullptr;
     }
     flags &= kAllFlags;
     return new SkFont(face, size, scaleX, skewX, mt, flags);
@@ -82,7 +82,7 @@
             count = SkToInt(byteLength >> 1);
             break;
     }
-    if (NULL == glyphs) {
+    if (nullptr == glyphs) {
         return count;
     }
 
diff --git a/src/core/SkFontDescriptor.h b/src/core/SkFontDescriptor.h
index 933a36a..21fecdc 100644
--- a/src/core/SkFontDescriptor.h
+++ b/src/core/SkFontDescriptor.h
@@ -32,7 +32,7 @@
             fAxis[i] = that.fAxis[i];
         }
     }
-    bool hasStream() const { return fStream.get() != NULL; }
+    bool hasStream() const { return fStream.get() != nullptr; }
     SkStreamAsset* duplicateStream() const { return fStream->duplicate(); }
     SkStreamAsset* detachStream() { return fStream.detach(); }
     SkStreamAsset* getStream() { return fStream.get(); }
@@ -61,7 +61,7 @@
     const char* getFamilyName() const { return fFamilyName.c_str(); }
     const char* getFullName() const { return fFullName.c_str(); }
     const char* getPostscriptName() const { return fPostscriptName.c_str(); }
-    bool hasFontData() const { return fFontData.get() != NULL; }
+    bool hasFontData() const { return fFontData.get() != nullptr; }
     SkFontData* detachFontData() { return fFontData.detach(); }
 
     void setFamilyName(const char* name) { fFamilyName.set(name); }
diff --git a/src/core/SkFontMgr.cpp b/src/core/SkFontMgr.cpp
index 35ad6c3..7c06690 100644
--- a/src/core/SkFontMgr.cpp
+++ b/src/core/SkFontMgr.cpp
@@ -22,10 +22,10 @@
     }
     SkTypeface* createTypeface(int index) override {
         SkDEBUGFAIL("SkFontStyleSet::createTypeface called on empty set");
-        return NULL;
+        return nullptr;
     }
     SkTypeface* matchStyle(const SkFontStyle&) override {
-        return NULL;
+        return nullptr;
     }
 };
 
@@ -43,7 +43,7 @@
     }
     SkFontStyleSet* onCreateStyleSet(int index) const override {
         SkDEBUGFAIL("onCreateStyleSet called with bad index");
-        return NULL;
+        return nullptr;
     }
     SkFontStyleSet* onMatchFamily(const char[]) const override {
         return SkFontStyleSet::CreateEmpty();
@@ -51,36 +51,36 @@
 
     virtual SkTypeface* onMatchFamilyStyle(const char[],
                                            const SkFontStyle&) const override {
-        return NULL;
+        return nullptr;
     }
     virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[],
                                                     const SkFontStyle& style,
                                                     const char* bcp47[],
                                                     int bcp47Count,
                                                     SkUnichar character) const override {
-        return NULL;
+        return nullptr;
     }
     virtual SkTypeface* onMatchFaceStyle(const SkTypeface*,
                                          const SkFontStyle&) const override {
-        return NULL;
+        return nullptr;
     }
     SkTypeface* onCreateFromData(SkData*, int) const override {
-        return NULL;
+        return nullptr;
     }
     SkTypeface* onCreateFromStream(SkStreamAsset* stream, int) const override {
         delete stream;
-        return NULL;
+        return nullptr;
     }
     SkTypeface* onCreateFromFile(const char[], int) const override {
-        return NULL;
+        return nullptr;
     }
     SkTypeface* onLegacyCreateTypeface(const char [], unsigned) const override {
-        return NULL;
+        return nullptr;
     }
 };
 
 static SkFontStyleSet* emptyOnNull(SkFontStyleSet* fsset) {
-    if (NULL == fsset) {
+    if (nullptr == fsset) {
         fsset = SkFontStyleSet::CreateEmpty();
     }
     return fsset;
@@ -119,22 +119,22 @@
 }
 
 SkTypeface* SkFontMgr::createFromData(SkData* data, int ttcIndex) const {
-    if (NULL == data) {
-        return NULL;
+    if (nullptr == data) {
+        return nullptr;
     }
     return this->onCreateFromData(data, ttcIndex);
 }
 
 SkTypeface* SkFontMgr::createFromStream(SkStreamAsset* stream, int ttcIndex) const {
-    if (NULL == stream) {
-        return NULL;
+    if (nullptr == stream) {
+        return nullptr;
     }
     return this->onCreateFromStream(stream, ttcIndex);
 }
 
 SkTypeface* SkFontMgr::createFromFontData(SkFontData* data) const {
-    if (NULL == data) {
-        return NULL;
+    if (nullptr == data) {
+        return nullptr;
     }
     return this->onCreateFromFontData(data);
 }
@@ -147,8 +147,8 @@
 }
 
 SkTypeface* SkFontMgr::createFromFile(const char path[], int ttcIndex) const {
-    if (NULL == path) {
-        return NULL;
+    if (nullptr == path) {
+        return nullptr;
     }
     return this->onCreateFromFile(path, ttcIndex);
 }
diff --git a/src/core/SkFontStream.cpp b/src/core/SkFontStream.cpp
index 580da37..b2ffe8d 100644
--- a/src/core/SkFontStream.cpp
+++ b/src/core/SkFontStream.cpp
@@ -101,7 +101,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 struct SfntHeader {
-    SfntHeader() : fCount(0), fDir(NULL) {}
+    SfntHeader() : fCount(0), fDir(nullptr) {}
     ~SfntHeader() { sk_free(fDir); }
 
     /** If it returns true, then fCount and fDir are properly initialized.
diff --git a/src/core/SkFontStream.h b/src/core/SkFontStream.h
index 0f7a052..0a2322f 100644
--- a/src/core/SkFontStream.h
+++ b/src/core/SkFontStream.h
@@ -42,7 +42,7 @@
                                size_t offset, size_t length, void* data);
 
     static size_t GetTableSize(SkStream* stream, int ttcIndex, SkFontTableTag tag) {
-        return GetTableData(stream, ttcIndex, tag, 0, ~0U, NULL);
+        return GetTableData(stream, ttcIndex, tag, 0, ~0U, nullptr);
     }
 };
 
diff --git a/src/core/SkGeometry.cpp b/src/core/SkGeometry.cpp
index 7462009..01b6180 100644
--- a/src/core/SkGeometry.cpp
+++ b/src/core/SkGeometry.cpp
@@ -912,7 +912,7 @@
                               SkScalar tValues[3]) {
     SkScalar    t_storage[3];
 
-    if (tValues == NULL) {
+    if (tValues == nullptr) {
         tValues = t_storage;
     }
 
diff --git a/src/core/SkGeometry.h b/src/core/SkGeometry.h
index bd3abe1..79cad2e 100644
--- a/src/core/SkGeometry.h
+++ b/src/core/SkGeometry.h
@@ -39,7 +39,7 @@
 /** Set pt to the point on the src quadratic specified by t. t must be
     0 <= t <= 1.0
 */
-void SkEvalQuadAt(const SkPoint src[3], SkScalar t, SkPoint* pt, SkVector* tangent = NULL);
+void SkEvalQuadAt(const SkPoint src[3], SkScalar t, SkPoint* pt, SkVector* tangent = nullptr);
 
 /**
  *  output is : eval(t) == coeff[0] * t^2 + coeff[1] * t + coeff[2]
@@ -164,7 +164,7 @@
 
 int SkFindCubicMaxCurvature(const SkPoint src[4], SkScalar tValues[3]);
 int SkChopCubicAtMaxCurvature(const SkPoint src[4], SkPoint dst[13],
-                              SkScalar tValues[3] = NULL);
+                              SkScalar tValues[3] = nullptr);
 
 bool SkChopMonoCubicAtX(SkPoint src[4], SkScalar y, SkPoint dst[7]);
 bool SkChopMonoCubicAtY(SkPoint src[4], SkScalar x, SkPoint dst[7]);
@@ -239,7 +239,7 @@
      *  tangent value's length is arbitrary, and only its direction should
      *  be used.
      */
-    void evalAt(SkScalar t, SkPoint* pos, SkVector* tangent = NULL) const;
+    void evalAt(SkScalar t, SkPoint* pos, SkVector* tangent = nullptr) const;
     void chopAt(SkScalar t, SkConic dst[2]) const;
     void chop(SkConic dst[2]) const;
 
diff --git a/src/core/SkGlyph.h b/src/core/SkGlyph.h
index 4699859..c747995 100644
--- a/src/core/SkGlyph.h
+++ b/src/core/SkGlyph.h
@@ -131,8 +131,8 @@
 
     void initCommon(uint32_t id) {
         fID             = id;
-        fImage          = NULL;
-        fPath           = NULL;
+        fImage          = nullptr;
+        fPath           = nullptr;
         fMaskFormat     = MASK_FORMAT_UNKNOWN;
         fForceBW        = 0;
     }
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
index ff52004..e6d66f0 100644
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -43,13 +43,13 @@
     SkASSERT(desc);
     SkASSERT(ctx);
 
-    fPrev = fNext = NULL;
+    fPrev = fNext = nullptr;
 
     fScalerContext->getFontMetrics(&fFontMetrics);
 
     fMemoryUsed = sizeof(*this);
 
-    fAuxProcList = NULL;
+    fAuxProcList = nullptr;
 }
 
 SkGlyphCache::~SkGlyphCache() {
@@ -60,7 +60,7 @@
 }
 
 SkGlyphCache::CharGlyphRec* SkGlyphCache::getCharGlyphRec(PackedUnicharID packedUnicharID) {
-    if (NULL == fPackedUnicharIDToPackedGlyphID.get()) {
+    if (nullptr == fPackedUnicharIDToPackedGlyphID.get()) {
         // Allocate the array.
         fPackedUnicharIDToPackedGlyphID.reset(kHashCount);
         // Initialize array to map character and position with the impossible glyph ID. This
@@ -161,7 +161,7 @@
 SkGlyph* SkGlyphCache::lookupByPackedGlyphID(PackedGlyphID packedGlyphID, MetricsType type) {
     SkGlyph* glyph = fGlyphMap.find(packedGlyphID);
 
-    if (NULL == glyph) {
+    if (nullptr == glyph) {
         glyph = this->allocateNewGlyph(packedGlyphID, type);
     } else {
         if (type == kFull_MetricsType && glyph->isJustAdvance()) {
@@ -194,7 +194,7 @@
 
 const void* SkGlyphCache::findImage(const SkGlyph& glyph) {
     if (glyph.fWidth > 0 && glyph.fWidth < kMaxGlyphWidth) {
-        if (NULL == glyph.fImage) {
+        if (nullptr == glyph.fImage) {
             size_t  size = glyph.computeImageSize();
             const_cast<SkGlyph&>(glyph).fImage = fGlyphAlloc.alloc(size,
                                         SkChunkAlloc::kReturnNil_AllocFailType);
@@ -214,7 +214,7 @@
 
 const SkPath* SkGlyphCache::findPath(const SkGlyph& glyph) {
     if (glyph.fWidth) {
-        if (glyph.fPath == NULL) {
+        if (glyph.fPath == nullptr) {
             const_cast<SkGlyph&>(glyph).fPath = new SkPath;
             fScalerContext->getPath(glyph, glyph.fPath);
             fMemoryUsed += sizeof(SkPath) +
@@ -260,7 +260,7 @@
 }
 
 void SkGlyphCache::setAuxProc(void (*proc)(void*), void* data) {
-    if (proc == NULL) {
+    if (proc == nullptr) {
         return;
     }
 
@@ -357,12 +357,12 @@
 
         globals.validate();
 
-        for (cache = globals.internalGetHead(); cache != NULL; cache = cache->fNext) {
+        for (cache = globals.internalGetHead(); cache != nullptr; cache = cache->fNext) {
             if (cache->fDesc->equals(*desc)) {
                 globals.internalDetachCache(cache);
                 if (!proc(cache, context)) {
                     globals.internalAttachCacheToHead(cache);
-                    cache = NULL;
+                    cache = nullptr;
                 }
                 return cache;
             }
@@ -388,14 +388,14 @@
 
     if (!proc(cache, context)) {   // need to reattach
         globals.attachCacheToHead(cache);
-        cache = NULL;
+        cache = nullptr;
     }
     return cache;
 }
 
 void SkGlyphCache::AttachCache(SkGlyphCache* cache) {
     SkASSERT(cache);
-    SkASSERT(cache->fNext == NULL);
+    SkASSERT(cache->fNext == nullptr);
 
     get_globals().attachCacheToHead(cache);
 }
@@ -431,7 +431,7 @@
 
     globals.validate();
 
-    for (cache = globals.internalGetHead(); cache != NULL; cache = cache->fNext) {
+    for (cache = globals.internalGetHead(); cache != nullptr; cache = cache->fNext) {
         visitor(*cache, context);
     }
 }
@@ -489,7 +489,7 @@
     // we start at the tail and proceed backwards, as the linklist is in LRU
     // order, with unimportant entries at the tail.
     SkGlyphCache* cache = this->internalGetTail();
-    while (cache != NULL &&
+    while (cache != nullptr &&
            (bytesFreed < bytesNeeded || countFreed < countNeeded)) {
         SkGlyphCache* prev = cache->fPrev;
         bytesFreed += cache->fMemoryUsed;
@@ -513,7 +513,7 @@
 }
 
 void SkGlyphCache_Globals::internalAttachCacheToHead(SkGlyphCache* cache) {
-    SkASSERT(NULL == cache->fPrev && NULL == cache->fNext);
+    SkASSERT(nullptr == cache->fPrev && nullptr == cache->fNext);
     if (fHead) {
         fHead->fPrev = cache;
         cache->fNext = fHead;
@@ -537,7 +537,7 @@
     if (cache->fNext) {
         cache->fNext->fPrev = cache->fPrev;
     }
-    cache->fPrev = cache->fNext = NULL;
+    cache->fPrev = cache->fNext = nullptr;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -562,7 +562,7 @@
     int computedCount = 0;
 
     const SkGlyphCache* head = fHead;
-    while (head != NULL) {
+    while (head != nullptr) {
         computedBytes += head->fMemoryUsed;
         computedCount += 1;
         head = head->fNext;
diff --git a/src/core/SkGlyphCache.h b/src/core/SkGlyphCache.h
index dc2aa57..7062041 100644
--- a/src/core/SkGlyphCache.h
+++ b/src/core/SkGlyphCache.h
@@ -117,7 +117,7 @@
 
     /** Find a matching cache entry, and call proc() with it. If none is found create a new one.
         If the proc() returns true, detach the cache and return it, otherwise leave it and return
-        NULL.
+        nullptr.
     */
     static SkGlyphCache* VisitCache(SkTypeface*, const SkDescriptor* desc,
                                     bool (*proc)(const SkGlyphCache*, void*),
@@ -136,7 +136,7 @@
         win is that different thread will never block each other while a strike is being used.
     */
     static SkGlyphCache* DetachCache(SkTypeface* typeface, const SkDescriptor* desc) {
-        return VisitCache(typeface, desc, DetachProc, NULL);
+        return VisitCache(typeface, desc, DetachProc, nullptr);
     }
 
     static void Dump();
@@ -163,7 +163,7 @@
             }
         }
         void forget() {
-            fCache = NULL;
+            fCache = nullptr;
         }
     private:
         const SkGlyphCache* fCache;
@@ -249,7 +249,7 @@
     void release() {
         if (fCache) {
             SkGlyphCache::AttachCache(fCache);
-            fCache = NULL;
+            fCache = nullptr;
         }
     }
 
@@ -263,10 +263,10 @@
     SkAutoGlyphCacheBase(const SkPaint& /*paint*/,
                          const SkSurfaceProps* /*surfaceProps*/,
                          const SkMatrix* /*matrix*/) {
-        fCache = NULL;
+        fCache = nullptr;
     }
     SkAutoGlyphCacheBase() {
-        fCache = NULL;
+        fCache = nullptr;
     }
     ~SkAutoGlyphCacheBase() {
         if (fCache) {
diff --git a/src/core/SkGlyphCache_Globals.h b/src/core/SkGlyphCache_Globals.h
index 70d8020..e1825a2 100644
--- a/src/core/SkGlyphCache_Globals.h
+++ b/src/core/SkGlyphCache_Globals.h
@@ -26,7 +26,7 @@
 class SkGlyphCache_Globals {
 public:
     SkGlyphCache_Globals() {
-        fHead = NULL;
+        fHead = nullptr;
         fTotalMemoryUsed = 0;
         fCacheSizeLimit = SK_DEFAULT_FONT_CACHE_LIMIT;
         fCacheCount = 0;
diff --git a/src/core/SkImageCacherator.h b/src/core/SkImageCacherator.h
index c9aa121..dc6b0f2 100644
--- a/src/core/SkImageCacherator.h
+++ b/src/core/SkImageCacherator.h
@@ -34,7 +34,7 @@
 
     /**
      *  Returns a ref() on the texture produced by this generator. The caller must call unref()
-     *  when it is done. Will return NULL on failure.
+     *  when it is done. Will return nullptr on failure.
      *
      *  The caller is responsible for calling texture->unref() when they are done.
      */
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 90f14c5..cda3e05 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -182,7 +182,7 @@
     fCropRect(cropRect ? *cropRect : CropRect(SkRect(), 0x0)),
     fUniqueID(next_image_filter_unique_id()) {
     for (int i = 0; i < inputCount; ++i) {
-        if (NULL == inputs[i] || inputs[i]->usesSrcInput()) {
+        if (nullptr == inputs[i] || inputs[i]->usesSrcInput()) {
             fUsesSrcInput = true;
         }
         fInputs[i] = inputs[i];
@@ -207,13 +207,13 @@
         fInputs = new SkImageFilter* [fInputCount];
         common.detachInputs(fInputs);
         for (int i = 0; i < fInputCount; ++i) {
-            if (NULL == fInputs[i] || fInputs[i]->usesSrcInput()) {
+            if (nullptr == fInputs[i] || fInputs[i]->usesSrcInput()) {
                 fUsesSrcInput = true;
             }
         }
     } else {
         fInputCount = 0;
-        fInputs = NULL;
+        fInputs = nullptr;
     }
 }
 
@@ -221,8 +221,8 @@
     buffer.writeInt(fInputCount);
     for (int i = 0; i < fInputCount; i++) {
         SkImageFilter* input = getInput(i);
-        buffer.writeBool(input != NULL);
-        if (input != NULL) {
+        buffer.writeBool(input != nullptr);
+        if (input != nullptr) {
             buffer.writeFlattenable(input);
         }
     }
@@ -307,7 +307,7 @@
 }
 
 bool SkImageFilter::canFilterImageGPU() const {
-    return this->asFragmentProcessor(NULL, NULL, NULL, SkMatrix::I(), SkIRect());
+    return this->asFragmentProcessor(nullptr, nullptr, nullptr, SkMatrix::I(), SkIRect());
 }
 
 bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
@@ -464,7 +464,7 @@
                 if (kUnknown_SkColorType == info.colorType()) {
                     return false;
                 }
-                SkAutoTUnref<GrTexture> resultTex(GrRefCachedBitmapTexture(context, *result, NULL));
+                SkAutoTUnref<GrTexture> resultTex(GrRefCachedBitmapTexture(context, *result, nullptr));
                 result->setPixelRef(new SkGrPixelRef(info, resultTex))->unref();
             }
             return true;
@@ -587,8 +587,8 @@
                                    SkBaseDevice::kNever_TileUsage,
                                    kUnknown_SkPixelGeometry,
                                    true /*forImageFilter*/);
-    SkBaseDevice* dev = fDevice->onCreateDevice(cinfo, NULL);
-    if (NULL == dev) {
+    SkBaseDevice* dev = fDevice->onCreateDevice(cinfo, nullptr);
+    if (nullptr == dev) {
         const SkSurfaceProps surfaceProps(fDevice->fSurfaceProps.flags(),
                                           kUnknown_SkPixelGeometry);
         dev = SkBitmapDevice::Create(cinfo.fInfo, surfaceProps);
diff --git a/src/core/SkImageGenerator.cpp b/src/core/SkImageGenerator.cpp
index ffccb61..33da50a 100644
--- a/src/core/SkImageGenerator.cpp
+++ b/src/core/SkImageGenerator.cpp
@@ -18,7 +18,7 @@
     if (kUnknown_SkColorType == info.colorType()) {
         return false;
     }
-    if (NULL == pixels) {
+    if (nullptr == pixels) {
         return false;
     }
     if (rowBytes < info.minRowBytes()) {
@@ -26,15 +26,15 @@
     }
 
     if (kIndex_8_SkColorType == info.colorType()) {
-        if (NULL == ctable || NULL == ctableCount) {
+        if (nullptr == ctable || nullptr == ctableCount) {
             return false;
         }
     } else {
         if (ctableCount) {
             *ctableCount = 0;
         }
-        ctableCount = NULL;
-        ctable = NULL;
+        ctableCount = nullptr;
+        ctable = nullptr;
     }
 
     const bool success = this->onGetPixels(info, pixels, rowBytes, ctable, ctableCount);
@@ -49,7 +49,7 @@
     if (kIndex_8_SkColorType == info.colorType()) {
         return false;
     }
-    return this->getPixels(info, pixels, rowBytes, NULL, NULL);
+    return this->getPixels(info, pixels, rowBytes, nullptr, nullptr);
 }
 
 bool SkImageGenerator::getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3],
@@ -62,9 +62,9 @@
         ((planes[0]) && (planes[1]) && (planes[2]) &&
          (0  != rowBytes[0]) && (0  != rowBytes[1]) && (0  != rowBytes[2]));
     bool isValidWithoutPlanes =
-        ((NULL == planes) ||
-         ((NULL == planes[0]) && (NULL == planes[1]) && (NULL == planes[2]))) &&
-        ((NULL == rowBytes) ||
+        ((nullptr == planes) ||
+         ((nullptr == planes[0]) && (nullptr == planes[1]) && (nullptr == planes[2]))) &&
+        ((nullptr == rowBytes) ||
          ((0 == rowBytes[0]) && (0 == rowBytes[1]) && (0 == rowBytes[2])));
 
     // Either we have all planes and rowBytes information or we have none of it
@@ -115,7 +115,7 @@
 /////////////////////////////////////////////////////////////////////////////////////////////
 
 SkData* SkImageGenerator::onRefEncodedData() {
-    return NULL;
+    return nullptr;
 }
 
 bool SkImageGenerator::onGetPixels(const SkImageInfo& info, void* dst, size_t rb,
@@ -138,8 +138,8 @@
 }
 
 SkImageGenerator* SkImageGenerator::NewFromEncoded(SkData* data) {
-    if (NULL == data) {
-        return NULL;
+    if (nullptr == data) {
+        return nullptr;
     }
     if (gFactory) {
         if (SkImageGenerator* generator = gFactory(data)) {
diff --git a/src/core/SkImageGeneratorPriv.h b/src/core/SkImageGeneratorPriv.h
index 5d018bc..bf03596 100644
--- a/src/core/SkImageGeneratorPriv.h
+++ b/src/core/SkImageGeneratorPriv.h
@@ -17,7 +17,7 @@
  *  the generator.  If it succeeds, it will modify destination
  *  bitmap.
  *
- *  If generator is NULL, will safely return false.
+ *  If generator is nullptr, will safely return false.
  *
  *  If this fails or when the SkDiscardablePixelRef that is
  *  installed into destination is destroyed, it will call
@@ -27,8 +27,8 @@
  *  @param destination Upon success, this bitmap will be
  *  configured and have a pixelref installed.
  *
- *  @param factory If not NULL, this object will be used as a
- *  source of discardable memory when decoding.  If NULL, then
+ *  @param factory If not nullptr, this object will be used as a
+ *  source of discardable memory when decoding.  If nullptr, then
  *  SkDiscardableMemory::Create() will be called.
  *
  *  @return true iff successful.
diff --git a/src/core/SkImageInfo.cpp b/src/core/SkImageInfo.cpp
index 8429ef2..b90f858 100644
--- a/src/core/SkImageInfo.cpp
+++ b/src/core/SkImageInfo.cpp
@@ -90,7 +90,7 @@
         default:
             break;
     }
-    if (NULL == fPixels || fRowBytes < fInfo.minRowBytes()) {
+    if (nullptr == fPixels || fRowBytes < fInfo.minRowBytes()) {
         return false;
     }
     if (0 == fInfo.width() || 0 == fInfo.height()) {
diff --git a/src/core/SkLayerInfo.h b/src/core/SkLayerInfo.h
index 5d598ef..04ae179 100644
--- a/src/core/SkLayerInfo.h
+++ b/src/core/SkLayerInfo.h
@@ -18,7 +18,7 @@
     // Information about a given saveLayer/restore block in an SkPicture
     class BlockInfo {
     public:
-        BlockInfo() : fPicture(NULL), fPaint(NULL), fKey(NULL), fKeySize(0) {}
+        BlockInfo() : fPicture(nullptr), fPaint(nullptr), fKey(nullptr), fKeySize(0) {}
         ~BlockInfo() {
             SkSafeUnref(fPicture);
             delete fPaint;
@@ -27,8 +27,8 @@
 
         // The picture owning the layer. If the owning picture is the top-most
         // one (i.e., the picture for which this SkLayerInfo was created) then
-        // this pointer is NULL. If it is a nested picture then the pointer
-        // is non-NULL and owns a ref on the picture.
+        // this pointer is nullptr. If it is a nested picture then the pointer
+        // is non-nullptr and owns a ref on the picture.
         const SkPicture* fPicture;
         // The device space bounds of this layer.
         SkRect fBounds;
@@ -46,7 +46,7 @@
         // layer's top-left point to the origin (which must be part of the
         // initial matrix).
         SkMatrix fLocalMat;
-        // The paint to use on restore. Can be NULL since it is optional.
+        // The paint to use on restore. Can be nullptr since it is optional.
         const SkPaint* fPaint;
         // The index of this saveLayer in the picture.
         size_t  fSaveLayerOpID;
diff --git a/src/core/SkLazyFnPtr.h b/src/core/SkLazyFnPtr.h
index 9e9bc11..1535782 100644
--- a/src/core/SkLazyFnPtr.h
+++ b/src/core/SkLazyFnPtr.h
@@ -42,7 +42,7 @@
     F get() {
         // First, try reading to see if it's already set.
         F fn = (F)sk_atomic_load(&fPtr, sk_memory_order_relaxed);
-        if (fn != NULL) {
+        if (fn != nullptr) {
             return fn;
         }
 
@@ -50,11 +50,11 @@
         fn = Choose();
 
         // No particular memory barriers needed; we're not guarding anything but the pointer itself.
-        F prev = (F)sk_atomic_cas(&fPtr, NULL, (void*)fn);
+        F prev = (F)sk_atomic_cas(&fPtr, nullptr, (void*)fn);
 
-        // If prev != NULL, someone snuck in and set fPtr concurrently.
-        // If prev == NULL, we did write fn to fPtr.
-        return prev != NULL ? prev : fn;
+        // If prev != nullptr, someone snuck in and set fPtr concurrently.
+        // If prev == nullptr, we did write fn to fPtr.
+        return prev != nullptr ? prev : fn;
     }
 
 private:
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp
index 0e20db4..a8d346a 100644
--- a/src/core/SkLightingShader.cpp
+++ b/src/core/SkLightingShader.cpp
@@ -176,22 +176,22 @@
             GrGLFragmentBuilder* fpb = args.fBuilder->getFragmentShaderBuilder();
 
             // add uniforms
-            const char* lightDirUniName = NULL;
+            const char* lightDirUniName = nullptr;
             fLightDirUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
                                                      kVec3f_GrSLType, kDefault_GrSLPrecision,
                                                      "LightDir", &lightDirUniName);
 
-            const char* lightColorUniName = NULL;
+            const char* lightColorUniName = nullptr;
             fLightColorUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
                                                        kVec3f_GrSLType, kDefault_GrSLPrecision,
                                                        "LightColor", &lightColorUniName);
 
-            const char* ambientColorUniName = NULL;
+            const char* ambientColorUniName = nullptr;
             fAmbientColorUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
                                                          kVec3f_GrSLType, kDefault_GrSLPrecision,
                                                          "AmbientColor", &ambientColorUniName);
 
-            const char* xformUniName = NULL;
+            const char* xformUniName = nullptr;
             fXformUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
                                                   kVec2f_GrSLType, kDefault_GrSLPrecision,
                                                   "Xform", &xformUniName);
@@ -578,13 +578,13 @@
 
     SkBitmap diffuse;
     if (!buf.readBitmap(&diffuse)) {
-        return NULL;
+        return nullptr;
     }
     diffuse.setImmutable();
 
     SkBitmap normal;
     if (!buf.readBitmap(&normal)) {
-        return NULL;
+        return nullptr;
     }
     normal.setImmutable();
 
@@ -597,7 +597,7 @@
 
         SkColor3f color;
         if (!buf.readScalarArray(&color.fX, 3)) {
-            return NULL;
+            return nullptr;
         }
 
         if (isAmbient) {
@@ -605,7 +605,7 @@
         } else {
             SkVector3 dir;
             if (!buf.readScalarArray(&dir.fX, 3)) {
-                return NULL;
+                return nullptr;
             }
             builder.add(SkLight(color, dir));        
         }
@@ -665,7 +665,7 @@
 
     SkMatrix normTotalInv;
     if (!this->computeNormTotalInverse(rec, &normTotalInv)) {
-        return NULL;
+        return nullptr;
     }
 
     void* diffuseStateStorage = (char*)storage + sizeof(LightingShaderContext);
@@ -677,7 +677,7 @@
     diffuseState->fOrigBitmap = fDiffuseMap;
     if (!diffuseState->chooseProcs(diffTotalInv, *rec.fPaint)) {
         diffuseState->~SkBitmapProcState();
-        return NULL;
+        return nullptr;
     }
 
     void* normalStateStorage = (char*)storage + sizeof(LightingShaderContext) + sizeof(SkBitmapProcState);
@@ -690,7 +690,7 @@
     if (!normalState->chooseProcs(normTotalInv, *rec.fPaint)) {
         diffuseState->~SkBitmapProcState();
         normalState->~SkBitmapProcState();
-        return NULL;
+        return nullptr;
     }
 
     return new (storage) LightingShaderContext(*this, rec, diffuseState, normalState);
diff --git a/src/core/SkLightingShader.h b/src/core/SkLightingShader.h
index d286487..f87db31 100644
--- a/src/core/SkLightingShader.h
+++ b/src/core/SkLightingShader.h
@@ -73,7 +73,7 @@
         @param  ambient     the linear (unpremul) ambient light color. Range is 0..1/channel.
         @param  localMatrix the matrix mapping the textures to the dest rect 
 
-        NULL will be returned if:
+        nullptr will be returned if:
             either 'diffuse' or 'normal' are empty
             either 'diffuse' or 'normal' are too big (> 65535 on a side)
             'diffuse' and 'normal' aren't the same size
diff --git a/src/core/SkLocalMatrixShader.cpp b/src/core/SkLocalMatrixShader.cpp
index b9a0960..ce5a7ca 100644
--- a/src/core/SkLocalMatrixShader.cpp
+++ b/src/core/SkLocalMatrixShader.cpp
@@ -12,7 +12,7 @@
     buffer.readMatrix(&lm);
     SkAutoTUnref<SkShader> shader(buffer.readShader());
     if (!shader.get()) {
-        return NULL;
+        return nullptr;
     }
     return SkShader::CreateLocalMatrixShader(shader, lm);
 }
@@ -48,8 +48,8 @@
 #endif
 
 SkShader* SkShader::CreateLocalMatrixShader(SkShader* proxy, const SkMatrix& localMatrix) {
-    if (NULL == proxy) {
-        return NULL;
+    if (nullptr == proxy) {
+        return nullptr;
     }
 
     if (localMatrix.isIdentity()) {
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp
index 4916510..0196e04 100644
--- a/src/core/SkMallocPixelRef.cpp
+++ b/src/core/SkMallocPixelRef.cpp
@@ -27,7 +27,7 @@
     // that expect the pixelref to succeed even when there is a mismatch
     // with colortables. fix?
 #if 0
-    if (kIndex8_SkColorType == info.fColorType && NULL == ctable) {
+    if (kIndex8_SkColorType == info.fColorType && nullptr == ctable) {
         return false;
     }
     if (kIndex8_SkColorType != info.fColorType && ctable) {
@@ -42,9 +42,9 @@
                                               size_t rowBytes,
                                               SkColorTable* ctable) {
     if (!is_valid(info, ctable)) {
-        return NULL;
+        return nullptr;
     }
-    return new SkMallocPixelRef(info, addr, rowBytes, ctable, NULL, NULL);
+    return new SkMallocPixelRef(info, addr, rowBytes, ctable, nullptr, nullptr);
 }
 
 
@@ -52,16 +52,16 @@
                                                 size_t requestedRowBytes,
                                                 SkColorTable* ctable) {
     if (!is_valid(info, ctable)) {
-        return NULL;
+        return nullptr;
     }
 
     // only want to permit 31bits of rowBytes
     int64_t minRB = (int64_t)info.minRowBytes64();
     if (minRB < 0 || !sk_64_isS32(minRB)) {
-        return NULL;    // allocation will be too large
+        return nullptr;    // allocation will be too large
     }
     if (requestedRowBytes > 0 && (int32_t)requestedRowBytes < minRB) {
-        return NULL;    // cannot meet requested rowbytes
+        return nullptr;    // cannot meet requested rowbytes
     }
 
     int32_t rowBytes;
@@ -73,17 +73,17 @@
 
     int64_t bigSize = (int64_t)info.height() * rowBytes;
     if (!sk_64_isS32(bigSize)) {
-        return NULL;
+        return nullptr;
     }
 
     size_t size = sk_64_asS32(bigSize);
     SkASSERT(size >= info.getSafeSize(rowBytes));
     void* addr = sk_malloc_flags(size, 0);
-    if (NULL == addr) {
-        return NULL;
+    if (nullptr == addr) {
+        return nullptr;
     }
 
-    return new SkMallocPixelRef(info, addr, rowBytes, ctable, sk_free_releaseproc, NULL);
+    return new SkMallocPixelRef(info, addr, rowBytes, ctable, sk_free_releaseproc, nullptr);
 }
 
 SkMallocPixelRef* SkMallocPixelRef::NewWithProc(const SkImageInfo& info,
@@ -93,7 +93,7 @@
                                                 SkMallocPixelRef::ReleaseProc proc,
                                                 void* context) {
     if (!is_valid(info, ctable)) {
-        return NULL;
+        return nullptr;
     }
     return new SkMallocPixelRef(info, addr, rowBytes, ctable, proc, context);
 }
@@ -106,19 +106,19 @@
                                                 size_t rowBytes,
                                                 SkColorTable* ctable,
                                                 SkData* data) {
-    SkASSERT(data != NULL);
+    SkASSERT(data != nullptr);
     if (!is_valid(info, ctable)) {
-        return NULL;
+        return nullptr;
     }
     if ((rowBytes < info.minRowBytes())
         || (data->size() < info.getSafeSize(rowBytes))) {
-        return NULL;
+        return nullptr;
     }
     data->ref();
     SkMallocPixelRef* pr =
             new SkMallocPixelRef(info, const_cast<void*>(data->data()), rowBytes, ctable,
                                  sk_data_releaseproc, static_cast<void*>(data));
-    SkASSERT(pr != NULL);
+    SkASSERT(pr != nullptr);
     // We rely on the immutability of the pixels to make the
     // const_cast okay.
     pr->setImmutable();
@@ -131,14 +131,14 @@
                                    size_t rowBytes, SkColorTable* ctable,
                                    bool ownsPixels)
     : INHERITED(info)
-    , fReleaseProc(ownsPixels ? sk_free_releaseproc : NULL)
-    , fReleaseProcContext(NULL) {
+    , fReleaseProc(ownsPixels ? sk_free_releaseproc : nullptr)
+    , fReleaseProcContext(nullptr) {
     // This constructor is now DEPRICATED.
     SkASSERT(is_valid(info, ctable));
     SkASSERT(rowBytes >= info.minRowBytes());
 
     if (kIndex_8_SkColorType != info.colorType()) {
-        ctable = NULL;
+        ctable = nullptr;
     }
 
     fStorage = storage;
@@ -161,7 +161,7 @@
     SkASSERT(rowBytes >= info.minRowBytes());
 
     if (kIndex_8_SkColorType != info.colorType()) {
-        ctable = NULL;
+        ctable = nullptr;
     }
 
     fStorage = storage;
@@ -175,7 +175,7 @@
 
 SkMallocPixelRef::~SkMallocPixelRef() {
     SkSafeUnref(fCTable);
-    if (fReleaseProc != NULL) {
+    if (fReleaseProc != nullptr) {
         fReleaseProc(fStorage, fReleaseProcContext);
     }
 }
diff --git a/src/core/SkMaskCache.cpp b/src/core/SkMaskCache.cpp
index cc729c3..da7b538 100644
--- a/src/core/SkMaskCache.cpp
+++ b/src/core/SkMaskCache.cpp
@@ -64,7 +64,7 @@
 
         SkCachedData* tmpData = rec.fValue.fData;
         tmpData->ref();
-        if (NULL == tmpData->data()) {
+        if (nullptr == tmpData->data()) {
             tmpData->unref();
             return false;
         }
@@ -79,7 +79,7 @@
     MaskValue result;
     RRectBlurKey key(sigma, rrect, style, quality);
     if (!CHECK_LOCAL(localCache, find, Find, key, RRectBlurRec::Visitor, &result)) {
-        return NULL;
+        return nullptr;
     }
 
     *mask = result.fMask;
@@ -159,7 +159,7 @@
 
         SkCachedData* tmpData = rec.fValue.fData;
         tmpData->ref();
-        if (NULL == tmpData->data()) {
+        if (nullptr == tmpData->data()) {
             tmpData->unref();
             return false;
         }
@@ -175,7 +175,7 @@
     MaskValue result;
     RectsBlurKey key(sigma, style, quality, rects, count);
     if (!CHECK_LOCAL(localCache, find, Find, key, RectsBlurRec::Visitor, &result)) {
-        return NULL;
+        return nullptr;
     }
 
     *mask = result.fMask;
diff --git a/src/core/SkMaskCache.h b/src/core/SkMaskCache.h
index f98387b..9df1bf8 100644
--- a/src/core/SkMaskCache.h
+++ b/src/core/SkMaskCache.h
@@ -21,24 +21,24 @@
      * On success, return a ref to the SkCachedData that holds the pixels, and have mask
      * already point to that memory.
      *
-     * On failure, return NULL.
+     * On failure, return nullptr.
      */
     static SkCachedData* FindAndRef(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
                                     const SkRRect& rrect, SkMask* mask,
-                                    SkResourceCache* localCache = NULL);
+                                    SkResourceCache* localCache = nullptr);
     static SkCachedData* FindAndRef(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
                                     const SkRect rects[], int count, SkMask* mask,
-                                    SkResourceCache* localCache = NULL);
+                                    SkResourceCache* localCache = nullptr);
 
     /**
      * Add a mask and its pixel-data to the cache.
      */
     static void Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
                     const SkRRect& rrect, const SkMask& mask, SkCachedData* data,
-                    SkResourceCache* localCache = NULL);
+                    SkResourceCache* localCache = nullptr);
     static void Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
                     const SkRect rects[], int count, const SkMask& mask, SkCachedData* data,
-                    SkResourceCache* localCache = NULL);
+                    SkResourceCache* localCache = nullptr);
 };
 
 #endif
diff --git a/src/core/SkMaskFilter.cpp b/src/core/SkMaskFilter.cpp
index 5e7cee6..7c48bca 100644
--- a/src/core/SkMaskFilter.cpp
+++ b/src/core/SkMaskFilter.cpp
@@ -222,11 +222,11 @@
     // cannot be used, return false to allow our caller to recover and perform
     // the drawing another way.
     NinePatch patch;
-    patch.fMask.fImage = NULL;
+    patch.fMask.fImage = nullptr;
     if (kTrue_FilterReturn != this->filterRRectToNine(devRRect, matrix,
                                                       clip.getBounds(),
                                                       &patch)) {
-        SkASSERT(NULL == patch.fMask.fImage);
+        SkASSERT(nullptr == patch.fMask.fImage);
         return false;
     }
     draw_nine(patch.fMask, patch.fOuterRect, patch.fCenter, true, clip, blitter);
@@ -246,7 +246,7 @@
 
         switch (this->filterRectsToNine(rects, rectCount, matrix, clip.getBounds(), &patch)) {
             case kFalse_FilterReturn:
-                SkASSERT(NULL == patch.fMask.fImage);
+                SkASSERT(nullptr == patch.fMask.fImage);
                 return false;
 
             case kTrue_FilterReturn:
@@ -255,7 +255,7 @@
                 return true;
 
             case kUnimplemented_FilterReturn:
-                SkASSERT(NULL == patch.fMask.fImage);
+                SkASSERT(nullptr == patch.fMask.fImage);
                 // fall through
                 break;
         }
@@ -270,7 +270,7 @@
     }
     SkAutoMaskFreeImage autoSrc(srcM.fImage);
 
-    if (!this->filterMask(&dstM, srcM, matrix, NULL)) {
+    if (!this->filterMask(&dstM, srcM, matrix, nullptr)) {
         return false;
     }
     SkAutoMaskFreeImage autoDst(dstM.fImage);
@@ -351,7 +351,7 @@
 void SkMaskFilter::computeFastBounds(const SkRect& src, SkRect* dst) const {
     SkMask  srcM, dstM;
 
-    srcM.fImage = NULL;
+    srcM.fImage = nullptr;
     srcM.fBounds = src.roundOut();
     srcM.fRowBytes = 0;
     srcM.fFormat = SkMask::kA8_Format;
diff --git a/src/core/SkMaskGamma.h b/src/core/SkMaskGamma.h
index be5d034..16ea47b 100644
--- a/src/core/SkMaskGamma.h
+++ b/src/core/SkMaskGamma.h
@@ -168,7 +168,7 @@
  * convert a linear alpha value for a given channel to a gamma correcting alpha
  * value for that channel. This class is immutable.
  *
- * If fR, fG, or fB is NULL, all of them will be. This indicates that no mask
+ * If fR, fG, or fB is nullptr, all of them will be. This indicates that no mask
  * pre blend should be applied. SkTMaskPreBlend::isApplicable() is provided as
  * a convenience function to test for the absence of this case.
  */
@@ -182,7 +182,7 @@
     friend class SkTMaskGamma<R_LUM_BITS, G_LUM_BITS, B_LUM_BITS>;
 public:
     /** Creates a non applicable SkTMaskPreBlend. */
-    SkTMaskPreBlend() : fParent(), fR(NULL), fG(NULL), fB(NULL) { }
+    SkTMaskPreBlend() : fParent(), fR(nullptr), fG(nullptr), fB(nullptr) { }
 
     /**
      * This copy contructor exists for correctness, but should never be called
@@ -193,7 +193,7 @@
 
     ~SkTMaskPreBlend() { }
 
-    /** True if this PreBlend should be applied. When false, fR, fG, and fB are NULL. */
+    /** True if this PreBlend should be applied. When false, fR, fG, and fB are nullptr. */
     bool isApplicable() const { return SkToBool(this->fG); }
 
     const uint8_t* fR;
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index f5e4e80..13a9ac2 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -858,7 +858,7 @@
                 // translate only
                 inv->setTranslate(-fMat[kMTransX], -fMat[kMTransY]);
             }
-        } else {    // inv is NULL, just check if we're invertible
+        } else {    // inv is nullptr, just check if we're invertible
             if (!fMat[kMScaleX] || !fMat[kMScaleY]) {
                 invertible = false;
             }
@@ -878,7 +878,7 @@
     SkMatrix* tmp = inv;
 
     SkMatrix storage;
-    if (applyingInPlace || NULL == tmp) {
+    if (applyingInPlace || nullptr == tmp) {
         tmp = &storage;     // we either need to avoid trampling memory or have no memory
     }
 
diff --git a/src/core/SkMatrixImageFilter.cpp b/src/core/SkMatrixImageFilter.cpp
index b6f6fc8..823647f 100644
--- a/src/core/SkMatrixImageFilter.cpp
+++ b/src/core/SkMatrixImageFilter.cpp
@@ -72,7 +72,7 @@
     dstRect.roundOut(&dstBounds);
 
     SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(dstBounds.width(), dstBounds.height()));
-    if (NULL == device.get()) {
+    if (nullptr == device.get()) {
         return false;
     }
 
diff --git a/src/core/SkMatrixImageFilter.h b/src/core/SkMatrixImageFilter.h
index 83f2cfa..86734b6 100644
--- a/src/core/SkMatrixImageFilter.h
+++ b/src/core/SkMatrixImageFilter.h
@@ -24,13 +24,13 @@
     /** Construct a 2D transformation image filter.
      *  @param transform    The matrix to apply when drawing the src bitmap
      *  @param filterLevel  The quality of filtering to apply when scaling.
-     *  @param input        The input image filter.  If NULL, the src bitmap
+     *  @param input        The input image filter.  If nullptr, the src bitmap
      *                      passed to filterImage() is used instead.
      */
 
     static SkMatrixImageFilter* Create(const SkMatrix& transform,
                                        SkFilterQuality,
-                                       SkImageFilter* input = NULL);
+                                       SkImageFilter* input = nullptr);
     virtual ~SkMatrixImageFilter();
 
     void computeFastBounds(const SkRect&, SkRect*) const override;
diff --git a/src/core/SkMetaData.cpp b/src/core/SkMetaData.cpp
index dfc2a94..dd6ed05 100644
--- a/src/core/SkMetaData.cpp
+++ b/src/core/SkMetaData.cpp
@@ -27,11 +27,11 @@
     return ptr;
 }
 
-SkMetaData::SkMetaData() : fRec(NULL)
+SkMetaData::SkMetaData() : fRec(nullptr)
 {
 }
 
-SkMetaData::SkMetaData(const SkMetaData& src) : fRec(NULL)
+SkMetaData::SkMetaData(const SkMetaData& src) : fRec(nullptr)
 {
     *this = src;
 }
@@ -55,7 +55,7 @@
         Rec::Free(rec);
         rec = next;
     }
-    fRec = NULL;
+    fRec = nullptr;
 }
 
 SkMetaData& SkMetaData::operator=(const SkMetaData& src)
@@ -86,7 +86,7 @@
     SkASSERT(count > 0);
     if (count > 0)
         return (SkScalar*)this->set(name, values, sizeof(SkScalar), kScalar_Type, count);
-    return NULL;
+    return nullptr;
 }
 
 void SkMetaData::setString(const char name[], const char value[])
@@ -179,7 +179,7 @@
             memcpy(values, rec->data(), rec->fDataCount * rec->fDataLen);
         return (const SkScalar*)rec->data();
     }
-    return NULL;
+    return nullptr;
 }
 
 bool SkMetaData::findPtr(const char name[], void** ptr, PtrProc* proc) const {
@@ -201,8 +201,8 @@
 const char* SkMetaData::findString(const char name[]) const
 {
     const Rec* rec = this->find(name, kString_Type);
-    SkASSERT(rec == NULL || rec->fDataLen == sizeof(char));
-    return rec ? (const char*)rec->data() : NULL;
+    SkASSERT(rec == nullptr || rec->fDataLen == sizeof(char));
+    return rec ? (const char*)rec->data() : nullptr;
 }
 
 bool SkMetaData::findBool(const char name[], bool* value) const
@@ -227,7 +227,7 @@
         }
         return rec->data();
     }
-    return NULL;
+    return nullptr;
 }
 
 const SkMetaData::Rec* SkMetaData::find(const char name[], Type type) const
@@ -239,12 +239,12 @@
             return rec;
         rec = rec->fNext;
     }
-    return NULL;
+    return nullptr;
 }
 
 bool SkMetaData::remove(const char name[], Type type) {
     Rec* rec = fRec;
-    Rec* prev = NULL;
+    Rec* prev = nullptr;
     while (rec) {
         Rec* next = rec->fNext;
         if (rec->fType == type && !strcmp(rec->name(), name)) {
@@ -309,7 +309,7 @@
 }
 
 const char* SkMetaData::Iter::next(SkMetaData::Type* t, int* count) {
-    const char* name = NULL;
+    const char* name = nullptr;
 
     if (fRec) {
         if (t) {
diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp
index 8a62f88..6e0aaed 100644
--- a/src/core/SkMipMap.cpp
+++ b/src/core/SkMipMap.cpp
@@ -206,7 +206,7 @@
             proc_nocheck = downsample8_nocheck;
             break;
         default:
-            return NULL; // don't build mipmaps for any other colortypes (yet)
+            return nullptr; // don't build mipmaps for any other colortypes (yet)
     }
 
     // whip through our loop to compute the exact size needed
@@ -226,29 +226,29 @@
         }
     }
     if (0 == countLevels) {
-        return NULL;
+        return nullptr;
     }
 
     size_t storageSize = SkMipMap::AllocLevelsSize(countLevels, size);
     if (0 == storageSize) {
-        return NULL;
+        return nullptr;
     }
 
     SkAutoPixmapUnlock srcUnlocker;
     if (!src.requestLock(&srcUnlocker)) {
-        return NULL;
+        return nullptr;
     }
     const SkPixmap& srcPixmap = srcUnlocker.pixmap();
-    // Try to catch where we might have returned NULL for src crbug.com/492818
-    if (NULL == srcPixmap.addr()) {
+    // Try to catch where we might have returned nullptr for src crbug.com/492818
+    if (nullptr == srcPixmap.addr()) {
         sk_throw();
     }
 
     SkMipMap* mipmap;
     if (fact) {
         SkDiscardableMemory* dm = fact(storageSize);
-        if (NULL == dm) {
-            return NULL;
+        if (nullptr == dm) {
+            return nullptr;
         }
         mipmap = new SkMipMap(storageSize, dm);
     } else {
@@ -321,7 +321,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 bool SkMipMap::extractLevel(SkScalar scale, Level* levelPtr) const {
-    if (NULL == fLevels) {
+    if (nullptr == fLevels) {
         return false;
     }
 
diff --git a/src/core/SkMipMap.h b/src/core/SkMipMap.h
index e22c0a2..36c17ba 100644
--- a/src/core/SkMipMap.h
+++ b/src/core/SkMipMap.h
@@ -31,7 +31,7 @@
 
 protected:
     void onDataChange(void* oldData, void* newData) override {
-        fLevels = (Level*)newData; // could be NULL
+        fLevels = (Level*)newData; // could be nullptr
     }
 
 private:
diff --git a/src/core/SkMultiPictureDraw.cpp b/src/core/SkMultiPictureDraw.cpp
index 8cbb9ca..4003808 100644
--- a/src/core/SkMultiPictureDraw.cpp
+++ b/src/core/SkMultiPictureDraw.cpp
@@ -37,7 +37,7 @@
     if (paint) {
         fPaint = new SkPaint(*paint);
     } else {
-        fPaint = NULL;
+        fPaint = nullptr;
     }
 }
 
@@ -68,8 +68,8 @@
                              const SkPicture* picture,
                              const SkMatrix* matrix,
                              const SkPaint* paint) {
-    if (NULL == canvas || NULL == picture) {
-        SkDEBUGFAIL("parameters to SkMultiPictureDraw::add should be non-NULL");
+    if (nullptr == canvas || nullptr == picture) {
+        SkDEBUGFAIL("parameters to SkMultiPictureDraw::add should be non-nullptr");
         return;
     }
 
@@ -179,7 +179,7 @@
 
             // Render the entire picture using new layers
             GrRecordReplaceDraw(picture, canvas, context->getLayerCache(),
-                                initialMatrix, NULL);
+                                initialMatrix, nullptr);
 
             GrLayerHoister::UnlockLayers(context, needRendering);
             GrLayerHoister::UnlockLayers(context, recycled);
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 7fd0b9d..c109720 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -40,16 +40,16 @@
 //#define SK_REPORT_API_RANGE_CHECK
 
 SkPaint::SkPaint() {
-    fTypeface    = NULL;
-    fPathEffect  = NULL;
-    fShader      = NULL;
-    fXfermode    = NULL;
-    fMaskFilter  = NULL;
-    fColorFilter = NULL;
-    fRasterizer  = NULL;
-    fLooper      = NULL;
-    fImageFilter = NULL;
-    fAnnotation  = NULL;
+    fTypeface    = nullptr;
+    fPathEffect  = nullptr;
+    fShader      = nullptr;
+    fXfermode    = nullptr;
+    fMaskFilter  = nullptr;
+    fColorFilter = nullptr;
+    fRasterizer  = nullptr;
+    fLooper      = nullptr;
+    fImageFilter = nullptr;
+    fAnnotation  = nullptr;
 
     fTextSize   = SkPaintDefaults_TextSize;
     fTextScaleX = SK_Scalar1;
@@ -398,9 +398,9 @@
         return 0;
     }
 
-    SkASSERT(textData != NULL);
+    SkASSERT(textData != nullptr);
 
-    if (NULL == glyphs) {
+    if (nullptr == glyphs) {
         switch (this->getTextEncoding()) {
         case kUTF8_TextEncoding:
             return SkUTF8_CountUnichars((const char*)textData, byteLength);
@@ -425,7 +425,7 @@
         return SkToInt(byteLength >> 1);
     }
 
-    SkAutoGlyphCache autoCache(*this, NULL, NULL);
+    SkAutoGlyphCache autoCache(*this, nullptr, nullptr);
     SkGlyphCache*    cache = autoCache.getCache();
 
     const char* text = (const char*)textData;
@@ -465,7 +465,7 @@
         return true;
     }
 
-    SkASSERT(textData != NULL);
+    SkASSERT(textData != nullptr);
 
     // handle this encoding before the setup for the glyphcache
     if (this->getTextEncoding() == kGlyphID_TextEncoding) {
@@ -479,7 +479,7 @@
         return true;
     }
 
-    SkAutoGlyphCache autoCache(*this, NULL, NULL);
+    SkAutoGlyphCache autoCache(*this, nullptr, nullptr);
     SkGlyphCache*    cache = autoCache.getCache();
 
     switch (this->getTextEncoding()) {
@@ -525,11 +525,11 @@
         return;
     }
 
-    SkASSERT(glyphs != NULL);
-    SkASSERT(textData != NULL);
+    SkASSERT(glyphs != nullptr);
+    SkASSERT(textData != nullptr);
 
     SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
-    SkAutoGlyphCache autoCache(*this, &props, NULL);
+    SkAutoGlyphCache autoCache(*this, &props, nullptr);
     SkGlyphCache*    cache = autoCache.getCache();
 
     for (int index = 0; index < count; index++) {
@@ -541,24 +541,24 @@
 
 static const SkGlyph& sk_getMetrics_utf8_next(SkGlyphCache* cache,
                                               const char** text) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     return cache->getUnicharMetrics(SkUTF8_NextUnichar(text));
 }
 
 static const SkGlyph& sk_getMetrics_utf16_next(SkGlyphCache* cache,
                                                const char** text) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     return cache->getUnicharMetrics(SkUTF16_NextUnichar((const uint16_t**)text));
 }
 
 static const SkGlyph& sk_getMetrics_utf32_next(SkGlyphCache* cache,
                                                const char** text) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     const int32_t* ptr = *(const int32_t**)text;
     SkUnichar uni = *ptr++;
@@ -568,8 +568,8 @@
 
 static const SkGlyph& sk_getMetrics_glyph_next(SkGlyphCache* cache,
                                                const char** text) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     const uint16_t* ptr = *(const uint16_t**)text;
     unsigned glyphID = *ptr;
@@ -580,24 +580,24 @@
 
 static const SkGlyph& sk_getAdvance_utf8_next(SkGlyphCache* cache,
                                               const char** text) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     return cache->getUnicharAdvance(SkUTF8_NextUnichar(text));
 }
 
 static const SkGlyph& sk_getAdvance_utf16_next(SkGlyphCache* cache,
                                                const char** text) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     return cache->getUnicharAdvance(SkUTF16_NextUnichar((const uint16_t**)text));
 }
 
 static const SkGlyph& sk_getAdvance_utf32_next(SkGlyphCache* cache,
                                                const char** text) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     const int32_t* ptr = *(const int32_t**)text;
     SkUnichar uni = *ptr++;
@@ -607,8 +607,8 @@
 
 static const SkGlyph& sk_getAdvance_glyph_next(SkGlyphCache* cache,
                                                const char** text) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     const uint16_t* ptr = *(const uint16_t**)text;
     unsigned glyphID = *ptr;
@@ -644,32 +644,32 @@
 
 static const SkGlyph& sk_getMetrics_utf8_00(SkGlyphCache* cache,
                                         const char** text, SkFixed, SkFixed) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     return cache->getUnicharMetrics(SkUTF8_NextUnichar(text));
 }
 
 static const SkGlyph& sk_getMetrics_utf8_xy(SkGlyphCache* cache,
                                     const char** text, SkFixed x, SkFixed y) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     return cache->getUnicharMetrics(SkUTF8_NextUnichar(text), x, y);
 }
 
 static const SkGlyph& sk_getMetrics_utf16_00(SkGlyphCache* cache,
                                         const char** text, SkFixed, SkFixed) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     return cache->getUnicharMetrics(SkUTF16_NextUnichar((const uint16_t**)text));
 }
 
 static const SkGlyph& sk_getMetrics_utf16_xy(SkGlyphCache* cache,
                                      const char** text, SkFixed x, SkFixed y) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     return cache->getUnicharMetrics(SkUTF16_NextUnichar((const uint16_t**)text),
                                     x, y);
@@ -677,8 +677,8 @@
 
 static const SkGlyph& sk_getMetrics_utf32_00(SkGlyphCache* cache,
                                     const char** text, SkFixed, SkFixed) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     const int32_t* ptr = *(const int32_t**)text;
     SkUnichar uni = *ptr++;
@@ -688,8 +688,8 @@
 
 static const SkGlyph& sk_getMetrics_utf32_xy(SkGlyphCache* cache,
                                     const char** text, SkFixed x, SkFixed y) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     const int32_t* ptr = *(const int32_t**)text;
     SkUnichar uni = *ptr++;
@@ -699,8 +699,8 @@
 
 static const SkGlyph& sk_getMetrics_glyph_00(SkGlyphCache* cache,
                                          const char** text, SkFixed, SkFixed) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     const uint16_t* ptr = *(const uint16_t**)text;
     unsigned glyphID = *ptr;
@@ -711,8 +711,8 @@
 
 static const SkGlyph& sk_getMetrics_glyph_xy(SkGlyphCache* cache,
                                      const char** text, SkFixed x, SkFixed y) {
-    SkASSERT(cache != NULL);
-    SkASSERT(text != NULL);
+    SkASSERT(cache != nullptr);
+    SkASSERT(text != nullptr);
 
     const uint16_t* ptr = *(const uint16_t**)text;
     unsigned glyphID = *ptr;
@@ -835,7 +835,7 @@
         return 0;
     }
 
-    SkMeasureCacheProc glyphCacheProc = this->getMeasureCacheProc(NULL != bounds);
+    SkMeasureCacheProc glyphCacheProc = this->getMeasureCacheProc(nullptr != bounds);
 
     int xyIndex;
     JoinBoundsProc joinBoundsProc;
@@ -857,7 +857,7 @@
 
     SkAutoKern  autokern;
 
-    if (NULL == bounds) {
+    if (nullptr == bounds) {
         if (this->isDevKernText()) {
             int rsb;
             for (; text < stop; n++) {
@@ -897,13 +897,13 @@
 
 SkScalar SkPaint::measureText(const void* textData, size_t length, SkRect* bounds) const {
     const char* text = (const char*)textData;
-    SkASSERT(text != NULL || length == 0);
+    SkASSERT(text != nullptr || length == 0);
 
     SkCanonicalizePaint canon(*this);
     const SkPaint& paint = canon.getPaint();
     SkScalar scale = canon.getScale();
 
-    SkAutoGlyphCache    autoCache(paint, NULL, NULL);
+    SkAutoGlyphCache    autoCache(paint, nullptr, nullptr);
     SkGlyphCache*       cache = autoCache.getCache();
 
     SkScalar width = 0;
@@ -944,7 +944,7 @@
         return length;
     }
 
-    SkASSERT(textD != NULL);
+    SkASSERT(textD != nullptr);
     const char* text = (const char*)textD;
     const char* stop = text + length;
 
@@ -957,7 +957,7 @@
         maxWidth /= scale;
     }
 
-    SkAutoGlyphCache    autoCache(paint, NULL, NULL);
+    SkAutoGlyphCache    autoCache(paint, nullptr, nullptr);
     SkGlyphCache*       cache = autoCache.getCache();
 
     SkMeasureCacheProc glyphCacheProc = paint.getMeasureCacheProc(false);
@@ -1022,18 +1022,18 @@
     const SkPaint& paint = canon.getPaint();
     SkScalar scale = canon.getScale();
 
-    SkMatrix zoomMatrix, *zoomPtr = NULL;
+    SkMatrix zoomMatrix, *zoomPtr = nullptr;
     if (zoom) {
         zoomMatrix.setScale(zoom, zoom);
         zoomPtr = &zoomMatrix;
     }
 
     FontMetrics storage;
-    if (NULL == metrics) {
+    if (nullptr == metrics) {
         metrics = &storage;
     }
 
-    paint.descriptorProc(NULL, zoomPtr, FontMetricsDescProc, metrics, true);
+    paint.descriptorProc(nullptr, zoomPtr, FontMetricsDescProc, metrics, true);
 
     if (scale) {
         metrics->fTop = SkScalarMul(metrics->fTop, scale);
@@ -1068,7 +1068,7 @@
 
     SkASSERT(textData);
 
-    if (NULL == widths && NULL == bounds) {
+    if (nullptr == widths && nullptr == bounds) {
         return this->countText(textData, byteLength);
     }
 
@@ -1076,10 +1076,10 @@
     const SkPaint& paint = canon.getPaint();
     SkScalar scale = canon.getScale();
 
-    SkAutoGlyphCache    autoCache(paint, NULL, NULL);
+    SkAutoGlyphCache    autoCache(paint, nullptr, nullptr);
     SkGlyphCache*       cache = autoCache.getCache();
     SkMeasureCacheProc  glyphCacheProc;
-    glyphCacheProc = paint.getMeasureCacheProc(NULL != bounds);
+    glyphCacheProc = paint.getMeasureCacheProc(nullptr != bounds);
 
     const char* text = (const char*)textData;
     const char* stop = text + byteLength;
@@ -1168,10 +1168,10 @@
 
 void SkPaint::getTextPath(const void* textData, size_t length,
                           SkScalar x, SkScalar y, SkPath* path) const {
-    SkASSERT(length == 0 || textData != NULL);
+    SkASSERT(length == 0 || textData != nullptr);
 
     const char* text = (const char*)textData;
-    if (text == NULL || length == 0 || path == NULL) {
+    if (text == nullptr || length == 0 || path == nullptr) {
         return;
     }
 
@@ -1196,10 +1196,10 @@
 
 void SkPaint::getPosTextPath(const void* textData, size_t length,
                              const SkPoint pos[], SkPath* path) const {
-    SkASSERT(length == 0 || textData != NULL);
+    SkASSERT(length == 0 || textData != nullptr);
 
     const char* text = (const char*)textData;
-    if (text == NULL || length == 0 || path == NULL) {
+    if (text == nullptr || length == 0 || path == nullptr) {
         return;
     }
 
@@ -1213,7 +1213,7 @@
 
     unsigned int    i = 0;
     const SkPath*   iterPath;
-    while (iter.next(&iterPath, NULL)) {
+    while (iter.next(&iterPath, nullptr)) {
         matrix.postTranslate(pos[i].fX - prevPos.fX, pos[i].fY - prevPos.fY);
         if (iterPath) {
             path->addPath(*iterPath, matrix);
@@ -1229,7 +1229,7 @@
     m.postSkew(fTextSkewX, 0);
 
     SkTypeface* typeface = this->getTypeface();
-    if (NULL == typeface) {
+    if (nullptr == typeface) {
         typeface = SkTypeface::GetDefaultTypeface();
     }
 
@@ -1240,7 +1240,7 @@
 
 static void add_flattenable(SkDescriptor* desc, uint32_t tag,
                             SkWriteBuffer* buffer) {
-    buffer->writeToMemory(desc->addEntry(tag, buffer->bytesWritten(), NULL));
+    buffer->writeToMemory(desc->addEntry(tag, buffer->bytesWritten(), nullptr));
 }
 
 static SkMask::Format compute_mask_format(const SkPaint& paint) {
@@ -1329,10 +1329,10 @@
                               const SkSurfaceProps* surfaceProps,
                               const SkMatrix* deviceMatrix,
                               Rec* rec) {
-    SkASSERT(deviceMatrix == NULL || !deviceMatrix->hasPerspective());
+    SkASSERT(deviceMatrix == nullptr || !deviceMatrix->hasPerspective());
 
     SkTypeface* typeface = paint.getTypeface();
-    if (NULL == typeface) {
+    if (nullptr == typeface) {
         typeface = SkTypeface::GetDefaultTypeface();
     }
     rec->fFontID = typeface->uniqueID();
@@ -1498,8 +1498,8 @@
  */
 SK_DECLARE_STATIC_MUTEX(gMaskGammaCacheMutex);
 
-static SkMaskGamma* gLinearMaskGamma = NULL;
-static SkMaskGamma* gMaskGamma = NULL;
+static SkMaskGamma* gLinearMaskGamma = nullptr;
+static SkMaskGamma* gMaskGamma = nullptr;
 static SkScalar gContrast = SK_ScalarMin;
 static SkScalar gPaintGamma = SK_ScalarMin;
 static SkScalar gDeviceGamma = SK_ScalarMin;
@@ -1510,7 +1510,7 @@
 static const SkMaskGamma& cachedMaskGamma(SkScalar contrast, SkScalar paintGamma, SkScalar deviceGamma) {
     gMaskGammaCacheMutex.assertHeld();
     if (0 == contrast && SK_Scalar1 == paintGamma && SK_Scalar1 == deviceGamma) {
-        if (NULL == gLinearMaskGamma) {
+        if (nullptr == gLinearMaskGamma) {
             gLinearMaskGamma = new SkMaskGamma;
         }
         return *gLinearMaskGamma;
@@ -1529,9 +1529,9 @@
     SkAutoMutexAcquire ama(gMaskGammaCacheMutex);
 
     SkSafeUnref(gLinearMaskGamma);
-    gLinearMaskGamma = NULL;
+    gLinearMaskGamma = nullptr;
     SkSafeUnref(gMaskGamma);
-    gMaskGamma = NULL;
+    gMaskGamma = nullptr;
     SkDEBUGCODE(gContrast = SK_ScalarMin;)
     SkDEBUGCODE(gPaintGamma = SK_ScalarMin;)
     SkDEBUGCODE(gDeviceGamma = SK_ScalarMin;)
@@ -1975,7 +1975,7 @@
     if (flatFlags & kHasTypeface_FlatFlag) {
         this->setTypeface(buffer.readTypeface());
     } else {
-        this->setTypeface(NULL);
+        this->setTypeface(nullptr);
     }
 
     if (flatFlags & kHasEffects_FlatFlag) {
@@ -1992,14 +1992,14 @@
             this->setAnnotation(SkAnnotation::Create(buffer))->unref();
         }
     } else {
-        this->setPathEffect(NULL);
-        this->setShader(NULL);
-        this->setXfermode(NULL);
-        this->setMaskFilter(NULL);
-        this->setColorFilter(NULL);
-        this->setRasterizer(NULL);
-        this->setLooper(NULL);
-        this->setImageFilter(NULL);
+        this->setPathEffect(nullptr);
+        this->setShader(nullptr);
+        this->setXfermode(nullptr);
+        this->setMaskFilter(nullptr);
+        this->setColorFilter(nullptr);
+        this->setRasterizer(nullptr);
+        this->setLooper(nullptr);
+        this->setImageFilter(nullptr);
     }
 }
 
@@ -2303,14 +2303,14 @@
     fGlyphCacheProc = paint.getMeasureCacheProc(true);
 
     fPaint.setLinearText(true);
-    fPaint.setMaskFilter(NULL);   // don't want this affecting our path-cache lookup
+    fPaint.setMaskFilter(nullptr);   // don't want this affecting our path-cache lookup
 
-    if (fPaint.getPathEffect() == NULL && !has_thick_frame(fPaint)) {
+    if (fPaint.getPathEffect() == nullptr && !has_thick_frame(fPaint)) {
         applyStrokeAndPathEffects = false;
     }
 
     // can't use our canonical size if we need to apply patheffects
-    if (fPaint.getPathEffect() == NULL) {
+    if (fPaint.getPathEffect() == nullptr) {
         fPaint.setTextSize(SkIntToScalar(SkPaint::kCanonicalTextSizeForPaths));
         fScale = paint.getTextSize() / SkPaint::kCanonicalTextSizeForPaths;
         if (has_thick_frame(fPaint)) {
@@ -2322,13 +2322,13 @@
 
     if (!applyStrokeAndPathEffects) {
         fPaint.setStyle(SkPaint::kFill_Style);
-        fPaint.setPathEffect(NULL);
+        fPaint.setPathEffect(nullptr);
     }
 
-    fCache = fPaint.detachCache(NULL, NULL, false);
+    fCache = fPaint.detachCache(nullptr, nullptr, false);
 
     SkPaint::Style  style = SkPaint::kFill_Style;
-    SkPathEffect*   pe = NULL;
+    SkPathEffect*   pe = nullptr;
 
     if (!applyStrokeAndPathEffects) {
         style = paint.getStyle();   // restore
@@ -2344,7 +2344,7 @@
     if (paint.getTextAlign() != SkPaint::kLeft_Align) { // need to measure first
         int      count;
         SkScalar width = SkScalarMul(fPaint.measure_text(fCache, text, length,
-                                                         &count, NULL), fScale);
+                                                         &count, nullptr), fScale);
         if (paint.getTextAlign() == SkPaint::kCenter_Align) {
             width = SkScalarHalf(width);
         }
@@ -2376,7 +2376,7 @@
             }
         } else {
             if (path) {
-                *path = NULL;
+                *path = nullptr;
             }
         }
         if (xpos) {
@@ -2398,7 +2398,7 @@
 static bool affects_alpha(const SkImageFilter* imf) {
     // TODO: check if we should allow imagefilters to broadcast that they don't affect alpha
     // ala colorfilters
-    return imf != NULL;
+    return imf != nullptr;
 }
 
 bool SkPaint::nothingToDraw() const {
diff --git a/src/core/SkPaintPriv.h b/src/core/SkPaintPriv.h
index 708f861..a03f9b3 100644
--- a/src/core/SkPaintPriv.h
+++ b/src/core/SkPaintPriv.h
@@ -23,7 +23,7 @@
     };
     
     /**
-     *  Returns true if drawing with this paint (or NULL) will ovewrite all affected pixels.
+     *  Returns true if drawing with this paint (or nullptr) will ovewrite all affected pixels.
      *
      *  Note: returns conservative true, meaning it may return false even though the paint might
      *        in fact overwrite its pixels.
@@ -35,13 +35,13 @@
     }
 
     /**
-     *  Returns true if drawing this bitmap with this paint (or NULL) will ovewrite all affected
+     *  Returns true if drawing this bitmap with this paint (or nullptr) will ovewrite all affected
      *  pixels.
      */
     static bool Overwrites(const SkBitmap&, const SkPaint* paint);
 
     /**
-     *  Returns true if drawing this image with this paint (or NULL) will ovewrite all affected
+     *  Returns true if drawing this image with this paint (or nullptr) will ovewrite all affected
      *  pixels.
      */
     static bool Overwrites(const SkImage*, const SkPaint* paint);
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 05fc730..8da1580 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -137,7 +137,7 @@
     fFirstDirection = SkPathPriv::kUnknown_FirstDirection;
 
     // We don't touch Android's fSourcePath.  It's used to track texture garbage collection, so we
-    // don't want to muck with it if it's been set to something non-NULL.
+    // don't want to muck with it if it's been set to something non-nullptr.
 }
 
 SkPath::SkPath(const SkPath& that)
@@ -385,7 +385,7 @@
     int corners = 0;
     SkPoint first, last;
     const SkPoint* pts = *ptsPtr;
-    const SkPoint* savePts = NULL;
+    const SkPoint* savePts = nullptr;
     first.set(0, 0);
     last.set(0, 0);
     int firstDirection = 0;
@@ -531,7 +531,7 @@
     const SkPoint* pts = fPathRef->points();
     const SkPoint* first = pts;
     Direction testDirs[2];
-    if (!isRectContour(true, &currVerb, &pts, NULL, &testDirs[0])) {
+    if (!isRectContour(true, &currVerb, &pts, nullptr, &testDirs[0])) {
         return false;
     }
     const SkPoint* last = pts;
@@ -1434,7 +1434,7 @@
 
 void SkPath::transform(const SkMatrix& matrix, SkPath* dst) const {
     SkDEBUGCODE(this->validate();)
-    if (dst == NULL) {
+    if (dst == nullptr) {
         dst = (SkPath*)this;
     }
 
@@ -1522,15 +1522,15 @@
 
 SkPath::Iter::Iter() {
 #ifdef SK_DEBUG
-    fPts = NULL;
-    fConicWeights = NULL;
+    fPts = nullptr;
+    fConicWeights = nullptr;
     fMoveTo.fX = fMoveTo.fY = fLastPt.fX = fLastPt.fY = 0;
     fForceClose = fCloseLine = false;
     fSegmentState = kEmptyContour_SegmentState;
 #endif
     // need to init enough to make next() harmlessly return kDone_Verb
-    fVerbs = NULL;
-    fVerbStop = NULL;
+    fVerbs = nullptr;
+    fVerbStop = nullptr;
     fNeedClose = false;
 }
 
@@ -1551,7 +1551,7 @@
 }
 
 bool SkPath::Iter::isClosedContour() const {
-    if (fVerbs == NULL || fVerbs == fVerbStop) {
+    if (fVerbs == nullptr || fVerbs == fVerbStop) {
         return false;
     }
     if (fForceClose) {
@@ -1617,7 +1617,7 @@
     // forward before the next move is seen
     const uint8_t* lastMoveVerb = 0;
     const SkPoint* lastMovePt = 0;
-    const SkScalar* lastMoveWeight = NULL;
+    const SkScalar* lastMoveWeight = nullptr;
     SkPoint lastPt = fLastPt;
     while (fVerbs != fVerbStop) {
         unsigned verb = *(fVerbs - 1); // fVerbs is one beyond the current verb
@@ -1776,12 +1776,12 @@
 
 SkPath::RawIter::RawIter() {
 #ifdef SK_DEBUG
-    fPts = NULL;
-    fConicWeights = NULL;
+    fPts = nullptr;
+    fConicWeights = nullptr;
 #endif
     // need to init enough to make next() harmlessly return kDone_Verb
-    fVerbs = NULL;
-    fVerbStop = NULL;
+    fVerbs = nullptr;
+    fVerbStop = nullptr;
 }
 
 SkPath::RawIter::RawIter(const SkPath& path) {
@@ -1850,7 +1850,7 @@
 size_t SkPath::writeToMemory(void* storage) const {
     SkDEBUGCODE(this->validate();)
 
-    if (NULL == storage) {
+    if (nullptr == storage) {
         const int byteCount = sizeof(int32_t) + fPathRef->writeSize();
         return SkAlign4(byteCount);
     }
@@ -1913,7 +1913,7 @@
         buffer.skipToAlign4();
         sizeRead = buffer.pos();
     } else if (pathRef) {
-        // If the buffer is not valid, pathRef should be NULL
+        // If the buffer is not valid, pathRef should be nullptr
         sk_throw();
     }
     return sizeRead;
@@ -2006,11 +2006,11 @@
 }
 
 void SkPath::dump() const {
-    this->dump(NULL, false, false);
+    this->dump(nullptr, false, false);
 }
 
 void SkPath::dumpHex() const {
-    this->dump(NULL, false, true);
+    this->dump(nullptr, false, true);
 }
 
 #ifdef SK_DEBUG
diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp
index 17ae95e..caff6df 100644
--- a/src/core/SkPathMeasure.cpp
+++ b/src/core/SkPathMeasure.cpp
@@ -297,7 +297,7 @@
             }
         } break;
         case kCubic_SegType:
-            SkEvalCubicAt(pts, t, pos, tangent, NULL);
+            SkEvalCubicAt(pts, t, pos, tangent, nullptr);
             if (tangent) {
                 tangent->normalize();
             }
@@ -402,7 +402,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 SkPathMeasure::SkPathMeasure() {
-    fPath = NULL;
+    fPath = nullptr;
     fLength = -1;   // signal we need to compute it
     fForceClosed = false;
     fFirstPtIndex = -1;
@@ -435,7 +435,7 @@
 }
 
 SkScalar SkPathMeasure::getLength() {
-    if (fPath == NULL) {
+    if (fPath == nullptr) {
         return 0;
     }
     if (fLength < 0) {
@@ -452,7 +452,7 @@
         return ~0;
     }
     
-    SkASSERT(base != NULL); // base may be NULL if count is zero
+    SkASSERT(base != nullptr); // base may be nullptr if count is zero
     
     int lo = 0;
     int hi = count - 1;
@@ -511,7 +511,7 @@
 
 bool SkPathMeasure::getPosTan(SkScalar distance, SkPoint* pos,
                               SkVector* tangent) {
-    if (NULL == fPath) {
+    if (nullptr == fPath) {
         return false;
     }
 
@@ -538,7 +538,7 @@
 
 bool SkPathMeasure::getMatrix(SkScalar distance, SkMatrix* matrix,
                               MatrixFlags flags) {
-    if (NULL == fPath) {
+    if (nullptr == fPath) {
         return false;
     }
 
@@ -584,7 +584,7 @@
     SkASSERT(seg <= stopSeg);
 
     if (startWithMoveTo) {
-        compute_pos_tan(&fPts[seg->fPtIndex], seg->fType, startT, &p, NULL);
+        compute_pos_tan(&fPts[seg->fPtIndex], seg->fType, startT, &p, nullptr);
         dst->moveTo(p);
     }
 
diff --git a/src/core/SkPathRef.cpp b/src/core/SkPathRef.cpp
index e3317a6..be7c66c 100644
--- a/src/core/SkPathRef.cpp
+++ b/src/core/SkPathRef.cpp
@@ -35,8 +35,8 @@
     SkDEBUGCODE(this->validate();)
     sk_free(fPoints);
 
-    SkDEBUGCODE(fPoints = NULL;)
-    SkDEBUGCODE(fVerbs = NULL;)
+    SkDEBUGCODE(fPoints = nullptr;)
+    SkDEBUGCODE(fVerbs = nullptr;)
     SkDEBUGCODE(fVerbCnt = 0x9999999;)
     SkDEBUGCODE(fPointCnt = 0xAAAAAAA;)
     SkDEBUGCODE(fPointCnt = 0xBBBBBBB;)
@@ -130,7 +130,7 @@
     int32_t packed;
     if (!buffer->readS32(&packed)) {
         delete ref;
-        return NULL;
+        return nullptr;
     }
 
     ref->fIsFinite = (packed >> kIsFinite_SerializationShift) & 1;
@@ -143,7 +143,7 @@
         !buffer->readS32(&pointCount) ||
         !buffer->readS32(&conicCount)) {
         delete ref;
-        return NULL;
+        return nullptr;
     }
 
     ref->resetToSize(verbCount, pointCount, conicCount);
@@ -156,7 +156,7 @@
         !buffer->read(ref->fConicWeights.begin(), conicCount * sizeof(SkScalar)) ||
         !buffer->read(&ref->fBounds, sizeof(SkRect))) {
         delete ref;
-        return NULL;
+        return nullptr;
     }
     ref->fBoundsIsDirty = false;
 
@@ -443,7 +443,7 @@
 }
 
 void SkPathRef::addGenIDChangeListener(GenIDChangeListener* listener) {
-    if (NULL == listener || this == empty.get()) {
+    if (nullptr == listener || this == empty.get()) {
         delete listener;
         return;
     }
@@ -465,11 +465,11 @@
     this->INHERITED::validate();
     SkASSERT(static_cast<ptrdiff_t>(fFreeSpace) >= 0);
     SkASSERT(reinterpret_cast<intptr_t>(fVerbs) - reinterpret_cast<intptr_t>(fPoints) >= 0);
-    SkASSERT((NULL == fPoints) == (NULL == fVerbs));
-    SkASSERT(!(NULL == fPoints && 0 != fFreeSpace));
-    SkASSERT(!(NULL == fPoints && 0 != fFreeSpace));
-    SkASSERT(!(NULL == fPoints && fPointCnt));
-    SkASSERT(!(NULL == fVerbs && fVerbCnt));
+    SkASSERT((nullptr == fPoints) == (nullptr == fVerbs));
+    SkASSERT(!(nullptr == fPoints && 0 != fFreeSpace));
+    SkASSERT(!(nullptr == fPoints && 0 != fFreeSpace));
+    SkASSERT(!(nullptr == fPoints && fPointCnt));
+    SkASSERT(!(nullptr == fVerbs && fVerbCnt));
     SkASSERT(this->currSize() ==
                 fFreeSpace + sizeof(SkPoint) * fPointCnt + sizeof(uint8_t) * fVerbCnt);
 
diff --git a/src/core/SkPictureContentInfo.cpp b/src/core/SkPictureContentInfo.cpp
index 9fa6a64..42d42c4 100644
--- a/src/core/SkPictureContentInfo.cpp
+++ b/src/core/SkPictureContentInfo.cpp
@@ -45,7 +45,7 @@
 }
 
 void SkPictureContentInfo::onDrawPoints(size_t count, const SkPaint& paint) {
-    if (paint.getPathEffect() != NULL) {
+    if (paint.getPathEffect() != nullptr) {
         SkPathEffect::DashInfo info;
         SkPathEffect::DashType dashType = paint.getPathEffect()->asADash(&info);
         if (2 == count && SkPaint::kRound_Cap != paint.getStrokeCap() &&
diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp
index e70cd66..2cc2841 100644
--- a/src/core/SkPictureData.cpp
+++ b/src/core/SkPictureData.cpp
@@ -80,14 +80,14 @@
 }
 
 void SkPictureData::init() {
-    fPictureRefs = NULL;
+    fPictureRefs = nullptr;
     fPictureCount = 0;
-    fTextBlobRefs = NULL;
+    fTextBlobRefs = nullptr;
     fTextBlobCount = 0;
-    fImageRefs = NULL;
+    fImageRefs = nullptr;
     fImageCount = 0;
-    fOpData = NULL;
-    fFactoryPlayback = NULL;
+    fOpData = nullptr;
+    fFactoryPlayback = nullptr;
 }
 
 SkPictureData::~SkPictureData() {
@@ -133,7 +133,7 @@
 
     for (int i = 0; i < count; i++) {
         const char* name = SkFlattenable::FactoryToName(array[i]);
-        if (NULL == name || 0 == *name) {
+        if (nullptr == name || 0 == *name) {
             size += SkWStream::SizeOfPackedUInt(0);
         } else {
             size_t len = strlen(name);
@@ -171,7 +171,7 @@
 
     for (int i = 0; i < count; i++) {
         const char* name = SkFlattenable::FactoryToName(array[i]);
-        if (NULL == name || 0 == *name) {
+        if (nullptr == name || 0 == *name) {
             stream->writePackedUInt(0);
         } else {
             size_t len = strlen(name);
@@ -355,7 +355,7 @@
 
     switch (tag) {
         case SK_PICT_READER_TAG:
-            SkASSERT(NULL == fOpData);
+            SkASSERT(nullptr == fOpData);
             fOpData = SkData::NewFromStream(stream, size);
             if (!fOpData) {
                 return false;
@@ -443,7 +443,7 @@
     int height = buffer.read32();
     if (width <= 0 || height <= 0) {    // SkImage never has a zero dimension
         buffer.validate(false);
-        return NULL;
+        return nullptr;
     }
 
     SkAutoTUnref<SkData> encoded(buffer.readByteArrayAsData());
@@ -451,7 +451,7 @@
     int originY = buffer.read32();
     if (0 == encoded->size() || originX < 0 || originY < 0) {
         buffer.validate(false);
-        return NULL;
+        return nullptr;
     }
 
     const SkIRect subset = SkIRect::MakeXYWH(originX, originY, width, height);
@@ -467,7 +467,7 @@
 template <typename T>
 bool new_array_from_buffer(SkReadBuffer& buffer, uint32_t inCount,
                            const T*** array, int* outCount, const T* (*factory)(SkReadBuffer&)) {
-    if (!buffer.validate((0 == *outCount) && (NULL == *array))) {
+    if (!buffer.validate((0 == *outCount) && (nullptr == *array))) {
         return false;
     }
     if (0 == inCount) {
@@ -479,7 +479,7 @@
     int i = 0;
     for (; i < *outCount; i++) {
         (*array)[i] = factory(buffer);
-        if (NULL == (*array)[i]) {
+        if (nullptr == (*array)[i]) {
             success = false;
             break;
         }
@@ -491,7 +491,7 @@
         }
         // Delete the array
         delete[] * array;
-        *array = NULL;
+        *array = nullptr;
         *outCount = 0;
         return false;
     }
@@ -542,10 +542,10 @@
         case SK_PICT_READER_TAG: {
             SkAutoDataUnref data(SkData::NewUninitialized(size));
             if (!buffer.readByteArray(data->writable_data(), size) ||
-                !buffer.validate(NULL == fOpData)) {
+                !buffer.validate(nullptr == fOpData)) {
                 return false;
             }
-            SkASSERT(NULL == fOpData);
+            SkASSERT(nullptr == fOpData);
             fOpData = data.detach();
         } break;
         case SK_PICT_PICTURE_TAG:
@@ -571,7 +571,7 @@
     }
 
     if (!data->parseStream(stream, proc, topLevelTFPlayback)) {
-        return NULL;
+        return nullptr;
     }
     return data.detach();
 }
@@ -582,7 +582,7 @@
     buffer.setVersion(info.fVersion);
 
     if (!data->parseBuffer(buffer)) {
-        return NULL;
+        return nullptr;
     }
     return data.detach();
 }
@@ -631,11 +631,11 @@
 bool SkPictureData::suitableForGpuRasterization(GrContext* context, const char **reason,
                                                 GrPixelConfig config, SkScalar dpi) const {
 
-    if (context != NULL) {
+    if (context != nullptr) {
         return this->suitableForGpuRasterization(context, reason,
                                                  context->getRecommendedSampleCount(config, dpi));
     } else {
-        return this->suitableForGpuRasterization(NULL, reason);
+        return this->suitableForGpuRasterization(nullptr, reason);
     }
 }
 
diff --git a/src/core/SkPictureData.h b/src/core/SkPictureData.h
index a68a8c8..4e4deef 100644
--- a/src/core/SkPictureData.h
+++ b/src/core/SkPictureData.h
@@ -111,7 +111,7 @@
     const SkPaint* getPaint(SkReader32* reader) const {
         int index = reader->readInt();
         if (index == 0) {
-            return NULL;
+            return nullptr;
         }
         return &fPaints[index - 1];
     }
diff --git a/src/core/SkPictureFlat.cpp b/src/core/SkPictureFlat.cpp
index 3556004..02d8592 100644
--- a/src/core/SkPictureFlat.cpp
+++ b/src/core/SkPictureFlat.cpp
@@ -18,10 +18,10 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-SkTypefacePlayback::SkTypefacePlayback() : fCount(0), fArray(NULL) {}
+SkTypefacePlayback::SkTypefacePlayback() : fCount(0), fArray(nullptr) {}
 
 SkTypefacePlayback::~SkTypefacePlayback() {
-    this->reset(NULL);
+    this->reset(nullptr);
 }
 
 void SkTypefacePlayback::reset(const SkRefCntSet* rec) {
@@ -31,7 +31,7 @@
     }
     delete[] fArray;
 
-    if (rec!= NULL && rec->count() > 0) {
+    if (rec!= nullptr && rec->count() > 0) {
         fCount = rec->count();
         fArray = new SkRefCnt* [fCount];
         rec->copyToArray(fArray);
@@ -40,12 +40,12 @@
         }
     } else {
         fCount = 0;
-        fArray = NULL;
+        fArray = nullptr;
     }
 }
 
 void SkTypefacePlayback::setCount(int count) {
-    this->reset(NULL);
+    this->reset(nullptr);
 
     fCount = count;
     fArray = new SkRefCnt* [count];
@@ -61,10 +61,10 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SkFlatController::SkFlatController(uint32_t writeBufferFlags)
-: fBitmapHeap(NULL)
-, fTypefaceSet(NULL)
-, fTypefacePlayback(NULL)
-, fFactorySet(NULL)
+: fBitmapHeap(nullptr)
+, fTypefaceSet(nullptr)
+, fTypefacePlayback(nullptr)
+, fFactorySet(nullptr)
 , fWriteBufferFlags(writeBufferFlags) {}
 
 SkFlatController::~SkFlatController() {
diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h
index 176f486..98a43ec 100644
--- a/src/core/SkPictureFlat.h
+++ b/src/core/SkPictureFlat.h
@@ -296,8 +296,8 @@
     // Unflatten this into result, using bitmapHeap and facePlayback for bitmaps and fonts if given
     template <typename Traits, typename T>
     void unflatten(T* result,
-                   SkBitmapHeap* bitmapHeap = NULL,
-                   SkTypefacePlayback* facePlayback = NULL) const {
+                   SkBitmapHeap* bitmapHeap = nullptr,
+                   SkTypefacePlayback* facePlayback = nullptr) const {
         SkReadBuffer buffer(this->data(), fFlatSize);
 
         if (bitmapHeap) {
@@ -411,28 +411,28 @@
      * Similar to find. Allows the caller to specify an SkFlatData to replace in
      * the case of an add. Also tells the caller whether a new SkFlatData was
      * added and whether the old one was replaced. The parameters added and
-     * replaced are required to be non-NULL. Rather than returning the index of
+     * replaced are required to be non-nullptr. Rather than returning the index of
      * the entry in the dictionary, it returns the actual SkFlatData.
      */
     const SkFlatData* findAndReplace(const T& element,
                                      const SkFlatData* toReplace,
                                      bool* added,
                                      bool* replaced) {
-        SkASSERT(added != NULL && replaced != NULL);
+        SkASSERT(added != nullptr && replaced != nullptr);
 
         const int oldCount = this->count();
         SkFlatData* flat = this->findAndReturnMutableFlat(element);
         *added = this->count() > oldCount;
 
         // If we don't want to replace anything, we're done.
-        if (!*added || toReplace == NULL) {
+        if (!*added || toReplace == nullptr) {
             *replaced = false;
             return flat;
         }
 
         // If we don't have the thing to replace, we're done.
         const SkFlatData* found = fHash.find(*toReplace);
-        if (found == NULL) {
+        if (found == nullptr) {
             *replaced = false;
             return flat;
         }
@@ -469,7 +469,7 @@
 
     /**
      * Find or insert a flattened version of element into the dictionary.
-     * Caller does not take ownership of the result.  This will not return NULL.
+     * Caller does not take ownership of the result.  This will not return nullptr.
      */
     const SkFlatData* findAndReturnFlat(const T& element) {
         return this->findAndReturnMutableFlat(element);
@@ -484,7 +484,7 @@
         }
 
         // Without a bitmap heap, we'll flatten bitmaps into paints.  That's never what you want.
-        SkASSERT(fController->getBitmapHeap() != NULL);
+        SkASSERT(fController->getBitmapHeap() != nullptr);
         fScratch.setBitmapHeap(fController->getBitmapHeap());
         fScratch.setTypefaceRecorder(fController->getTypefaceSet());
         fScratch.setNamedFactoryRecorder(fController->getNamedFactorySet());
@@ -497,7 +497,7 @@
         const SkFlatData& scratch = this->resetScratch(element, this->count()+1);
 
         SkFlatData* candidate = fHash.find(scratch);
-        if (candidate != NULL) {
+        if (candidate != nullptr) {
             return candidate;
         }
 
@@ -520,7 +520,7 @@
 
         // Reinterpret data in fScratch as an SkFlatData.
         SkFlatData* scratch = (SkFlatData*)fScratch.getWriter32()->contiguousArray();
-        SkASSERT(scratch != NULL);
+        SkASSERT(scratch != nullptr);
         scratch->stampHeader(index, SkToS32(dataSize));
         return *scratch;
     }
@@ -534,7 +534,7 @@
 
         // Copy scratch into the new SkFlatData.
         SkFlatData* scratch = (SkFlatData*)fScratch.getWriter32()->contiguousArray();
-        SkASSERT(scratch != NULL);
+        SkASSERT(scratch != nullptr);
         memcpy(detached, scratch, fScratch.bytesWritten());
 
         // We can now reuse fScratch, and detached will live until fController dies.
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index eb7c476..b994071 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -44,7 +44,7 @@
     if (reader->readBool()) {
         return &reader->skipT<SkRect>();
     } else {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -164,13 +164,13 @@
             const int count = reader->readU32();
             const SkRSXform* xform = (const SkRSXform*)reader->skip(count * sizeof(SkRSXform));
             const SkRect* tex = (const SkRect*)reader->skip(count * sizeof(SkRect));
-            const SkColor* colors = NULL;
+            const SkColor* colors = nullptr;
             SkXfermode::Mode mode = SkXfermode::kDst_Mode;
             if (flags & DRAW_ATLAS_HAS_COLORS) {
                 colors = (const SkColor*)reader->skip(count * sizeof(SkColor));
                 mode = (SkXfermode::Mode)reader->readU32();
             }
-            const SkRect* cull = NULL;
+            const SkRect* cull = nullptr;
             if (flags & DRAW_ATLAS_HAS_CULL) {
                 cull = (const SkRect*)reader->skip(sizeof(SkRect));
             }
@@ -275,11 +275,11 @@
             const SkPoint* cubics = (const SkPoint*)reader->skip(SkPatchUtils::kNumCtrlPts *
                                                                  sizeof(SkPoint));
             uint32_t flag = reader->readInt();
-            const SkColor* colors = NULL;
+            const SkColor* colors = nullptr;
             if (flag & DRAW_VERTICES_HAS_COLORS) {
                 colors = (const SkColor*)reader->skip(SkPatchUtils::kNumCorners * sizeof(SkColor));
             }
-            const SkPoint* texCoords = NULL;
+            const SkPoint* texCoords = nullptr;
             if (flag & DRAW_VERTICES_HAS_TEXS) {
                 texCoords = (const SkPoint*)reader->skip(SkPatchUtils::kNumCorners *
                                                          sizeof(SkPoint));
@@ -418,9 +418,9 @@
             SkCanvas::VertexMode vmode = (SkCanvas::VertexMode)reader->readInt();
             int vCount = reader->readInt();
             const SkPoint* verts = (const SkPoint*)reader->skip(vCount * sizeof(SkPoint));
-            const SkPoint* texs = NULL;
-            const SkColor* colors = NULL;
-            const uint16_t* indices = NULL;
+            const SkPoint* texs = nullptr;
+            const SkColor* colors = nullptr;
+            const uint16_t* indices = nullptr;
             int iCount = 0;
             if (flags & DRAW_VERTICES_HAS_TEXS) {
                 texs = (const SkPoint*)reader->skip(vCount * sizeof(SkPoint));
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 2281d16..28561c7 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -275,7 +275,7 @@
 void SkPictureRecord::recordConcat(const SkMatrix& matrix) {
     this->validate(fWriter.bytesWritten(), 0);
     // op + matrix
-    size_t size = kUInt32Size + matrix.writeToMemory(NULL);
+    size_t size = kUInt32Size + matrix.writeToMemory(nullptr);
     size_t initialOffset = this->addDraw(CONCAT, &size);
     this->addMatrix(matrix);
     this->validate(initialOffset, size);
@@ -284,7 +284,7 @@
 void SkPictureRecord::didSetMatrix(const SkMatrix& matrix) {
     this->validate(fWriter.bytesWritten(), 0);
     // op + matrix
-    size_t size = kUInt32Size + matrix.writeToMemory(NULL);
+    size_t size = kUInt32Size + matrix.writeToMemory(nullptr);
     size_t initialOffset = this->addDraw(SET_MATRIX, &size);
     this->addMatrix(matrix);
     this->validate(initialOffset, size);
@@ -440,7 +440,7 @@
 
 size_t SkPictureRecord::recordClipRegion(const SkRegion& region, SkRegion::Op op) {
     // op + clip params + region
-    size_t size = 2 * kUInt32Size + region.writeToMemory(NULL);
+    size_t size = 2 * kUInt32Size + region.writeToMemory(nullptr);
     // recordRestoreOffsetPlaceholder doesn't always write an offset
     if (!fRestoreOffsetStack.isEmpty()) {
         // + restore offset
@@ -694,7 +694,7 @@
                                        const SkMatrix* matrix, const SkPaint& paint) {
     // op + paint index + length + 'length' worth of data + path index + matrix
     const SkMatrix& m = matrix ? *matrix : SkMatrix::I();
-    size_t size = 3 * kUInt32Size + SkAlign4(byteLength) + kUInt32Size + m.writeToMemory(NULL);
+    size_t size = 3 * kUInt32Size + SkAlign4(byteLength) + kUInt32Size + m.writeToMemory(nullptr);
     size_t initialOffset = this->addDraw(DRAW_TEXT_ON_PATH, &size);
     SkASSERT(initialOffset+get_paint_offset(DRAW_TEXT_ON_PATH, size) == fWriter.bytesWritten());
     this->addPaint(paint);
@@ -726,12 +726,12 @@
     size_t size = 2 * kUInt32Size;
     size_t initialOffset;
 
-    if (NULL == matrix && NULL == paint) {
+    if (nullptr == matrix && nullptr == paint) {
         initialOffset = this->addDraw(DRAW_PICTURE, &size);
         this->addPicture(picture);
     } else {
         const SkMatrix& m = matrix ? *matrix : SkMatrix::I();
-        size += m.writeToMemory(NULL) + kUInt32Size;    // matrix + paint
+        size += m.writeToMemory(nullptr) + kUInt32Size;    // matrix + paint
         initialOffset = this->addDraw(DRAW_PICTURE_MATRIX_PAINT, &size);
         SkASSERT(initialOffset + get_paint_offset(DRAW_PICTURE_MATRIX_PAINT, size)
                  == fWriter.bytesWritten());
@@ -887,7 +887,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SkSurface* SkPictureRecord::onNewSurface(const SkImageInfo& info, const SkSurfaceProps&) {
-    return NULL;
+    return nullptr;
 }
 
 // If we already have a stored, can we reuse it instead of also storing b?
@@ -1028,7 +1028,7 @@
 }
 
 void SkPictureRecord::addRectPtr(const SkRect* rect) {
-    if (fWriter.writeBool(rect != NULL)) {
+    if (fWriter.writeBool(rect != nullptr)) {
         fWriter.writeRect(*rect);
     }
 }
@@ -1038,7 +1038,7 @@
 }
 
 void SkPictureRecord::addIRectPtr(const SkIRect* rect) {
-    if (fWriter.writeBool(rect != NULL)) {
+    if (fWriter.writeBool(rect != nullptr)) {
         *(SkIRect*)fWriter.reserve(sizeof(SkIRect)) = *rect;
     }
 }
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp
index 8612aa7..6397ca0 100644
--- a/src/core/SkPictureRecorder.cpp
+++ b/src/core/SkPictureRecorder.cpp
@@ -25,7 +25,7 @@
 SkPictureRecorder::~SkPictureRecorder() {}
 
 SkCanvas* SkPictureRecorder::beginRecording(const SkRect& cullRect,
-                                            SkBBHFactory* bbhFactory /* = NULL */,
+                                            SkBBHFactory* bbhFactory /* = nullptr */,
                                             uint32_t recordFlags /* = 0 */) {
     fCullRect = cullRect;
     fFlags = recordFlags;
@@ -69,7 +69,7 @@
 
     SkDrawableList* drawableList = fRecorder->getDrawableList();
     SkBigPicture::SnapshotArray* pictList =
-        drawableList ? drawableList->newDrawableSnapshot() : NULL;
+        drawableList ? drawableList->newDrawableSnapshot() : nullptr;
 
     if (fBBH.get()) {
         if (saveLayerData) {
@@ -98,18 +98,18 @@
 
 
 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const {
-    if (NULL == canvas) {
+    if (nullptr == canvas) {
         return;
     }
 
     int drawableCount = 0;
-    SkDrawable* const* drawables = NULL;
+    SkDrawable* const* drawables = nullptr;
     SkDrawableList* drawableList = fRecorder->getDrawableList();
     if (drawableList) {
         drawableCount = drawableList->count();
         drawables = drawableList->begin();
     }
-    SkRecordDraw(*fRecord, canvas, NULL, drawables, drawableCount, NULL/*bbh*/, NULL/*callback*/);
+    SkRecordDraw(*fRecord, canvas, nullptr, drawables, drawableCount, nullptr/*bbh*/, nullptr/*callback*/);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -135,17 +135,17 @@
     SkRect onGetBounds() override { return fBounds; }
 
     void onDraw(SkCanvas* canvas) override {
-        SkDrawable* const* drawables = NULL;
+        SkDrawable* const* drawables = nullptr;
         int drawableCount = 0;
         if (fDrawableList) {
             drawables = fDrawableList->begin();
             drawableCount = fDrawableList->count();
         }
-        SkRecordDraw(*fRecord, canvas, NULL, drawables, drawableCount, fBBH, NULL/*callback*/);
+        SkRecordDraw(*fRecord, canvas, nullptr, drawables, drawableCount, fBBH, nullptr/*callback*/);
     }
 
     SkPicture* onNewPictureSnapshot() override {
-        SkBigPicture::SnapshotArray* pictList = NULL;
+        SkBigPicture::SnapshotArray* pictList = nullptr;
         if (fDrawableList) {
             // TODO: should we plumb-down the BBHFactory and recordFlags from our host
             //       PictureRecorder?
@@ -157,7 +157,7 @@
         if (fBBH && fDoSaveLayerInfo) {
             saveLayerData.reset(new SkLayerInfo);
 
-            SkBBoxHierarchy* bbh = NULL;    // we've already computed fBBH (received in constructor)
+            SkBBoxHierarchy* bbh = nullptr;    // we've already computed fBBH (received in constructor)
             // TODO: update saveLayer info computation to reuse the already computed
             // bounds in 'fBBH'
             SkRecordComputeLayers(fBounds, *fRecord, pictList, bbh, saveLayerData);
@@ -191,8 +191,8 @@
                                    SkToBool(fFlags & kComputeSaveLayerInfo_RecordFlag));
 
     // release our refs now, so only the drawable will be the owner.
-    fRecord.reset(NULL);
-    fBBH.reset(NULL);
+    fRecord.reset(nullptr);
+    fBBH.reset(nullptr);
 
     return drawable;
 }
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp
index 569ef3d..0b3c9e8 100644
--- a/src/core/SkPictureShader.cpp
+++ b/src/core/SkPictureShader.cpp
@@ -85,12 +85,12 @@
         result->reset(SkRef(rec.fShader.get()));
 
         SkBitmap tile;
-        if (rec.fShader.get()->isABitmap(&tile, NULL, NULL)) {
+        if (rec.fShader.get()->isABitmap(&tile, nullptr, nullptr)) {
             // FIXME: this doesn't protect the pixels from being discarded as soon as we unlock.
             // Should be handled via a pixel ref generator instead
             // (https://code.google.com/p/skia/issues/detail?id=3220).
             SkAutoLockPixels alp(tile, true);
-            return tile.getPixels() != NULL;
+            return tile.getPixels() != nullptr;
         }
         return false;
     }
@@ -99,8 +99,8 @@
 static bool cache_try_alloc_pixels(SkBitmap* bitmap) {
     SkBitmap::Allocator* allocator = SkResourceCache::GetAllocator();
 
-    return NULL != allocator
-        ? allocator->allocPixelRef(bitmap, NULL)
+    return nullptr != allocator
+        ? allocator->allocPixelRef(bitmap, nullptr)
         : bitmap->tryAllocPixels();
 }
 
@@ -141,7 +141,7 @@
         if (buffer.isVersionLT(SkReadBuffer::kPictureShaderHasPictureBool_Version)) {
             // Older code blindly serialized pictures.  We don't trust them.
             buffer.validate(false);
-            return NULL;
+            return nullptr;
         }
         // Newer code won't serialize pictures in disallow-cross-process-picture mode.
         // Assert that they didn't serialize anything except a false here.
@@ -187,7 +187,7 @@
     //
     // TODO: replace this with decomposeScale() -- but beware LayoutTest rebaselines!
     //
-    if (!SkDecomposeUpper2x2(m, NULL, &scale, NULL)) {
+    if (!SkDecomposeUpper2x2(m, nullptr, &scale, nullptr)) {
         // Decomposition failed, use an approximation.
         scale.set(SkScalarSqrt(m.getScaleX() * m.getScaleX() + m.getSkewX() * m.getSkewX()),
                   SkScalarSqrt(m.getScaleY() * m.getScaleY() + m.getSkewY() * m.getSkewY()));
@@ -262,8 +262,8 @@
 
 SkShader::Context* SkPictureShader::onCreateContext(const ContextRec& rec, void* storage) const {
     SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(*rec.fMatrix, rec.fLocalMatrix));
-    if (NULL == bitmapShader.get()) {
-        return NULL;
+    if (nullptr == bitmapShader.get()) {
+        return nullptr;
     }
     return PictureShaderContext::Create(storage, *this, rec, bitmapShader);
 }
@@ -273,9 +273,9 @@
 SkShader::Context* SkPictureShader::PictureShaderContext::Create(void* storage,
                    const SkPictureShader& shader, const ContextRec& rec, SkShader* bitmapShader) {
     PictureShaderContext* ctx = new (storage) PictureShaderContext(shader, rec, bitmapShader);
-    if (NULL == ctx->fBitmapShaderContext) {
+    if (nullptr == ctx->fBitmapShaderContext) {
         ctx->~PictureShaderContext();
-        ctx = NULL;
+        ctx = nullptr;
     }
     return ctx;
 }
@@ -349,7 +349,7 @@
     if (!bitmapShader) {
         return false;
     }
-    return bitmapShader->asFragmentProcessor(context, paint, viewM, NULL, paintColor,
+    return bitmapShader->asFragmentProcessor(context, paint, viewM, nullptr, paintColor,
                                              procDataManager, fp);
 }
 #else
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp
index 7bcaffe..d711761 100644
--- a/src/core/SkPixelRef.cpp
+++ b/src/core/SkPixelRef.cpp
@@ -95,7 +95,7 @@
     if (kIndex_8_SkColorType == info.colorType()) {
         SkASSERT(ctable);
     } else {
-        SkASSERT(NULL == ctable);
+        SkASSERT(nullptr == ctable);
     }
 }
 
@@ -198,8 +198,8 @@
     }
 
     if (fPreLocked) {
-        result->fUnlockProc = NULL;
-        result->fUnlockContext = NULL;
+        result->fUnlockProc = nullptr;
+        result->fUnlockContext = nullptr;
         result->fCTable = fRec.fColorTable;
         result->fPixels = fRec.fPixels;
         result->fRowBytes = fRec.fRowBytes;
@@ -241,7 +241,7 @@
 }
 
 void SkPixelRef::addGenIDChangeListener(GenIDChangeListener* listener) {
-    if (NULL == listener || !this->genIDIsUnique()) {
+    if (nullptr == listener || !this->genIDIsUnique()) {
         // No point in tracking this if we're not going to call it.
         delete listener;
         return;
@@ -320,7 +320,7 @@
 void SkPixelRef::onNotifyPixelsChanged() { }
 
 SkData* SkPixelRef::onRefEncodedData() {
-    return NULL;
+    return nullptr;
 }
 
 bool SkPixelRef::onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3],
diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp
index 339dea0..c63bef9 100644
--- a/src/core/SkPixmap.cpp
+++ b/src/core/SkPixmap.cpp
@@ -12,7 +12,7 @@
 #include "SkUtils.h"
 
 void SkAutoPixmapUnlock::reset(const SkPixmap& pm, void (*unlock)(void*), void* ctx) {
-    SkASSERT(pm.addr() != NULL);
+    SkASSERT(pm.addr() != nullptr);
 
     this->unlock();
     fPixmap = pm;
@@ -24,8 +24,8 @@
 /////////////////////////////////////////////////////////////////////////////////////////////////
 
 void SkPixmap::reset() {
-    fPixels = NULL;
-    fCTable = NULL;
+    fPixels = nullptr;
+    fCTable = nullptr;
     fRowBytes = 0;
     fInfo = SkImageInfo::MakeUnknown();
 }
@@ -43,7 +43,7 @@
 bool SkPixmap::reset(const SkMask& src) {
     if (SkMask::kA8_Format == src.fFormat) {
         this->reset(SkImageInfo::MakeA8(src.fBounds.width(), src.fBounds.height()),
-                    src.fImage, src.fRowBytes, NULL);
+                    src.fImage, src.fRowBytes, nullptr);
         return true;
     }
     this->reset();
@@ -62,7 +62,7 @@
     SkASSERT(static_cast<unsigned>(r.fLeft) < static_cast<unsigned>(this->width()));
     SkASSERT(static_cast<unsigned>(r.fTop) < static_cast<unsigned>(this->height()));
 
-    const void* pixels = NULL;
+    const void* pixels = nullptr;
     if (fPixels) {
         const size_t bpp = fInfo.bytesPerPixel();
         pixels = (const uint8_t*)fPixels + r.fTop * fRowBytes + r.fLeft * bpp;
@@ -76,7 +76,7 @@
     if (kUnknown_SkColorType == requestedDstInfo.colorType()) {
         return false;
     }
-    if (NULL == dstPixels || dstRB < requestedDstInfo.minRowBytes()) {
+    if (nullptr == dstPixels || dstRB < requestedDstInfo.minRowBytes()) {
         return false;
     }
     if (0 == requestedDstInfo.width() || 0 == requestedDstInfo.height()) {
@@ -116,7 +116,7 @@
 }
 
 bool SkPixmap::erase(SkColor color, const SkIRect& inArea) const {
-    if (NULL == fPixels) {
+    if (nullptr == fPixels) {
         return false;
     }
     SkIRect area;
@@ -207,7 +207,7 @@
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
-SkAutoPixmapStorage::SkAutoPixmapStorage() : fStorage(NULL) {}
+SkAutoPixmapStorage::SkAutoPixmapStorage() : fStorage(nullptr) {}
 
 SkAutoPixmapStorage::~SkAutoPixmapStorage() {
     this->freeStorage();
@@ -222,7 +222,7 @@
         return false;
     }
     void* pixels = sk_malloc_flags(size, 0);
-    if (NULL == pixels) {
+    if (nullptr == pixels) {
         return false;
     }
     this->reset(info, pixels, rb);
diff --git a/src/core/SkPtrRecorder.cpp b/src/core/SkPtrRecorder.cpp
index aae28d0..be169d7 100644
--- a/src/core/SkPtrRecorder.cpp
+++ b/src/core/SkPtrRecorder.cpp
@@ -23,7 +23,7 @@
 }
 
 uint32_t SkPtrSet::find(void* ptr) const {
-    if (NULL == ptr) {
+    if (nullptr == ptr) {
         return 0;
     }
 
@@ -39,7 +39,7 @@
 }
 
 uint32_t SkPtrSet::add(void* ptr) {
-    if (NULL == ptr) {
+    if (nullptr == ptr) {
         return 0;
     }
 
diff --git a/src/core/SkPtrRecorder.h b/src/core/SkPtrRecorder.h
index 325471e..2d755e6 100644
--- a/src/core/SkPtrRecorder.h
+++ b/src/core/SkPtrRecorder.h
@@ -26,7 +26,7 @@
 
     /**
      *  Search for the specified ptr in the set. If it is found, return its
-     *  32bit ID [1..N], or if not found, return 0. Always returns 0 for NULL.
+     *  32bit ID [1..N], or if not found, return 0. Always returns 0 for nullptr.
      */
     uint32_t find(void*) const;
 
@@ -34,7 +34,7 @@
      *  Add the specified ptr to the set, returning a unique 32bit ID for it
      *  [1...N]. Duplicate ptrs will return the same ID.
      *
-     *  If the ptr is NULL, it is not added, and 0 is returned.
+     *  If the ptr is nullptr, it is not added, and 0 is returned.
      */
     uint32_t add(void*);
 
@@ -71,7 +71,7 @@
          * Return the next ptr in the set or null if the end was reached.
          */
         void* next() {
-            return fIndex < fSet.fList.count() ? fSet.fList[fIndex++].fPtr : NULL;
+            return fIndex < fSet.fList.count() ? fSet.fList[fIndex++].fPtr : nullptr;
         }
 
     private:
@@ -85,7 +85,7 @@
 
 private:
     struct Pair {
-        void*       fPtr;   // never NULL
+        void*       fPtr;   // never nullptr
         uint32_t    fIndex; // 1...N
     };
 
diff --git a/src/core/SkRRect.cpp b/src/core/SkRRect.cpp
index 0d1887d..ef81121 100644
--- a/src/core/SkRRect.cpp
+++ b/src/core/SkRRect.cpp
@@ -359,7 +359,7 @@
 }
 
 bool SkRRect::transform(const SkMatrix& matrix, SkRRect* dst) const {
-    if (NULL == dst) {
+    if (nullptr == dst) {
         return false;
     }
 
diff --git a/src/core/SkRWBuffer.cpp b/src/core/SkRWBuffer.cpp
index 7c77513..e9147dc 100644
--- a/src/core/SkRWBuffer.cpp
+++ b/src/core/SkRWBuffer.cpp
@@ -24,7 +24,7 @@
     static SkBufferBlock* Alloc(size_t length) {
         size_t capacity = LengthToCapacity(length);
         SkBufferBlock* block = (SkBufferBlock*)sk_malloc_throw(sizeof(SkBufferBlock) + capacity);
-        block->fNext = NULL;
+        block->fNext = nullptr;
         block->fUsed = 0;
         block->fCapacity = capacity;
         return block;
@@ -68,7 +68,7 @@
         size_t size = sizeof(SkBufferHead) + capacity;
         SkBufferHead* head = (SkBufferHead*)sk_malloc_throw(size);
         head->fRefCnt = 1;
-        head->fBlock.fNext = NULL;
+        head->fBlock.fNext = nullptr;
         head->fBlock.fUsed = 0;
         head->fBlock.fCapacity = capacity;
         return head;
@@ -94,7 +94,7 @@
         }
     }
 
-    void validate(size_t minUsed, SkBufferBlock* tail = NULL) const {
+    void validate(size_t minUsed, SkBufferBlock* tail = nullptr) const {
 #ifdef SK_DEBUG
         SkASSERT(fRefCnt > 0);
         size_t totalUsed = 0;
@@ -140,13 +140,13 @@
         fBlock = &buffer->fHead->fBlock;
         fRemaining = buffer->fUsed;
     } else {
-        fBlock = NULL;
+        fBlock = nullptr;
         fRemaining = 0;
     }
 }
 
 const void* SkROBuffer::Iter::data() const {
-    return fRemaining ? fBlock->startData() : NULL;
+    return fRemaining ? fBlock->startData() : nullptr;
 }
 
 size_t SkROBuffer::Iter::size() const {
@@ -161,7 +161,7 @@
     return fRemaining != 0;
 }
 
-SkRWBuffer::SkRWBuffer(size_t initialCapacity) : fHead(NULL), fTail(NULL), fTotalUsed(0) {}
+SkRWBuffer::SkRWBuffer(size_t initialCapacity) : fHead(nullptr), fTail(nullptr), fTotalUsed(0) {}
 
 SkRWBuffer::~SkRWBuffer() {
     this->validate();
@@ -176,7 +176,7 @@
 
     fTotalUsed += length;
 
-    if (NULL == fHead) {
+    if (nullptr == fHead) {
         fHead = SkBufferHead::Alloc(length);
         fTail = &fHead->fBlock;
     }
@@ -199,12 +199,12 @@
 void* SkRWBuffer::append(size_t length) {
     this->validate();
     if (0 == length) {
-        return NULL;
+        return nullptr;
     }
 
     fTotalUsed += length;
 
-    if (NULL == fHead) {
+    if (nullptr == fHead) {
         fHead = SkBufferHead::Alloc(length);
         fTail = &fHead->fBlock;
     } else if (fTail->avail() < length) {
@@ -223,7 +223,7 @@
     if (fHead) {
         fHead->validate(fTotalUsed, fTail);
     } else {
-        SkASSERT(NULL == fTail);
+        SkASSERT(nullptr == fTail);
         SkASSERT(0 == fTotalUsed);
     }
 }
diff --git a/src/core/SkRWBuffer.h b/src/core/SkRWBuffer.h
index 89cb425..9d88a60 100644
--- a/src/core/SkRWBuffer.h
+++ b/src/core/SkRWBuffer.h
@@ -34,7 +34,7 @@
         void reset(const SkROBuffer*);
 
         /**
-         *  Return the current continuous block of memory, or NULL if the iterator is exhausted
+         *  Return the current continuous block of memory, or nullptr if the iterator is exhausted
          */
         const void* data() const;
 
diff --git a/src/core/SkRasterClip.cpp b/src/core/SkRasterClip.cpp
index 35197c1..89c22e8 100644
--- a/src/core/SkRasterClip.cpp
+++ b/src/core/SkRasterClip.cpp
@@ -313,7 +313,7 @@
 }
 
 void SkRasterClip::translate(int dx, int dy, SkRasterClip* dst) const {
-    if (NULL == dst) {
+    if (nullptr == dst) {
         return;
     }
 
@@ -386,8 +386,8 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SkAAClipBlitterWrapper::SkAAClipBlitterWrapper() {
-    SkDEBUGCODE(fClipRgn = NULL;)
-    SkDEBUGCODE(fBlitter = NULL;)
+    SkDEBUGCODE(fClipRgn = nullptr;)
+    SkDEBUGCODE(fBlitter = nullptr;)
 }
 
 SkAAClipBlitterWrapper::SkAAClipBlitterWrapper(const SkRasterClip& clip,
diff --git a/src/core/SkRasterizer.cpp b/src/core/SkRasterizer.cpp
index ab9e011..87b9caa 100644
--- a/src/core/SkRasterizer.cpp
+++ b/src/core/SkRasterizer.cpp
@@ -23,7 +23,7 @@
 
         srcM.fFormat = SkMask::kA8_Format;
         srcM.fBounds.set(0, 0, 1, 1);
-        srcM.fImage = NULL;
+        srcM.fImage = nullptr;
         if (!filter->filterMask(&dstM, srcM, matrix, &margin)) {
             return false;
         }
@@ -42,6 +42,6 @@
     SkPath  devPath;
 
     fillPath.transform(matrix, &devPath);
-    return SkDraw::DrawToMask(devPath, clipBounds, NULL, NULL, mask, mode,
+    return SkDraw::DrawToMask(devPath, clipBounds, nullptr, nullptr, mask, mode,
                               SkPaint::kFill_Style);
 }
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp
index 58a4ac4..00e3e2c 100644
--- a/src/core/SkReadBuffer.cpp
+++ b/src/core/SkReadBuffer.cpp
@@ -24,16 +24,16 @@
 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 @@
     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 @@
     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 @@
             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 @@
         if (index) {
             SkDebugf("====== typeface index %d\n", index);
         }
-        return NULL;
+        return nullptr;
     } else {
         SkASSERT(fTFArray);
         return fTFArray[index - 1];
@@ -293,12 +293,12 @@
     // 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 @@
     } 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 @@
             return;
         }
     } else {
-        if (NULL == this->readFunctionPtr()) {
+        if (nullptr == this->readFunctionPtr()) {
             return;
         }
     }
diff --git a/src/core/SkReadBuffer.h b/src/core/SkReadBuffer.h
index 2564051..06b5a77 100644
--- a/src/core/SkReadBuffer.h
+++ b/src/core/SkReadBuffer.h
@@ -185,7 +185,7 @@
      *  were created/written by the writer. SkPicture uses this.
      */
     void setFactoryPlayback(SkFlattenable::Factory array[], int count) {
-        fFactoryTDArray = NULL;
+        fFactoryTDArray = nullptr;
         fFactoryArray = array;
         fFactoryCount = count;
     }
@@ -197,7 +197,7 @@
      */
     void setFactoryArray(SkTDArray<SkFlattenable::Factory>* array) {
         fFactoryTDArray = array;
-        fFactoryArray = NULL;
+        fFactoryArray = nullptr;
         fFactoryCount = 0;
     }
 
diff --git a/src/core/SkReader32.h b/src/core/SkReader32.h
index 3d874d1..68dda23 100644
--- a/src/core/SkReader32.h
+++ b/src/core/SkReader32.h
@@ -20,7 +20,7 @@
 
 class SkReader32 : SkNoncopyable {
 public:
-    SkReader32() : fCurr(NULL), fStop(NULL), fBase(NULL) {}
+    SkReader32() : fCurr(nullptr), fStop(nullptr), fBase(nullptr) {}
     SkReader32(const void* data, size_t size)  {
         this->setMemory(data, size);
     }
@@ -94,7 +94,7 @@
     }
 
     void read(void* dst, size_t size) {
-        SkASSERT(0 == size || dst != NULL);
+        SkASSERT(0 == size || dst != nullptr);
         SkASSERT(ptr_align_4(fCurr));
         memcpy(dst, fCurr, size);
         fCurr += SkAlign4(size);
@@ -124,10 +124,10 @@
 
     /**
      *  Read the length of a string (written by SkWriter32::writeString) into
-     *  len (if len is not NULL) and return the null-ternimated address of the
+     *  len (if len is not nullptr) and return the null-ternimated address of the
      *  string within the reader's buffer.
      */
-    const char* readString(size_t* len = NULL);
+    const char* readString(size_t* len = nullptr);
 
     /**
      *  Read the string (written by SkWriter32::writeString) and return it in
@@ -152,7 +152,7 @@
 
 #ifdef SK_DEBUG
     static bool ptr_align_4(const void* ptr) {
-        return (((const char*)ptr - (const char*)NULL) & 3) == 0;
+        return (((const char*)ptr - (const char*)nullptr) & 3) == 0;
     }
 #endif
 };
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index fe8f5f4..1a03348 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -64,7 +64,7 @@
     SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
 
     stop = SkTMin(stop, record.count());
-    SkRecords::Draw draw(canvas, drawablePicts, NULL, drawableCount, &initialCTM);
+    SkRecords::Draw draw(canvas, drawablePicts, nullptr, drawableCount, &initialCTM);
     for (int i = start; i < stop; i++) {
         record.visit<void>(i, draw);
     }
@@ -123,10 +123,10 @@
     SkASSERT(r.index >= 0);
     SkASSERT(r.index < fDrawableCount);
     if (fDrawables) {
-        SkASSERT(NULL == fDrawablePicts);
+        SkASSERT(nullptr == fDrawablePicts);
         fCanvas->drawDrawable(fDrawables[r.index], r.matrix);
     } else {
-        fCanvas->drawPicture(fDrawablePicts[r.index], r.matrix, NULL);
+        fCanvas->drawPicture(fDrawablePicts[r.index], r.matrix, nullptr);
     }
 }
 
@@ -280,7 +280,7 @@
 
     // The bounds of these ops must be calculated when we hit the Restore
     // from the bounds of the ops in the same Save block.
-    void trackBounds(const Save&)          { this->pushSaveBlock(NULL); }
+    void trackBounds(const Save&)          { this->pushSaveBlock(nullptr); }
     void trackBounds(const SaveLayer& op)  { this->pushSaveBlock(op.paint); }
     void trackBounds(const Restore&) { fBounds[fCurrentOp] = this->popSaveBlock(); }
 
@@ -324,7 +324,7 @@
             // https://crbug.com/401593
             SkXfermode* xfermode = paint->getXfermode();
             SkXfermode::Mode mode;
-            // SrcOver is ok, and is also the common case with a NULL xfermode.
+            // SrcOver is ok, and is also the common case with a nullptr xfermode.
             // So we should make that the fast path and bypass the mode extraction
             // and test.
             if (xfermode && xfermode->asMode(&mode)) {
@@ -525,7 +525,7 @@
     }
 
     Bounds bounds(const DrawDrawable& op) const {
-        return this->adjustAndMap(op.worstCaseBounds, NULL);
+        return this->adjustAndMap(op.worstCaseBounds, nullptr);
     }
 
     static void AdjustTextForFontMetrics(SkRect* rect, const SkPaint& paint) {
@@ -644,14 +644,14 @@
     template <typename T> void trackSaveLayers(const T& op) {
         /* most ops aren't involved in saveLayers */
     }
-    void trackSaveLayers(const Save& s) { this->pushSaveLayerInfo(false, NULL, NULL); }
+    void trackSaveLayers(const Save& s) { this->pushSaveLayerInfo(false, nullptr, nullptr); }
     void trackSaveLayers(const SaveLayer& sl) { this->pushSaveLayerInfo(true, sl.bounds, sl.paint); }
     void trackSaveLayers(const Restore& r) { this->popSaveLayerInfo(); }
 
     void trackSaveLayersForPicture(const SkPicture* picture, const SkPaint* paint) {
         // For sub-pictures, we wrap their layer information within the parent
         // picture's rendering hierarchy
-        const SkLayerInfo* childData = NULL;
+        const SkLayerInfo* childData = nullptr;
         if (const SkBigPicture* bp = picture->asSkBigPicture()) {
             childData = static_cast<const SkLayerInfo*>(bp->accelData());
         }
@@ -677,7 +677,7 @@
 
             SkLayerInfo::BlockInfo& dst = fAccelData->addBlock();
 
-            // If src.fPicture is NULL the layer is in dp.picture; otherwise
+            // If src.fPicture is nullptr the layer is in dp.picture; otherwise
             // it belongs to a sub-picture.
             dst.fPicture = src.fPicture ? src.fPicture : picture;
             dst.fPicture->ref();
@@ -710,7 +710,7 @@
     void trackSaveLayers(const DrawDrawable& dp) {
         SkASSERT(fPictList);
         SkASSERT(dp.index >= 0 && dp.index < fPictList->count());
-        const SkPaint* paint = NULL;    // drawables don't get a side-car paint
+        const SkPaint* paint = nullptr;    // drawables don't get a side-car paint
         this->trackSaveLayersForPicture(fPictList->begin()[dp.index], paint);
     }
 
@@ -757,7 +757,7 @@
 
         SkLayerInfo::BlockInfo& block = fAccelData->addBlock();
 
-        SkASSERT(NULL == block.fPicture);  // This layer is in the top-most picture
+        SkASSERT(nullptr == block.fPicture);  // This layer is in the top-most picture
 
         block.fBounds = fFillBounds.getBounds(sli.fStartIndex);
         block.fLocalMat = fFillBounds.ctm();
diff --git a/src/core/SkRecordDraw.h b/src/core/SkRecordDraw.h
index 5af74dc..c2db37a 100644
--- a/src/core/SkRecordDraw.h
+++ b/src/core/SkRecordDraw.h
@@ -45,7 +45,7 @@
 public:
     explicit Draw(SkCanvas* canvas, SkPicture const* const drawablePicts[],
                   SkDrawable* const drawables[], int drawableCount,
-                  const SkMatrix* initialCTM = NULL)
+                  const SkMatrix* initialCTM = nullptr)
         : fInitialCTM(initialCTM ? *initialCTM : canvas->getTotalMatrix())
         , fCanvas(canvas)
         , fDrawablePicts(drawablePicts)
diff --git a/src/core/SkRecordOpts.cpp b/src/core/SkRecordOpts.cpp
index 07aac3e..8faa45c 100644
--- a/src/core/SkRecordOpts.cpp
+++ b/src/core/SkRecordOpts.cpp
@@ -151,13 +151,13 @@
     bool onMatch(SkRecord* record, Pattern* pattern, int begin, int end) {
         // A SaveLayer's bounds field is just a hint, so we should be free to ignore it.
         SkPaint* layerPaint = pattern->first<SaveLayer>()->paint;
-        if (NULL == layerPaint) {
+        if (nullptr == layerPaint) {
             // There wasn't really any point to this SaveLayer at all.
             return KillSaveLayerAndRestore(record, begin);
         }
 
         SkPaint* drawPaint = pattern->second<SkPaint>();
-        if (drawPaint == NULL) {
+        if (drawPaint == nullptr) {
             // We can just give the draw the SaveLayer's paint.
             // TODO(mtklein): figure out how to do this clearly
             return false;
@@ -197,7 +197,7 @@
 
     bool onMatch(SkRecord* record, Pattern* pattern, int begin, int end) {
         SkPaint* opacityPaint = pattern->first<SaveLayer>()->paint;
-        if (NULL == opacityPaint) {
+        if (nullptr == opacityPaint) {
             // There wasn't really any point to this SaveLayer at all.
             return KillSaveLayerAndRestore(record, begin);
         }
@@ -205,7 +205,7 @@
         // This layer typically contains a filter, but this should work for layers with for other
         // purposes too.
         SkPaint* filterLayerPaint = pattern->fourth<SaveLayer>()->paint;
-        if (filterLayerPaint == NULL) {
+        if (filterLayerPaint == nullptr) {
             // We can just give the inner SaveLayer the paint of the outer SaveLayer.
             // TODO(mtklein): figure out how to do this clearly
             return false;
diff --git a/src/core/SkRecordPattern.h b/src/core/SkRecordPattern.h
index 174665a..ecc61b3 100644
--- a/src/core/SkRecordPattern.h
+++ b/src/core/SkRecordPattern.h
@@ -19,7 +19,7 @@
 template <typename T>
 class Is {
 public:
-    Is() : fPtr(NULL) {}
+    Is() : fPtr(nullptr) {}
 
     typedef T type;
     type* get() { return fPtr; }
@@ -31,7 +31,7 @@
 
     template <typename U>
     bool operator()(U*) {
-        fPtr = NULL;
+        fPtr = nullptr;
         return false;
     }
 
@@ -43,7 +43,7 @@
 class IsDraw {
     SK_CREATE_MEMBER_DETECTOR(paint);
 public:
-    IsDraw() : fPaint(NULL) {}
+    IsDraw() : fPaint(nullptr) {}
 
     typedef SkPaint type;
     type* get() { return fPaint; }
@@ -56,13 +56,13 @@
 
     template <typename T>
     SK_WHEN(!HasMember_paint<T>, bool) operator()(T*) {
-        fPaint = NULL;
+        fPaint = nullptr;
         return false;
     }
 
     // SaveLayer has an SkPaint named paint, but it's not a draw.
     bool operator()(SaveLayer*) {
-        fPaint = NULL;
+        fPaint = nullptr;
         return false;
     }
 
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp
index 0fe9e28..9eccca1 100644
--- a/src/core/SkRecorder.cpp
+++ b/src/core/SkRecorder.cpp
@@ -21,7 +21,7 @@
 SkBigPicture::SnapshotArray* SkDrawableList::newDrawableSnapshot() {
     const int count = fArray.count();
     if (0 == count) {
-        return NULL;
+        return nullptr;
     }
     SkAutoTMalloc<const SkPicture*> pics(count);
     for (int i = 0; i < count; ++i) {
@@ -60,9 +60,9 @@
 }
 
 void SkRecorder::forgetRecord() {
-    fDrawableList.reset(NULL);
+    fDrawableList.reset(nullptr);
     fApproxBytesUsedBySubPictures = 0;
-    fRecord = NULL;
+    fRecord = nullptr;
 }
 
 // To make appending to fRecord a little less verbose.
@@ -82,8 +82,8 @@
 // (For most types we just pass by value and let copy constructors do their thing.)
 template <typename T>
 T* SkRecorder::copy(const T* src) {
-    if (NULL == src) {
-        return NULL;
+    if (nullptr == src) {
+        return nullptr;
     }
     return new (fRecord->alloc<T>()) T(*src);
 }
@@ -92,8 +92,8 @@
 // It will work with POD or non-POD, though currently we only use it for POD.
 template <typename T>
 T* SkRecorder::copy(const T src[], size_t count) {
-    if (NULL == src) {
-        return NULL;
+    if (nullptr == src) {
+        return nullptr;
     }
     T* dst = fRecord->alloc<T>(count);
     for (size_t i = 0; i < count; i++) {
@@ -107,8 +107,8 @@
 // but I found no corresponding speedup for other arrays.
 template <>
 char* SkRecorder::copy(const char src[], size_t count) {
-    if (NULL == src) {
-        return NULL;
+    if (nullptr == src) {
+        return nullptr;
     }
     char* dst = fRecord->alloc<char>(count);
     memcpy(dst, src, count);
@@ -302,8 +302,8 @@
                          vmode,
                          vertexCount,
                          this->copy(vertices, vertexCount),
-                         texs ? this->copy(texs, vertexCount) : NULL,
-                         colors ? this->copy(colors, vertexCount) : NULL,
+                         texs ? this->copy(texs, vertexCount) : nullptr,
+                         colors ? this->copy(colors, vertexCount) : nullptr,
                          xmode,
                          this->copy(indices, indexCount),
                          indexCount);
@@ -312,9 +312,9 @@
 void SkRecorder::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
                              const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) {
     APPEND(DrawPatch, paint,
-           cubics ? this->copy(cubics, SkPatchUtils::kNumCtrlPts) : NULL,
-           colors ? this->copy(colors, SkPatchUtils::kNumCorners) : NULL,
-           texCoords ? this->copy(texCoords, SkPatchUtils::kNumCorners) : NULL,
+           cubics ? this->copy(cubics, SkPatchUtils::kNumCtrlPts) : nullptr,
+           colors ? this->copy(colors, SkPatchUtils::kNumCorners) : nullptr,
+           texCoords ? this->copy(texCoords, SkPatchUtils::kNumCorners) : nullptr,
            xmode);
 }
 
diff --git a/src/core/SkRecorder.h b/src/core/SkRecorder.h
index 57b4568..92197a0 100644
--- a/src/core/SkRecorder.h
+++ b/src/core/SkRecorder.h
@@ -122,7 +122,7 @@
 
     void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
 
-    SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) override { return NULL; }
+    SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) override { return nullptr; }
 
     void flushMiniRecorder();
 
diff --git a/src/core/SkRefDict.cpp b/src/core/SkRefDict.cpp
index 44eddf0..9364a39 100644
--- a/src/core/SkRefDict.cpp
+++ b/src/core/SkRefDict.cpp
@@ -16,15 +16,15 @@
     SkRefCnt*   fData;
 };
 
-SkRefDict::SkRefDict() : fImpl(NULL) {}
+SkRefDict::SkRefDict() : fImpl(nullptr) {}
 
 SkRefDict::~SkRefDict() {
     this->removeAll();
 }
 
 SkRefCnt* SkRefDict::find(const char name[]) const {
-    if (NULL == name) {
-        return NULL;
+    if (nullptr == name) {
+        return nullptr;
     }
 
     Impl* rec = fImpl;
@@ -34,16 +34,16 @@
         }
         rec = rec->fNext;
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkRefDict::set(const char name[], SkRefCnt* data) {
-    if (NULL == name) {
+    if (nullptr == name) {
         return;
     }
 
     Impl* rec = fImpl;
-    Impl* prev = NULL;
+    Impl* prev = nullptr;
     while (rec) {
         if (rec->fName.equals(name)) {
             if (data) {
@@ -85,5 +85,5 @@
         delete rec;
         rec = next;
     }
-    fImpl = NULL;
+    fImpl = nullptr;
 }
diff --git a/src/core/SkRefDict.h b/src/core/SkRefDict.h
index 55b9bfe..9583df1 100644
--- a/src/core/SkRefDict.h
+++ b/src/core/SkRefDict.h
@@ -22,15 +22,15 @@
     ~SkRefDict();
 
     /**
-     *  Return the data associated with name[], or NULL if no matching entry
+     *  Return the data associated with name[], or nullptr if no matching entry
      *  is found. The reference-count of the entry is not affected.
      */
     SkRefCnt* find(const char name[]) const;
 
     /**
-     *  If data is NULL, remove (if present) the entry matching name and call
+     *  If data is nullptr, remove (if present) the entry matching name and call
      *  prev_data->unref() on the data for the matching entry.
-     *  If data is not-NULL, replace the existing entry matching name and
+     *  If data is not-nullptr, replace the existing entry matching name and
      *  call (prev_data->unref()), or add a new one. In either case,
      *  data->ref() is called.
      */
@@ -39,7 +39,7 @@
     /**
      *  Remove the matching entry (if found) and unref its data.
      */
-    void remove(const char name[]) { this->set(name, NULL); }
+    void remove(const char name[]) { this->set(name, nullptr); }
 
     /**
      *  Remove all entries, and unref() their associated data.
diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp
index b87fbc8..3a542c6 100644
--- a/src/core/SkRegion.cpp
+++ b/src/core/SkRegion.cpp
@@ -194,8 +194,8 @@
     // 4 ints, up to 10 digits each plus sign, 3 commas, '(', ')', SkRegion() and '\0'
     const int max = (count*((11*4)+5))+11+1;
     char* result = (char*)sk_malloc_throw(max);
-    if (result == NULL) {
-        return NULL;
+    if (result == nullptr) {
+        return nullptr;
     }
     count = sprintf(result, "SkRegion(");
     iter.reset(*this);
@@ -408,7 +408,7 @@
      *  A contains B is equivalent to
      *  B - A == 0
      */
-    return !Oper(rgn, *this, kDifference_Op, NULL);
+    return !Oper(rgn, *this, kDifference_Op, nullptr);
 }
 
 const SkRegion::RunType* SkRegion::getRuns(RunType tmpStorage[],
@@ -498,7 +498,7 @@
     }
 
     // both of us are complex
-    return Oper(*this, rgn, kIntersect_Op, NULL);
+    return Oper(*this, rgn, kIntersect_Op, nullptr);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -533,7 +533,7 @@
 void SkRegion::translate(int dx, int dy, SkRegion* dst) const {
     SkDEBUGCODE(this->validate();)
 
-    if (NULL == dst) {
+    if (nullptr == dst) {
         return;
     }
     if (this->isEmpty()) {
@@ -1074,7 +1074,7 @@
 //  sk_memset32((uint32_t*)array.get(), 0x7FFFFFFF, dstCount);
 #endif
 
-    int count = operate(a_runs, b_runs, array.get(), op, NULL == result);
+    int count = operate(a_runs, b_runs, array.get(), op, nullptr == result);
     SkASSERT(count <= dstCount);
 
     if (result) {
@@ -1095,7 +1095,7 @@
 #include "SkBuffer.h"
 
 size_t SkRegion::writeToMemory(void* storage) const {
-    if (NULL == storage) {
+    if (nullptr == storage) {
         size_t size = sizeof(int32_t); // -1 (empty), 0 (rect), runCount
         if (!this->isEmpty()) {
             size += sizeof(fBounds);
@@ -1295,7 +1295,7 @@
         fDone = false;
         if (rgn.isRect()) {
             fRect = rgn.fBounds;
-            fRuns = NULL;
+            fRuns = nullptr;
         } else {
             fRuns = rgn.fRunHead->readonly_runs();
             fRect.set(fRuns[3], fRuns[0], fRuns[4], fRuns[1]);
@@ -1310,7 +1310,7 @@
         return;
     }
 
-    if (fRuns == NULL) {   // rect case
+    if (fRuns == nullptr) {   // rect case
         fDone = true;
         return;
     }
@@ -1402,7 +1402,7 @@
             }
             fLeft = left;
             fRight = right;
-            fRuns = NULL;    // means we're a rect, not a rgn
+            fRuns = nullptr;    // means we're a rect, not a rgn
             fDone = false;
         } else {
             const SkRegion::RunType* runs = rgn.fRunHead->findScanline(y);
@@ -1433,7 +1433,7 @@
         return false;
     }
 
-    if (fRuns == NULL) {   // we're a rect
+    if (fRuns == nullptr) {   // we're a rect
         fDone = true;   // ok, now we're done
         if (left) {
             *left = fLeft;
diff --git a/src/core/SkRegionPriv.h b/src/core/SkRegionPriv.h
index 9ddefc0..160c55d 100644
--- a/src/core/SkRegionPriv.h
+++ b/src/core/SkRegionPriv.h
@@ -142,7 +142,7 @@
     /**
      *  Return the scanline that contains the Y value. This requires that the Y
      *  value is already known to be contained within the bounds of the region,
-     *  and so this routine never returns NULL.
+     *  and so this routine never returns nullptr.
      *
      *  It returns the beginning of the scanline, starting with its Bottom value.
      */
diff --git a/src/core/SkRegion_path.cpp b/src/core/SkRegion_path.cpp
index b07d679..9289641 100644
--- a/src/core/SkRegion_path.cpp
+++ b/src/core/SkRegion_path.cpp
@@ -32,7 +32,7 @@
     bool init(int maxHeight, int maxTransitions, bool pathIsInverse);
 
     void done() {
-        if (fCurrScanline != NULL) {
+        if (fCurrScanline != nullptr) {
             fCurrScanline->fXCount = (SkRegion::RunType)((int)(fCurrXPtr - fCurrScanline->firstX()));
             if (!this->collapsWithPrev()) { // flush the last line
                 fCurrScanline = fCurrScanline->nextScanline();
@@ -94,7 +94,7 @@
     int fStorageCount;
 
     bool collapsWithPrev() {
-        if (fPrevScanline != NULL &&
+        if (fPrevScanline != nullptr &&
             fPrevScanline->fLastY + 1 == fCurrScanline->fLastY &&
             fPrevScanline->fXCount == fCurrScanline->fXCount &&
             sk_memeq32(fPrevScanline->firstX(), fCurrScanline->firstX(), fCurrScanline->fXCount))
@@ -108,7 +108,7 @@
 };
 
 SkRgnBuilder::SkRgnBuilder()
-    : fStorage(NULL) {
+    : fStorage(nullptr) {
 }
 
 SkRgnBuilder::~SkRgnBuilder() {
@@ -147,17 +147,17 @@
     }
 
     fStorage = (SkRegion::RunType*)sk_malloc_flags(sk_64_asS32(size), 0);
-    if (NULL == fStorage) {
+    if (nullptr == fStorage) {
         return false;
     }
 
-    fCurrScanline = NULL;    // signal empty collection
-    fPrevScanline = NULL;    // signal first scanline
+    fCurrScanline = nullptr;    // signal empty collection
+    fPrevScanline = nullptr;    // signal first scanline
     return true;
 }
 
 void SkRgnBuilder::blitH(int x, int y, int width) {
-    if (fCurrScanline == NULL) {  // first time
+    if (fCurrScanline == nullptr) {  // first time
         fTop = (SkRegion::RunType)(y);
         fCurrScanline = (Scanline*)fStorage;
         fCurrScanline->fLastY = (SkRegion::RunType)(y);
@@ -197,7 +197,7 @@
 }
 
 int SkRgnBuilder::computeRunCount() const {
-    if (fCurrScanline == NULL) {
+    if (fCurrScanline == nullptr) {
         return 0;
     }
 
@@ -208,7 +208,7 @@
 }
 
 void SkRgnBuilder::copyToRect(SkIRect* r) const {
-    SkASSERT(fCurrScanline != NULL);
+    SkASSERT(fCurrScanline != nullptr);
     // A rect's scanline is [bottom intervals left right sentinel] == 5
     SkASSERT((const SkRegion::RunType*)fCurrScanline - fStorage == 5);
 
@@ -219,7 +219,7 @@
 }
 
 void SkRgnBuilder::copyToRgn(SkRegion::RunType runs[]) const {
-    SkASSERT(fCurrScanline != NULL);
+    SkASSERT(fCurrScanline != nullptr);
     SkASSERT((const SkRegion::RunType*)fCurrScanline - fStorage > 4);
 
     const Scanline* line = (const Scanline*)fStorage;
@@ -397,7 +397,7 @@
         fY0 = (SkRegion::RunType)(y0);
         fY1 = (SkRegion::RunType)(y1);
         fFlags = 0;
-        SkDEBUGCODE(fNext = NULL;)
+        SkDEBUGCODE(fNext = nullptr;)
     }
 
     int top() const {
@@ -423,7 +423,7 @@
         for (;;) {
             e += 1;
             if ((e->fFlags & Edge::kY1Link) == 0 && y0 == e->fY1) {
-                SkASSERT(NULL == e->fNext);
+                SkASSERT(nullptr == e->fNext);
                 e->fNext = base;
                 e->fFlags = SkToU8(e->fFlags | Edge::kY1Link);
                 break;
@@ -436,7 +436,7 @@
         for (;;) {
             e += 1;
             if ((e->fFlags & Edge::kY0Link) == 0 && y1 == e->fY0) {
-                SkASSERT(NULL == base->fNext);
+                SkASSERT(nullptr == base->fNext);
                 base->fNext = e;
                 e->fFlags = SkToU8(e->fFlags | Edge::kY0Link);
                 break;
@@ -484,7 +484,7 @@
 };
 
 bool SkRegion::getBoundaryPath(SkPath* path) const {
-    // path could safely be NULL if we're empty, but the caller shouldn't
+    // path could safely be nullptr if we're empty, but the caller shouldn't
     // *know* that
     SkASSERT(path);
 
@@ -522,7 +522,7 @@
 
 #ifdef SK_DEBUG
     for (e = start; e != stop; e++) {
-        SkASSERT(e->fNext != NULL);
+        SkASSERT(e->fNext != nullptr);
         SkASSERT(e->fFlags == Edge::kCompleteLink);
     }
 #endif
diff --git a/src/core/SkResourceCache.cpp b/src/core/SkResourceCache.cpp
index 911a090..4d2453c 100644
--- a/src/core/SkResourceCache.cpp
+++ b/src/core/SkResourceCache.cpp
@@ -59,17 +59,17 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 void SkResourceCache::init() {
-    fHead = NULL;
-    fTail = NULL;
+    fHead = nullptr;
+    fTail = nullptr;
     fHash = new Hash;
     fTotalBytesUsed = 0;
     fCount = 0;
     fSingleAllocationByteLimit = 0;
-    fAllocator = NULL;
+    fAllocator = nullptr;
 
     // One of these should be explicit set by the caller after we return.
     fTotalByteLimit = 0;
-    fDiscardableFactory = NULL;
+    fDiscardableFactory = nullptr;
 }
 
 #include "SkDiscardableMemory.h"
@@ -116,20 +116,20 @@
     }
 
     // A previous call to onUnlock may have deleted our DM, so check for that
-    if (NULL == fDM) {
+    if (nullptr == fDM) {
         return false;
     }
 
     if (!fDM->lock()) {
         // since it failed, we delete it now, to free-up the resource
         delete fDM;
-        fDM = NULL;
+        fDM = nullptr;
         return false;
     }
 
 SUCCESS:
     rec->fPixels = fDM->data();
-    rec->fColorTable = NULL;
+    rec->fColorTable = nullptr;
     rec->fRowBytes = fRB;
     return true;
 }
@@ -164,7 +164,7 @@
     }
 
     SkDiscardableMemory* dm = fFactory(size);
-    if (NULL == dm) {
+    if (nullptr == dm) {
         return false;
     }
 
@@ -371,7 +371,7 @@
 
     if (fDiscardableFactory) {
         SkDiscardableMemory* dm = fDiscardableFactory(bytes);
-        return dm ? new SkCachedData(bytes, dm) : NULL;
+        return dm ? new SkCachedData(bytes, dm) : nullptr;
     } else {
         return new SkCachedData(sk_malloc_throw(bytes), bytes);
     }
@@ -396,7 +396,7 @@
         next->fPrev = prev;
     }
 
-    rec->fNext = rec->fPrev = NULL;
+    rec->fNext = rec->fPrev = nullptr;
 }
 
 void SkResourceCache::moveToHead(Rec* rec) {
@@ -421,7 +421,7 @@
 void SkResourceCache::addToHead(Rec* rec) {
     this->validate();
 
-    rec->fPrev = NULL;
+    rec->fPrev = nullptr;
     rec->fNext = fHead;
     if (fHead) {
         fHead->fPrev = rec;
@@ -440,22 +440,22 @@
 
 #ifdef SK_DEBUG
 void SkResourceCache::validate() const {
-    if (NULL == fHead) {
-        SkASSERT(NULL == fTail);
+    if (nullptr == fHead) {
+        SkASSERT(nullptr == fTail);
         SkASSERT(0 == fTotalBytesUsed);
         return;
     }
 
     if (fHead == fTail) {
-        SkASSERT(NULL == fHead->fPrev);
-        SkASSERT(NULL == fHead->fNext);
+        SkASSERT(nullptr == fHead->fPrev);
+        SkASSERT(nullptr == fHead->fNext);
         SkASSERT(fHead->bytesUsed() == fTotalBytesUsed);
         return;
     }
 
-    SkASSERT(NULL == fHead->fPrev);
+    SkASSERT(nullptr == fHead->fPrev);
     SkASSERT(fHead->fNext);
-    SkASSERT(NULL == fTail->fNext);
+    SkASSERT(nullptr == fTail->fNext);
     SkASSERT(fTail->fPrev);
 
     size_t used = 0;
@@ -506,7 +506,7 @@
 
     // if we're not discardable (i.e. we are fixed-budget) then cap the single-limit
     // to our budget.
-    if (NULL == fDiscardableFactory) {
+    if (nullptr == fDiscardableFactory) {
         if (0 == limit) {
             limit = fTotalByteLimit;
         } else {
@@ -527,7 +527,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SK_DECLARE_STATIC_MUTEX(gMutex);
-static SkResourceCache* gResourceCache = NULL;
+static SkResourceCache* gResourceCache = nullptr;
 static void cleanup_gResourceCache() {
     // We'll clean this up in our own tests, but disable for clients.
     // Chrome seems to have funky multi-process things going on in unit tests that
@@ -542,7 +542,7 @@
 static SkResourceCache* get_cache() {
     // gMutex is always held when this is called, so we don't need to be fancy in here.
     gMutex.assertHeld();
-    if (NULL == gResourceCache) {
+    if (nullptr == gResourceCache) {
 #ifdef SK_USE_DISCARDABLE_SCALEDIMAGECACHE
         gResourceCache = new SkResourceCache(SkDiscardableMemory::Create);
 #else
diff --git a/src/core/SkResourceCache.h b/src/core/SkResourceCache.h
index 7267c67..813e2ee 100644
--- a/src/core/SkResourceCache.h
+++ b/src/core/SkResourceCache.h
@@ -79,7 +79,7 @@
 
         // for memory usage diagnostics
         virtual const char* getCategory() const = 0;
-        virtual SkDiscardableMemory* diagnostic_only_getDiscardable() const { return NULL; }
+        virtual SkDiscardableMemory* diagnostic_only_getDiscardable() const { return nullptr; }
 
         // for SkTDynamicHash::Traits
         static uint32_t Hash(const Key& key) { return key.hash(); }
@@ -115,7 +115,7 @@
 
     /**
      *  Returns a locked/pinned SkDiscardableMemory instance for the specified
-     *  number of bytes, or NULL on failure.
+     *  number of bytes, or nullptr on failure.
      */
     typedef SkDiscardableMemory* (*DiscardableFactory)(size_t bytes);
 
@@ -153,13 +153,13 @@
     static void TestDumpMemoryStatistics();
 
     /**
-     *  Returns the DiscardableFactory used by the global cache, or NULL.
+     *  Returns the DiscardableFactory used by the global cache, or nullptr.
      */
     static DiscardableFactory GetDiscardableFactory();
 
     /**
      * Use this allocator for bitmaps, so they can use ashmem when available.
-     * Returns NULL if the ResourceCache has not been initialized with a DiscardableFactory.
+     * Returns nullptr if the ResourceCache has not been initialized with a DiscardableFactory.
      */
     static SkBitmap::Allocator* GetAllocator();
 
@@ -250,7 +250,7 @@
     Hash*   fHash;
 
     DiscardableFactory  fDiscardableFactory;
-    // the allocator is NULL or one that matches discardables
+    // the allocator is nullptr or one that matches discardables
     SkBitmap::Allocator* fAllocator;
 
     size_t  fTotalBytesUsed;
diff --git a/src/core/SkScalar.cpp b/src/core/SkScalar.cpp
index e8f6e93..7cb0a8b 100644
--- a/src/core/SkScalar.cpp
+++ b/src/core/SkScalar.cpp
@@ -13,8 +13,8 @@
 SkScalar SkScalarInterpFunc(SkScalar searchKey, const SkScalar keys[],
                             const SkScalar values[], int length) {
     SkASSERT(length > 0);
-    SkASSERT(keys != NULL);
-    SkASSERT(values != NULL);
+    SkASSERT(keys != nullptr);
+    SkASSERT(values != nullptr);
 #ifdef SK_DEBUG
     for (int i = 1; i < length; i++)
         SkASSERT(keys[i] >= keys[i-1]);
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 5f0f653..70a9c30 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -63,7 +63,7 @@
 
 static SkFlattenable* load_flattenable(const SkDescriptor* desc, uint32_t tag,
                                        SkFlattenable::Type ft) {
-    SkFlattenable*  obj = NULL;
+    SkFlattenable*  obj = nullptr;
     uint32_t        len;
     const void*     data = desc->findEntry(tag, &len);
 
@@ -76,7 +76,7 @@
 }
 
 SkScalerContext::SkScalerContext(SkTypeface* typeface, const SkDescriptor* desc)
-    : fRec(*static_cast<const Rec*>(desc->findEntry(kRec_SkDescriptorTag, NULL)))
+    : fRec(*static_cast<const Rec*>(desc->findEntry(kRec_SkDescriptorTag, nullptr)))
 
     , fTypeface(SkRef(typeface))
     , fPathEffect(static_cast<SkPathEffect*>(load_flattenable(desc, kPathEffect_SkDescriptorTag,
@@ -86,7 +86,7 @@
     , fRasterizer(static_cast<SkRasterizer*>(load_flattenable(desc, kRasterizer_SkDescriptorTag,
                                              SkFlattenable::kSkRasterizer_Type)))
       // Initialize based on our settings. Subclasses can also force this.
-    , fGenerateImageFromPath(fRec.fFrameWidth > 0 || fPathEffect != NULL || fRasterizer != NULL)
+    , fGenerateImageFromPath(fRec.fFrameWidth > 0 || fPathEffect != nullptr || fRasterizer != nullptr)
 
     , fPreBlend(fMaskFilter ? SkMaskGamma::PreBlend() : SkScalerContext::GetMaskPreBlend(fRec))
     , fPreBlendForFilter(fMaskFilter ? SkScalerContext::GetMaskPreBlend(fRec)
@@ -103,8 +103,8 @@
         rec->fFrameWidth, rec->fMiterLimit, rec->fHints, rec->fFrameAndFill,
         rec->fMaskFormat, rec->fStrokeJoin);
     SkDebugf("  pathEffect %x maskFilter %x\n",
-             desc->findEntry(kPathEffect_SkDescriptorTag, NULL),
-        desc->findEntry(kMaskFilter_SkDescriptorTag, NULL));
+             desc->findEntry(kPathEffect_SkDescriptorTag, nullptr),
+        desc->findEntry(kMaskFilter_SkDescriptorTag, nullptr));
 #endif
 }
 
@@ -154,7 +154,7 @@
         if (fRasterizer) {
             SkMask  mask;
 
-            if (fRasterizer->rasterize(fillPath, fillToDevMatrix, NULL,
+            if (fRasterizer->rasterize(fillPath, fillToDevMatrix, nullptr,
                                        fMaskFilter, &mask,
                                        SkMask::kJustComputeBounds_CreateMode)) {
                 glyph->fLeft    = mask.fBounds.fLeft;
@@ -206,12 +206,12 @@
         glyph->toMask(&src);
         fRec.getMatrixFrom2x2(&matrix);
 
-        src.fImage = NULL;  // only want the bounds from the filter
-        if (fMaskFilter->filterMask(&dst, src, matrix, NULL)) {
+        src.fImage = nullptr;  // only want the bounds from the filter
+        if (fMaskFilter->filterMask(&dst, src, matrix, nullptr)) {
             if (dst.fBounds.isEmpty() || !dst.fBounds.is16Bit()) {
                 goto SK_ERROR;
             }
-            SkASSERT(dst.fImage == NULL);
+            SkASSERT(dst.fImage == nullptr);
             glyph->fLeft    = dst.fBounds.fLeft;
             glyph->fTop     = dst.fBounds.fTop;
             glyph->fWidth   = SkToU16(dst.fBounds.width());
@@ -485,7 +485,7 @@
 
         // need the original bounds, sans our maskfilter
         SkMaskFilter* mf = fMaskFilter;
-        fMaskFilter = NULL;             // temp disable
+        fMaskFilter = nullptr;             // temp disable
         this->getMetrics(&tmpGlyph);
         fMaskFilter = mf;               // restore
 
@@ -514,7 +514,7 @@
             mask.fFormat = SkMask::kA8_Format;
             sk_bzero(glyph->fImage, mask.computeImageSize());
 
-            if (!fRasterizer->rasterize(fillPath, fillToDevMatrix, NULL,
+            if (!fRasterizer->rasterize(fillPath, fillToDevMatrix, nullptr,
                                         fMaskFilter, &mask,
                                         SkMask::kJustRenderImage_CreateMode)) {
                 return;
@@ -553,7 +553,7 @@
 
         fRec.getMatrixFrom2x2(&matrix);
 
-        if (fMaskFilter->filterMask(&dstM, srcM, matrix, NULL)) {
+        if (fMaskFilter->filterMask(&dstM, srcM, matrix, nullptr)) {
             int width = SkFastMin32(origGlyph.fWidth, dstM.fBounds.width());
             int height = SkFastMin32(origGlyph.fHeight, dstM.fBounds.height());
             int dstRB = origGlyph.rowBytes();
@@ -585,7 +585,7 @@
 }
 
 void SkScalerContext::getPath(const SkGlyph& glyph, SkPath* path) {
-    this->internalGetPath(glyph, NULL, path, NULL);
+    this->internalGetPath(glyph, nullptr, path, nullptr);
 }
 
 void SkScalerContext::getFontMetrics(SkPaint::FontMetrics* fm) {
@@ -611,7 +611,7 @@
         }
     }
 
-    if (fRec.fFrameWidth > 0 || fPathEffect != NULL) {
+    if (fRec.fFrameWidth > 0 || fPathEffect != nullptr) {
         // need the path in user-space, with only the point-size applied
         // so that our stroking and effects will operate the same way they
         // would if the user had extracted the path themself, and then
@@ -641,7 +641,7 @@
 
         if (fPathEffect) {
             SkPath effectPath;
-            if (fPathEffect->filterPath(&effectPath, localPath, &rec, NULL)) {
+            if (fPathEffect->filterPath(&effectPath, localPath, &rec, nullptr)) {
                 localPath.swap(effectPath);
             }
         }
@@ -668,7 +668,7 @@
             fillToDevMatrix->reset();
         }
         if (devPath) {
-            if (fillPath == NULL) {
+            if (fillPath == nullptr) {
                 devPath->swap(path);
             } else {
                 *devPath = path;
diff --git a/src/core/SkScalerContext.h b/src/core/SkScalerContext.h
index 6addf73..302698e 100644
--- a/src/core/SkScalerContext.h
+++ b/src/core/SkScalerContext.h
@@ -113,7 +113,7 @@
      *  The 'total' matrix is also (optionally) available. This is useful in cases where the
      *  underlying library will not be used, often when working directly with font data.
      *
-     *  The parameters 'scale' and 'remaining' are required, the other pointers may be NULL.
+     *  The parameters 'scale' and 'remaining' are required, the other pointers may be nullptr.
      *
      *  @param preMatrixScale the kind of scale to extract from the total matrix.
      *  @param scale the scale extracted from the total matrix (both values positive).
@@ -124,9 +124,9 @@
      */
     void computeMatrices(PreMatrixScale preMatrixScale,
                          SkVector* scale, SkMatrix* remaining,
-                         SkMatrix* remainingWithoutRotation = NULL,
-                         SkMatrix* remainingRotation = NULL,
-                         SkMatrix* total = NULL);
+                         SkMatrix* remainingWithoutRotation = nullptr,
+                         SkMatrix* remainingRotation = nullptr,
+                         SkMatrix* total = nullptr);
 
     inline SkPaint::Hinting getHinting() const;
     inline void setHinting(SkPaint::Hinting);
@@ -319,7 +319,7 @@
                          SkPath* devPath, SkMatrix* fillToDevMatrix);
 
     // returns the right context from our link-list for this char. If no match
-    // is found it returns NULL. If a match is found then the glyphID param is
+    // is found it returns nullptr. If a match is found then the glyphID param is
     // set to the glyphID that maps to the provided char.
     SkScalerContext* getContextFromChar(SkUnichar uni, uint16_t* glyphID);
 
diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp
index 3f95a68..6ea6b8b 100644
--- a/src/core/SkScan_AntiPath.cpp
+++ b/src/core/SkScan_AntiPath.cpp
@@ -686,7 +686,7 @@
     SkScanClipper   clipper(blitter, clipRgn, ir);
     const SkIRect*  clipRect = clipper.getClipRect();
 
-    if (clipper.getBlitter() == NULL) { // clipped out
+    if (clipper.getBlitter() == nullptr) { // clipped out
         if (isInverse) {
             blitter->blitRegion(*clipRgn);
         }
@@ -700,7 +700,7 @@
         sk_blit_above(blitter, ir, *clipRgn);
     }
 
-    SkIRect superRect, *superClipRect = NULL;
+    SkIRect superRect, *superClipRect = nullptr;
 
     if (clipRect) {
         superRect.set(  clipRect->fLeft << SHIFT, clipRect->fTop << SHIFT,
diff --git a/src/core/SkScan_Antihair.cpp b/src/core/SkScan_Antihair.cpp
index 2bcb4c6..beddf63 100644
--- a/src/core/SkScan_Antihair.cpp
+++ b/src/core/SkScan_Antihair.cpp
@@ -17,13 +17,13 @@
 /*  Our attempt to compute the worst case "bounds" for the horizontal and
     vertical cases has some numerical bug in it, and we sometimes undervalue
     our extends. The bug is that when this happens, we will set the clip to
-    NULL (for speed), and thus draw outside of the clip by a pixel, which might
+    nullptr (for speed), and thus draw outside of the clip by a pixel, which might
     only look bad, but it might also access memory outside of the valid range
     allcoated for the device bitmap.
 
     This define enables our fix to outset our "bounds" by 1, thus avoiding the
     chance of the bug, but at the cost of sometimes taking the rectblitter
-    case (i.e. not setting the clip to NULL) when we might not actually need
+    case (i.e. not setting the clip to nullptr) when we might not actually need
     to. If we can improve/fix the actual calculations, then we can remove this
     step.
  */
@@ -88,7 +88,7 @@
 
 class SkAntiHairBlitter {
 public:
-    SkAntiHairBlitter() : fBlitter(NULL) {}
+    SkAntiHairBlitter() : fBlitter(nullptr) {}
     virtual ~SkAntiHairBlitter() {}
 
     SkBlitter* getBlitter() const { return fBlitter; }
@@ -340,7 +340,7 @@
     Horish_SkAntiHairBlitter    horish_blitter;
     VLine_SkAntiHairBlitter     vline_blitter;
     Vertish_SkAntiHairBlitter   vertish_blitter;
-    SkAntiHairBlitter*          hairBlitter = NULL;
+    SkAntiHairBlitter*          hairBlitter = nullptr;
 
     if (SkAbs32(x1 - x0) > SkAbs32(y1 - y0)) {   // mostly horizontal
         if (x0 > x1) {    // we want to go left-to-right
@@ -412,7 +412,7 @@
                 return;
             }
             if (clip->fTop <= top && clip->fBottom >= bottom) {
-                clip = NULL;
+                clip = nullptr;
             }
         }
     } else {   // mostly vertical
@@ -488,7 +488,7 @@
                 return;
             }
             if (clip->fLeft <= left && clip->fRight >= right) {
-                clip = NULL;
+                clip = nullptr;
             }
         }
     }
@@ -526,7 +526,7 @@
         return;
     }
 
-    SkASSERT(clip == NULL || !clip->getBounds().isEmpty());
+    SkASSERT(clip == nullptr || !clip->getBounds().isEmpty());
 
 #ifdef TEST_GAMMA
     build_gamma_table();
@@ -595,7 +595,7 @@
             }
             // fall through to no-clip case
         }
-        do_anti_hairline(x0, y0, x1, y1, NULL, blitter);
+        do_anti_hairline(x0, y0, x1, y1, nullptr, blitter);
     }
 }
 
@@ -699,7 +699,7 @@
 
 void SkScan::AntiFillXRect(const SkXRect& xr, const SkRegion* clip,
                           SkBlitter* blitter) {
-    if (NULL == clip) {
+    if (nullptr == clip) {
         antifillrect(xr, blitter);
     } else {
         SkIRect outerBounds;
@@ -745,7 +745,7 @@
         XRect_roundOut(xr, &outerBounds);
 
         if (clip.quickContains(outerBounds)) {
-            AntiFillXRect(xr, NULL, blitter);
+            AntiFillXRect(xr, nullptr, blitter);
         } else {
             SkAAClipBlitterWrapper wrapper(clip, blitter);
             blitter = wrapper.getBlitter();
diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp
index eeac5cd..7a6e3ba 100644
--- a/src/core/SkScan_Hairline.cpp
+++ b/src/core/SkScan_Hairline.cpp
@@ -355,7 +355,7 @@
     }
 
     SkAAClipBlitterWrapper wrap;
-    const SkRegion* clip = NULL;
+    const SkRegion* clip = nullptr;
 
     {
         const SkIRect ibounds = path.getBounds().roundOut().makeOutset(1, 1);
@@ -462,7 +462,7 @@
     if (clip.isBW()) {
         HairLineRgn(pts, count, &clip.bwRgn(), blitter);
     } else {
-        const SkRegion* clipRgn = NULL;
+        const SkRegion* clipRgn = nullptr;
 
         SkRect r;
         r.set(pts, count);
@@ -483,7 +483,7 @@
     if (clip.isBW()) {
         AntiHairLineRgn(pts, count, &clip.bwRgn(), blitter);
     } else {
-        const SkRegion* clipRgn = NULL;
+        const SkRegion* clipRgn = nullptr;
 
         SkRect r;
         r.set(pts, count);
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp
index b7db3b4..fc79fc8 100644
--- a/src/core/SkScan_Path.cpp
+++ b/src/core/SkScan_Path.cpp
@@ -346,7 +346,7 @@
     }
     const SkPixmap* justAnOpaqueColor(uint32_t* value) override {
         SkDEBUGFAIL("justAnOpaqueColor unexpected");
-        return NULL;
+        return nullptr;
     }
 
 private:
@@ -437,14 +437,14 @@
     // this returns the first and last edge after they're sorted into a dlink list
     SkEdge* edge = sort_edges(list, count, &last);
 
-    headEdge.fPrev = NULL;
+    headEdge.fPrev = nullptr;
     headEdge.fNext = edge;
     headEdge.fFirstY = kEDGE_HEAD_Y;
     headEdge.fX = SK_MinS32;
     edge->fPrev = &headEdge;
 
     tailEdge.fPrev = last;
-    tailEdge.fNext = NULL;
+    tailEdge.fNext = nullptr;
     tailEdge.fFirstY = kEDGE_TAIL_Y;
     last->fNext = &tailEdge;
 
@@ -460,7 +460,7 @@
     }
 
     InverseBlitter  ib;
-    PrePostProc     proc = NULL;
+    PrePostProc     proc = nullptr;
 
     if (path.isInverseFillType()) {
         ib.setBlitter(blitter, clipRgn.getBounds(), shiftEdgesUp);
@@ -468,9 +468,9 @@
         proc = PrePostInverseBlitterProc;
     }
 
-    if (path.isConvex() && (NULL == proc)) {
+    if (path.isConvex() && (nullptr == proc)) {
         SkASSERT(count >= 2);   // convex walker does not handle missing right edges
-        walk_convex_edges(&headEdge, path.getFillType(), blitter, start_y, stop_y, NULL);
+        walk_convex_edges(&headEdge, path.getFillType(), blitter, start_y, stop_y, nullptr);
     } else {
         int rightEdge;
         if (clipRect) {
@@ -518,8 +518,8 @@
  */
 SkScanClipper::SkScanClipper(SkBlitter* blitter, const SkRegion* clip,
                              const SkIRect& ir, bool skipRejectTest) {
-    fBlitter = NULL;     // null means blit nothing
-    fClipRect = NULL;
+    fBlitter = nullptr;     // null means blit nothing
+    fClipRect = nullptr;
 
     if (clip) {
         fClipRect = &clip->getBounds();
@@ -529,7 +529,7 @@
 
         if (clip->isRect()) {
             if (fClipRect->contains(ir)) {
-                fClipRect = NULL;
+                fClipRect = nullptr;
             } else {
                 // only need a wrapper blitter if we're horizontally clipped
                 if (fClipRect->fLeft > ir.fLeft || fClipRect->fRight < ir.fRight) {
@@ -653,14 +653,14 @@
     // this returns the first and last edge after they're sorted into a dlink list
     SkEdge* edge = sort_edges(list, count, &last);
 
-    headEdge.fPrev = NULL;
+    headEdge.fPrev = nullptr;
     headEdge.fNext = edge;
     headEdge.fFirstY = kEDGE_HEAD_Y;
     headEdge.fX = SK_MinS32;
     edge->fPrev = &headEdge;
 
     tailEdge.fPrev = last;
-    tailEdge.fNext = NULL;
+    tailEdge.fNext = nullptr;
     tailEdge.fFirstY = kEDGE_TAIL_Y;
     last->fNext = &tailEdge;
 
@@ -673,8 +673,8 @@
     if (clipRect && start_y < clipRect->fTop) {
         start_y = clipRect->fTop;
     }
-    walk_convex_edges(&headEdge, SkPath::kEvenOdd_FillType, blitter, start_y, stop_y, NULL);
-//    walk_edges(&headEdge, SkPath::kEvenOdd_FillType, blitter, start_y, stop_y, NULL);
+    walk_convex_edges(&headEdge, SkPath::kEvenOdd_FillType, blitter, start_y, stop_y, nullptr);
+//    walk_edges(&headEdge, SkPath::kEvenOdd_FillType, blitter, start_y, stop_y, nullptr);
 }
 
 void SkScan::FillTriangle(const SkPoint pts[], const SkRasterClip& clip,
diff --git a/src/core/SkSemaphore.cpp b/src/core/SkSemaphore.cpp
index 29d0e01..5efdd2e 100644
--- a/src/core/SkSemaphore.cpp
+++ b/src/core/SkSemaphore.cpp
@@ -25,15 +25,15 @@
         HANDLE fSemaphore;
 
         OSSemaphore()  {
-            fSemaphore = CreateSemaphore(NULL    /*security attributes, optional*/,
+            fSemaphore = CreateSemaphore(nullptr    /*security attributes, optional*/,
                                          0       /*initial count*/,
                                          MAXLONG /*max count*/,
-                                         NULL    /*name, optional*/);
+                                         nullptr    /*name, optional*/);
         }
         ~OSSemaphore() { CloseHandle(fSemaphore); }
 
         void signal(int n) {
-            ReleaseSemaphore(fSemaphore, n, NULL/*returns previous count, optional*/);
+            ReleaseSemaphore(fSemaphore, n, nullptr/*returns previous count, optional*/);
         }
         void wait() { WaitForSingleObject(fSemaphore, INFINITE/*timeout in ms*/); }
     };
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index 6da73fc..51a8017 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -75,7 +75,7 @@
 
 bool SkShader::asLuminanceColor(SkColor* colorPtr) const {
     SkColor storage;
-    if (NULL == colorPtr) {
+    if (nullptr == colorPtr) {
         colorPtr = &storage;
     }
     if (this->onAsLuminanceColor(colorPtr)) {
@@ -86,14 +86,14 @@
 }
 
 SkShader::Context* SkShader::createContext(const ContextRec& rec, void* storage) const {
-    if (!this->computeTotalInverse(rec, NULL)) {
-        return NULL;
+    if (!this->computeTotalInverse(rec, nullptr)) {
+        return nullptr;
     }
     return this->onCreateContext(rec, storage);
 }
 
 SkShader::Context* SkShader::onCreateContext(const ContextRec& rec, void*) const {
-    return NULL;
+    return nullptr;
 }
 
 size_t SkShader::contextSize() const {
@@ -114,7 +114,7 @@
 SkShader::Context::~Context() {}
 
 SkShader::Context::ShadeProc SkShader::Context::asAShadeProc(void** ctx) {
-    return NULL;
+    return nullptr;
 }
 
 #include "SkColorPriv.h"
@@ -195,7 +195,7 @@
     MatrixClass mc = kLinear_MatrixClass;
 
     if (mat.hasPerspective()) {
-        if (mat.fixedStepInX(0, NULL, NULL)) {
+        if (mat.fixedStepInX(0, nullptr, nullptr)) {
             mc = kFixedStepInX_MatrixClass;
         } else {
             mc = kPerspective_MatrixClass;
@@ -221,7 +221,7 @@
 }
 
 SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const {
-    return NULL;
+    return nullptr;
 }
 
 SkShader* SkShader::CreateEmptyShader() { return new SkEmptyShader; }
@@ -230,7 +230,7 @@
 
 SkShader* SkShader::CreateBitmapShader(const SkBitmap& src, TileMode tmx, TileMode tmy,
                                        const SkMatrix* localMatrix) {
-    return SkCreateBitmapShader(src, tmx, tmy, localMatrix, NULL);
+    return SkCreateBitmapShader(src, tmx, tmy, localMatrix, nullptr);
 }
 
 SkShader* SkShader::CreatePictureShader(const SkPicture* src, TileMode tmx, TileMode tmy,
@@ -339,7 +339,7 @@
 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint& paint, const SkMatrix&,
                                         const SkMatrix*, GrColor* paintColor,
                                         GrProcessorDataManager*, GrFragmentProcessor** fp) const {
-    *fp = NULL;
+    *fp = nullptr;
     SkColor skColor = fColor;
     U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha());
     *paintColor = SkColor2GrColor(SkColorSetA(skColor, newA));
diff --git a/src/core/SkSmallAllocator.h b/src/core/SkSmallAllocator.h
index a2c132a..c7977d3 100644
--- a/src/core/SkSmallAllocator.h
+++ b/src/core/SkSmallAllocator.h
@@ -21,7 +21,7 @@
  *  Template class for allocating small objects without additional heap memory
  *  allocations. kMaxObjects is a hard limit on the number of objects that can
  *  be allocated using this class. After that, attempts to create more objects
- *  with this class will assert and return NULL.
+ *  with this class will assert and return nullptr.
  *  kTotalBytes is the total number of bytes provided for storage for all
  *  objects created by this allocator. If an object to be created is larger
  *  than the storage (minus storage already used), it will be allocated on the
@@ -44,7 +44,7 @@
             Rec* rec = &fRecs[fNumObjects];
             rec->fKillProc(rec->fObj);
             // Safe to do if fObj is in fStorage, since fHeapStorage will
-            // point to NULL.
+            // point to nullptr.
             sk_free(rec->fHeapStorage);
         }
     }
@@ -54,14 +54,14 @@
      *  SkSmallAllocator.
      *  Each version behaves the same but takes a different number of
      *  arguments.
-     *  Note: If kMaxObjects have been created by this SkSmallAllocator, NULL
+     *  Note: If kMaxObjects have been created by this SkSmallAllocator, nullptr
      *  will be returned.
      */
     template<typename T>
     T* createT() {
         void* buf = this->reserveT<T>();
-        if (NULL == buf) {
-            return NULL;
+        if (nullptr == buf) {
+            return nullptr;
         }
         new (buf) T;
         return static_cast<T*>(buf);
@@ -69,8 +69,8 @@
 
     template<typename T, typename A1> T* createT(const A1& a1) {
         void* buf = this->reserveT<T>();
-        if (NULL == buf) {
-            return NULL;
+        if (nullptr == buf) {
+            return nullptr;
         }
         new (buf) T(a1);
         return static_cast<T*>(buf);
@@ -79,8 +79,8 @@
     template<typename T, typename A1, typename A2>
     T* createT(const A1& a1, const A2& a2) {
         void* buf = this->reserveT<T>();
-        if (NULL == buf) {
-            return NULL;
+        if (nullptr == buf) {
+            return nullptr;
         }
         new (buf) T(a1, a2);
         return static_cast<T*>(buf);
@@ -89,8 +89,8 @@
     template<typename T, typename A1, typename A2, typename A3>
     T* createT(const A1& a1, const A2& a2, const A3& a3) {
         void* buf = this->reserveT<T>();
-        if (NULL == buf) {
-            return NULL;
+        if (nullptr == buf) {
+            return nullptr;
         }
         new (buf) T(a1, a2, a3);
         return static_cast<T*>(buf);
@@ -99,8 +99,8 @@
     template<typename T, typename A1, typename A2, typename A3, typename A4>
     T* createT(const A1& a1, const A2& a2, const A3& a3, const A4& a4) {
         void* buf = this->reserveT<T>();
-        if (NULL == buf) {
-            return NULL;
+        if (nullptr == buf) {
+            return nullptr;
         }
         new (buf) T(a1, a2, a3, a4);
         return static_cast<T*>(buf);
@@ -117,7 +117,7 @@
         SkASSERT(fNumObjects < kMaxObjects);
         SkASSERT(storageRequired >= sizeof(T));
         if (kMaxObjects == fNumObjects) {
-            return NULL;
+            return nullptr;
         }
         const size_t storageRemaining = SkAlign4(kTotalBytes) - fStorageUsed;
         storageRequired = SkAlign4(storageRequired);
@@ -133,7 +133,7 @@
         } else {
             // There is space in fStorage.
             rec->fStorageSize = storageRequired;
-            rec->fHeapStorage = NULL;
+            rec->fHeapStorage = nullptr;
             SkASSERT(SkIsAlign4(fStorageUsed));
             rec->fObj = static_cast<void*>(fStorage + (fStorageUsed / 4));
             fStorageUsed += storageRequired;
diff --git a/src/core/SkSpriteBlitter_ARGB32.cpp b/src/core/SkSpriteBlitter_ARGB32.cpp
index 962e2ac..9c47844 100644
--- a/src/core/SkSpriteBlitter_ARGB32.cpp
+++ b/src/core/SkSpriteBlitter_ARGB32.cpp
@@ -69,7 +69,7 @@
         SkSafeRef(fXfermode);
 
         fBufferSize = 0;
-        fBuffer = NULL;
+        fBuffer = nullptr;
 
         unsigned flags32 = 0;
         if (255 != paint.getAlpha()) {
@@ -137,7 +137,7 @@
             }
 
             if (xfermode) {
-                xfermode->xfer32(dst, tmp, width, NULL);
+                xfermode->xfer32(dst, tmp, width, nullptr);
             } else {
                 fProc32(dst, tmp, width, fAlpha);
             }
@@ -182,7 +182,7 @@
                 colorFilter->filterSpan(buffer, width, buffer);
             }
             if (xfermode) {
-                xfermode->xfer32(dst, buffer, width, NULL);
+                xfermode->xfer32(dst, buffer, width, nullptr);
             } else {
                 fProc32(dst, buffer, width, fAlpha);
             }
@@ -258,21 +258,21 @@
 
 SkSpriteBlitter* SkSpriteBlitter::ChooseD32(const SkPixmap& source, const SkPaint& paint,
         SkTBlitterAllocator* allocator) {
-    SkASSERT(allocator != NULL);
+    SkASSERT(allocator != nullptr);
 
-    if (paint.getMaskFilter() != NULL) {
-        return NULL;
+    if (paint.getMaskFilter() != nullptr) {
+        return nullptr;
     }
 
     U8CPU       alpha = paint.getAlpha();
     SkXfermode* xfermode = paint.getXfermode();
     SkColorFilter* filter = paint.getColorFilter();
-    SkSpriteBlitter* blitter = NULL;
+    SkSpriteBlitter* blitter = nullptr;
 
     switch (source.colorType()) {
         case kARGB_4444_SkColorType:
             if (alpha != 0xFF) {
-                return NULL;    // we only have opaque sprites
+                return nullptr;    // we only have opaque sprites
             }
             if (xfermode || filter) {
                 blitter = allocator->createT<Sprite_D32_S4444_XferFilter>(source, paint);
diff --git a/src/core/SkSpriteBlitter_RGB16.cpp b/src/core/SkSpriteBlitter_RGB16.cpp
index 677dbaa..4dd4164 100644
--- a/src/core/SkSpriteBlitter_RGB16.cpp
+++ b/src/core/SkSpriteBlitter_RGB16.cpp
@@ -299,21 +299,21 @@
 SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkPixmap& source, const SkPaint& paint,
                                             SkTBlitterAllocator* allocator) {
 
-    SkASSERT(allocator != NULL);
+    SkASSERT(allocator != nullptr);
 
-    if (paint.getMaskFilter() != NULL) { // may add cases for this
-        return NULL;
+    if (paint.getMaskFilter() != nullptr) { // may add cases for this
+        return nullptr;
     }
-    if (paint.getXfermode() != NULL) { // may add cases for this
-        return NULL;
+    if (paint.getXfermode() != nullptr) { // may add cases for this
+        return nullptr;
     }
-    if (paint.getColorFilter() != NULL) { // may add cases for this
-        return NULL;
+    if (paint.getColorFilter() != nullptr) { // may add cases for this
+        return nullptr;
     }
 
     const SkAlphaType at = source.alphaType();
 
-    SkSpriteBlitter* blitter = NULL;
+    SkSpriteBlitter* blitter = nullptr;
     unsigned alpha = paint.getAlpha();
 
     switch (source.colorType()) {
diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp
index 8b2e8ab..5a66399 100644
--- a/src/core/SkStream.cpp
+++ b/src/core/SkStream.cpp
@@ -181,7 +181,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SkFILEStream::SkFILEStream(const char file[]) : fName(file), fOwnership(kCallerPasses_Ownership) {
-    fFILE = file ? sk_fopen(fName.c_str(), kRead_SkFILE_Flag) : NULL;
+    fFILE = file ? sk_fopen(fName.c_str(), kRead_SkFILE_Flag) : nullptr;
 }
 
 SkFILEStream::SkFILEStream(FILE* file, Ownership ownership)
@@ -199,7 +199,7 @@
     fName.set(path);
     if (fFILE) {
         sk_fclose(fFILE);
-        fFILE = NULL;
+        fFILE = nullptr;
     }
     if (path) {
         fFILE = sk_fopen(fName.c_str(), kRead_SkFILE_Flag);
@@ -224,13 +224,13 @@
         }
         // we hit an error
         sk_fclose(fFILE);
-        fFILE = NULL;
+        fFILE = nullptr;
     }
     return false;
 }
 
 SkStreamAsset* SkFILEStream::duplicate() const {
-    if (NULL == fFILE) {
+    if (nullptr == fFILE) {
         return new SkMemoryStream();
     }
 
@@ -246,8 +246,8 @@
     }
 
     fData.reset(SkData::NewFromFILE(fFILE));
-    if (NULL == fData.get()) {
-        return NULL;
+    if (nullptr == fData.get()) {
+        return nullptr;
     }
     return new SkMemoryStream(fData);
 }
@@ -275,8 +275,8 @@
 }
 
 const void* SkFILEStream::getMemoryBase() {
-    if (NULL == fData.get()) {
-        return NULL;
+    if (nullptr == fData.get()) {
+        return nullptr;
     }
     return fData->data();
 }
@@ -307,7 +307,7 @@
 }
 
 SkMemoryStream::SkMemoryStream(SkData* data) {
-    if (NULL == data) {
+    if (nullptr == data) {
         fData = SkData::NewEmpty();
     } else {
         fData = data;
@@ -339,7 +339,7 @@
 
 SkData* SkMemoryStream::setData(SkData* data) {
     fData->unref();
-    if (NULL == data) {
+    if (nullptr == data) {
         fData = SkData::NewEmpty();
     } else {
         fData = data;
@@ -368,7 +368,7 @@
 }
 
 bool SkMemoryStream::peek(void* buffer, size_t size) const {
-    SkASSERT(buffer != NULL);
+    SkASSERT(buffer != nullptr);
     const size_t position = fOffset;
     if (size > fData->size() - position) {
         // The stream is not large enough to satisfy this request.
@@ -446,7 +446,7 @@
 
 bool SkFILEWStream::write(const void* buffer, size_t size)
 {
-    if (fFILE == NULL) {
+    if (fFILE == nullptr) {
         return false;
     }
 
@@ -454,7 +454,7 @@
     {
         SkDEBUGCODE(SkDebugf("SkFILEWStream failed writing %d bytes\n", size);)
         sk_fclose(fFILE);
-        fFILE = NULL;
+        fFILE = nullptr;
         return false;
     }
     return true;
@@ -500,7 +500,7 @@
 
     void init(size_t size)
     {
-        fNext = NULL;
+        fNext = nullptr;
         fCurr = this->start();
         fStop = this->start() + size;
     }
@@ -515,7 +515,7 @@
 };
 
 SkDynamicMemoryWStream::SkDynamicMemoryWStream()
-    : fHead(NULL), fTail(NULL), fBytesWritten(0), fCopy(NULL)
+    : fHead(nullptr), fTail(nullptr), fBytesWritten(0), fCopy(nullptr)
 {
 }
 
@@ -530,12 +530,12 @@
 
     Block*  block = fHead;
 
-    while (block != NULL) {
+    while (block != nullptr) {
         Block*  next = block->fNext;
         sk_free(block);
         block = next;
     }
-    fHead = fTail = NULL;
+    fHead = fTail = nullptr;
     fBytesWritten = 0;
 }
 
@@ -548,7 +548,7 @@
 
         size_t  size;
 
-        if (fTail != NULL && fTail->avail() > 0) {
+        if (fTail != nullptr && fTail->avail() > 0) {
             size = SkTMin(fTail->avail(), count);
             buffer = fTail->append(buffer, size);
             SkASSERT(count >= size);
@@ -562,7 +562,7 @@
         block->init(size);
         block->append(buffer, count);
 
-        if (fTail != NULL)
+        if (fTail != nullptr)
             fTail->fNext = block;
         else
             fHead = fTail = block;
@@ -580,7 +580,7 @@
     this->invalidateCopy();
 
     Block* block = fHead;
-    while (block != NULL) {
+    while (block != nullptr) {
         size_t size = block->written();
         if (offset < size) {
             size_t part = offset + count > size ? size - offset : count;
@@ -601,7 +601,7 @@
     if (offset + count > fBytesWritten)
         return false; // test does not partially modify
     Block* block = fHead;
-    while (block != NULL) {
+    while (block != nullptr) {
         size_t size = block->written();
         if (offset < size) {
             size_t part = offset + count > size ? size - offset : count;
@@ -624,7 +624,7 @@
     } else {
         Block* block = fHead;
 
-        while (block != NULL) {
+        while (block != nullptr) {
             size_t size = block->written();
             memcpy(dst, block->start(), size);
             dst = (void*)((char*)dst + size);
@@ -634,7 +634,7 @@
 }
 
 void SkDynamicMemoryWStream::writeToStream(SkWStream* dst) const {
-    for (Block* block = fHead; block != NULL; block = block->fNext) {
+    for (Block* block = fHead; block != nullptr; block = block->fNext) {
         dst->write(block->start(), block->written());
     }
 }
@@ -650,7 +650,7 @@
 }
 
 SkData* SkDynamicMemoryWStream::copyToData() const {
-    if (NULL == fCopy) {
+    if (nullptr == fCopy) {
         SkData* data = SkData::NewUninitialized(fBytesWritten);
         // be sure to call copyTo() before we assign to fCopy
         this->copyTo(data->writable_data());
@@ -662,7 +662,7 @@
 void SkDynamicMemoryWStream::invalidateCopy() {
     if (fCopy) {
         fCopy->unref();
-        fCopy = NULL;
+        fCopy = nullptr;
     }
 }
 
@@ -672,7 +672,7 @@
 
     virtual ~SkBlockMemoryRefCnt() {
         SkDynamicMemoryWStream::Block* block = fHead;
-        while (block != NULL) {
+        while (block != nullptr) {
             SkDynamicMemoryWStream::Block* next = block->fNext;
             sk_free(block);
             block = next;
@@ -701,7 +701,7 @@
             count = fSize - fOffset;
         }
         size_t bytesLeftToRead = count;
-        while (fCurrent != NULL) {
+        while (fCurrent != nullptr) {
             size_t bytesLeftInCurrent = fCurrent->written() - fCurrentOffset;
             size_t bytesFromCurrent = SkTMin(bytesLeftToRead, bytesLeftInCurrent);
             if (buffer) {
@@ -726,7 +726,7 @@
     }
 
     bool peek(void* buff, size_t size) const override {
-        SkASSERT(buff != NULL);
+        SkASSERT(buff != nullptr);
         if (fOffset + size > fSize) {
             return false;
         }
@@ -795,10 +795,10 @@
     }
 
     const void* getMemoryBase() override {
-        if (NULL == fBlockMemory->fHead->fNext) {
+        if (nullptr == fBlockMemory->fHead->fNext) {
             return fBlockMemory->fHead->start();
         }
-        return NULL;
+        return nullptr;
     }
 
 private:
@@ -850,8 +850,8 @@
 
 static SkData* mmap_filename(const char path[]) {
     SkFILE* file = sk_fopen(path, kRead_SkFILE_Flag);
-    if (NULL == file) {
-        return NULL;
+    if (nullptr == file) {
+        return nullptr;
     }
 
     SkData* data = SkData::NewFromFILE(file);
@@ -870,15 +870,15 @@
     SkFILEStream* stream = new SkFILEStream(path);
     if (!stream->isValid()) {
         delete stream;
-        stream = NULL;
+        stream = nullptr;
     }
     return stream;
 }
 
 // Declared in SkStreamPriv.h:
 size_t SkCopyStreamToStorage(SkAutoMalloc* storage, SkStream* stream) {
-    SkASSERT(storage != NULL);
-    SkASSERT(stream != NULL);
+    SkASSERT(storage != nullptr);
+    SkASSERT(stream != nullptr);
 
     if (stream->hasLength()) {
         const size_t length = stream->getLength();
@@ -908,7 +908,7 @@
 
 // Declared in SkStreamPriv.h:
 SkData* SkCopyStreamToData(SkStream* stream) {
-    SkASSERT(stream != NULL);
+    SkASSERT(stream != nullptr);
 
     if (stream->hasLength()) {
         return SkData::NewFromStream(stream, stream->getLength());
@@ -926,7 +926,7 @@
 
 SkStreamRewindable* SkStreamRewindableFromSkStream(SkStream* stream) {
     if (!stream) {
-        return NULL;
+        return nullptr;
     }
     SkAutoTDelete<SkStreamRewindable> dupStream(stream->duplicate());
     if (dupStream) {
diff --git a/src/core/SkStreamPriv.h b/src/core/SkStreamPriv.h
index d1af117..b82f7d8 100644
--- a/src/core/SkStreamPriv.h
+++ b/src/core/SkStreamPriv.h
@@ -31,7 +31,7 @@
  *  @param stream SkStream to be copied into data.
  *  @return SkData* The resulting SkData after the copy. This data
  *      will have a ref count of one upon return and belongs to the
- *      caller. Returns NULL on failure.
+ *      caller. Returns nullptr on failure.
  */
 SkData *SkCopyStreamToData(SkStream* stream);
 
diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp
index 5c63a8b..9110d80 100644
--- a/src/core/SkString.cpp
+++ b/src/core/SkString.cpp
@@ -256,7 +256,7 @@
 }
 
 SkString::SkString(size_t len) {
-    fRec = AllocRec(NULL, len);
+    fRec = AllocRec(nullptr, len);
 }
 
 SkString::SkString(const char text[]) {
@@ -295,7 +295,7 @@
 }
 
 bool SkString::equals(const char text[], size_t len) const {
-    SkASSERT(len == 0 || text != NULL);
+    SkASSERT(len == 0 || text != nullptr);
 
     return fRec->fLength == len && !memcmp(fRec->data(), text, len);
 }
diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp
index 2db5bba..1689f97 100644
--- a/src/core/SkStroke.cpp
+++ b/src/core/SkStroke.cpp
@@ -296,11 +296,11 @@
             // cap the end
             fInner.getLastPt(&pt);
             fCapper(&fOuter, fPrevPt, fPrevNormal, pt,
-                    currIsLine ? &fInner : NULL);
+                    currIsLine ? &fInner : nullptr);
             fOuter.reversePathTo(fInner);
             // cap the start
             fCapper(&fOuter, fFirstPt, -fFirstNormal, fFirstOuterPt,
-                    fPrevIsLine ? &fInner : NULL);
+                    fPrevIsLine ? &fInner : nullptr);
             fOuter.close();
         }
     }
@@ -553,7 +553,7 @@
     }
     for (int index = 0; index < count; ++index) {
         SkScalar t = tValues[index];
-        SkEvalCubicAt(cubic, t, &reduction[index], NULL, NULL);
+        SkEvalCubicAt(cubic, t, &reduction[index], nullptr, nullptr);
     }
     static_assert(kQuad_ReductionType + 1 == kDegenerate_ReductionType, "enum_out_of_whack");
     static_assert(kQuad_ReductionType + 2 == kDegenerate2_ReductionType, "enum_out_of_whack");
@@ -589,7 +589,7 @@
         return kLine_ReductionType;
     }
 #endif
-    conic.evalAt(t, reduction, NULL);
+    conic.evalAt(t, reduction, nullptr);
     return kDegenerate_ReductionType;
 }
 
@@ -738,7 +738,7 @@
 bool SkPathStroker::cubicPerpRay(const SkPoint cubic[4], SkScalar t, SkPoint* tPt, SkPoint* onPt,
         SkPoint* tangent) const {
     SkVector dxy;
-    SkEvalCubicAt(cubic, t, tPt, &dxy, NULL);
+    SkEvalCubicAt(cubic, t, tPt, &dxy, nullptr);
     if (dxy.fX == 0 && dxy.fY == 0) {
         if (SkScalarNearlyZero(t)) {
             dxy = cubic[2] - cubic[0];
@@ -779,7 +779,7 @@
 bool SkPathStroker::cubicQuadMid(const SkPoint cubic[4], const SkQuadConstruct* quadPts,
         SkPoint* mid) const {
     SkPoint cubicMidPt;
-    return this->cubicPerpRay(cubic, quadPts->fMidT, &cubicMidPt, mid, NULL);
+    return this->cubicPerpRay(cubic, quadPts->fMidT, &cubicMidPt, mid, nullptr);
 }
 
 // Given a quad and t, return the point on curve, its perpendicular, and the perpendicular tangent.
@@ -976,7 +976,7 @@
     }
     // project a ray from the curve to the stroke
     SkPoint ray[2];  // points near midpoint on quad, midpoint on cubic
-    if (!this->cubicPerpRay(cubic, quadPts->fMidT, &ray[1], &ray[0], NULL)) {
+    if (!this->cubicPerpRay(cubic, quadPts->fMidT, &ray[1], &ray[0], nullptr)) {
         return kNormalError_ResultType;
     }
     return this->strokeCloseEnough(quadPts->fQuad, ray, quadPts
@@ -994,7 +994,7 @@
     }
     // project a ray from the curve to the stroke
     SkPoint ray[2];  // points near midpoint on quad, midpoint on conic
-    this->conicPerpRay(conic, quadPts->fMidT, &ray[1], &ray[0], NULL);
+    this->conicPerpRay(conic, quadPts->fMidT, &ray[1], &ray[0], nullptr);
     return this->strokeCloseEnough(quadPts->fQuad, ray, quadPts
             STROKER_DEBUG_PARAMS(fRecursionDepth));
 }
@@ -1021,7 +1021,7 @@
     }
     // project a ray from the curve to the stroke
     SkPoint ray[2];
-    this->quadPerpRay(quad, quadPts->fMidT, &ray[1], &ray[0], NULL);
+    this->quadPerpRay(quad, quadPts->fMidT, &ray[1], &ray[0], nullptr);
     return this->strokeCloseEnough(quadPts->fQuad, ray, quadPts
             STROKER_DEBUG_PARAMS(fRecursionDepth));
 }
@@ -1429,7 +1429,7 @@
 
 void SkStroke::strokeRect(const SkRect& origRect, SkPath* dst,
                           SkPath::Direction dir) const {
-    SkASSERT(dst != NULL);
+    SkASSERT(dst != nullptr);
     dst->reset();
 
     SkScalar radius = SkScalarHalf(fWidth);
diff --git a/src/core/SkTDPQueue.h b/src/core/SkTDPQueue.h
index a6784bb..1545f97 100644
--- a/src/core/SkTDPQueue.h
+++ b/src/core/SkTDPQueue.h
@@ -15,7 +15,7 @@
  * function that compares two Ts and returns true if the first is higher priority than the second.
  *
  * Optionally objects may know their index into the priority queue. The queue will update the index
- * as the objects move through the queue. This is enabled by using a non-NULL function for INDEX.
+ * as the objects move through the queue. This is enabled by using a non-nullptr function for INDEX.
  * When an INDEX function is provided random deletes from the queue are allowed using remove().
  * Additionally, the * priority is allowed to change as long as priorityDidChange() is called
  * afterwards. In debug builds the index will be set to -1 before an element is removed from the
@@ -23,7 +23,7 @@
  */
 template <typename T,
           bool (*LESS)(const T&, const T&),
-          int* (*INDEX)(const T&) = (int* (*)(const T&))NULL>
+          int* (*INDEX)(const T&) = (int* (*)(const T&))nullptr>
 class SkTDPQueue : public SkNoncopyable {
 public:
     SkTDPQueue() {}
@@ -62,9 +62,9 @@
         this->validate();
     }
 
-    /** Random access removal. This requires that the INDEX function is non-NULL. */
+    /** Random access removal. This requires that the INDEX function is non-nullptr. */
     void remove(T entry) {
-        SkASSERT(NULL != INDEX);
+        SkASSERT(nullptr != INDEX);
         int index = *INDEX(entry);
         SkASSERT(index >= 0 && index < fArray.count());
         this->validate();
@@ -84,7 +84,7 @@
         item's priority is changed to maintain correct ordering. Changing the priority is only
         allowed if an INDEX function is provided. */
     void priorityDidChange(T entry) {
-        SkASSERT(NULL != INDEX);
+        SkASSERT(nullptr != INDEX);
         int index = *INDEX(entry);
         SkASSERT(index >= 0 && index < fArray.count());
         this->validate(index);
diff --git a/src/core/SkTDynamicHash.h b/src/core/SkTDynamicHash.h
index 8def89b..2fa37b5 100644
--- a/src/core/SkTDynamicHash.h
+++ b/src/core/SkTDynamicHash.h
@@ -22,7 +22,7 @@
           int kGrowPercent = 75>  // Larger -> more memory efficient, but slower.
 class SkTDynamicHash {
 public:
-    SkTDynamicHash() : fCount(0), fDeleted(0), fCapacity(0), fArray(NULL) {
+    SkTDynamicHash() : fCount(0), fDeleted(0), fCapacity(0), fArray(nullptr) {
         SkASSERT(this->validate());
     }
 
@@ -86,14 +86,14 @@
 
     int count() const { return fCount; }
 
-    // Return the entry with this key if we have it, otherwise NULL.
+    // Return the entry with this key if we have it, otherwise nullptr.
     T* find(const Key& key) const {
         int index = this->firstIndex(key);
         for (int round = 0; round < fCapacity; round++) {
             SkASSERT(index >= 0 && index < fCapacity);
             T* candidate = fArray[index];
             if (Empty() == candidate) {
-                return NULL;
+                return nullptr;
             }
             if (Deleted() != candidate && GetKey(*candidate) == key) {
                 return candidate;
@@ -101,12 +101,12 @@
             index = this->nextIndex(index, round);
         }
         SkASSERT(fCapacity == 0);
-        return NULL;
+        return nullptr;
     }
 
     // Add an entry with this key.  We require that no entry with newEntry's key is already present.
     void add(T* newEntry) {
-        SkASSERT(NULL == this->find(GetKey(*newEntry)));
+        SkASSERT(nullptr == this->find(GetKey(*newEntry)));
         this->maybeGrow();
         this->innerAdd(newEntry);
         SkASSERT(this->validate());
@@ -132,7 +132,7 @@
         fDeleted = 0; 
         fCapacity = 0; 
         sk_free(fArray); 
-        fArray = NULL; 
+        fArray = nullptr; 
     }
 
 protected:
@@ -157,7 +157,7 @@
 
 private:
     // We have two special values to indicate an empty or deleted entry.
-    static T* Empty()   { return reinterpret_cast<T*>(0); }  // i.e. NULL
+    static T* Empty()   { return reinterpret_cast<T*>(0); }  // i.e. nullptr
     static T* Deleted() { return reinterpret_cast<T*>(1); }  // Also an invalid pointer.
 
     bool validate() const {
diff --git a/src/core/SkTLList.h b/src/core/SkTLList.h
index 3a91efe..ac7f0fa 100644
--- a/src/core/SkTLList.h
+++ b/src/core/SkTLList.h
@@ -103,13 +103,13 @@
     }
 
     /** Adds a new element to the list before the location indicated by the iterator. If the
-        iterator refers to a NULL location then the new element is added at the tail */
+        iterator refers to a nullptr location then the new element is added at the tail */
     T* addBefore(const T& t, const Iter& location) {
         return new (this->internalAddBefore(location)) T(t);
     }
 
     /** Adds a new element to the list after the location indicated by the iterator. If the
-        iterator refers to a NULL location then the new element is added at the head */
+        iterator refers to a nullptr location then the new element is added at the head */
     T* addAfter(const T& t, const Iter& location) {
         return new (this->internalAddAfter(location)) T(t);
     }
@@ -222,7 +222,7 @@
             if (node) {
                 return reinterpret_cast<T*>(node->fObj);
             } else {
-                return NULL;
+                return nullptr;
             }
         }
     };
diff --git a/src/core/SkTLS.cpp b/src/core/SkTLS.cpp
index b22446b..a47dc14 100755
--- a/src/core/SkTLS.cpp
+++ b/src/core/SkTLS.cpp
@@ -56,8 +56,8 @@
 }
 
 void* SkTLS::Get(CreateProc createProc, DeleteProc deleteProc) {
-    if (NULL == createProc) {
-        return NULL;
+    if (nullptr == createProc) {
+        return nullptr;
     }
 
     void* ptr = SkTLS::PlatformGetSpecific(true);
@@ -69,7 +69,7 @@
                 SkASSERT(rec->fDeleteProc == deleteProc);
                 return rec->fData;
             }
-        } while ((rec = rec->fNext) != NULL);
+        } while ((rec = rec->fNext) != nullptr);
         // not found, so create a new one
     }
 
@@ -86,8 +86,8 @@
 }
 
 void* SkTLS::Find(CreateProc createProc) {
-    if (NULL == createProc) {
-        return NULL;
+    if (nullptr == createProc) {
+        return nullptr;
     }
 
     void* ptr = SkTLS::PlatformGetSpecific(false);
@@ -98,20 +98,20 @@
             if (rec->fCreateProc == createProc) {
                 return rec->fData;
             }
-        } while ((rec = rec->fNext) != NULL);
+        } while ((rec = rec->fNext) != nullptr);
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkTLS::Delete(CreateProc createProc) {
-    if (NULL == createProc) {
+    if (nullptr == createProc) {
         return;
     }
 
     void* ptr = SkTLS::PlatformGetSpecific(false);
 
     SkTLSRec* curr = (SkTLSRec*)ptr;
-    SkTLSRec* prev = NULL;
+    SkTLSRec* prev = nullptr;
     while (curr) {
         SkTLSRec* next = curr->fNext;
         if (curr->fCreateProc == createProc) {
diff --git a/src/core/SkTLS.h b/src/core/SkTLS.h
index e94f835..ace2de5 100644
--- a/src/core/SkTLS.h
+++ b/src/core/SkTLS.h
@@ -20,7 +20,7 @@
 
     /**
      *  If Get() has previously been called with this CreateProc, then this
-     *  returns its cached data, otherwise it returns NULL. The CreateProc is
+     *  returns its cached data, otherwise it returns nullptr. The CreateProc is
      *  never invoked in Find, it is only used as a key for searching the
      *  cache.
      */
@@ -52,8 +52,8 @@
      *  Implemented by the platform, to return the value of our (one) slot per-thread
      *
      *  If forceCreateTheSlot is true, then we must have created the "slot" for
-     *  our TLS, even though we know that the return value will be NULL in that
-     *  case (i.e. no-slot and first-time-slot both return NULL). This ensures
+     *  our TLS, even though we know that the return value will be nullptr in that
+     *  case (i.e. no-slot and first-time-slot both return nullptr). This ensures
      *  that after calling GetSpecific, we know that we can legally call
      *  SetSpecific.
      *
diff --git a/src/core/SkTMultiMap.h b/src/core/SkTMultiMap.h
index 5f8589d..b0d04d5 100644
--- a/src/core/SkTMultiMap.h
+++ b/src/core/SkTMultiMap.h
@@ -20,7 +20,7 @@
           typename HashTraits=T>
 class SkTMultiMap {
     struct ValueList {
-        explicit ValueList(T* value) : fValue(value), fNext(NULL) {}
+        explicit ValueList(T* value) : fValue(value), fNext(nullptr) {}
 
         static const Key& GetKey(const ValueList& e) { return HashTraits::GetKey(*e.fValue); }
         static uint32_t Hash(const Key& key) { return HashTraits::Hash(key); }
@@ -58,7 +58,7 @@
         // Since we expect the caller to be fully aware of what is stored, just
         // assert that the caller removes an existing value.
         SkASSERT(list);
-        ValueList* prev = NULL;
+        ValueList* prev = nullptr;
         while (list->fValue != value) {
             prev = list;
             list = list->fNext;
@@ -70,7 +70,7 @@
             list->fNext = next->fNext;
             delete next;
         } else if (prev) {
-            prev->fNext = NULL;
+            prev->fNext = nullptr;
             delete list;
         } else {
             fHash.remove(key);
@@ -85,7 +85,7 @@
         if (list) {
             return list->fValue;
         }
-        return NULL;
+        return nullptr;
     }
 
     template<class FindPredicate>
@@ -97,7 +97,7 @@
             }
             list = list->fNext;
         }
-        return NULL;
+        return nullptr;
     }
 
     int count() const { return fCount; }
diff --git a/src/core/SkTSearch.cpp b/src/core/SkTSearch.cpp
index 64c70cb..5b5f139 100644
--- a/src/core/SkTSearch.cpp
+++ b/src/core/SkTSearch.cpp
@@ -22,7 +22,7 @@
     if (count <= 0)
         return ~0;
 
-    SkASSERT(base != NULL);
+    SkASSERT(base != nullptr);
 
     int lo = 0;
     int hi = count - 1;
diff --git a/src/core/SkTaskGroup.cpp b/src/core/SkTaskGroup.cpp
index 9462903..97e3ff4 100644
--- a/src/core/SkTaskGroup.cpp
+++ b/src/core/SkTaskGroup.cpp
@@ -122,7 +122,7 @@
         // Send a poison pill to each thread.
         SkAtomic<int> dummy(0);
         for (int i = 0; i < fThreads.count(); i++) {
-            this->add(NULL, NULL, &dummy);
+            this->add(nullptr, nullptr, &dummy);
         }
         // Wait for them all to swallow the pill and die.
         for (int i = 0; i < fThreads.count(); i++) {
@@ -197,12 +197,12 @@
 
     friend struct SkTaskGroup::Enabler;
 };
-ThreadPool* ThreadPool::gGlobal = NULL;
+ThreadPool* ThreadPool::gGlobal = nullptr;
 
 }  // namespace
 
 SkTaskGroup::Enabler::Enabler(int threads) {
-    SkASSERT(ThreadPool::gGlobal == NULL);
+    SkASSERT(ThreadPool::gGlobal == nullptr);
     if (threads != 0) {
         ThreadPool::gGlobal = new ThreadPool(threads);
     }
diff --git a/src/core/SkTextBlob.cpp b/src/core/SkTextBlob.cpp
index d2b1605..68784f4 100644
--- a/src/core/SkTextBlob.cpp
+++ b/src/core/SkTextBlob.cpp
@@ -244,7 +244,7 @@
 const SkTextBlob* SkTextBlob::CreateFromBuffer(SkReadBuffer& reader) {
     int runCount = reader.read32();
     if (runCount < 0) {
-        return NULL;
+        return nullptr;
     }
 
     SkRect bounds;
@@ -255,7 +255,7 @@
         int glyphCount = reader.read32();
         GlyphPositioning pos = static_cast<GlyphPositioning>(reader.read32());
         if (glyphCount <= 0 || pos > kFull_Positioning) {
-            return NULL;
+            return nullptr;
         }
 
         SkPoint offset;
@@ -263,7 +263,7 @@
         SkPaint font;
         reader.readPaint(&font);
 
-        const SkTextBlobBuilder::RunBuffer* buf = NULL;
+        const SkTextBlobBuilder::RunBuffer* buf = nullptr;
         switch (pos) {
         case kDefault_Positioning:
             buf = &blobBuilder.allocRun(font, glyphCount, offset.x(), offset.y(), &bounds);
@@ -275,13 +275,13 @@
             buf = &blobBuilder.allocRunPos(font, glyphCount, &bounds);
             break;
         default:
-            return NULL;
+            return nullptr;
         }
 
         if (!reader.readByteArray(buf->glyphs, glyphCount * sizeof(uint16_t)) ||
             !reader.readByteArray(buf->pos,
                                   glyphCount * sizeof(SkScalar) * ScalarsPerGlyph(pos))) {
-            return NULL;
+            return nullptr;
         }
     }
 
@@ -359,7 +359,7 @@
 }
 
 SkTextBlobBuilder::~SkTextBlobBuilder() {
-    if (NULL != fStorage.get()) {
+    if (nullptr != fStorage.get()) {
         // We are abandoning runs and must destruct the associated font data.
         // The easiest way to accomplish that is to use the blob destructor.
         build()->unref();
@@ -447,7 +447,7 @@
     }
 
     if (0 == fRunCount) {
-        SkASSERT(NULL == fStorage.get());
+        SkASSERT(nullptr == fStorage.get());
         SkASSERT(0 == fStorageSize);
         SkASSERT(0 == fStorageUsed);
 
@@ -573,12 +573,12 @@
 }
 
 const SkTextBlob* SkTextBlobBuilder::build() {
-    SkASSERT((fRunCount > 0) == (NULL != fStorage.get()));
+    SkASSERT((fRunCount > 0) == (nullptr != fStorage.get()));
 
     this->updateDeferredBounds();
 
     if (0 == fRunCount) {
-        SkASSERT(NULL == fStorage.get());
+        SkASSERT(nullptr == fStorage.get());
         fStorageUsed = sizeof(SkTextBlob);
         fStorage.realloc(fStorageUsed);
     }
diff --git a/src/core/SkTraceEvent.h b/src/core/SkTraceEvent.h
index 96b6620..05dc340 100644
--- a/src/core/SkTraceEvent.h
+++ b/src/core/SkTraceEvent.h
@@ -395,7 +395,7 @@
     unsigned char flags) {
   return TRACE_EVENT_API_ADD_TRACE_EVENT(
       phase, category_group_enabled, name, id,
-      kZeroNumArgs, NULL, NULL, NULL, flags);
+      kZeroNumArgs, nullptr, nullptr, nullptr, flags);
 }
 
 template<class ARG1_TYPE>
@@ -444,7 +444,7 @@
 class TRACE_EVENT_API_CLASS_EXPORT ScopedTracer {
  public:
   // Note: members of data_ intentionally left uninitialized. See Initialize.
-  ScopedTracer() : p_data_(NULL) {}
+  ScopedTracer() : p_data_(nullptr) {}
 
   ~ScopedTracer() {
     if (p_data_ && *data_.category_group_enabled)
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index 7da1118..81daf2f 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -21,7 +21,7 @@
 SkTypeface::~SkTypeface() { }
 
 
-SkTypeface* (*gCreateTypefaceDelegate)(const char [], SkTypeface::Style ) = NULL;
+SkTypeface* (*gCreateTypefaceDelegate)(const char [], SkTypeface::Style ) = nullptr;
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -31,14 +31,14 @@
 protected:
     SkEmptyTypeface() : SkTypeface(SkFontStyle(), 0, true) { }
 
-    SkStreamAsset* onOpenStream(int* ttcIndex) const override { return NULL; }
+    SkStreamAsset* onOpenStream(int* ttcIndex) const override { return nullptr; }
     SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override {
-        return NULL;
+        return nullptr;
     }
     void onFilterRec(SkScalerContextRec*) const override { }
     virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
                                 PerGlyphInfo,
-                                const uint32_t*, uint32_t) const override { return NULL; }
+                                const uint32_t*, uint32_t) const override { return nullptr; }
     void onGetFontDescriptor(SkFontDescriptor*, bool*) const override { }
     virtual int onCharsToGlyphs(const void* chars, Encoding encoding,
                                 uint16_t glyphs[], int glyphCount) const override {
@@ -78,7 +78,7 @@
     SkAutoMutexAcquire lock(&gCreateDefaultMutex);
 
     SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
-    SkTypeface* t = fm->legacyCreateTypeface(NULL, style);
+    SkTypeface* t = fm->legacyCreateTypeface(nullptr, style);
     return t ? t : SkEmptyTypeface::Create();
 }
 
@@ -99,7 +99,7 @@
 }
 
 uint32_t SkTypeface::UniqueID(const SkTypeface* face) {
-    if (NULL == face) {
+    if (nullptr == face) {
         face = GetDefaultTypeface();
     }
     return face->uniqueID();
@@ -118,7 +118,7 @@
             return result;
         }
     }
-    if (NULL == name) {
+    if (nullptr == name) {
         return RefDefault(style);
     }
     SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
@@ -202,7 +202,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 int SkTypeface::countTables() const {
-    return this->onGetTableTags(NULL);
+    return this->onGetTableTags(nullptr);
 }
 
 int SkTypeface::getTableTags(SkFontTableTag tags[]) const {
@@ -210,7 +210,7 @@
 }
 
 size_t SkTypeface::getTableSize(SkFontTableTag tag) const {
-    return this->onGetTableData(tag, 0, ~0U, NULL);
+    return this->onGetTableData(tag, 0, ~0U, nullptr);
 }
 
 size_t SkTypeface::getTableData(SkFontTableTag tag, size_t offset, size_t length,
@@ -220,7 +220,7 @@
 
 SkStreamAsset* SkTypeface::openStream(int* ttcIndex) const {
     int ttcIndexStorage;
-    if (NULL == ttcIndex) {
+    if (nullptr == ttcIndex) {
         // So our subclasses don't need to check for null param
         ttcIndex = &ttcIndexStorage;
     }
@@ -235,7 +235,7 @@
 SkFontData* SkTypeface::onCreateFontData() const {
     int index;
     SkAutoTDelete<SkStreamAsset> stream(this->onOpenStream(&index));
-    return new SkFontData(stream.detach(), index, NULL, 0);
+    return new SkFontData(stream.detach(), index, nullptr, 0);
 };
 
 int SkTypeface::charsToGlyphs(const void* chars, Encoding encoding,
@@ -243,7 +243,7 @@
     if (glyphCount <= 0) {
         return 0;
     }
-    if (NULL == chars || (unsigned)encoding > kUTF32_Encoding) {
+    if (nullptr == chars || (unsigned)encoding > kUTF32_Encoding) {
         if (glyphs) {
             sk_bzero(glyphs, glyphCount * sizeof(glyphs[0]));
         }
@@ -264,13 +264,13 @@
 bool SkTypeface::getKerningPairAdjustments(const uint16_t glyphs[], int count,
                                            int32_t adjustments[]) const {
     SkASSERT(count >= 0);
-    // check for the only legal way to pass a NULL.. everything is 0
+    // check for the only legal way to pass a nullptr.. everything is 0
     // in which case they just want to know if this face can possibly support
     // kerning (true) or never (false).
-    if (NULL == glyphs || NULL == adjustments) {
-        SkASSERT(NULL == glyphs);
+    if (nullptr == glyphs || nullptr == adjustments) {
+        SkASSERT(nullptr == glyphs);
         SkASSERT(0 == count);
-        SkASSERT(NULL == adjustments);
+        SkASSERT(nullptr == adjustments);
     }
     return this->onGetKerningPairAdjustments(glyphs, count, adjustments);
 }
@@ -352,7 +352,7 @@
     paint.setLinearText(true);
 
     SkScalerContext::Rec rec;
-    SkScalerContext::MakeRec(paint, NULL, NULL, &rec);
+    SkScalerContext::MakeRec(paint, nullptr, nullptr, &rec);
 
     SkAutoDescriptor ad(sizeof(rec) + SkDescriptor::ComputeOverhead(1));
     SkDescriptor*    desc = ad.getDesc();
diff --git a/src/core/SkTypefaceCache.cpp b/src/core/SkTypefaceCache.cpp
index 49779fc..5fe080d 100644
--- a/src/core/SkTypefaceCache.cpp
+++ b/src/core/SkTypefaceCache.cpp
@@ -45,7 +45,7 @@
         }
         curr += 1;
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkTypefaceCache::purge(int numToPurge) {
@@ -113,6 +113,6 @@
 void SkTypefaceCache::Dump() {
 #ifdef SK_DEBUG
     SkAutoMutexAcquire ama(gMutex);
-    (void)Get().findByProcAndRef(DumpProc, NULL);
+    (void)Get().findByProcAndRef(DumpProc, nullptr);
 #endif
 }
diff --git a/src/core/SkTypefaceCache.h b/src/core/SkTypefaceCache.h
index 7929586..f39b0d7 100644
--- a/src/core/SkTypefaceCache.h
+++ b/src/core/SkTypefaceCache.h
@@ -44,7 +44,7 @@
     /**
      *  Iterate through the cache, calling proc(typeface, ctx) with each
      *  typeface. If proc returns true, then we return that typeface (this
-     *  ref()s the typeface). If it never returns true, we return NULL.
+     *  ref()s the typeface). If it never returns true, we return nullptr.
      */
     SkTypeface* findByProcAndRef(FindProc proc, void* ctx) const;
 
diff --git a/src/core/SkUtils.cpp b/src/core/SkUtils.cpp
index eecf122..b3f698b 100644
--- a/src/core/SkUtils.cpp
+++ b/src/core/SkUtils.cpp
@@ -155,7 +155,7 @@
         *--utf8 = (char)(~(0xFF >> count) | uni);
     }
 
-    SkASSERT(utf8 == NULL || orig == SkUTF8_ToUnichar(utf8));
+    SkASSERT(utf8 == nullptr || orig == SkUTF8_ToUnichar(utf8));
     return count;
 }
 
@@ -260,14 +260,14 @@
         return 0;
     }
 
-    SkASSERT(utf16 != NULL);
+    SkASSERT(utf16 != nullptr);
 
     const uint16_t* stop = utf16 + numberOf16BitValues;
     size_t          size = 0;
 
-    if (utf8 == NULL) {    // just count
+    if (utf8 == nullptr) {    // just count
         while (utf16 < stop) {
-            size += SkUTF8_FromUnichar(SkUTF16_NextUnichar(&utf16), NULL);
+            size += SkUTF8_FromUnichar(SkUTF16_NextUnichar(&utf16), nullptr);
         }
     } else {
         char* start = utf8;
diff --git a/src/core/SkUtilsArm.cpp b/src/core/SkUtilsArm.cpp
index 9fd19a5..9dc4e54 100644
--- a/src/core/SkUtilsArm.cpp
+++ b/src/core/SkUtilsArm.cpp
@@ -88,7 +88,7 @@
 
         char*  line = (char*) memmem(buffer, buffer_end - buffer,
                                      features, features_len);
-        if (line == NULL) {  // Weird, no Features line, bad kernel?
+        if (line == nullptr) {  // Weird, no Features line, bad kernel?
             SkDebugf("Could not find a line starting with 'Features'"
               "in /proc/cpuinfo ?\n");
             break;
@@ -98,7 +98,7 @@
 
         // Find the end of the current line
         char* line_end = (char*) memchr(line, '\n', buffer_end - line);
-        if (line_end == NULL)
+        if (line_end == nullptr)
             line_end = buffer_end;
 
         // Now find an instance of 'neon' in the flags list. We want to
@@ -108,7 +108,7 @@
         const size_t neon_len = sizeof(neon)-1;
         const char* flag = (const char*) memmem(line, line_end - line,
                                                 neon, neon_len);
-        if (flag == NULL)
+        if (flag == nullptr)
             break;
 
         // Ensure it is followed by a space or a newline.
diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp
index fd00e7d..e00613b 100644
--- a/src/core/SkValidatingReadBuffer.cpp
+++ b/src/core/SkValidatingReadBuffer.cpp
@@ -111,7 +111,7 @@
     this->validate(encodingType == encoding);
     *length = this->readInt();
     const void* ptr = this->skip(SkAlign4(*length));
-    void* data = NULL;
+    void* data = nullptr;
     if (!fError) {
         data = sk_malloc_throw(*length);
         memcpy(data, ptr, *length);
@@ -214,7 +214,7 @@
 
 SkTypeface* SkValidatingReadBuffer::readTypeface() {
     // TODO: Implement this (securely) when needed
-    return NULL;
+    return nullptr;
 }
 
 bool SkValidatingReadBuffer::validateAvailable(size_t size) {
@@ -225,24 +225,24 @@
     SkString name;
     this->readString(&name);
     if (fError) {
-        return NULL;
+        return nullptr;
     }
 
     // Is this the type we wanted ?
     const char* cname = name.c_str();
     SkFlattenable::Type baseType;
     if (!SkFlattenable::NameToType(cname, &baseType) || (baseType != type)) {
-        return NULL;
+        return nullptr;
     }
 
     SkFlattenable::Factory factory = SkFlattenable::NameToFactory(cname);
-    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 = this->readUInt();
     if (factory) {
         size_t offset = fReader.offset();
@@ -253,7 +253,7 @@
         if (fError) {
             // we could try to fix up the offset...
             SkSafeUnref(obj);
-            obj = NULL;
+            obj = nullptr;
         }
     } else {
         // we must skip the remaining data
diff --git a/src/core/SkVarAlloc.cpp b/src/core/SkVarAlloc.cpp
index 5d395d4..f953705 100644
--- a/src/core/SkVarAlloc.cpp
+++ b/src/core/SkVarAlloc.cpp
@@ -28,17 +28,17 @@
 
 SkVarAlloc::SkVarAlloc(size_t minLgSize)
     : fBytesAllocated(0)
-    , fByte(NULL)
+    , fByte(nullptr)
     , fRemaining(0)
     , fLgSize(minLgSize)
-    , fBlock(NULL) {}
+    , fBlock(nullptr) {}
 
 SkVarAlloc::SkVarAlloc(size_t minLgSize, char* storage, size_t len)
     : fBytesAllocated(0)
     , fByte(storage)
     , fRemaining(len)
     , fLgSize(minLgSize)
-    , fBlock(NULL) {}
+    , fBlock(nullptr) {}
 
 SkVarAlloc::~SkVarAlloc() {
     Block* b = fBlock;
diff --git a/src/core/SkVertState.cpp b/src/core/SkVertState.cpp
index f23b108..7c3047e 100644
--- a/src/core/SkVertState.cpp
+++ b/src/core/SkVertState.cpp
@@ -101,6 +101,6 @@
         case SkCanvas::kTriangleFan_VertexMode:
             return fIndices ? TriangleFanX : TriangleFan;
         default:
-            return NULL;
+            return nullptr;
     }
 }
diff --git a/src/core/SkVertState.h b/src/core/SkVertState.h
index ecf1773..ab79452 100644
--- a/src/core/SkVertState.h
+++ b/src/core/SkVertState.h
@@ -22,7 +22,7 @@
 
     /**
      *  Construct a VertState from a vertex count, index array, and index count.
-     *  If the vertices are unindexed pass NULL for indices.
+     *  If the vertices are unindexed pass nullptr for indices.
      */
     VertState(int vCount, const uint16_t indices[], int indexCount)
             : fIndices(indices) {
diff --git a/src/core/SkWriteBuffer.cpp b/src/core/SkWriteBuffer.cpp
index faa7f00..7ddc77f 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 @@
     //    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 @@
     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 @@
         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::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 @@
 
 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 @@
 
 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 @@
     fPixelSerializer.reset(serializer);
     if (serializer) {
         serializer->ref();
-        SkASSERT(NULL == fBitmapHeap);
+        SkASSERT(nullptr == fBitmapHeap);
         SkSafeUnref(fBitmapHeap);
-        fBitmapHeap = NULL;
+        fBitmapHeap = nullptr;
     }
 }
 
@@ -306,19 +306,19 @@
      *  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:
diff --git a/src/core/SkWriter32.cpp b/src/core/SkWriter32.cpp
index a1a8b88..457cff4 100644
--- a/src/core/SkWriter32.cpp
+++ b/src/core/SkWriter32.cpp
@@ -37,7 +37,7 @@
 }
 
 void SkWriter32::writeString(const char str[], size_t len) {
-    if (NULL == str) {
+    if (nullptr == str) {
         str = "";
         len = 0;
     }
@@ -64,7 +64,7 @@
 }
 
 void SkWriter32::growToAtLeast(size_t size) {
-    const bool wasExternal = (fExternal != NULL) && (fData == fExternal);
+    const bool wasExternal = (fExternal != nullptr) && (fData == fExternal);
 
     fCapacity = 4096 + SkTMax(size, fCapacity + (fCapacity / 2));
     fInternal.realloc(fCapacity);
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index 17ce215..1d40986 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -666,7 +666,7 @@
 #include "effects/GrPorterDuffXferProcessor.h"
 
 bool SkXfermode::AsXPFactory(SkXfermode* xfermode, GrXPFactory** xpf) {
-    if (NULL == xfermode) {
+    if (nullptr == xfermode) {
         if (xpf) {
             *xpf = GrPorterDuffXPFactory::Create(kSrcOver_Mode);
         }
@@ -691,7 +691,7 @@
                         const SkAlpha* SK_RESTRICT aa) const {
     SkASSERT(dst && src && count >= 0);
 
-    if (NULL == aa) {
+    if (nullptr == aa) {
         for (int i = count - 1; i >= 0; --i) {
             dst[i] = this->xferColor(src[i], dst[i]);
         }
@@ -715,7 +715,7 @@
                         const SkAlpha* SK_RESTRICT aa) const {
     SkASSERT(dst && src && count >= 0);
 
-    if (NULL == aa) {
+    if (nullptr == aa) {
         for (int i = count - 1; i >= 0; --i) {
             SkPMColor dstC = SkPixel16ToPixel32(dst[i]);
             dst[i] = SkPixel32ToPixel16_ToU16(this->xferColor(src[i], dstC));
@@ -740,7 +740,7 @@
                         const SkAlpha* SK_RESTRICT aa) const {
     SkASSERT(dst && src && count >= 0);
 
-    if (NULL == aa) {
+    if (nullptr == aa) {
         for (int i = count - 1; i >= 0; --i) {
             SkPMColor res = this->xferColor(src[i], (dst[i] << SK_A32_SHIFT));
             dst[i] = SkToU8(SkGetPackedA32(res));
@@ -775,7 +775,7 @@
 SkFlattenable* SkProcCoeffXfermode::CreateProc(SkReadBuffer& buffer) {
     uint32_t mode32 = buffer.read32();
     if (!buffer.validate(mode32 < SK_ARRAY_COUNT(gProcCoeffs))) {
-        return NULL;
+        return nullptr;
     }
     return SkXfermode::Create((SkXfermode::Mode)mode32);
 }
@@ -840,7 +840,7 @@
     SkXfermodeProc proc = fProc;
 
     if (proc) {
-        if (NULL == aa) {
+        if (nullptr == aa) {
             for (int i = count - 1; i >= 0; --i) {
                 dst[i] = proc(src[i], dst[i]);
             }
@@ -868,7 +868,7 @@
     SkXfermodeProc proc = fProc;
 
     if (proc) {
-        if (NULL == aa) {
+        if (nullptr == aa) {
             for (int i = count - 1; i >= 0; --i) {
                 SkPMColor dstC = SkPixel16ToPixel32(dst[i]);
                 dst[i] = SkPixel32ToPixel16_ToU16(proc(src[i], dstC));
@@ -897,7 +897,7 @@
     SkXfermodeProc proc = fProc;
 
     if (proc) {
-        if (NULL == aa) {
+        if (nullptr == aa) {
             for (int i = count - 1; i >= 0; --i) {
                 SkPMColor res = proc(src[i], dst[i] << SK_A32_SHIFT);
                 dst[i] = SkToU8(SkGetPackedA32(res));
@@ -1017,20 +1017,20 @@
 
     if ((unsigned)mode >= kModeCount) {
         // report error
-        return NULL;
+        return nullptr;
     }
 
-    // Skia's "default" mode is srcover. NULL in SkPaint is interpreted as srcover
-    // so we can just return NULL from the factory.
+    // Skia's "default" mode is srcover. nullptr in SkPaint is interpreted as srcover
+    // so we can just return nullptr from the factory.
     if (kSrcOver_Mode == mode) {
-        return NULL;
+        return nullptr;
     }
 
     return SkSafeRef(cached[mode]);
 }
 
 SkXfermodeProc SkXfermode::GetProc(Mode mode) {
-    SkXfermodeProc  proc = NULL;
+    SkXfermodeProc  proc = nullptr;
     if ((unsigned)mode < kModeCount) {
         proc = gProcCoeffs[mode].fProc;
     }
@@ -1062,7 +1062,7 @@
 }
 
 bool SkXfermode::AsMode(const SkXfermode* xfer, Mode* mode) {
-    if (NULL == xfer) {
+    if (nullptr == xfer) {
         if (mode) {
             *mode = kSrcOver_Mode;
         }
@@ -1081,7 +1081,7 @@
 }
 
 bool SkXfermode::SupportsCoverageAsAlpha(const SkXfermode* xfer) {
-    // if xfer is NULL we treat it as srcOver which always supports coverageAsAlpha
+    // if xfer is nullptr we treat it as srcOver which always supports coverageAsAlpha
     if (!xfer) {
         return true;
     }
@@ -1090,7 +1090,7 @@
 }
 
 bool SkXfermode::IsOpaque(const SkXfermode* xfer, SrcColorOpacity opacityType) {
-    // if xfer is NULL we treat it as srcOver which is opaque if our src is opaque
+    // if xfer is nullptr we treat it as srcOver which is opaque if our src is opaque
     if (!xfer) {
         return SkXfermode::kOpaque_SrcColorOpacity == opacityType;
     }
diff --git a/src/core/SkYUVPlanesCache.cpp b/src/core/SkYUVPlanesCache.cpp
index f013599..336b581 100644
--- a/src/core/SkYUVPlanesCache.cpp
+++ b/src/core/SkYUVPlanesCache.cpp
@@ -59,7 +59,7 @@
 
         SkCachedData* tmpData = rec.fValue.fData;
         tmpData->ref();
-        if (NULL == tmpData->data()) {
+        if (nullptr == tmpData->data()) {
             tmpData->unref();
             return false;
         }
@@ -75,7 +75,7 @@
     YUVValue result;
     YUVPlanesKey key(genID);
     if (!CHECK_LOCAL(localCache, find, Find, key, YUVPlanesRec::Visitor, &result)) {
-        return NULL;
+        return nullptr;
     }
     
     *info = result.fInfo;
diff --git a/src/core/SkYUVPlanesCache.h b/src/core/SkYUVPlanesCache.h
index aa9b89e..a024192 100644
--- a/src/core/SkYUVPlanesCache.h
+++ b/src/core/SkYUVPlanesCache.h
@@ -35,16 +35,16 @@
     /**
      * On success, return a ref to the SkCachedData that holds the pixels.
      *
-     * On failure, return NULL.
+     * On failure, return nullptr.
      */
     static SkCachedData* FindAndRef(uint32_t genID, Info* info,
-                                    SkResourceCache* localCache = NULL);
+                                    SkResourceCache* localCache = nullptr);
 
     /**
      * Add a pixelRef ID and its YUV planes data to the cache.
      */
     static void Add(uint32_t genID, SkCachedData* data, Info* info,
-                    SkResourceCache* localCache = NULL);
+                    SkResourceCache* localCache = nullptr);
 };
 
 #endif
diff --git a/src/device/xps/SkXPSDevice.cpp b/src/device/xps/SkXPSDevice.cpp
index 2b15cd9..74fda4b 100644
--- a/src/device/xps/SkXPSDevice.cpp
+++ b/src/device/xps/SkXPSDevice.cpp
@@ -52,7 +52,7 @@
 
 //Dummy representation of a GUID from createId.
 #define L_GUID_ID L"XXXXXXXXsXXXXsXXXXsXXXXsXXXXXXXXXXXX"
-//Length of GUID representation from createId, including NULL terminator.
+//Length of GUID representation from createId, including nullptr terminator.
 #define GUID_ID_LEN SK_ARRAY_COUNT(L_GUID_ID)
 
 /**
@@ -122,7 +122,7 @@
 
     HRVM(CoCreateInstance(
              CLSID_XpsOMObjectFactory,
-             NULL,
+             nullptr,
              CLSCTX_INPROC_SERVER,
              IID_PPV_ARGS(&this->fXpsFactory)),
          "Could not create factory for layer.");
@@ -136,9 +136,9 @@
 
 SkXPSDevice::TypefaceUse::TypefaceUse()
     : typefaceId(0xffffffff)
-    , fontData(NULL)
-    , xpsFont(NULL)
-    , glyphsUsed(NULL) {
+    , fontData(nullptr)
+    , xpsFont(nullptr)
+    , glyphsUsed(nullptr) {
 }
 
 SkXPSDevice::TypefaceUse::~TypefaceUse() {
@@ -153,7 +153,7 @@
     //Create XPS Factory.
     HRBM(CoCreateInstance(
              CLSID_XpsOMObjectFactory,
-             NULL,
+             nullptr,
              CLSCTX_INPROC_SERVER,
              IID_PPV_ARGS(&this->fXpsFactory)),
          "Could not create XPS factory.");
@@ -193,7 +193,7 @@
     SkTScopedComPtr<IXpsOMThumbnailGenerator> thumbnailGenerator;
     HRM(CoCreateInstance(
             CLSID_XpsOMThumbnailGenerator,
-            NULL,
+            nullptr,
             CLSCTX_INPROC_SERVER,
             IID_PPV_ARGS(&thumbnailGenerator)),
         "Could not create thumbnail generator.");
@@ -257,10 +257,10 @@
                 TRUE,
                 XPS_INTERLEAVING_OFF, //XPS_INTERLEAVING_ON,
                 partUri.get(),
-                NULL,
+                nullptr,
                 image,
-                NULL,
-                NULL,
+                nullptr,
+                nullptr,
                 &this->fPackageWriter),
             "Could not create package writer.");
     }
@@ -273,10 +273,10 @@
                 &partUri),
             "Could not create fixed document part uri.");
         HRM(this->fPackageWriter->StartNewDocument(partUri.get(),
-                                                   NULL,
-                                                   NULL,
-                                                   NULL,
-                                                   NULL),
+                                                   nullptr,
+                                                   nullptr,
+                                                   nullptr,
+                                                   nullptr),
             "Could not start document.");
     }
 
@@ -328,7 +328,7 @@
          "Could not add scale canvas to page.");
 
     //Create the package writer if it hasn't been created yet.
-    if (NULL == this->fPackageWriter.get()) {
+    if (nullptr == this->fPackageWriter.get()) {
         SkTScopedComPtr<IXpsOMImageResource> image;
         //Ignore return, thumbnail is completely optional.
         this->createXpsThumbnail(page.get(), 0, &image);
@@ -338,10 +338,10 @@
 
     HRBM(this->fPackageWriter->AddPage(page.get(),
                                        &pageSize,
-                                       NULL,
-                                       NULL,
-                                       NULL,
-                                       NULL),
+                                       nullptr,
+                                       nullptr,
+                                       nullptr,
+                                       nullptr),
          "Could not write the page.");
     this->fCurrentXpsCanvas.reset();
 
@@ -357,7 +357,7 @@
     int ttcCount = (current->ttcIndex + 1);
 
     //The following are declared with the types required by CreateFontPackage.
-    unsigned char *fontPackageBufferRaw = NULL;
+    unsigned char *fontPackageBufferRaw = nullptr;
     unsigned long fontPackageBufferSize;
     unsigned long bytesWritten;
     unsigned long result = CreateFontPackage(
@@ -377,7 +377,7 @@
         sk_malloc_throw,
         sk_realloc_throw,
         sk_free,
-        NULL);
+        nullptr);
     SkAutoTMalloc<unsigned char> fontPackageBuffer(fontPackageBufferRaw);
     if (result != NO_ERROR) {
         SkDEBUGF(("CreateFontPackage Error %lu", result));
@@ -535,7 +535,7 @@
                                         IXpsOMMatrixTransform** xpsTransform) {
     SkScalar affine[6];
     if (!matrix.asAffine(affine)) {
-        *xpsTransform = NULL;
+        *xpsTransform = nullptr;
         return S_FALSE;
     }
     XPS_MATRIX rawXpsMatrix = {
@@ -575,7 +575,7 @@
                                               IXpsOMBrush** xpsBrush) {
     XPS_COLOR xpsColor = xps_color(skColor);
     SkTScopedComPtr<IXpsOMSolidColorBrush> solidBrush;
-    HRM(this->fXpsFactory->CreateSolidColorBrush(&xpsColor, NULL, &solidBrush),
+    HRM(this->fXpsFactory->CreateSolidColorBrush(&xpsColor, nullptr, &solidBrush),
         "Could not create solid color brush.");
     HRM(solidBrush->SetOpacity(alpha / 255.0f), "Could not set opacity.");
     HRM(solidBrush->QueryInterface<IXpsOMBrush>(xpsBrush), "QI Fail.");
@@ -840,7 +840,7 @@
                                            IXpsOMGradientStop** xpsGradStop) {
     XPS_COLOR gradStopXpsColor = xps_color(skColor);
     HRM(this->fXpsFactory->CreateGradientStop(&gradStopXpsColor,
-                                              NULL,
+                                              nullptr,
                                               SkScalarToFLOAT(offset),
                                               xpsGradStop),
         "Could not create gradient stop.");
@@ -990,7 +990,7 @@
                                     IXpsOMBrush** brush,
                                     const SkMatrix* parentTransform) {
     const SkShader *shader = skPaint.getShader();
-    if (NULL == shader) {
+    if (nullptr == shader) {
         HR(this->createXpsSolidColorBrush(skPaint.getColor(), 0xFF, brush));
         return S_OK;
     }
@@ -998,8 +998,8 @@
     //Gradient shaders.
     SkShader::GradientInfo info;
     info.fColorCount = 0;
-    info.fColors = NULL;
-    info.fColorOffsets = NULL;
+    info.fColors = nullptr;
+    info.fColorOffsets = nullptr;
     SkShader::GradientType gradientType = shader->asAGradient(&info);
 
     if (SkShader::kNone_GradientType == gradientType) {
@@ -1200,7 +1200,7 @@
                             const SkPaint& paint) {
     SkPath path;
     path.addRRect(rr);
-    this->drawPath(d, path, paint, NULL, true);
+    this->drawPath(d, path, paint, nullptr, true);
 }
 
 void SkXPSDevice::internalDrawRect(const SkDraw& d,
@@ -1209,7 +1209,7 @@
                                    const SkPaint& paint) {
     //Exit early if there is nothing to draw.
     if (d.fClip->isEmpty() ||
-        (paint.getAlpha() == 0 && paint.getXfermode() == NULL)) {
+        (paint.getAlpha() == 0 && paint.getXfermode() == nullptr)) {
         return;
     }
 
@@ -1218,7 +1218,7 @@
         SkPath tmp;
         tmp.addRect(r);
         tmp.setFillType(SkPath::kWinding_FillType);
-        this->drawPath(d, tmp, paint, NULL, true);
+        this->drawPath(d, tmp, paint, nullptr, true);
         return;
     }
 
@@ -1525,7 +1525,7 @@
 
     // nothing to draw
     if (d.fClip->isEmpty() ||
-        (paint->getAlpha() == 0 && paint->getXfermode() == NULL)) {
+        (paint->getAlpha() == 0 && paint->getXfermode() == nullptr)) {
         return;
     }
 
@@ -1558,7 +1558,7 @@
         bool fill = paint->getFillPath(*skeletalPath, fillablePath);
 
         SkPaint* writablePaint = paint.writable();
-        writablePaint->setPathEffect(NULL);
+        writablePaint->setPathEffect(nullptr);
         if (fill) {
             writablePaint->setStyle(SkPaint::kFill_Style);
         } else {
@@ -1610,7 +1610,7 @@
                            d.fClip->getBounds(),
                            &clipIRect);
 
-        SkMask* mask = NULL;
+        SkMask* mask = nullptr;
 
         //[Fillable-path -> Mask]
         SkMask rasteredMask;
@@ -1628,11 +1628,11 @@
             //[Mask -> Mask]
             SkMask filteredMask;
             if (filter &&
-                filter->filterMask(&filteredMask, *mask, *d.fMatrix, NULL)) {
+                filter->filterMask(&filteredMask, *mask, *d.fMatrix, nullptr)) {
 
                 mask = &filteredMask;
             } else {
-                filteredMask.fImage = NULL;
+                filteredMask.fImage = nullptr;
             }
             SkAutoMaskFreeImage filteredAmi(filteredMask.fImage);
 
@@ -1656,7 +1656,7 @@
         SkPath* pixelPath = pathIsMutable ? fillablePath : &modifiedPath;
         fillablePath->transform(matrix, pixelPath);
 
-        SkMask* mask = NULL;
+        SkMask* mask = nullptr;
 
         //[Pixel-path -> Mask]
         SkMask rasteredMask;
@@ -1677,10 +1677,10 @@
             if (filter->filterMask(&filteredMask,
                                    rasteredMask,
                                    matrix,
-                                   NULL)) {
+                                   nullptr)) {
                 mask = &filteredMask;
             } else {
-                filteredMask.fImage = NULL;
+                filteredMask.fImage = nullptr;
             }
             SkAutoMaskFreeImage filteredAmi(filteredMask.fImage);
 
@@ -2004,7 +2004,7 @@
     HR(this->createXpsBrush(
             paint,
             &xpsFillBrush,
-            useCanvasForClip ? NULL : &transform));
+            useCanvasForClip ? nullptr : &transform));
 
     HRM(glyphs->SetFillBrushLocal(xpsFillBrush.get()),
         "Could not set fill brush.");
@@ -2132,7 +2132,7 @@
     if (text_must_be_pathed(paint, *d.fMatrix)) {
         SkPath path;
         paint.getTextPath(text, byteLen, x, y, &path);
-        this->drawPath(d, path, paint, NULL, true);
+        this->drawPath(d, path, paint, nullptr, true);
         //TODO: add automation "text"
         return;
     }
@@ -2163,7 +2163,7 @@
                   this->fXpsFactory.get(),
                   this->fCurrentXpsCanvas.get(),
                   typeface,
-                  NULL,
+                  nullptr,
                   procs.xpsGlyphs.begin(), procs.xpsGlyphs.count(),
                   &origin,
                   SkScalarToFLOAT(paint.getTextSize()),
@@ -2182,7 +2182,7 @@
         SkPath path;
         //TODO: make this work, Draw currently does not handle as well.
         //paint.getTextPath(text, byteLength, x, y, &path);
-        //this->drawPath(d, path, paint, NULL, true);
+        //this->drawPath(d, path, paint, nullptr, true);
         //TODO: add automation "text"
         return;
     }
@@ -2213,7 +2213,7 @@
                   this->fXpsFactory.get(),
                   this->fCurrentXpsCanvas.get(),
                   typeface,
-                  NULL,
+                  nullptr,
                   procs.xpsGlyphs.begin(), procs.xpsGlyphs.count(),
                   &origin,
                   SkScalarToFLOAT(paint.getTextSize()),
@@ -2253,7 +2253,7 @@
 //Conditional for bug compatibility with PDF device.
 #if 0
     if (SkBaseDevice::kGeneral_Usage == info.fUsage) {
-        return NULL;
+        return nullptr;
         SK_CRASH();
         //To what stream do we write?
         //SkXPSDevice* dev = new SkXPSDevice(this);
diff --git a/src/doc/SkDocument.cpp b/src/doc/SkDocument.cpp
index 5b2237d..fa25e44 100644
--- a/src/doc/SkDocument.cpp
+++ b/src/doc/SkDocument.cpp
@@ -21,7 +21,7 @@
 SkCanvas* SkDocument::beginPage(SkScalar width, SkScalar height,
                                 const SkRect* content) {
     if (width <= 0 || height <= 0) {
-        return NULL;
+        return nullptr;
     }
 
     SkRect outer = SkRect::MakeWH(width, height);
@@ -29,7 +29,7 @@
     if (content) {
         inner = *content;
         if (!inner.intersect(outer)) {
-            return NULL;
+            return nullptr;
         }
     } else {
         inner = outer;
@@ -44,11 +44,11 @@
                 this->endPage();
                 break;
             case kClosed_State:
-                return NULL;
+                return nullptr;
         }
     }
     SkDEBUGFAIL("never get here");
-    return NULL;
+    return nullptr;
 }
 
 void SkDocument::endPage() {
@@ -68,9 +68,9 @@
                 if (fDoneProc) {
                     fDoneProc(fStream, false);
                 }
-                // we don't own the stream, but we mark it NULL since we can
+                // we don't own the stream, but we mark it nullptr since we can
                 // no longer write to it.
-                fStream = NULL;
+                fStream = nullptr;
                 return success;
             }
             case kInPage_State:
@@ -89,7 +89,7 @@
     if (fDoneProc) {
         fDoneProc(fStream, true);
     }
-    // we don't own the stream, but we mark it NULL since we can
+    // we don't own the stream, but we mark it nullptr since we can
     // no longer write to it.
-    fStream = NULL;
+    fStream = nullptr;
 }
diff --git a/src/doc/SkDocument_PDF.cpp b/src/doc/SkDocument_PDF.cpp
index 1741239..6c47379 100644
--- a/src/doc/SkDocument_PDF.cpp
+++ b/src/doc/SkDocument_PDF.cpp
@@ -318,7 +318,7 @@
     void onEndPage() override {
         SkASSERT(fCanvas.get());
         fCanvas->flush();
-        fCanvas.reset(NULL);
+        fCanvas.reset(nullptr);
     }
 
     bool onClose(SkWStream* stream) override {
@@ -345,14 +345,14 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SkDocument* SkDocument::CreatePDF(SkWStream* stream, SkScalar dpi) {
-    return stream ? new SkDocument_PDF(stream, NULL, dpi) : NULL;
+    return stream ? new SkDocument_PDF(stream, nullptr, dpi) : nullptr;
 }
 
 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) {
     SkFILEWStream* stream = new SkFILEWStream(path);
     if (!stream->isValid()) {
         delete stream;
-        return NULL;
+        return nullptr;
     }
     auto delete_wstream = [](SkWStream* stream, bool) { delete stream; };
     return new SkDocument_PDF(stream, delete_wstream, dpi);
diff --git a/src/doc/SkDocument_PDF_None.cpp b/src/doc/SkDocument_PDF_None.cpp
index 4759acf..f146cba 100644
--- a/src/doc/SkDocument_PDF_None.cpp
+++ b/src/doc/SkDocument_PDF_None.cpp
@@ -5,5 +5,5 @@
  * found in the LICENSE file.
  */
 #include "SkDocument.h"
-SkDocument* SkDocument::CreatePDF(SkWStream*, SkScalar) { return  NULL; }
-SkDocument* SkDocument::CreatePDF(const char path[], SkScalar) { return NULL; }
+SkDocument* SkDocument::CreatePDF(SkWStream*, SkScalar) { return  nullptr; }
+SkDocument* SkDocument::CreatePDF(const char path[], SkScalar) { return nullptr; }
diff --git a/src/doc/SkDocument_XPS.cpp b/src/doc/SkDocument_XPS.cpp
index 943d0a8..57fa0b8 100644
--- a/src/doc/SkDocument_XPS.cpp
+++ b/src/doc/SkDocument_XPS.cpp
@@ -42,7 +42,7 @@
     void onEndPage() override {
         SkASSERT(fCanvas.get());
         fCanvas->flush();
-        fCanvas.reset(NULL);
+        fCanvas.reset(nullptr);
         fDevice.endSheet();
     }
 
@@ -63,7 +63,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SkDocument* SkDocument::CreateXPS(SkWStream* stream, SkScalar dpi) {
-    return stream ? new SkDocument_XPS(stream, NULL, dpi) : NULL;
+    return stream ? new SkDocument_XPS(stream, nullptr, dpi) : nullptr;
 }
 
 static void delete_wstream(SkWStream* stream, bool aborted) { delete stream; }
@@ -71,7 +71,7 @@
 SkDocument* SkDocument::CreateXPS(const char path[], SkScalar dpi) {
     SkAutoTDelete<SkFILEWStream> stream(new SkFILEWStream(path));
     if (!stream->isValid()) {
-        return NULL;
+        return nullptr;
     }
     return new SkDocument_XPS(stream.detach(), delete_wstream, dpi);
 }
diff --git a/src/doc/SkDocument_XPS_None.cpp b/src/doc/SkDocument_XPS_None.cpp
index 01055e5..9d51ea2 100644
--- a/src/doc/SkDocument_XPS_None.cpp
+++ b/src/doc/SkDocument_XPS_None.cpp
@@ -1,3 +1,9 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
 #include "SkDocument.h"
-SkDocument* SkDocument::CreateXPS(SkWStream*, SkScalar) { return NULL; }
-SkDocument* SkDocument::CreateXPS(const char path[], SkScalar) { return NULL; }
+SkDocument* SkDocument::CreateXPS(SkWStream*, SkScalar) { return nullptr; }
+SkDocument* SkDocument::CreateXPS(const char path[], SkScalar) { return nullptr; }
diff --git a/src/effects/Sk1DPathEffect.cpp b/src/effects/Sk1DPathEffect.cpp
index 3af9887..d630a8e 100644
--- a/src/effects/Sk1DPathEffect.cpp
+++ b/src/effects/Sk1DPathEffect.cpp
@@ -160,7 +160,7 @@
         Style style = (Style)buffer.readUInt();
         return SkPath1DPathEffect::Create(path, advance, phase, style);
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkPath1DPathEffect::flatten(SkWriteBuffer& buffer) const {
@@ -177,7 +177,7 @@
     switch (fStyle) {
         case kTranslate_Style: {
             SkPoint pos;
-            if (meas.getPosTan(distance, &pos, NULL)) {
+            if (meas.getPosTan(distance, &pos, nullptr)) {
                 dst->addPath(fPath, pos.fX, pos.fY);
             }
         } break;
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index f6d1461..0f96cdf 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -282,7 +282,7 @@
             GrPaint grPaint;
             grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
             SkRegion::Iterator iter(fRegion);
-            drawContext->clear(maskTexture->asRenderTarget(), NULL, 0x0, true);
+            drawContext->clear(maskTexture->asRenderTarget(), nullptr, 0x0, true);
 
             while (!iter.done()) {
                 SkRect rect = SkRect::Make(iter.rect());
diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp
index b8959dd..7db6b47 100644
--- a/src/effects/SkArithmeticMode.cpp
+++ b/src/effects/SkArithmeticMode.cpp
@@ -105,7 +105,7 @@
     SkScalar k4 = fK[3] * 255;
 
     for (int i = 0; i < count; ++i) {
-        if ((NULL == aaCoverage) || aaCoverage[i]) {
+        if ((nullptr == aaCoverage) || aaCoverage[i]) {
             SkPMColor sc = src[i];
             SkPMColor dc = dst[i];
 
diff --git a/src/effects/SkArithmeticMode_gpu.cpp b/src/effects/SkArithmeticMode_gpu.cpp
index 279e36d..7732917 100644
--- a/src/effects/SkArithmeticMode_gpu.cpp
+++ b/src/effects/SkArithmeticMode_gpu.cpp
@@ -27,7 +27,7 @@
                                 const char* kUni,
                                 bool enforcePMColor) {
     // We don't try to optimize for this case at all
-    if (NULL == inputColor) {
+    if (nullptr == inputColor) {
         fsBuilder->codeAppend("const vec4 src = vec4(1);");
     } else {
         fsBuilder->codeAppendf("vec4 src = %s;", inputColor);
diff --git a/src/effects/SkBitmapSource.cpp b/src/effects/SkBitmapSource.cpp
index ecaffcf..5b1934f 100644
--- a/src/effects/SkBitmapSource.cpp
+++ b/src/effects/SkBitmapSource.cpp
@@ -43,7 +43,7 @@
     buffer.readRect(&dst);
     SkBitmap bitmap;
     if (!buffer.readBitmap(&bitmap)) {
-        return NULL;
+        return nullptr;
     }
     return SkBitmapSource::Create(bitmap, src, dst, filterQuality);
 }
@@ -69,7 +69,7 @@
 
     const SkIRect dstIRect = dstRect.roundOut();
     SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(dstIRect.width(), dstIRect.height()));
-    if (NULL == device.get()) {
+    if (nullptr == device.get()) {
         return false;
     }
 
diff --git a/src/effects/SkBlurDrawLooper.cpp b/src/effects/SkBlurDrawLooper.cpp
index ceb210d..9f10ff5 100644
--- a/src/effects/SkBlurDrawLooper.cpp
+++ b/src/effects/SkBlurDrawLooper.cpp
@@ -36,7 +36,7 @@
 
         fBlur = SkBlurMaskFilter::Create(kNormal_SkBlurStyle, fSigma, flags);
     } else {
-        fBlur = NULL;
+        fBlur = nullptr;
     }
 
     if (fBlurFlags & kOverrideColor_BlurFlag) {
@@ -47,7 +47,7 @@
         fColorFilter = SkColorFilter::CreateModeFilter(opaqueColor,
                                                        SkXfermode::kSrcIn_Mode);
     } else {
-        fColorFilter = NULL;
+        fColorFilter = nullptr;
     }
 }
 
diff --git a/src/effects/SkBlurMask.cpp b/src/effects/SkBlurMask.cpp
index 4d366fe..0fc554f 100644
--- a/src/effects/SkBlurMask.cpp
+++ b/src/effects/SkBlurMask.cpp
@@ -530,7 +530,7 @@
 
     dst->fRowBytes = dst->fBounds.width();
     dst->fFormat = SkMask::kA8_Format;
-    dst->fImage = NULL;
+    dst->fImage = nullptr;
 
     if (src.fImage) {
         size_t dstSize = dst->computeImageSize();
@@ -754,7 +754,7 @@
 
     dst->fRowBytes = dst->fBounds.width();
     dst->fFormat = SkMask::kA8_Format;
-    dst->fImage = NULL;
+    dst->fImage = nullptr;
 
     int             sw = SkScalarFloorToInt(src.width());
     int             sh = SkScalarFloorToInt(src.height());
@@ -769,7 +769,7 @@
         }
         return true;
     }
-    uint8_t *profile = NULL;
+    uint8_t *profile = nullptr;
 
     ComputeBlurProfile(sigma, &profile);
     SkAutoTDeleteArray<uint8_t> ada(profile);
@@ -890,7 +890,7 @@
 
     dst->fRowBytes = dst->fBounds.width();
     dst->fFormat = SkMask::kA8_Format;
-    dst->fImage = NULL;
+    dst->fImage = nullptr;
 
     if (src.fImage) {
 
diff --git a/src/effects/SkBlurMask.h b/src/effects/SkBlurMask.h
index 71f60d9..5c2a82e 100644
--- a/src/effects/SkBlurMask.h
+++ b/src/effects/SkBlurMask.h
@@ -16,11 +16,11 @@
 class SkBlurMask {
 public:
     static bool BlurRect(SkScalar sigma, SkMask *dst, const SkRect &src, SkBlurStyle,
-                         SkIPoint *margin = NULL,
+                         SkIPoint *margin = nullptr,
                          SkMask::CreateMode createMode =
                                                 SkMask::kComputeBoundsAndRenderImage_CreateMode);
     static bool BlurRRect(SkScalar sigma, SkMask *dst, const SkRRect &src, SkBlurStyle,
-                         SkIPoint *margin = NULL,
+                         SkIPoint *margin = nullptr,
                          SkMask::CreateMode createMode =
                                                 SkMask::kComputeBoundsAndRenderImage_CreateMode);
 
@@ -32,12 +32,12 @@
 
     static bool BoxBlur(SkMask* dst, const SkMask& src,
                         SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
-                        SkIPoint* margin = NULL, bool force_quality=false);
+                        SkIPoint* margin = nullptr, bool force_quality=false);
 
     // the "ground truth" blur does a gaussian convolution; it's slow
     // but useful for comparison purposes.
     static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src, SkBlurStyle,
-                                SkIPoint* margin = NULL);
+                                SkIPoint* margin = nullptr);
 
     // If radius > 0, return the corresponding sigma, else return 0
     static SkScalar ConvertRadiusToSigma(SkScalar radius);
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index dc2a40a..f2bcf3e 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -125,13 +125,13 @@
 
 SkMaskFilter* SkBlurMaskFilter::Create(SkBlurStyle style, SkScalar sigma, uint32_t flags) {
     if (!SkScalarIsFinite(sigma) || sigma <= 0) {
-        return NULL;
+        return nullptr;
     }
     if ((unsigned)style > (unsigned)kLastEnum_SkBlurStyle) {
-        return NULL;
+        return nullptr;
     }
     if (flags > SkBlurMaskFilter::kAll_BlurFlag) {
-        return NULL;
+        return nullptr;
     }
     return new SkBlurMaskFilterImpl(sigma, style, flags);
 }
@@ -192,14 +192,14 @@
 #include "SkCanvas.h"
 
 static bool prepare_to_draw_into_mask(const SkRect& bounds, SkMask* mask) {
-    SkASSERT(mask != NULL);
+    SkASSERT(mask != nullptr);
 
     mask->fBounds = bounds.roundOut();
     mask->fRowBytes = SkAlign4(mask->fBounds.width());
     mask->fFormat = SkMask::kA8_Format;
     const size_t size = mask->computeImageSize();
     mask->fImage = SkMask::AllocImage(size);
-    if (NULL == mask->fImage) {
+    if (nullptr == mask->fImage) {
         return false;
     }
 
@@ -316,7 +316,7 @@
 SkBlurMaskFilterImpl::filterRRectToNine(const SkRRect& rrect, const SkMatrix& matrix,
                                         const SkIRect& clipBounds,
                                         NinePatch* patch) const {
-    SkASSERT(patch != NULL);
+    SkASSERT(patch != nullptr);
     switch (rrect.getType()) {
         case SkRRect::kEmpty_Type:
             // Nothing to draw.
@@ -353,7 +353,7 @@
     SkIPoint margin;
     SkMask  srcM, dstM;
     srcM.fBounds = rrect.rect().roundOut();
-    srcM.fImage = NULL;
+    srcM.fImage = nullptr;
     srcM.fFormat = SkMask::kA8_Format;
     srcM.fRowBytes = 0;
 
@@ -442,7 +442,7 @@
     patch->fOuterRect = dstM.fBounds;
     patch->fCenter.fX = SkScalarCeilToInt(leftUnstretched) + 1;
     patch->fCenter.fY = SkScalarCeilToInt(topUnstretched) + 1;
-    SkASSERT(NULL == patch->fCache);
+    SkASSERT(nullptr == patch->fCache);
     patch->fCache = cache;  // transfer ownership to patch
     return kTrue_FilterReturn;
 }
@@ -473,7 +473,7 @@
     SkIPoint margin;
     SkMask  srcM, dstM;
     srcM.fBounds = rects[0].roundOut();
-    srcM.fImage = NULL;
+    srcM.fImage = nullptr;
     srcM.fFormat = SkMask::kA8_Format;
     srcM.fRowBytes = 0;
 
@@ -572,7 +572,7 @@
     patch->fMask.fBounds.offsetTo(0, 0);
     patch->fOuterRect = dstM.fBounds;
     patch->fCenter = center;
-    SkASSERT(NULL == patch->fCache);
+    SkASSERT(nullptr == patch->fCache);
     patch->fCache = cache;  // transfer ownership to patch
     return kTrue_FilterReturn;
 }
@@ -592,7 +592,7 @@
     if (style <= kLastEnum_SkBlurStyle) {
         return SkBlurMaskFilter::Create((SkBlurStyle)style, sigma, flags);
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkBlurMaskFilterImpl::flatten(SkWriteBuffer& buffer) const {
@@ -616,21 +616,21 @@
      */
     static GrFragmentProcessor* Create(GrTextureProvider *textureProvider, const SkRect& rect,
                                        float sigma) {
-        GrTexture *blurProfileTexture = NULL;
+        GrTexture *blurProfileTexture = nullptr;
         int doubleProfileSize = SkScalarCeilToInt(12*sigma);
 
         if (doubleProfileSize >= rect.width() || doubleProfileSize >= rect.height()) {
             // if the blur sigma is too large so the gaussian overlaps the whole
             // rect in either direction, fall back to CPU path for now.
 
-            return NULL;
+            return nullptr;
         }
 
         bool createdBlurProfileTexture = CreateBlurProfileTexture(
             textureProvider, sigma, &blurProfileTexture);
         SkAutoTUnref<GrTexture> hunref(blurProfileTexture);
         if (!createdBlurProfileTexture) {
-           return NULL;
+           return nullptr;
         }
         return new GrRectBlurEffect(rect, sigma, blurProfileTexture);
     }
@@ -762,19 +762,19 @@
     builder[0] = profileSize;
     builder.finish();
 
-    uint8_t *profile = NULL;
-    SkAutoTDeleteArray<uint8_t> ada(NULL);
+    uint8_t *profile = nullptr;
+    SkAutoTDeleteArray<uint8_t> ada(nullptr);
 
     *blurProfileTexture = textureProvider->findAndRefTextureByUniqueKey(key);
 
-    if (NULL == *blurProfileTexture) {
+    if (nullptr == *blurProfileTexture) {
 
         SkBlurMask::ComputeBlurProfile(sigma, &profile);
         ada.reset(profile);
 
         *blurProfileTexture = textureProvider->createTexture(texDesc, true, profile, 0);
 
-        if (NULL == *blurProfileTexture) {
+        if (nullptr == *blurProfileTexture) {
             return false;
         }
         textureProvider->assignUniqueKeyToTexture(key, *blurProfileTexture);
@@ -906,7 +906,7 @@
 GrFragmentProcessor* GrRRectBlurEffect::Create(GrTextureProvider* texProvider, float sigma,
                                                const SkRRect& rrect) {
     if (!rrect.isSimpleCircular()) {
-        return NULL;
+        return nullptr;
     }
 
     // Make sure we can successfully ninepatch this rrect -- the blur sigma has to be
@@ -917,7 +917,7 @@
     unsigned int cornerRadius = SkScalarCeilToInt(rrect.getSimpleRadii().x());
     if (cornerRadius + blurRadius > rrect.width()/2 ||
         cornerRadius + blurRadius > rrect.height()/2) {
-        return NULL;
+        return nullptr;
     }
 
     static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain();
@@ -951,12 +951,12 @@
         SkPath path;
         path.addRRect( smallRRect );
 
-        SkDraw::DrawToMask(path, &mask.fBounds, NULL, NULL, &mask,
+        SkDraw::DrawToMask(path, &mask.fBounds, nullptr, nullptr, &mask,
                            SkMask::kJustRenderImage_CreateMode, SkPaint::kFill_Style);
 
         SkMask blurredMask;
         SkBlurMask::BoxBlur(&blurredMask, mask, sigma, kNormal_SkBlurStyle, kHigh_SkBlurQuality,
-                            NULL, true );
+                            nullptr, true );
 
         unsigned int texSide = smallRectSide + 2*blurRadius;
         GrSurfaceDesc texDesc;
@@ -968,7 +968,7 @@
             texProvider->createTexture(texDesc, true, blurredMask.fImage, 0));
         SkMask::FreeImage(blurredMask.fImage);
         if (!blurNinePatchTexture) {
-            return NULL;
+            return nullptr;
         }
         texProvider->assignUniqueKeyToTexture(key, blurNinePatchTexture);
     }
@@ -1165,7 +1165,7 @@
         return false;
     }
 
-    if (NULL == maskRect) {
+    if (nullptr == maskRect) {
         // don't need to compute maskRect
         return true;
     }
@@ -1202,7 +1202,7 @@
     bool isNormalBlur = (kNormal_SkBlurStyle == fBlurStyle);
     *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOverwriteSrc,
                                            clipRect, false, xformedSigma, xformedSigma);
-    if (NULL == *result) {
+    if (nullptr == *result) {
         return false;
     }
 
diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp
index d1857f9..c5d4fc5 100644
--- a/src/effects/SkColorCubeFilter.cpp
+++ b/src/effects/SkColorCubeFilter.cpp
@@ -43,12 +43,12 @@
 static bool is_valid_3D_lut(SkData* cubeData, int cubeDimension) {
     size_t minMemorySize = sizeof(uint8_t) * 4 * cubeDimension * cubeDimension * cubeDimension;
     return (cubeDimension >= MIN_CUBE_SIZE) && (cubeDimension <= MAX_CUBE_SIZE) &&
-           (NULL != cubeData) && (cubeData->size() >= minMemorySize);
+           (nullptr != cubeData) && (cubeData->size() >= minMemorySize);
 }
 
 SkColorFilter* SkColorCubeFilter::Create(SkData* cubeData, int cubeDimension) {
     if (!is_valid_3D_lut(cubeData, cubeDimension)) {
-        return NULL;
+        return nullptr;
     }
 
     return new SkColorCubeFilter(cubeData, cubeDimension);
@@ -67,9 +67,9 @@
 SkColorCubeFilter::ColorCubeProcesingCache::ColorCubeProcesingCache(int cubeDimension)
   : fCubeDimension(cubeDimension)
   , fLutsInited(false) {
-    fColorToIndex[0] = fColorToIndex[1] = NULL;
-    fColorToFactors[0] = fColorToFactors[1] = NULL;
-    fColorToScalar = NULL;
+    fColorToIndex[0] = fColorToIndex[1] = nullptr;
+    fColorToFactors[0] = fColorToFactors[1] = nullptr;
+    fColorToScalar = nullptr;
 }
 
 void SkColorCubeFilter::ColorCubeProcesingCache::getProcessingLuts(
@@ -77,11 +77,11 @@
     const SkScalar** colorToScalar) {
     SkOnce(&fLutsInited, &fLutsMutex,
            SkColorCubeFilter::ColorCubeProcesingCache::initProcessingLuts, this);
-    SkASSERT((fColorToIndex[0] != NULL) &&
-             (fColorToIndex[1] != NULL) &&
-             (fColorToFactors[0] != NULL) &&
-             (fColorToFactors[1] != NULL) &&
-             (fColorToScalar != NULL));
+    SkASSERT((fColorToIndex[0] != nullptr) &&
+             (fColorToIndex[1] != nullptr) &&
+             (fColorToFactors[0] != nullptr) &&
+             (fColorToFactors[1] != nullptr) &&
+             (fColorToScalar != nullptr));
     (*colorToIndex)[0] = fColorToIndex[0];
     (*colorToIndex)[1] = fColorToIndex[1];
     (*colorToFactors)[0] = fColorToFactors[0];
@@ -138,7 +138,7 @@
     int cubeDimension = buffer.readInt();
     SkAutoDataUnref cubeData(buffer.readByteArrayAsData());
     if (!buffer.validate(is_valid_3D_lut(cubeData, cubeDimension))) {
-        return NULL;
+        return nullptr;
     }
     return Create(cubeData, cubeDimension);
 }
@@ -161,7 +161,7 @@
 class GrColorCubeEffect : public GrFragmentProcessor {
 public:
     static GrFragmentProcessor* Create(GrTexture* colorCube) {
-        return (NULL != colorCube) ? new GrColorCubeEffect(colorCube) : NULL;
+        return (nullptr != colorCube) ? new GrColorCubeEffect(colorCube) : nullptr;
     }
 
     virtual ~GrColorCubeEffect();
@@ -239,7 +239,7 @@
 }
 
 void GrColorCubeEffect::GLProcessor::emitCode(EmitArgs& args) {
-    if (NULL == args.fInputColor) {
+    if (nullptr == args.fInputColor) {
         args.fInputColor = "vec4(1)";
     }
 
@@ -327,13 +327,13 @@
         }
     }
 
-    GrFragmentProcessor* frag = textureCube ? GrColorCubeEffect::Create(textureCube) : NULL;
+    GrFragmentProcessor* frag = textureCube ? GrColorCubeEffect::Create(textureCube) : nullptr;
     if (frag) {
         if (array) {
             *array->append() = frag;
         } else {
             frag->unref();
-            SkDEBUGCODE(frag = NULL;)
+            SkDEBUGCODE(frag = nullptr;)
         }
         return true;
     }
diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp
index 20dee8e..e5f64ce 100644
--- a/src/effects/SkColorFilterImageFilter.cpp
+++ b/src/effects/SkColorFilterImageFilter.cpp
@@ -17,8 +17,8 @@
 
 SkColorFilterImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf,
         SkImageFilter* input, const CropRect* cropRect) {
-    if (NULL == cf) {
-        return NULL;
+    if (nullptr == cf) {
+        return nullptr;
     }
 
     SkColorFilter* inputCF;
@@ -71,7 +71,7 @@
     }
 
     SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds.height()));
-    if (NULL == device.get()) {
+    if (nullptr == device.get()) {
         return false;
     }
     SkCanvas canvas(device.get());
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 5560183..c3fa730 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -132,7 +132,7 @@
         SkXfermode::Coeff srcCoeff, dstCoeff;
         if (!SkXfermode::ModeAsCoeff(mode, &srcCoeff, &dstCoeff)) {
 //            SkDebugf("Failing to create color filter for mode %d\n", mode);
-            return NULL;
+            return nullptr;
         }
         return new ModeColorFilterEffect(c, mode);
     }
@@ -161,7 +161,7 @@
             SkXfermode::Mode mode = args.fFp.cast<ModeColorFilterEffect>().mode();
 
             SkASSERT(SkXfermode::kDst_Mode != mode);
-            const char* colorFilterColorUniName = NULL;
+            const char* colorFilterColorUniName = nullptr;
             if (args.fFp.cast<ModeColorFilterEffect>().willUseFilterColor()) {
                 fFilterColorUni = args.fBuilder->addUniform(
                                                       GrGLProgramBuilder::kFragment_Visibility,
@@ -363,7 +363,7 @@
                 *array->append() = frag;
             } else {
                 frag->unref();
-                SkDEBUGCODE(frag = NULL;)
+                SkDEBUGCODE(frag = nullptr;)
             }
             return true;
         }
@@ -403,7 +403,7 @@
 
 SkColorFilter* SkColorFilter::CreateModeFilter(SkColor color, SkXfermode::Mode mode) {
     if (!SkIsValidMode(mode)) {
-        return NULL;
+        return nullptr;
     }
 
     unsigned alpha = SkColorGetA(color);
@@ -431,7 +431,7 @@
                         SkXfermode::kXor_Mode == mode ||
                         SkXfermode::kDarken_Mode == mode)) ||
             (0xFF == alpha && SkXfermode::kDstIn_Mode == mode)) {
-        return NULL;
+        return nullptr;
     }
 
     switch (mode) {
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 46c9b26..8dc6030 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -197,7 +197,7 @@
                    array[SkColorMatrix::kB_Trans]) {
             fProc = shiftIs16 ? Add16 : Add;
         } else {
-            fProc = NULL;   // identity
+            fProc = nullptr;   // identity
         }
     }
 
@@ -262,7 +262,7 @@
 
 void SkColorMatrixFilter::filterSpan(const SkPMColor src[], int count, SkPMColor dst[]) const {
     Proc proc = fProc;
-    if (NULL == proc) {
+    if (nullptr == proc) {
         if (src != dst) {
             memcpy(dst, src, count * sizeof(SkPMColor));
         }
@@ -360,7 +360,7 @@
     if (buffer.readScalarArray(matrix.fMat, 20)) {
         return Create(matrix);
     }
-    return NULL;
+    return nullptr;
 }
 
 bool SkColorMatrixFilter::asColorMatrix(SkScalar matrix[20]) const {
@@ -377,7 +377,7 @@
         SkColorMatrix::SetConcat(concat, fMatrix.fMat, innerMatrix);
         return SkColorMatrixFilter::Create(concat);
     }
-    return NULL;
+    return nullptr;
 }
 
 #if SK_SUPPORT_GPU
@@ -411,7 +411,7 @@
                                                 kVec4f_GrSLType, kDefault_GrSLPrecision,
                                                 "ColorMatrixVector");
 
-            if (NULL == args.fInputColor) {
+            if (nullptr == args.fInputColor) {
                 // could optimize this case, but we aren't for now.
                 args.fInputColor = "vec4(1)";
             }
@@ -542,7 +542,7 @@
             *array->append() = frag;
         } else {
             frag->unref();
-            SkDEBUGCODE(frag = NULL;)
+            SkDEBUGCODE(frag = nullptr;)
         }
         return true;
     }
diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp
index 62e6771..2927f97 100644
--- a/src/effects/SkDashPathEffect.cpp
+++ b/src/effects/SkDashPathEffect.cpp
@@ -58,7 +58,7 @@
 static bool cull_line(SkPoint* pts, const SkStrokeRec& rec,
                       const SkMatrix& ctm, const SkRect* cullRect,
                       const SkScalar intervalLength) {
-    if (NULL == cullRect) {
+    if (nullptr == cullRect) {
         SkASSERT(false); // Shouldn't ever occur in practice
         return false;
     }
@@ -367,7 +367,7 @@
     if (buffer.readScalarArray(intervals.get(), count)) {
         return Create(intervals.get(), SkToInt(count), phase);
     }
-    return NULL;
+    return nullptr;
 }
 
 #ifndef SK_IGNORE_TO_STRING
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 62fca7b..9044284 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -169,7 +169,7 @@
                                                          const CropRect* cropRect) {
     if (!channel_selector_type_is_valid(xChannelSelector) ||
         !channel_selector_type_is_valid(yChannelSelector)) {
-        return NULL;
+        return nullptr;
     }
 
     SkImageFilter* inputs[2] = { displacement, color };
diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp
index fb3ea31..c856bd1 100644
--- a/src/effects/SkDropShadowImageFilter.cpp
+++ b/src/effects/SkDropShadowImageFilter.cpp
@@ -68,7 +68,7 @@
     }
 
     SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds.height()));
-    if (NULL == device.get()) {
+    if (nullptr == device.get()) {
         return false;
     }
     SkCanvas canvas(device.get());
diff --git a/src/effects/SkEmbossMaskFilter.cpp b/src/effects/SkEmbossMaskFilter.cpp
index fcb6a2a..2607e25 100644
--- a/src/effects/SkEmbossMaskFilter.cpp
+++ b/src/effects/SkEmbossMaskFilter.cpp
@@ -35,8 +35,8 @@
 
 SkMaskFilter* SkBlurMaskFilter::CreateEmboss(SkScalar blurSigma, const SkScalar direction[3],
                                              SkScalar ambient, SkScalar specular) {
-    if (direction == NULL) {
-        return NULL;
+    if (direction == nullptr) {
+        return nullptr;
     }
 
     // ambient should be 0...1 as a scalar
@@ -87,7 +87,7 @@
         margin->set(SkScalarCeilToInt(3*sigma), SkScalarCeilToInt(3*sigma));
     }
 
-    if (src.fImage == NULL) {
+    if (src.fImage == nullptr) {
         return true;
     }
 
@@ -131,7 +131,7 @@
         const SkScalar sigma = buffer.readScalar();
         return Create(sigma, light);
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkEmbossMaskFilter::flatten(SkWriteBuffer& buffer) const {
diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp
index 2b6b310..8b0e5fb 100644
--- a/src/effects/SkGpuBlurUtils.cpp
+++ b/src/effects/SkGpuBlurUtils.cpp
@@ -192,11 +192,11 @@
         tempTexture = temp2.get();
     }
 
-    if (NULL == dstTexture || NULL == tempTexture) {
-        return NULL;
+    if (nullptr == dstTexture || nullptr == tempTexture) {
+        return nullptr;
     }
 
-    GrDrawContext* srcDrawContext = NULL;
+    GrDrawContext* srcDrawContext = nullptr;
 
     for (int i = 1; i < scaleFactorX || i < scaleFactorY; i *= 2) {
         GrPaint paint;
@@ -226,7 +226,7 @@
 
         GrDrawContext* dstDrawContext = context->drawContext();
         if (!dstDrawContext) {
-            return NULL;
+            return nullptr;
         }
         dstDrawContext->drawNonAARectToRect(dstTexture->asRenderTarget(), clip, paint,
                                             SkMatrix::I(), dstRect, srcRect);
@@ -249,7 +249,7 @@
 
         GrDrawContext* dstDrawContext = context->drawContext();
         if (!dstDrawContext) {
-            return NULL;
+            return nullptr;
         }
         convolve_gaussian_2d(dstDrawContext, dstTexture->asRenderTarget(), clip, srcRect, dstRect,
                              srcTexture, radiusX, radiusY, sigmaX, sigmaY, cropToRect, srcIRect);
@@ -266,7 +266,7 @@
                 if (!srcDrawContext) {
                     srcDrawContext = context->drawContext();
                     if (!srcDrawContext) {
-                        return NULL;
+                        return nullptr;
                     }        
                 }
 
@@ -280,7 +280,7 @@
 
             GrDrawContext* dstDrawContext = context->drawContext();
             if (!dstDrawContext) {
-                return NULL;
+                return nullptr;
             }
             convolve_gaussian(dstDrawContext, dstTexture->asRenderTarget(), clip, srcRect, dstRect,
                               srcTexture, Gr1DKernelEffect::kX_Direction, radiusX, sigmaX,
@@ -298,7 +298,7 @@
                 if (!srcDrawContext) {
                     srcDrawContext = context->drawContext();
                     if (!srcDrawContext) {
-                        return NULL;
+                        return nullptr;
                     }        
                 }
 
@@ -313,7 +313,7 @@
 
             GrDrawContext* dstDrawContext = context->drawContext();
             if (!dstDrawContext) {
-                return NULL;
+                return nullptr;
             }
             convolve_gaussian(dstDrawContext, dstTexture->asRenderTarget(), clip, srcRect,
                               dstRect, srcTexture, Gr1DKernelEffect::kY_Direction, radiusY, sigmaY,
@@ -350,7 +350,7 @@
 
         GrDrawContext* dstDrawContext = context->drawContext();
         if (!dstDrawContext) {
-            return NULL;
+            return nullptr;
         }
         dstDrawContext->drawNonAARectToRect(dstTexture->asRenderTarget(), clip, paint,
                                             SkMatrix::I(), dstRect, srcRect);
diff --git a/src/effects/SkLayerDrawLooper.cpp b/src/effects/SkLayerDrawLooper.cpp
index 622088f..b5f26a3 100644
--- a/src/effects/SkLayerDrawLooper.cpp
+++ b/src/effects/SkLayerDrawLooper.cpp
@@ -22,8 +22,8 @@
 }
 
 SkLayerDrawLooper::SkLayerDrawLooper()
-        : fRecs(NULL),
-          fTopRec(NULL),
+        : fRecs(nullptr),
+          fTopRec(nullptr),
           fCount(0) {
 }
 
@@ -134,7 +134,7 @@
 bool SkLayerDrawLooper::LayerDrawLooperContext::next(SkCanvas* canvas,
                                                      SkPaint* paint) {
     canvas->restore();
-    if (NULL == fCurrRec) {
+    if (nullptr == fCurrRec) {
         return false;
     }
 
@@ -167,7 +167,7 @@
         return false;
     }
     const SkMaskFilter* mf = rec->fPaint.getMaskFilter();
-    if (NULL == mf) {
+    if (nullptr == mf) {
         return false;
     }
     SkMaskFilter::BlurRec maskBlur;
@@ -293,8 +293,8 @@
 #endif
 
 SkLayerDrawLooper::Builder::Builder()
-        : fRecs(NULL),
-          fTopRec(NULL),
+        : fRecs(nullptr),
+          fTopRec(nullptr),
           fCount(0) {
 }
 
@@ -314,7 +314,7 @@
     rec->fNext = fRecs;
     rec->fInfo = info;
     fRecs = rec;
-    if (NULL == fTopRec) {
+    if (nullptr == fTopRec) {
         fTopRec = rec;
     }
 
@@ -332,9 +332,9 @@
     fCount += 1;
 
     Rec* rec = new Rec;
-    rec->fNext = NULL;
+    rec->fNext = nullptr;
     rec->fInfo = info;
-    if (NULL == fRecs) {
+    if (nullptr == fRecs) {
         fRecs = rec;
     } else {
         SkASSERT(fTopRec);
@@ -351,8 +351,8 @@
     looper->fRecs = fRecs;
 
     fCount = 0;
-    fRecs = NULL;
-    fTopRec = NULL;
+    fRecs = nullptr;
+    fTopRec = nullptr;
 
     return looper;
 }
diff --git a/src/effects/SkLayerRasterizer.cpp b/src/effects/SkLayerRasterizer.cpp
index d5ebb24..6c08afc 100644
--- a/src/effects/SkLayerRasterizer.cpp
+++ b/src/effects/SkLayerRasterizer.cpp
@@ -36,7 +36,7 @@
     SkDeque::F2BIter        iter(*layers);
     SkLayerRasterizer_Rec*  rec;
 
-    while ((rec = (SkLayerRasterizer_Rec*)iter.next()) != NULL)
+    while ((rec = (SkLayerRasterizer_Rec*)iter.next()) != nullptr)
         rec->fPaint.~SkPaint();
 
     delete layers;
@@ -55,7 +55,7 @@
 
     bounds->set(SK_MaxS32, SK_MaxS32, SK_MinS32, SK_MinS32);
 
-    while ((rec = (SkLayerRasterizer_Rec*)iter.next()) != NULL) {
+    while ((rec = (SkLayerRasterizer_Rec*)iter.next()) != nullptr) {
         const SkPaint&  paint = rec->fPaint;
         SkPath          fillPath, devPath;
         const SkPath*   p = &path;
@@ -136,7 +136,7 @@
         SkDeque::F2BIter        iter(*fLayers);
         SkLayerRasterizer_Rec*  rec;
 
-        while ((rec = (SkLayerRasterizer_Rec*)iter.next()) != NULL) {
+        while ((rec = (SkLayerRasterizer_Rec*)iter.next()) != nullptr) {
             drawMatrix = translatedMatrix;
             drawMatrix.preTranslate(rec->fOffset.fX, rec->fOffset.fY);
             draw.drawPath(path, rec->fPaint);
@@ -172,7 +172,7 @@
     SkDeque::F2BIter                iter(*fLayers);
     const SkLayerRasterizer_Rec*    rec;
 
-    while ((rec = (const SkLayerRasterizer_Rec*)iter.next()) != NULL) {
+    while ((rec = (const SkLayerRasterizer_Rec*)iter.next()) != nullptr) {
         buffer.writePaint(rec->fPaint);
         buffer.writePoint(rec->fOffset);
     }
@@ -182,7 +182,7 @@
 
 SkLayerRasterizer::Builder::~Builder()
 {
-    if (fLayers != NULL) {
+    if (fLayers != nullptr) {
         clean_up_layers(fLayers);
     }
 }
@@ -199,24 +199,24 @@
 SkLayerRasterizer* SkLayerRasterizer::Builder::detachRasterizer() {
     SkLayerRasterizer* rasterizer;
     if (0 == fLayers->count()) {
-        rasterizer = NULL;
+        rasterizer = nullptr;
         delete fLayers;
     } else {
         rasterizer = new SkLayerRasterizer(fLayers);
     }
-    fLayers = NULL;
+    fLayers = nullptr;
     return rasterizer;
 }
 
 SkLayerRasterizer* SkLayerRasterizer::Builder::snapshotRasterizer() const {
     if (0 == fLayers->count()) {
-        return NULL;
+        return nullptr;
     }
     SkDeque* layers = new SkDeque(sizeof(SkLayerRasterizer_Rec), fLayers->count());
     SkDeque::F2BIter                iter(*fLayers);
     const SkLayerRasterizer_Rec*    recOrig;
     SkDEBUGCODE(int                 count = 0;)
-    while ((recOrig = static_cast<SkLayerRasterizer_Rec*>(iter.next())) != NULL) {
+    while ((recOrig = static_cast<SkLayerRasterizer_Rec*>(iter.next())) != nullptr) {
         SkDEBUGCODE(count++);
         SkLayerRasterizer_Rec* recCopy = static_cast<SkLayerRasterizer_Rec*>(layers->push_back());
         new (&recCopy->fPaint) SkPaint(recOrig->fPaint);
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 2bb1582..dd56751 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -754,7 +754,7 @@
         return new GrGLDistantLight;
 #else
         SkDEBUGFAIL("Should not call in GPU-less build");
-        return NULL;
+        return nullptr;
 #endif
     }
     bool requiresFragmentPosition() const override { return false; }
@@ -813,7 +813,7 @@
         return new GrGLPointLight;
 #else
         SkDEBUGFAIL("Should not call in GPU-less build");
-        return NULL;
+        return nullptr;
 #endif
     }
     bool requiresFragmentPosition() const override { return true; }
@@ -927,7 +927,7 @@
         return new GrGLSpotLight;
 #else
         SkDEBUGFAIL("Should not call in GPU-less build");
-        return NULL;
+        return nullptr;
 #endif
     }
     bool requiresFragmentPosition() const override { return true; }
@@ -1039,7 +1039,7 @@
         default:
             SkDEBUGFAIL("Unknown LightType.");
             buffer.validate(false);
-            return NULL;
+            return nullptr;
     }
 }
 ///////////////////////////////////////////////////////////////////////////////
@@ -1137,16 +1137,16 @@
                                                     SkScalar kd,
                                                     SkImageFilter* input,
                                                     const CropRect* cropRect) {
-    if (NULL == light) {
-        return NULL;
+    if (nullptr == light) {
+        return nullptr;
     }
     if (!SkScalarIsFinite(surfaceScale) || !SkScalarIsFinite(kd)) {
-        return NULL;
+        return nullptr;
     }
     // According to the spec, kd can be any non-negative number :
     // http://www.w3.org/TR/SVG/filters.html#feDiffuseLightingElement
     if (kd < 0) {
-        return NULL;
+        return nullptr;
     }
     return new SkDiffuseLightingImageFilter(light, surfaceScale, kd, input, cropRect);
 }
@@ -1275,16 +1275,16 @@
                                                      SkScalar shininess,
                                                      SkImageFilter* input,
                                                      const CropRect* cropRect) {
-    if (NULL == light) {
-        return NULL;
+    if (nullptr == light) {
+        return nullptr;
     }
     if (!SkScalarIsFinite(surfaceScale) || !SkScalarIsFinite(ks) || !SkScalarIsFinite(shininess)) {
-        return NULL;
+        return nullptr;
     }
     // According to the spec, ks can be any non-negative number :
     // http://www.w3.org/TR/SVG/filters.html#feSpecularLightingElement
     if (ks < 0) {
-        return NULL;
+        return nullptr;
     }
     return new SkSpecularLightingImageFilter(light, surfaceScale, ks, shininess, input, cropRect);
 }
@@ -1433,7 +1433,7 @@
         }
         default:
             SkFAIL("Unexpected value.");
-            return NULL;
+            return nullptr;
     }
 }
 
diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp
index caa2a20..21f7c05 100644
--- a/src/effects/SkLumaColorFilter.cpp
+++ b/src/effects/SkLumaColorFilter.cpp
@@ -68,7 +68,7 @@
         static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {}
 
         virtual void emitCode(EmitArgs& args) override {
-            if (NULL == args.fInputColor) {
+            if (nullptr == args.fInputColor) {
                 args.fInputColor = "vec4(1)";
             }
 
@@ -117,7 +117,7 @@
             *array->append() = frag;
         } else {
             frag->unref();
-            SkDEBUGCODE(frag = NULL;)
+            SkDEBUGCODE(frag = nullptr;)
         }
         return true;
     }
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index 8bebd20..1e1ec45 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -245,11 +245,11 @@
                                               SkImageFilter* input) {
 
     if (!SkScalarIsFinite(inset) || !SkIsValidRect(srcRect)) {
-        return NULL;
+        return nullptr;
     }
     // Negative numbers in src rect are not supported
     if (srcRect.fLeft < 0 || srcRect.fTop < 0) {
-        return NULL;
+        return nullptr;
     }
     return new SkMagnifierImageFilter(srcRect, inset, input);
 }
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 1c44fed..c2ad9ea 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -57,17 +57,17 @@
     SkImageFilter* input,
     const CropRect* cropRect) {
     if (kernelSize.width() < 1 || kernelSize.height() < 1) {
-        return NULL;
+        return nullptr;
     }
     if (gMaxKernelSize / kernelSize.fWidth < kernelSize.fHeight) {
-        return NULL;
+        return nullptr;
     }
     if (!kernel) {
-        return NULL;
+        return nullptr;
     }
     if ((kernelOffset.fX < 0) || (kernelOffset.fX >= kernelSize.fWidth) ||
         (kernelOffset.fY < 0) || (kernelOffset.fY >= kernelSize.fHeight)) {
-        return NULL;
+        return nullptr;
     }
     return new SkMatrixConvolutionImageFilter(kernelSize, kernel, gain, bias, kernelOffset,
                                               tileMode, convolveAlpha, input, cropRect);
@@ -82,11 +82,11 @@
 
     const int64_t kernelArea = sk_64_mul(kernelSize.width(), kernelSize.height());
     if (!buffer.validate(kernelArea == count)) {
-        return NULL;
+        return nullptr;
     }
     SkAutoSTArray<16, SkScalar> kernel(count);
     if (!buffer.readScalarArray(kernel.get(), count)) {
-        return NULL;
+        return nullptr;
     }
     SkScalar gain = buffer.readScalar();
     SkScalar bias = buffer.readScalar();
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp
index 4c5404d..6e06b25 100755
--- a/src/effects/SkMergeImageFilter.cpp
+++ b/src/effects/SkMergeImageFilter.cpp
@@ -24,7 +24,7 @@
             fModes = SkTCast<uint8_t*>(sk_malloc_throw(size));
         }
     } else {
-        fModes = NULL;
+        fModes = nullptr;
     }
 }
 
@@ -36,7 +36,7 @@
             fModes[i] = SkToU8(modes[i]);
         }
     } else {
-        fModes = NULL;
+        fModes = nullptr;
     }
 }
 
@@ -71,7 +71,7 @@
     const int y0 = bounds.top();
 
     SkAutoTUnref<SkBaseDevice> dst(proxy->createDevice(bounds.width(), bounds.height()));
-    if (NULL == dst) {
+    if (nullptr == dst) {
         return false;
     }
     SkCanvas canvas(dst);
@@ -96,7 +96,7 @@
         if (fModes) {
             paint.setXfermodeMode((SkXfermode::Mode)fModes[i]);
         } else {
-            paint.setXfermode(NULL);
+            paint.setXfermode(nullptr);
         }
         canvas.drawSprite(*srcPtr, pos.x() - x0, pos.y() - y0, &paint);
         didProduceResult = true;
@@ -114,7 +114,7 @@
 SkFlattenable* SkMergeImageFilter::CreateProc(SkReadBuffer& buffer) {
     Common common;
     if (!common.unflatten(buffer, -1)) {
-        return NULL;
+        return nullptr;
     }
 
     const int count = common.inputCount();
@@ -123,23 +123,23 @@
         SkAutoSTArray<4, SkXfermode::Mode> modes(count);
         SkAutoSTArray<4, uint8_t> modes8(count);
         if (!buffer.readByteArray(modes8.get(), count)) {
-            return NULL;
+            return nullptr;
         }
         for (int i = 0; i < count; ++i) {
             modes[i] = (SkXfermode::Mode)modes8[i];
             buffer.validate(SkIsValidMode(modes[i]));
         }
         if (!buffer.isValid()) {
-            return NULL;
+            return nullptr;
         }
         return Create(common.inputs(), count, modes.get(), &common.cropRect());
     }
-    return Create(common.inputs(), count, NULL, &common.cropRect());
+    return Create(common.inputs(), count, nullptr, &common.cropRect());
 }
 
 void SkMergeImageFilter::flatten(SkWriteBuffer& buffer) const {
     this->INHERITED::flatten(buffer);
-    buffer.writeBool(fModes != NULL);
+    buffer.writeBool(fModes != nullptr);
     if (fModes) {
         buffer.writeByteArray(fModes, countInputs() * sizeof(fModes[0]));
     }
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index b8efd2d..cde29c0 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -570,7 +570,7 @@
 
     if (radius.fWidth > 0) {
         GrTexture* scratch = context->textureProvider()->createApproxTexture(desc);
-        if (NULL == scratch) {
+        if (nullptr == scratch) {
             return false;
         }
         GrDrawContext* dstDrawContext = context->drawContext();
@@ -593,7 +593,7 @@
     }
     if (radius.fHeight > 0) {
         GrTexture* scratch = context->textureProvider()->createApproxTexture(desc);
-        if (NULL == scratch) {
+        if (nullptr == scratch) {
             return false;
         }
         GrDrawContext* dstDrawContext = context->drawContext();
diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/SkOffsetImageFilter.cpp
index 1944e58..551902b 100644
--- a/src/effects/SkOffsetImageFilter.cpp
+++ b/src/effects/SkOffsetImageFilter.cpp
@@ -47,7 +47,7 @@
         }
 
         SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds.height()));
-        if (NULL == device.get()) {
+        if (nullptr == device.get()) {
             return false;
         }
         SkCanvas canvas(device);
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index 2ca86c7..af6622b 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -272,7 +272,7 @@
   , fBaseFrequencyY(baseFrequencyY)
   , fNumOctaves(numOctaves > 255 ? 255 : numOctaves/*[0,255] octaves allowed*/)
   , fSeed(seed)
-  , fTileSize(NULL == tileSize ? SkISize::Make(0, 0) : *tileSize)
+  , fTileSize(nullptr == tileSize ? SkISize::Make(0, 0) : *tileSize)
   , fStitchTiles(!fTileSize.isEmpty())
 {
     SkASSERT(numOctaves >= 0 && numOctaves < 256);
@@ -297,7 +297,7 @@
         case kTurbulence_Type:
             return SkPerlinNoiseShader::CreateTubulence(freqX, freqY, octaves, seed, &tileSize);
         default:
-            return NULL;
+            return nullptr;
     }
 }
 
@@ -607,16 +607,16 @@
 
     SkShader* shader = d->fRandom->nextBool() ?
         SkPerlinNoiseShader::CreateFractalNoise(baseFrequencyX, baseFrequencyY, numOctaves, seed,
-                                                stitchTiles ? &tileSize : NULL) :
+                                                stitchTiles ? &tileSize : nullptr) :
         SkPerlinNoiseShader::CreateTurbulence(baseFrequencyX, baseFrequencyY, numOctaves, seed,
-                                             stitchTiles ? &tileSize : NULL);
+                                             stitchTiles ? &tileSize : nullptr);
 
     SkPaint paint;
     GrColor paintColor;
     GrFragmentProcessor* effect;
     GrPaint grPaint;
     SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
-                                               GrTest::TestMatrix(d->fRandom), NULL,
+                                               GrTest::TestMatrix(d->fRandom), nullptr,
                                                &paintColor, grPaint.getProcessorDataManager(),
                                                &effect));
 
@@ -644,7 +644,7 @@
                                     "alpha");
     const char* alphaUni = args.fBuilder->getUniformCStr(fAlphaUni);
 
-    const char* stitchDataUni = NULL;
+    const char* stitchDataUni = nullptr;
     if (fStitchTiles) {
         fStitchDataUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
                                              kVec2f_GrSLType, kDefault_GrSLPrecision,
@@ -966,9 +966,9 @@
     SkPerlinNoiseShader::PaintingData* paintingData =
             new PaintingData(fTileSize, fSeed, fBaseFrequencyX, fBaseFrequencyY, matrix);
     SkAutoTUnref<GrTexture> permutationsTexture(
-        GrRefCachedBitmapTexture(context, paintingData->getPermutationsBitmap(), NULL));
+        GrRefCachedBitmapTexture(context, paintingData->getPermutationsBitmap(), nullptr));
     SkAutoTUnref<GrTexture> noiseTexture(
-        GrRefCachedBitmapTexture(context, paintingData->getNoiseBitmap(), NULL));
+        GrRefCachedBitmapTexture(context, paintingData->getNoiseBitmap(), nullptr));
 
     SkMatrix m = viewM;
     m.setTranslateX(-localMatrix.getTranslateX() + SK_Scalar1);
@@ -983,7 +983,7 @@
                                           m, paint.getAlpha());
     } else {
         delete paintingData;
-        *fp = NULL;
+        *fp = nullptr;
     }
     return true;
 }
diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp
index bf1ba8d..d85024e 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -14,7 +14,7 @@
 #include "SkValidationUtils.h"
 
 SkPictureImageFilter::SkPictureImageFilter(const SkPicture* picture)
-    : INHERITED(0, 0, NULL)
+    : INHERITED(0, 0, nullptr)
     , fPicture(SkSafeRef(picture))
     , fCropRect(picture ? picture->cullRect() : SkRect::MakeEmpty())
     , fPictureResolution(kDeviceSpace_PictureResolution) 
@@ -24,7 +24,7 @@
 SkPictureImageFilter::SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect,
                                            PictureResolution pictureResolution,
                                            SkFilterQuality filterQuality)
-    : INHERITED(0, 0, NULL)
+    : INHERITED(0, 0, nullptr)
     , fPicture(SkSafeRef(picture))
     , fCropRect(cropRect)
     , fPictureResolution(pictureResolution)
@@ -71,7 +71,7 @@
     if (buffer.isCrossProcess() && SkPicture::PictureIOSecurityPrecautionsEnabled()) {
         buffer.writeBool(false);
     } else {
-        bool hasPicture = (fPicture != NULL);
+        bool hasPicture = (fPicture != nullptr);
         buffer.writeBool(hasPicture);
         if (hasPicture) {
             fPicture->flatten(buffer);
@@ -104,7 +104,7 @@
     }
 
     SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds.height()));
-    if (NULL == device.get()) {
+    if (nullptr == device.get()) {
         return false;
     }
 
diff --git a/src/effects/SkRectShaderImageFilter.cpp b/src/effects/SkRectShaderImageFilter.cpp
index 6309d35..f9e7070 100644
--- a/src/effects/SkRectShaderImageFilter.cpp
+++ b/src/effects/SkRectShaderImageFilter.cpp
@@ -20,16 +20,16 @@
         flags = 0x0;
     }
     CropRect cropRect(rect, flags);
-    return s ? new SkRectShaderImageFilter(s, &cropRect) : NULL;
+    return s ? new SkRectShaderImageFilter(s, &cropRect) : nullptr;
 }
 
 SkRectShaderImageFilter* SkRectShaderImageFilter::Create(SkShader* s, const CropRect* cropRect) {
     SkASSERT(s);
-    return s ? new SkRectShaderImageFilter(s, cropRect) : NULL;
+    return s ? new SkRectShaderImageFilter(s, cropRect) : nullptr;
 }
 
 SkRectShaderImageFilter::SkRectShaderImageFilter(SkShader* s, const CropRect* cropRect)
-  : INHERITED(0, NULL, cropRect)
+  : INHERITED(0, nullptr, cropRect)
   , fShader(SkRef(s)) {
 }
 
@@ -60,7 +60,7 @@
 
     SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(),
                                                           bounds.height()));
-    if (NULL == device.get()) {
+    if (nullptr == device.get()) {
         return false;
     }
     SkCanvas canvas(device.get());
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index e20f922..f0245b7 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -17,7 +17,7 @@
 public:
     SkTable_ColorFilter(const uint8_t tableA[], const uint8_t tableR[],
                         const uint8_t tableG[], const uint8_t tableB[]) {
-        fBitmap = NULL;
+        fBitmap = nullptr;
         fFlags = 0;
 
         uint8_t* dst = fStorage;
@@ -215,10 +215,10 @@
     uint8_t packedStorage[5*256];
     size_t packedSize = buffer.getArrayCount();
     if (!buffer.validate(packedSize <= sizeof(packedStorage))) {
-        return NULL;
+        return nullptr;
     }
     if (!buffer.readByteArray(packedStorage, packedSize)) {
-        return NULL;
+        return nullptr;
     }
 
     uint8_t unpackedStorage[4*256];
@@ -226,13 +226,13 @@
                               unpackedStorage, sizeof(unpackedStorage));
     // now check that we got the size we expected
     if (!buffer.validate(unpackedSize == count*256)) {
-        return NULL;
+        return nullptr;
     }
 
-    const uint8_t* a = NULL;
-    const uint8_t* r = NULL;
-    const uint8_t* g = NULL;
-    const uint8_t* b = NULL;
+    const uint8_t* a = nullptr;
+    const uint8_t* r = nullptr;
+    const uint8_t* g = nullptr;
+    const uint8_t* b = nullptr;
     const uint8_t* ptr = unpackedStorage;
 
     if (flags & kA_Flag) {
@@ -256,7 +256,7 @@
 
 bool SkTable_ColorFilter::asComponentTable(SkBitmap* table) const {
     if (table) {
-        if (NULL == fBitmap) {
+        if (nullptr == fBitmap) {
             SkBitmap* bmp = new SkBitmap;
             bmp->allocPixels(SkImageInfo::MakeA8(256, 4));
             uint8_t* bitmapPixels = bmp->getAddr8(0, 0);
@@ -290,12 +290,12 @@
 SkColorFilter* SkTable_ColorFilter::newComposed(const SkColorFilter* innerFilter) const {
     SkBitmap innerBM;
     if (!innerFilter->asComponentTable(&innerBM)) {
-        return NULL;
+        return nullptr;
     }
 
     innerBM.lockPixels();
-    if (NULL == innerBM.getPixels()) {
-        return NULL;
+    if (nullptr == innerBM.getPixels()) {
+        return nullptr;
     }
 
     const uint8_t* table = fStorage;
@@ -419,7 +419,7 @@
     static const float kColorScaleFactor = 255.0f / 256.0f;
     static const float kColorOffsetFactor = 1.0f / 512.0f;
     GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
-    if (NULL == args.fInputColor) {
+    if (nullptr == args.fInputColor) {
         // the input color is solid white (all ones).
         static const float kMaxValue = kColorScaleFactor + kColorOffsetFactor;
         fsBuilder->codeAppendf("\t\tvec4 coord = vec4(%f, %f, %f, %f);\n",
@@ -473,9 +473,9 @@
     int row = atlas->lockRow(bitmap);
     SkAutoTUnref<GrTexture> texture;
     if (-1 == row) {
-        atlas = NULL;
-        // Passing params=NULL because this effect does no tiling or filtering.
-        texture.reset(GrRefCachedBitmapTexture(context, bitmap, NULL));
+        atlas = nullptr;
+        // Passing params=nullptr because this effect does no tiling or filtering.
+        texture.reset(GrRefCachedBitmapTexture(context, bitmap, nullptr));
     } else {
         texture.reset(SkRef(atlas->getTexture()));
     }
@@ -557,10 +557,10 @@
         }
     }
     SkAutoTUnref<SkColorFilter> filter(SkTableColorFilter::CreateARGB(
-        (flags & (1 << 0)) ? luts[0] : NULL,
-        (flags & (1 << 1)) ? luts[1] : NULL,
-        (flags & (1 << 2)) ? luts[2] : NULL,
-        (flags & (1 << 3)) ? luts[3] : NULL
+        (flags & (1 << 0)) ? luts[0] : nullptr,
+        (flags & (1 << 1)) ? luts[1] : nullptr,
+        (flags & (1 << 2)) ? luts[2] : nullptr,
+        (flags & (1 << 3)) ? luts[3] : nullptr
     ));
 
     SkTDArray<GrFragmentProcessor*> array;
@@ -568,7 +568,7 @@
         SkASSERT(1 == array.count());   // TableColorFilter only returns 1
         return array[0];
     }
-    return NULL;
+    return nullptr;
 }
 
 bool SkTable_ColorFilter::asFragmentProcessors(GrContext* context,
@@ -583,7 +583,7 @@
             *array->append() = frag;
         } else {
             frag->unref();
-            SkDEBUGCODE(frag = NULL;)
+            SkDEBUGCODE(frag = nullptr;)
         }
         return true;
     }
diff --git a/src/effects/SkTableMaskFilter.cpp b/src/effects/SkTableMaskFilter.cpp
index dc9b335..999b998 100644
--- a/src/effects/SkTableMaskFilter.cpp
+++ b/src/effects/SkTableMaskFilter.cpp
@@ -33,7 +33,7 @@
     dst->fBounds = src.fBounds;
     dst->fRowBytes = SkAlign4(dst->fBounds.width());
     dst->fFormat = SkMask::kA8_Format;
-    dst->fImage = NULL;
+    dst->fImage = nullptr;
 
     if (src.fImage) {
         dst->fImage = SkMask::AllocImage(dst->computeImageSize());
@@ -77,7 +77,7 @@
 SkFlattenable* SkTableMaskFilter::CreateProc(SkReadBuffer& buffer) {
     uint8_t table[256];
     if (!buffer.readByteArray(table, 256)) {
-        return NULL;
+        return nullptr;
     }
     return Create(table);
 }
diff --git a/src/effects/SkTestImageFilters.cpp b/src/effects/SkTestImageFilters.cpp
index 43b43a5..432b576 100755
--- a/src/effects/SkTestImageFilters.cpp
+++ b/src/effects/SkTestImageFilters.cpp
@@ -49,7 +49,7 @@
     // downsample
     {
         SkBaseDevice* dev = proxy->createDevice(dstW, dstH);
-        if (NULL == dev) {
+        if (nullptr == dev) {
             return false;
         }
         OwnDeviceCanvas canvas(dev);
@@ -64,7 +64,7 @@
     // upscale
     {
         SkBaseDevice* dev = proxy->createDevice(src.width(), src.height());
-        if (NULL == dev) {
+        if (nullptr == dev) {
             return false;
         }
         OwnDeviceCanvas canvas(dev);
diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp
index 9292b26..5e633a3 100644
--- a/src/effects/SkTileImageFilter.cpp
+++ b/src/effects/SkTileImageFilter.cpp
@@ -19,7 +19,7 @@
 SkTileImageFilter* SkTileImageFilter::Create(const SkRect& srcRect, const SkRect& dstRect,
                                              SkImageFilter* input) {
     if (!SkIsValidRect(srcRect) || !SkIsValidRect(dstRect)) {
-        return NULL;
+        return nullptr;
     }
     return new SkTileImageFilter(srcRect, dstRect, input);
 }
@@ -60,7 +60,7 @@
     }
 
     SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(w, h));
-    if (NULL == device.get()) {
+    if (nullptr == device.get()) {
         return false;
     }
     SkCanvas canvas(device);
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index f62773a..7c4a94b 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -77,7 +77,7 @@
     }
 
     SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds.height()));
-    if (NULL == device.get()) {
+    if (nullptr == device.get()) {
         return false;
     }
     SkCanvas canvas(device);
@@ -123,7 +123,7 @@
 #if SK_SUPPORT_GPU
 
 bool SkXfermodeImageFilter::canFilterImageGPU() const {
-    return fMode && fMode->asFragmentProcessor(NULL, NULL, NULL) && !cropRectIsSet();
+    return fMode && fMode->asFragmentProcessor(nullptr, nullptr, nullptr) && !cropRectIsSet();
 }
 
 bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
@@ -139,7 +139,7 @@
     }
 
     GrTexture* backgroundTex = background.getTexture();
-    if (NULL == backgroundTex) {
+    if (nullptr == backgroundTex) {
         SkASSERT(false);
         return false;
     }
@@ -153,7 +153,7 @@
     GrTexture* foregroundTex = foreground.getTexture();
     GrContext* context = foregroundTex->getContext();
 
-    GrFragmentProcessor* xferProcessor = NULL;
+    GrFragmentProcessor* xferProcessor = nullptr;
 
     GrSurfaceDesc desc;
     desc.fFlags = kRenderTarget_GrSurfaceFlag;
diff --git a/src/effects/gradients/SkGradientBitmapCache.cpp b/src/effects/gradients/SkGradientBitmapCache.cpp
index 90fa3d5..24e7f58 100644
--- a/src/effects/gradients/SkGradientBitmapCache.cpp
+++ b/src/effects/gradients/SkGradientBitmapCache.cpp
@@ -18,8 +18,8 @@
     SkBitmap    fBitmap;
 
     Entry(const void* buffer, size_t size, const SkBitmap& bm)
-            : fPrev(NULL),
-              fNext(NULL),
+            : fPrev(nullptr),
+              fNext(nullptr),
               fBitmap(bm) {
         fBuffer = sk_malloc_throw(size);
         fSize = size;
@@ -35,7 +35,7 @@
 
 SkGradientBitmapCache::SkGradientBitmapCache(int max) : fMaxEntries(max) {
     fEntryCount = 0;
-    fHead = fTail = NULL;
+    fHead = fTail = nullptr;
 
     this->validate();
 }
@@ -70,7 +70,7 @@
 }
 
 void SkGradientBitmapCache::attachToHead(Entry* entry) const {
-    entry->fPrev = NULL;
+    entry->fPrev = nullptr;
     entry->fNext = fHead;
     if (fHead) {
         fHead->fPrev = entry;
@@ -121,8 +121,8 @@
     SkASSERT(fEntryCount >= 0 && fEntryCount <= fMaxEntries);
 
     if (fEntryCount > 0) {
-        SkASSERT(NULL == fHead->fPrev);
-        SkASSERT(NULL == fTail->fNext);
+        SkASSERT(nullptr == fHead->fPrev);
+        SkASSERT(nullptr == fTail->fNext);
 
         if (fEntryCount == 1) {
             SkASSERT(fHead == fTail);
@@ -145,8 +145,8 @@
         }
         SkASSERT(0 == count);
     } else {
-        SkASSERT(NULL == fHead);
-        SkASSERT(NULL == fTail);
+        SkASSERT(nullptr == fHead);
+        SkASSERT(nullptr == fTail);
     }
 }
 
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 8bef3e3..2f89352 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -49,7 +49,7 @@
             return false;
         }
     } else {
-        fPos = NULL;
+        fPos = nullptr;
     }
 
     fTileMode = (SkShader::TileMode)buffer.read32();
@@ -59,7 +59,7 @@
         fLocalMatrix = &fLocalMatrixStorage;
         buffer.readMatrix(&fLocalMatrixStorage);
     } else {
-        fLocalMatrix = NULL;
+        fLocalMatrix = nullptr;
     }
     return buffer.isValid();
 }
@@ -130,7 +130,7 @@
         fOrigPos = (SkScalar*)(fOrigColors + fColorCount);
         fRecs = (Rec*)(fOrigPos + fColorCount);
     } else {
-        fOrigPos = NULL;
+        fOrigPos = nullptr;
         fRecs = (Rec*)(fOrigColors + fColorCount);
     }
 
@@ -175,7 +175,7 @@
                 recs += 1;
             }
         } else {    // assume even distribution
-            fOrigPos = NULL;
+            fOrigPos = nullptr;
 
             SkFixed dp = SK_Fixed1 / (desc.fCount - 1);
             SkFixed p = dp;
@@ -194,7 +194,7 @@
         fOrigPos[0] = SkScalarPin(desc.fPos[0], 0, 1);
         fOrigPos[1] = SkScalarPin(desc.fPos[1], fOrigPos[0], 1);
         if (0 == fOrigPos[0] && 1 == fOrigPos[1]) {
-            fOrigPos = NULL;
+            fOrigPos = nullptr;
         }
     }
     this->initCommon();
@@ -223,7 +223,7 @@
     desc.fGradFlags = fGradFlags;
 
     const SkMatrix& m = this->getLocalMatrix();
-    desc.fLocalMatrix = m.isIdentity() ? NULL : &m;
+    desc.fLocalMatrix = m.isIdentity() ? nullptr : &m;
     desc.flatten(buffer);
 }
 
@@ -324,10 +324,10 @@
     , fCache32Inited(false)
 {
     // Only initialize the cache in getCache16/32.
-    fCache16 = NULL;
-    fCache32 = NULL;
-    fCache16Storage = NULL;
-    fCache32PixelRef = NULL;
+    fCache16 = nullptr;
+    fCache32 = nullptr;
+    fCache16Storage = nullptr;
+    fCache32PixelRef = nullptr;
 }
 
 SkGradientShaderBase::GradientShaderCache::~GradientShaderCache() {
@@ -535,7 +535,7 @@
     const int entryCount = kCache16Count * 2;
     const size_t allocSize = sizeof(uint16_t) * entryCount;
 
-    SkASSERT(NULL == cache->fCache16Storage);
+    SkASSERT(nullptr == cache->fCache16Storage);
     cache->fCache16Storage = (uint16_t*)sk_malloc_throw(allocSize);
     cache->fCache16 = cache->fCache16Storage;
     if (cache->fShader.fColorCount == 2) {
@@ -567,8 +567,8 @@
     const int kNumberOfDitherRows = 4;
     const SkImageInfo info = SkImageInfo::MakeN32Premul(kCache32Count, kNumberOfDitherRows);
 
-    SkASSERT(NULL == cache->fCache32PixelRef);
-    cache->fCache32PixelRef = SkMallocPixelRef::NewAllocate(info, 0, NULL);
+    SkASSERT(nullptr == cache->fCache32PixelRef);
+    cache->fCache32PixelRef = SkMallocPixelRef::NewAllocate(info, 0, nullptr);
     cache->fCache32 = (SkPMColor*)cache->fCache32PixelRef->getAddr();
     if (cache->fShader.fColorCount == 2) {
         Build32bitCache(cache->fCache32, cache->fShader.fOrigColors[0],
@@ -647,7 +647,7 @@
     static const int MAX_NUM_CACHED_GRADIENT_BITMAPS = 32;
     SkAutoMutexAcquire ama(gGradientCacheMutex);
 
-    if (NULL == gCache) {
+    if (nullptr == gCache) {
         gCache = new SkGradientBitmapCache(MAX_NUM_CACHED_GRADIENT_BITMAPS);
     }
     size_t size = count * sizeof(int32_t);
@@ -737,7 +737,7 @@
 // Return true if these parameters are valid/legal/safe to construct a gradient
 //
 static bool valid_grad(const SkColor colors[], const SkScalar pos[], int count, unsigned tileMode) {
-    return NULL != colors && count >= 1 && tileMode < (unsigned)SkShader::kTileModeCount;
+    return nullptr != colors && count >= 1 && tileMode < (unsigned)SkShader::kTileModeCount;
 }
 
 // assumes colors is SkColor* and pos is SkScalar*
@@ -747,7 +747,7 @@
         if (1 == count) {                   \
             tmp[0] = tmp[1] = colors[0];    \
             colors = tmp;                   \
-            pos = NULL;                     \
+            pos = nullptr;                     \
             count = 2;                      \
         }                                   \
     } while (0)
@@ -770,10 +770,10 @@
                                          uint32_t flags,
                                          const SkMatrix* localMatrix) {
     if (!pts) {
-        return NULL;
+        return nullptr;
     }
     if (!valid_grad(colors, pos, colorCount, mode)) {
-        return NULL;
+        return nullptr;
     }
     EXPAND_1_COLOR(colorCount);
 
@@ -789,10 +789,10 @@
                                          uint32_t flags,
                                          const SkMatrix* localMatrix) {
     if (radius <= 0) {
-        return NULL;
+        return nullptr;
     }
     if (!valid_grad(colors, pos, colorCount, mode)) {
-        return NULL;
+        return nullptr;
     }
     EXPAND_1_COLOR(colorCount);
 
@@ -812,10 +812,10 @@
                                                   uint32_t flags,
                                                   const SkMatrix* localMatrix) {
     if (startRadius < 0 || endRadius < 0) {
-        return NULL;
+        return nullptr;
     }
     if (!valid_grad(colors, pos, colorCount, mode)) {
-        return NULL;
+        return nullptr;
     }
     if (start == end && startRadius == endRadius) {
         return SkShader::CreateEmptyShader();
@@ -844,7 +844,7 @@
             }
             desc_init(&desc, colorsNew.get(), posNew.get(), colorCount, mode, flags, localMatrix);
         } else {
-            desc_init(&desc, colorsNew.get(), NULL, colorCount, mode, flags, localMatrix);
+            desc_init(&desc, colorsNew.get(), nullptr, colorCount, mode, flags, localMatrix);
         }
 
         return new SkTwoPointConicalGradient(end, endRadius, start, startRadius, flipGradient,
@@ -859,7 +859,7 @@
                                         uint32_t flags,
                                         const SkMatrix* localMatrix) {
     if (!valid_grad(colors, pos, colorCount, SkShader::kClamp_TileMode)) {
-        return NULL;
+        return nullptr;
     }
     EXPAND_1_COLOR(colorCount);
 
@@ -1168,7 +1168,7 @@
 
     // if one color, omit stops, otherwise randomly decide whether or not to
     if (outColors == 1 || (outColors >= 2 && random->nextBool())) {
-        *stops = NULL;
+        *stops = nullptr;
     }
 
     SkScalar stop = 0.f;
diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h
index d081d6f..38b506b 100644
--- a/src/effects/gradients/SkGradientShaderPriv.h
+++ b/src/effects/gradients/SkGradientShaderPriv.h
@@ -137,7 +137,7 @@
         unsigned getAlpha() const { return fCacheAlpha; }
 
     private:
-        // Working pointers. If either is NULL, we need to recompute the corresponding cache values.
+        // Working pointers. If either is nullptr, we need to recompute the corresponding cache values.
         uint16_t*   fCache16;
         SkPMColor*  fCache32;
 
@@ -358,7 +358,7 @@
         The function decides whether stop values should be used or not. The return value indicates
         the number of colors, which will be capped by kMaxRandomGradientColors. colors should be
         sized to be at least kMaxRandomGradientColors. stops is a pointer to an array of at least
-        size kMaxRandomGradientColors. It may be updated to NULL, indicating that NULL should be
+        size kMaxRandomGradientColors. It may be updated to nullptr, indicating that nullptr should be
         passed to the gradient factory rather than the array.
     */
     static const int kMaxRandomGradientColors = 4;
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index a5be417..86142fd 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -63,7 +63,7 @@
 SkFlattenable* SkLinearGradient::CreateProc(SkReadBuffer& buffer) {
     DescriptorScope desc;
     if (!desc.unflatten(buffer)) {
-        return NULL;
+        return nullptr;
     }
     SkPoint pts[2];
     pts[0] = buffer.readPoint();
@@ -228,7 +228,7 @@
 
         if (fDstToIndexClass == kFixedStepInX_MatrixClass) {
             SkFixed dxStorage[1];
-            (void)fDstToIndex.fixedStepInX(SkIntToScalar(y), dxStorage, NULL);
+            (void)fDstToIndex.fixedStepInX(SkIntToScalar(y), dxStorage, nullptr);
             // todo: do we need a real/high-precision value for dx here?
             dx = SkFixedToGradFixed(dxStorage[0]);
         } else {
@@ -401,7 +401,7 @@
 
         if (fDstToIndexClass == kFixedStepInX_MatrixClass) {
             SkFixed dxStorage[1];
-            (void)fDstToIndex.fixedStepInX(SkIntToScalar(y), dxStorage, NULL);
+            (void)fDstToIndex.fixedStepInX(SkIntToScalar(y), dxStorage, nullptr);
             // todo: do we need a real/high-precision value for dx here?
             dx = SkFixedToGradFixed(dxStorage[0]);
         } else {
@@ -523,7 +523,7 @@
     GrColor paintColor;
     GrFragmentProcessor* fp;
     SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
-                                               GrTest::TestMatrix(d->fRandom), NULL,
+                                               GrTest::TestMatrix(d->fRandom), nullptr,
                                                &paintColor, d->fProcDataManager, &fp));
     return fp;
 }
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index 7e24949..3a1a21e 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -237,7 +237,7 @@
 SkFlattenable* SkRadialGradient::CreateProc(SkReadBuffer& buffer) {
     DescriptorScope desc;
     if (!desc.unflatten(buffer)) {
-        return NULL;
+        return nullptr;
     }
     const SkPoint center = buffer.readPoint();
     const SkScalar radius = buffer.readScalar();
@@ -495,7 +495,7 @@
     GrColor paintColor;
     GrFragmentProcessor* fp;
     SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
-                                               GrTest::TestMatrix(d->fRandom), NULL,
+                                               GrTest::TestMatrix(d->fRandom), nullptr,
                                                &paintColor, d->fProcDataManager, &fp));
     return fp;
 }
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index 9e44b70..c6699e8 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -33,7 +33,7 @@
 SkFlattenable* SkSweepGradient::CreateProc(SkReadBuffer& buffer) {
     DescriptorScope desc;
     if (!desc.unflatten(buffer)) {
-        return NULL;
+        return nullptr;
     }
     const SkPoint center = buffer.readPoint();
     return SkGradientShader::CreateSweep(center.x(), center.y(), desc.fColors, desc.fPos,
@@ -240,7 +240,7 @@
     GrFragmentProcessor* fp;
     GrColor paintColor;
     SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
-                                               GrTest::TestMatrix(d->fRandom), NULL,
+                                               GrTest::TestMatrix(d->fRandom), nullptr,
                                                &paintColor, d->fProcDataManager, &fp));
     return fp;
 }
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 7e5edf2..41b5c1b 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -312,7 +312,7 @@
 SkFlattenable* SkTwoPointConicalGradient::CreateProc(SkReadBuffer& buffer) {
     DescriptorScope desc;
     if (!desc.unflatten(buffer)) {
-        return NULL;
+        return nullptr;
     }
     SkPoint c1 = buffer.readPoint();
     SkPoint c2 = buffer.readPoint();
diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
index cdc1862..30f0fdf 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
@@ -213,14 +213,14 @@
     GrFragmentProcessor* fp;
     GrColor paintColor;
     SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
-                                               GrTest::TestMatrix(d->fRandom), NULL,
+                                               GrTest::TestMatrix(d->fRandom), nullptr,
                                                &paintColor, d->fProcDataManager, &fp));
     return fp;
 }
 
 GLEdge2PtConicalEffect::GLEdge2PtConicalEffect(const GrProcessor&)
-    : fVSVaryingName(NULL)
-    , fFSVaryingName(NULL)
+    : fVSVaryingName(nullptr)
+    , fFSVaryingName(nullptr)
     , fCachedRadius(-SK_ScalarMax)
     , fCachedDiffRadius(-SK_ScalarMax) {}
 
@@ -493,15 +493,15 @@
     GrColor paintColor;
     GrPaint grPaint;
     SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
-                                               GrTest::TestMatrix(d->fRandom), NULL,
+                                               GrTest::TestMatrix(d->fRandom), nullptr,
                                                &paintColor, d->fProcDataManager,
                                                &effect));
     return effect;
 }
 
 GLFocalOutside2PtConicalEffect::GLFocalOutside2PtConicalEffect(const GrProcessor& processor)
-    : fVSVaryingName(NULL)
-    , fFSVaryingName(NULL)
+    : fVSVaryingName(nullptr)
+    , fFSVaryingName(nullptr)
     , fCachedFocal(SK_ScalarMax) {
     const FocalOutside2PtConicalEffect& data = processor.cast<FocalOutside2PtConicalEffect>();
     fIsFlipped = data.isFlipped();
@@ -705,14 +705,14 @@
     GrColor paintColor;
     GrFragmentProcessor* fp;
     SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
-                                               GrTest::TestMatrix(d->fRandom), NULL,
+                                               GrTest::TestMatrix(d->fRandom), nullptr,
                                                &paintColor, d->fProcDataManager, &fp));
     return fp;
 }
 
 GLFocalInside2PtConicalEffect::GLFocalInside2PtConicalEffect(const GrProcessor&)
-    : fVSVaryingName(NULL)
-    , fFSVaryingName(NULL)
+    : fVSVaryingName(nullptr)
+    , fFSVaryingName(nullptr)
     , fCachedFocal(SK_ScalarMax) {}
 
 void GLFocalInside2PtConicalEffect::emitCode(EmitArgs& args) {
@@ -952,14 +952,14 @@
     GrColor paintColor;
     GrFragmentProcessor* fp;
     SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
-                                               GrTest::TestMatrix(d->fRandom), NULL,
+                                               GrTest::TestMatrix(d->fRandom), nullptr,
                                                &paintColor, d->fProcDataManager, &fp));
     return fp;
 }
 
 GLCircleInside2PtConicalEffect::GLCircleInside2PtConicalEffect(const GrProcessor& processor)
-    : fVSVaryingName(NULL)
-    , fFSVaryingName(NULL)
+    : fVSVaryingName(nullptr)
+    , fFSVaryingName(nullptr)
     , fCachedCenterX(SK_ScalarMax)
     , fCachedCenterY(SK_ScalarMax)
     , fCachedA(SK_ScalarMax)
@@ -1183,14 +1183,14 @@
     GrColor paintColor;
     GrFragmentProcessor* fp;
     SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
-                                               GrTest::TestMatrix(d->fRandom), NULL,
+                                               GrTest::TestMatrix(d->fRandom), nullptr,
                                                &paintColor, d->fProcDataManager, &fp));
     return fp;
 }
 
 GLCircleOutside2PtConicalEffect::GLCircleOutside2PtConicalEffect(const GrProcessor& processor)
-    : fVSVaryingName(NULL)
-    , fFSVaryingName(NULL)
+    : fVSVaryingName(nullptr)
+    , fFSVaryingName(nullptr)
     , fCachedCenterX(SK_ScalarMax)
     , fCachedCenterY(SK_ScalarMax)
     , fCachedA(SK_ScalarMax)
@@ -1301,12 +1301,12 @@
                                                         const SkMatrix* localMatrix) {
     SkMatrix matrix;
     if (!shader.getLocalMatrix().invert(&matrix)) {
-        return NULL;
+        return nullptr;
     }
     if (localMatrix) {
         SkMatrix inv;
         if (!localMatrix->invert(&inv)) {
-            return NULL;
+            return nullptr;
         }
         matrix.postConcat(inv);
     }
diff --git a/src/fonts/SkFontMgr_fontconfig.cpp b/src/fonts/SkFontMgr_fontconfig.cpp
index 72a5a61..de309d3 100644
--- a/src/fonts/SkFontMgr_fontconfig.cpp
+++ b/src/fonts/SkFontMgr_fontconfig.cpp
@@ -60,7 +60,7 @@
 // look for the last substring after a '/' and return that, or return null.
 static const char* find_just_name(const char* str) {
     const char* last = strrchr(str, '/');
-    return last ? last + 1 : NULL;
+    return last ? last + 1 : nullptr;
 }
 
 static bool is_lower(char c) {
@@ -123,7 +123,7 @@
     }
 
     if (iter == stop || !match_name(*iter, post_config_family)) {
-        return NULL;
+        return nullptr;
     }
 
     FcPattern** firstIter = iter++;
@@ -202,11 +202,11 @@
 }
 
 SkTypeface* SkFontStyleSet_FC::createTypeface(int index) {
-    return NULL;
+    return nullptr;
 }
 
 SkTypeface* SkFontStyleSet_FC::matchStyle(const SkFontStyle& pattern) {
-    return NULL;
+    return nullptr;
 }
 
 class SkFontMgr_fontconfig : public SkFontMgr {
@@ -245,7 +245,7 @@
 #if 0
         FcPatternAddBool(pattern, FC_SCALABLE, FcTrue);
 #endif
-        FcConfigSubstitute(NULL, pattern, FcMatchPattern);
+        FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
         FcDefaultSubstitute(pattern);
 
         const char* post_config_family = get_name(pattern, FC_FAMILY);
@@ -254,7 +254,7 @@
         FcFontSet* font_set = FcFontSort(0, pattern, 0, 0, &result);
         if (!font_set) {
             FcPatternDestroy(pattern);
-            return NULL;
+            return nullptr;
         }
 
         int count;
@@ -262,7 +262,7 @@
         if (!match) {
             FcPatternDestroy(pattern);
             FcFontSetDestroy(font_set);
-            return NULL;
+            return nullptr;
         }
 
         FcPatternDestroy(pattern);
@@ -281,32 +281,32 @@
     }
 
     SkTypeface* onMatchFamilyStyle(const char familyName[],
-                                   const SkFontStyle&) const override { return NULL; }
+                                   const SkFontStyle&) const override { return nullptr; }
     SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], const SkFontStyle&,
                                             const char* bcp47[], int bcp47Count,
                                             SkUnichar character) const override {
-        return NULL;
+        return nullptr;
     }
     SkTypeface* onMatchFaceStyle(const SkTypeface*,
-                                 const SkFontStyle&) const override { return NULL; }
+                                 const SkFontStyle&) const override { return nullptr; }
 
-    SkTypeface* onCreateFromData(SkData*, int ttcIndex) const override { return NULL; }
+    SkTypeface* onCreateFromData(SkData*, int ttcIndex) const override { return nullptr; }
 
     SkTypeface* onCreateFromStream(SkStreamAsset* bareStream, int ttcIndex) const override {
         SkAutoTDelete<SkStreamAsset> stream(bareStream);
         const size_t length = stream->getLength();
         if (!length) {
-            return NULL;
+            return nullptr;
         }
         if (length >= 1024 * 1024 * 1024) {
-            return NULL;  // don't accept too large fonts (>= 1GB) for safety.
+            return nullptr;  // don't accept too large fonts (>= 1GB) for safety.
         }
 
         // TODO should the caller give us the style or should we get it from freetype?
         SkFontStyle style;
         bool isFixedWidth = false;
-        if (!fScanner.scanFont(stream, 0, NULL, &style, &isFixedWidth, NULL)) {
-            return NULL;
+        if (!fScanner.scanFont(stream, 0, nullptr, &style, &isFixedWidth, nullptr)) {
+            return nullptr;
         }
 
         SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, stream.detach());
@@ -315,7 +315,7 @@
 
     SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override {
         SkAutoTDelete<SkStreamAsset> stream(SkStream::NewFromFile(path));
-        return stream.get() ? this->createFromStream(stream.detach(), ttcIndex) : NULL;
+        return stream.get() ? this->createFromStream(stream.detach(), ttcIndex) : nullptr;
     }
 
     SkTypeface* onLegacyCreateTypeface(const char familyName[],
@@ -327,5 +327,5 @@
 
 SkFontMgr* SkFontMgr::Factory() {
     SkFontConfigInterface* fci = RefFCI();
-    return fci ? new SkFontMgr_fontconfig(fci) : NULL;
+    return fci ? new SkFontMgr_fontconfig(fci) : nullptr;
 }
diff --git a/src/fonts/SkFontMgr_indirect.cpp b/src/fonts/SkFontMgr_indirect.cpp
index 33c79c8..132130f 100644
--- a/src/fonts/SkFontMgr_indirect.cpp
+++ b/src/fonts/SkFontMgr_indirect.cpp
@@ -175,8 +175,8 @@
 
 SkFontStyleSet* SkFontMgr_Indirect::onCreateStyleSet(int index) const {
     SkRemotableFontIdentitySet* set = fProxy->getIndex(index);
-    if (NULL == set) {
-        return NULL;
+    if (nullptr == set) {
+        return nullptr;
     }
     return new SkStyleSet_Indirect(this, index, set);
 }
@@ -187,7 +187,7 @@
 
 SkTypeface* SkFontMgr_Indirect::createTypefaceFromFontId(const SkFontIdentity& id) const {
     if (id.fDataId == SkFontIdentity::kInvalidDataId) {
-        return NULL;
+        return nullptr;
     }
 
     SkAutoMutexAcquire ama(fDataCacheMutex);
@@ -202,7 +202,7 @@
             {
                 return entry.fTypeface;
             }
-            if (dataTypeface.get() == NULL &&
+            if (dataTypeface.get() == nullptr &&
                 !entry.fTypeface->weak_expired() && entry.fTypeface->try_ref())
             {
                 dataTypeface.reset(entry.fTypeface);
@@ -217,22 +217,22 @@
     }
 
     // No exact match, but did find a data match.
-    if (dataTypeface.get() != NULL) {
-        SkAutoTDelete<SkStreamAsset> stream(dataTypeface->openStream(NULL));
-        if (stream.get() != NULL) {
+    if (dataTypeface.get() != nullptr) {
+        SkAutoTDelete<SkStreamAsset> stream(dataTypeface->openStream(nullptr));
+        if (stream.get() != nullptr) {
             return fImpl->createFromStream(stream.detach(), dataTypefaceIndex);
         }
     }
 
     // No data match, request data and add entry.
     SkAutoTDelete<SkStreamAsset> stream(fProxy->getData(id.fDataId));
-    if (stream.get() == NULL) {
-        return NULL;
+    if (stream.get() == nullptr) {
+        return nullptr;
     }
 
     SkAutoTUnref<SkTypeface> typeface(fImpl->createFromStream(stream.detach(), id.fTtcIndex));
-    if (typeface.get() == NULL) {
-        return NULL;
+    if (typeface.get() == nullptr) {
+        return nullptr;
     }
 
     DataEntry& newEntry = fDataCache.push_back();
@@ -291,11 +291,11 @@
 
     SkAutoTUnref<SkTypeface> face(this->matchFamilyStyle(familyName, style));
 
-    if (NULL == face.get()) {
-        face.reset(this->matchFamilyStyle(NULL, style));
+    if (nullptr == face.get()) {
+        face.reset(this->matchFamilyStyle(nullptr, style));
     }
 
-    if (NULL == face.get()) {
+    if (nullptr == face.get()) {
         SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style);
         face.reset(this->createTypefaceFromFontId(fontId));
     }
diff --git a/src/fonts/SkTestScalerContext.cpp b/src/fonts/SkTestScalerContext.cpp
index ee78381..368f269 100644
--- a/src/fonts/SkTestScalerContext.cpp
+++ b/src/fonts/SkTestScalerContext.cpp
@@ -24,7 +24,7 @@
     , fWidths(fontData.fWidths)
     , fMetrics(fontData.fMetrics)
     , fName(fontData.fName)
-    , fPaths(NULL)
+    , fPaths(nullptr)
 {
     init(fontData.fPoints, fontData.fVerbs);
 #ifdef SK_DEBUG
@@ -173,7 +173,7 @@
     SkString familyName(fTestFont->fName);
     SkString language("und"); //undetermined
 SkASSERT(0);  // incomplete
-    return NULL;
+    return nullptr;
 //     return new SkOTUtils::LocalizedStrings_SingleName(familyName, language);
 }
 
diff --git a/src/fonts/SkTestScalerContext.h b/src/fonts/SkTestScalerContext.h
index 95316d7..fe5c8d6 100644
--- a/src/fonts/SkTestScalerContext.h
+++ b/src/fonts/SkTestScalerContext.h
@@ -74,7 +74,7 @@
         uint32_t glyphIDsCount) const override;
 
     SkStreamAsset* onOpenStream(int* ttcIndex) const override {
-        return NULL;
+        return nullptr;
     }
 
     void onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const override;
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 668a09a..296f6da 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -673,7 +673,7 @@
     return d->fCaps->shaderCaps()->shaderDerivativeSupport() ?
            QuadEdgeEffect::Create(GrRandomColor(d->fRandom),
                                   GrTest::TestMatrix(d->fRandom),
-                                  d->fRandom->nextBool()) : NULL;
+                                  d->fRandom->nextBool()) : nullptr;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/GrAADistanceFieldPathRenderer.cpp b/src/gpu/GrAADistanceFieldPathRenderer.cpp
index 7a51149..45a3d65 100644
--- a/src/gpu/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/GrAADistanceFieldPathRenderer.cpp
@@ -62,7 +62,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-GrAADistanceFieldPathRenderer::GrAADistanceFieldPathRenderer() : fAtlas(NULL) {}
+GrAADistanceFieldPathRenderer::GrAADistanceFieldPathRenderer() : fAtlas(nullptr) {}
 
 GrAADistanceFieldPathRenderer::~GrAADistanceFieldPathRenderer() {
     PathDataList::Iter iter;
@@ -226,7 +226,7 @@
             // TODO: handle stroked vs. filled version of same path
             PathData::Key key = { args.fPath.getGenerationID(), desiredDimension };
             args.fPathData = fPathCache->find(key);
-            if (NULL == args.fPathData || !atlas->hasID(args.fPathData->fID)) {
+            if (nullptr == args.fPathData || !atlas->hasID(args.fPathData->fID)) {
                 // Remove the stale cache entry
                 if (args.fPathData) {
                     fPathCache->remove(args.fPathData->fKey);
@@ -281,7 +281,7 @@
         fBatch.fColor = color;
         fBatch.fViewMatrix = viewMatrix;
         fGeoData.push_back(geometry);
-        fGeoData.back().fPathData = NULL;
+        fGeoData.back().fPathData = nullptr;
 
         fAtlas = atlas;
         fPathCache = pathCache;
@@ -558,7 +558,7 @@
     typedef GrAADistanceFieldPathRenderer::PathCache PathCache;
     typedef GrAADistanceFieldPathRenderer::PathData PathData;
     typedef GrAADistanceFieldPathRenderer::PathDataList PathDataList;
-    PathTestStruct() : fContextID(SK_InvalidGenID), fAtlas(NULL) {}
+    PathTestStruct() : fContextID(SK_InvalidGenID), fAtlas(nullptr) {}
     ~PathTestStruct() { this->reset(); }
 
     void reset() {
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index f2f9563..e102db2 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -622,7 +622,7 @@
         return false;
     }
 
-    if (!IsStrokeHairlineOrEquivalent(*args.fStroke, *args.fViewMatrix, NULL)) {
+    if (!IsStrokeHairlineOrEquivalent(*args.fStroke, *args.fViewMatrix, nullptr)) {
         return false;
     }
 
@@ -798,8 +798,8 @@
     bool hasPerspective = this->viewMatrix().hasPerspective();
     const SkMatrix* geometryProcessorViewM = &SkMatrix::I();
     const SkMatrix* geometryProcessorLocalM = &invert;
-    const SkMatrix* toDevice = NULL;
-    const SkMatrix* toSrc = NULL;
+    const SkMatrix* toDevice = nullptr;
+    const SkMatrix* toSrc = nullptr;
     if (hasPerspective) {
         geometryProcessorViewM = &this->viewMatrix();
         geometryProcessorLocalM = &SkMatrix::I();
diff --git a/src/gpu/GrAllocator.h b/src/gpu/GrAllocator.h
index 64f6533..c5d2dc3 100644
--- a/src/gpu/GrAllocator.h
+++ b/src/gpu/GrAllocator.h
@@ -29,7 +29,7 @@
     GrAllocator(size_t itemSize, int itemsPerBlock, void* initialBlock)
         : fItemSize(itemSize)
         , fItemsPerBlock(itemsPerBlock)
-        , fOwnFirstBlock(NULL == initialBlock)
+        , fOwnFirstBlock(nullptr == initialBlock)
         , fCount(0)
         , fInsertionIndexInBlock(0) {
         SkASSERT(itemsPerBlock > 0);
@@ -192,7 +192,7 @@
 protected:
     /**
      * Set first block of memory to write into.  Must be called before any other methods.
-     * This requires that you have passed NULL in the constructor.
+     * This requires that you have passed nullptr in the constructor.
      *
      * @param   initialBlock    optional memory to use for the first block.
      *                          Must be at least itemSize*itemsPerBlock sized.
@@ -237,7 +237,7 @@
      * @param   itemsPerBlock   the number of items to allocate at once
      */
     explicit GrTAllocator(int itemsPerBlock)
-        : fAllocator(sizeof(T), itemsPerBlock, NULL) {}
+        : fAllocator(sizeof(T), itemsPerBlock, nullptr) {}
 
     /**
      * Adds an item and returns it.
diff --git a/src/gpu/GrAtlas.cpp b/src/gpu/GrAtlas.cpp
index e280302..3eb74f0 100644
--- a/src/gpu/GrAtlas.cpp
+++ b/src/gpu/GrAtlas.cpp
@@ -22,9 +22,9 @@
 
 GrPlot::GrPlot() 
     : fID(-1)
-    , fTexture(NULL)
-    , fRects(NULL)
-    , fAtlas(NULL)
+    , fTexture(nullptr)
+    , fRects(nullptr)
+    , fAtlas(nullptr)
     , fBytesPerPixel(1)
     , fDirty(false)
     , fBatchUploads(false)
@@ -34,7 +34,7 @@
 
 GrPlot::~GrPlot() {
     delete[] fPlotData;
-    fPlotData = NULL;
+    fPlotData = nullptr;
     delete fRects;
 }
 
@@ -45,7 +45,7 @@
     fAtlas = atlas;
     fOffset.set(offX * width, offY * height);
     fBytesPerPixel = bpp;
-    fPlotData = NULL;
+    fPlotData = nullptr;
     fDirtyRect.setEmpty();
     fDirty = false;
     fBatchUploads = batchUploads;
@@ -66,7 +66,7 @@
     // once the plot is nearly full we will revert to uploading each subimage individually
     int plotWidth = fRects->width();
     int plotHeight = fRects->height();
-    if (fBatchUploads && NULL == fPlotData && 0.0f == percentFull) {
+    if (fBatchUploads && nullptr == fPlotData && 0.0f == percentFull) {
         fPlotData = new unsigned char[fBytesPerPixel * plotWidth * plotHeight];
         memset(fPlotData, 0, fBytesPerPixel*plotWidth*plotHeight);
     }
@@ -122,7 +122,7 @@
     fNumPlotsX = numPlotsX;
     fNumPlotsY = numPlotsY;
     fBatchUploads = batchUploads;
-    fTexture = NULL;
+    fTexture = nullptr;
 
     int textureWidth = fBackingTextureSize.width();
     int textureHeight = fBackingTextureSize.height();
@@ -186,7 +186,7 @@
     }
 
     // before we get a new plot, make sure we have a backing texture
-    if (NULL == fTexture) {
+    if (nullptr == fTexture) {
         // TODO: Update this to use the cache rather than directly creating a texture.
         GrSurfaceDesc desc;
         desc.fFlags = fFlags;
@@ -194,9 +194,9 @@
         desc.fHeight = fBackingTextureSize.height();
         desc.fConfig = fPixelConfig;
 
-        fTexture = fGpu->createTexture(desc, true, NULL, 0);
-        if (NULL == fTexture) {
-            return NULL;
+        fTexture = fGpu->createTexture(desc, true, nullptr, 0);
+        if (nullptr == fTexture) {
+            return nullptr;
         }
     }
 
@@ -218,7 +218,7 @@
     }
 
     // If the above fails, then the current plot list has no room
-    return NULL;
+    return nullptr;
 }
 
 void GrAtlas::RemovePlot(ClientPlotUsage* usage, const GrPlot* plot) {
diff --git a/src/gpu/GrAtlas.h b/src/gpu/GrAtlas.h
index 5ef2dab..aaec0b0 100644
--- a/src/gpu/GrAtlas.h
+++ b/src/gpu/GrAtlas.h
@@ -92,7 +92,7 @@
 
     // Adds a width x height subimage to the atlas. Upon success it returns 
     // the containing GrPlot and absolute location in the backing texture. 
-    // NULL is returned if the subimage cannot fit in the atlas.
+    // nullptr is returned if the subimage cannot fit in the atlas.
     // If provided, the image data will either be immediately uploaded or
     // written to the CPU-side backing bitmap.
     GrPlot* addToAtlas(ClientPlotUsage*, int width, int height, const void* image, SkIPoint16* loc);
diff --git a/src/gpu/GrAtlasTextBlob.h b/src/gpu/GrAtlasTextBlob.h
index 2c8aa57..4232043 100644
--- a/src/gpu/GrAtlasTextBlob.h
+++ b/src/gpu/GrAtlasTextBlob.h
@@ -93,7 +93,7 @@
             }
             // Distance field text cannot draw coloremoji, and so has to fall back.  However,
             // though the distance field text and the coloremoji may share the same run, they
-            // will have different descriptors.  If fOverrideDescriptor is non-NULL, then it
+            // will have different descriptors.  If fOverrideDescriptor is non-nullptr, then it
             // will be used in place of the run's descriptor to regen texture coords
             // TODO we could have a descriptor cache, it would reduce the size of these blobs
             // significantly, and then the subrun could just have a refed pointer to the
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index 61cd2a1..06d6675 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -104,7 +104,7 @@
     // vertexStride
     static_assert(kGrayTextVASize >= kColorTextVASize && kGrayTextVASize >= kLCDTextVASize,
                   "vertex_attribute_changed");
-    fCurrStrike = NULL;
+    fCurrStrike = nullptr;
     fCache = context->getTextBlobCache();
 }
 
@@ -537,7 +537,7 @@
             subRun.fUseLCDText = runPaint.isLCDRenderText();
             subRun.fDrawAsDistanceFields = true;
 
-            SkGlyphCache* cache = this->setupCache(&cacheBlob->fRuns[run], dfPaint, NULL, true);
+            SkGlyphCache* cache = this->setupCache(&cacheBlob->fRuns[run], dfPaint, nullptr, true);
 
             SkTDArray<char> fallbackTxt;
             SkTDArray<SkScalar> fallbackPos;
@@ -704,7 +704,7 @@
     subRun.fUseLCDText = origPaint.isLCDRenderText();
     subRun.fDrawAsDistanceFields = true;
 
-    *cache = this->setupCache(&blob->fRuns[0], *dfPaint, NULL, true);
+    *cache = this->setupCache(&blob->fRuns[0], *dfPaint, nullptr, true);
     return blob;
 }
 
@@ -823,14 +823,14 @@
                                              const SkMatrix& viewMatrix,
                                              const char text[], size_t byteLength,
                                              SkScalar x, SkScalar y, const SkIRect& clipRect) {
-    SkASSERT(byteLength == 0 || text != NULL);
+    SkASSERT(byteLength == 0 || text != nullptr);
 
     // nothing to draw
-    if (text == NULL || byteLength == 0) {
+    if (text == nullptr || byteLength == 0) {
         return;
     }
 
-    fCurrStrike = NULL;
+    fCurrStrike = nullptr;
     SkDrawCacheProc glyphCacheProc = skPaint.getDrawCacheProc();
 
     // Get GrFontScaler from cache
@@ -912,15 +912,15 @@
                                                 const char text[], size_t byteLength,
                                                 const SkScalar pos[], int scalarsPerPosition,
                                                 const SkPoint& offset, const SkIRect& clipRect) {
-    SkASSERT(byteLength == 0 || text != NULL);
+    SkASSERT(byteLength == 0 || text != nullptr);
     SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition);
 
     // nothing to draw
-    if (text == NULL || byteLength == 0) {
+    if (text == nullptr || byteLength == 0) {
         return;
     }
 
-    fCurrStrike = NULL;
+    fCurrStrike = nullptr;
     SkDrawCacheProc glyphCacheProc = skPaint.getDrawCacheProc();
 
     // Get GrFontScaler from cache
@@ -1069,16 +1069,16 @@
                                             SkTDArray<SkScalar>* fallbackPos,
                                             SkPoint* offset,
                                             const SkPaint& origPaint) {
-    SkASSERT(byteLength == 0 || text != NULL);
+    SkASSERT(byteLength == 0 || text != nullptr);
 
     // nothing to draw
-    if (text == NULL || byteLength == 0) {
+    if (text == nullptr || byteLength == 0) {
         return;
     }
 
     SkDrawCacheProc glyphCacheProc = origPaint.getDrawCacheProc();
     SkAutoDescriptor desc;
-    origPaint.getScalerContextDescriptor(&desc, fSurfaceProps, NULL, true);
+    origPaint.getScalerContextDescriptor(&desc, fSurfaceProps, nullptr, true);
     SkGlyphCache* origPaintCache = SkGlyphCache::DetachCache(origPaint.getTypeface(),
                                                              desc.getDesc());
 
@@ -1143,15 +1143,15 @@
                                                SkTDArray<char>* fallbackTxt,
                                                SkTDArray<SkScalar>* fallbackPos) {
 
-    SkASSERT(byteLength == 0 || text != NULL);
+    SkASSERT(byteLength == 0 || text != nullptr);
     SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition);
 
     // nothing to draw
-    if (text == NULL || byteLength == 0) {
+    if (text == nullptr || byteLength == 0) {
         return;
     }
 
-    fCurrStrike = NULL;
+    fCurrStrike = nullptr;
 
     SkDrawCacheProc glyphCacheProc = skPaint.getDrawCacheProc();
     GrFontScaler* fontScaler = GetGrFontScaler(cache);
@@ -1364,7 +1364,7 @@
                                                 GrFontScaler* scaler, const SkGlyph& skGlyph,
                                                 SkScalar x, SkScalar y, SkScalar scale,
                                                 bool applyVM) {
-    if (NULL == glyph->fPath) {
+    if (nullptr == glyph->fPath) {
         const SkPath* glyphPath = scaler->getGlyphPath(skGlyph);
         if (!glyphPath) {
             return;
@@ -1624,10 +1624,10 @@
 
         // We cache some values to avoid going to the glyphcache for the same fontScaler twice
         // in a row
-        const SkDescriptor* desc = NULL;
-        SkGlyphCache* cache = NULL;
-        GrFontScaler* scaler = NULL;
-        SkTypeface* typeface = NULL;
+        const SkDescriptor* desc = nullptr;
+        SkGlyphCache* cache = nullptr;
+        GrFontScaler* scaler = nullptr;
+        SkTypeface* typeface = nullptr;
 
         for (int i = 0; i < fGeoCount; i++) {
             Geometry& args = fGeoData[i];
@@ -1668,7 +1668,7 @@
                 // it.  These ids will still be valid as long as we hold the ref.  When we are done
                 // updating our cache of the GrGlyph*s, we drop our ref on the old strike
                 bool regenerateGlyphs = false;
-                GrBatchTextStrike* strike = NULL;
+                GrBatchTextStrike* strike = nullptr;
                 if (regenerateTextureCoords) {
                     info.fBulkUseToken.reset();
 
@@ -2231,7 +2231,7 @@
 
 DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
     static uint32_t gContextID = SK_InvalidGenID;
-    static GrAtlasTextContext* gTextContext = NULL;
+    static GrAtlasTextContext* gTextContext = nullptr;
     static SkSurfaceProps gSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType);
 
     if (context->uniqueID() != gContextID) {
@@ -2253,9 +2253,9 @@
     desc.fHeight = 1024;
     desc.fConfig = kRGBA_8888_GrPixelConfig;
     desc.fSampleCnt = 0;
-    SkAutoTUnref<GrTexture> texture(context->textureProvider()->createTexture(desc, true, NULL, 0));
+    SkAutoTUnref<GrTexture> texture(context->textureProvider()->createTexture(desc, true, nullptr, 0));
     SkASSERT(texture);
-    SkASSERT(NULL != texture->asRenderTarget());
+    SkASSERT(nullptr != texture->asRenderTarget());
     GrRenderTarget* rt = texture->asRenderTarget();
 
     // Setup dummy SkPaint / GrPaint
diff --git a/src/gpu/GrBatchAtlas.cpp b/src/gpu/GrBatchAtlas.cpp
index 1607ed1..ebd0907 100644
--- a/src/gpu/GrBatchAtlas.cpp
+++ b/src/gpu/GrBatchAtlas.cpp
@@ -131,14 +131,14 @@
         , fIndex(-1)
         , fGenID(-1)
         , fID(0)
-        , fData(NULL)
+        , fData(nullptr)
         , fWidth(0)
         , fHeight(0)
         , fX(0)
         , fY(0)
-        , fTexture(NULL)
-        , fRects(NULL)
-        , fAtlas(NULL)
+        , fTexture(nullptr)
+        , fRects(nullptr)
+        , fAtlas(nullptr)
         , fBytesPerPixel(1)
     #ifdef SK_DEBUG
         , fDirty(false)
@@ -149,7 +149,7 @@
 
     ~BatchPlot() {
         sk_free(fData);
-        fData = NULL;
+        fData = nullptr;
         delete fRects;
     }
 
@@ -166,7 +166,7 @@
         fAtlas = atlas;
         fOffset.set(offX * width, offY * height);
         fBytesPerPixel = bpp;
-        fData = NULL;
+        fData = nullptr;
         fDirtyRect.setEmpty();
         SkDEBUGCODE(fDirty = false;)
         fTexture = texture;
diff --git a/src/gpu/GrBatchAtlas.h b/src/gpu/GrBatchAtlas.h
index 4e23540..544e1b0 100644
--- a/src/gpu/GrBatchAtlas.h
+++ b/src/gpu/GrBatchAtlas.h
@@ -46,7 +46,7 @@
 
     // Adds a width x height subimage to the atlas. Upon success it returns
     // the containing GrPlot and absolute location in the backing texture.
-    // NULL is returned if the subimage cannot fit in the atlas.
+    // nullptr is returned if the subimage cannot fit in the atlas.
     // If provided, the image data will be written to the CPU-side backing bitmap.
     // NOTE: If the client intends to refer to the atlas, they should immediately call 'setUseToken'
     // with the currentToken from the batch target, otherwise the next call to addToAtlas might
diff --git a/src/gpu/GrBatchFontCache.cpp b/src/gpu/GrBatchFontCache.cpp
index e8c2183..de8047b 100644
--- a/src/gpu/GrBatchFontCache.cpp
+++ b/src/gpu/GrBatchFontCache.cpp
@@ -40,9 +40,9 @@
 
 GrBatchFontCache::GrBatchFontCache(GrContext* context)
     : fContext(context)
-    , fPreserveStrike(NULL) {
+    , fPreserveStrike(nullptr) {
     for (int i = 0; i < kMaskFormatCount; ++i) {
-        fAtlases[i] = NULL;
+        fAtlases[i] = nullptr;
     }
 
     // setup default atlas configs
@@ -84,7 +84,7 @@
     fCache.rewind();
     for (int i = 0; i < kMaskFormatCount; ++i) {
         delete fAtlases[i];
-        fAtlases[i] = NULL;
+        fAtlases[i] = nullptr;
     }
 }
 
@@ -131,7 +131,7 @@
     for (int i = 0; i < kMaskFormatCount; i++) {
         if (fAtlases[i]) {
             delete fAtlases[i];
-            fAtlases[i] = NULL;
+            fAtlases[i] = nullptr;
         }
     }
     memcpy(fAtlasConfigs, configs, sizeof(fAtlasConfigs));
@@ -169,11 +169,11 @@
     SkIRect bounds;
     if (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(packed)) {
         if (!scaler->getPackedGlyphDFBounds(skGlyph, &bounds)) {
-            return NULL;
+            return nullptr;
         }
     } else {
         if (!scaler->getPackedGlyphBounds(skGlyph, &bounds)) {
-            return NULL;
+            return nullptr;
         }
     }
     GrMaskFormat format = scaler->getPackedGlyphMaskFormat(skGlyph);
diff --git a/src/gpu/GrBatchFontCache.h b/src/gpu/GrBatchFontCache.h
index 5d57221..9463566 100644
--- a/src/gpu/GrBatchFontCache.h
+++ b/src/gpu/GrBatchFontCache.h
@@ -33,7 +33,7 @@
     inline GrGlyph* getGlyph(const SkGlyph& skGlyph, GrGlyph::PackedID packed,
                              GrFontScaler* scaler) {
         GrGlyph* glyph = fCache.find(packed);
-        if (NULL == glyph) {
+        if (nullptr == glyph) {
             glyph = this->generateGlyph(skGlyph, packed, scaler);
         }
         return glyph;
@@ -46,7 +46,7 @@
     inline GrGlyph* getGlyph(const SkGlyph& skGlyph, GrGlyph::PackedID packed,
                              GrMaskFormat expectedMaskFormat, GrFontScaler* scaler) {
         GrGlyph* glyph = fCache.find(packed);
-        if (NULL == glyph) {
+        if (nullptr == glyph) {
             glyph = this->generateGlyph(skGlyph, packed, scaler);
             glyph->fMaskFormat = expectedMaskFormat;
         }
@@ -109,7 +109,7 @@
     // interactions with the cache since the strike was received.
     inline GrBatchTextStrike* getStrike(GrFontScaler* scaler) {
         GrBatchTextStrike* strike = fCache.find(*(scaler->getKey()));
-        if (NULL == strike) {
+        if (nullptr == strike) {
             strike = this->generateStrike(scaler);
         }
         return strike;
@@ -117,14 +117,14 @@
 
     void freeAll();
 
-    // if getTexture returns NULL, the client must not try to use other functions on the
+    // if getTexture returns nullptr, the client must not try to use other functions on the
     // GrBatchFontCache which use the atlas.  This function *must* be called first, before other
     // functions which use the atlas.
     GrTexture* getTexture(GrMaskFormat format) {
         if (this->initAtlas(format)) {
             return this->getAtlas(format)->getTexture();
         }
-        return NULL;
+        return nullptr;
     }
 
     bool hasGlyph(GrGlyph* glyph) {
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index ede386a..a6eeae6 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -66,7 +66,7 @@
     }
     SkAutoMaskFreeImage autoSrc(srcM.fImage);
 
-    if (!filter->filterMask(&dstM, srcM, viewMatrix, NULL)) {
+    if (!filter->filterMask(&dstM, srcM, viewMatrix, nullptr)) {
         return false;
     }
     // this will free-up dstM when we're done (allocated in filterMask())
@@ -116,18 +116,18 @@
     }
 
     GrTexture* mask = context->textureProvider()->createApproxTexture(desc);
-    if (NULL == mask) {
-        return NULL;
+    if (nullptr == mask) {
+        return nullptr;
     }
 
     SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height());
 
     GrDrawContext* drawContext = context->drawContext();
     if (!drawContext) {
-        return NULL;
+        return nullptr;
     }
 
-    drawContext->clear(mask->asRenderTarget(), NULL, 0x0, true);
+    drawContext->clear(mask->asRenderTarget(), nullptr, 0x0, true);
 
     GrPaint tempPaint;
     tempPaint.setAntiAlias(doAA);
@@ -170,7 +170,7 @@
     if (prePathMatrix) {
         // stroking, path effects, and blurs are supposed to be applied *after* the prePathMatrix.
         // The pre-path-matrix also should not affect shading.
-        if (NULL == paint.getMaskFilter() && NULL == pathEffect && NULL == paint.getShader() &&
+        if (nullptr == paint.getMaskFilter() && nullptr == pathEffect && nullptr == paint.getShader() &&
             (strokeInfo.isFillStyle() || strokeInfo.isHairlineStyle())) {
             viewMatrix.preConcat(*prePathMatrix);
         } else {
@@ -195,7 +195,7 @@
         return;
     }
 
-    const SkRect* cullRect = NULL;  // TODO: what is our bounds?
+    const SkRect* cullRect = nullptr;  // TODO: what is our bounds?
     if (!strokeInfo.isDashed() && pathEffect && pathEffect->filterPath(effectPath.init(), *pathPtr,
                                                                        &strokeInfo, cullRect)) {
         pathPtr = effectPath.get();
diff --git a/src/gpu/GrBufferedDrawTarget.cpp b/src/gpu/GrBufferedDrawTarget.cpp
index c733f0c..7ba6a2d 100644
--- a/src/gpu/GrBufferedDrawTarget.cpp
+++ b/src/gpu/GrBufferedDrawTarget.cpp
@@ -54,7 +54,7 @@
     fPathIndexBuffer.rewind();
     fPathTransformBuffer.rewind();
 
-    fPrevState.reset(NULL);
+    fPrevState.reset(nullptr);
     // Note, fPrevState points into fPipelineBuffer's allocation, so we have to reset first.
     // Furthermore, we have to reset fCommands before fPipelineBuffer too.
     if (fDrawID % kPipelineBufferHighWaterMark) {
@@ -76,7 +76,7 @@
     StateForPathDraw* state = this->allocState(primProc);
     if (!GrPipeline::CreateAt(state->pipelineLocation(), pipelineInfo.pipelineCreateArgs(), opts)) {
         this->unallocState(state);
-        return NULL;
+        return nullptr;
     }
 
     state->fPrimitiveProcessor->initBatchTracker(&state->fBatchTracker, *opts);
diff --git a/src/gpu/GrBufferedDrawTarget.h b/src/gpu/GrBufferedDrawTarget.h
index 82421ab..5a80a3c 100644
--- a/src/gpu/GrBufferedDrawTarget.h
+++ b/src/gpu/GrBufferedDrawTarget.h
@@ -41,7 +41,7 @@
         memcpy(*indicesLocation, reinterpret_cast<const char*>(indexValues), count * indexBytes);
 
         const int xformBytes = GrPathRendering::PathTransformSize(transformType) * sizeof(float);
-        *xformsLocation = NULL;
+        *xformsLocation = nullptr;
 
         if (0 != xformBytes) {
             *xformsLocation = (float*) fPathTransformBuffer.alloc(count * xformBytes,
@@ -59,7 +59,7 @@
 
     typedef GrTargetCommands::StateForPathDraw StateForPathDraw;
 
-    StateForPathDraw* allocState(const GrPrimitiveProcessor* primProc = NULL) {
+    StateForPathDraw* allocState(const GrPrimitiveProcessor* primProc = nullptr) {
         void* allocation = fPipelineBuffer.alloc(sizeof(StateForPathDraw),
                                                  SkChunkAlloc::kThrow_AllocFailType);
         return new (allocation) StateForPathDraw(primProc);
diff --git a/src/gpu/GrClipMaskCache.h b/src/gpu/GrClipMaskCache.h
index edba54d..56b0e97 100644
--- a/src/gpu/GrClipMaskCache.h
+++ b/src/gpu/GrClipMaskCache.h
@@ -92,7 +92,7 @@
 
         if (fStack.empty()) {
             SkASSERT(false);
-            return NULL;
+            return nullptr;
         }
 
         GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
@@ -104,7 +104,7 @@
 
         if (fStack.empty()) {
             SkASSERT(false);
-            return NULL;
+            return nullptr;
         }
 
         GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
@@ -135,7 +135,7 @@
 
         GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
 
-        if (NULL == back->fLastMask) {
+        if (nullptr == back->fLastMask) {
             return -1;
         }
 
@@ -151,7 +151,7 @@
 
         GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
 
-        if (NULL == back->fLastMask) {
+        if (nullptr == back->fLastMask) {
             return -1;
         }
 
@@ -175,7 +175,7 @@
     void purgeResources() {
         SkDeque::F2BIter iter(fStack);
         for (GrClipStackFrame* frame = (GrClipStackFrame*) iter.next();
-                frame != NULL;
+                frame != nullptr;
                 frame = (GrClipStackFrame*) iter.next()) {
             frame->reset();
         }
@@ -208,7 +208,7 @@
 
             GrSurfaceDesc desc;
 
-            fLastMask.reset(NULL);
+            fLastMask.reset(nullptr);
             fLastBound.setEmpty();
         }
 
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index c9362fa..7184fe2 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -73,7 +73,7 @@
                                          GrPathRendererChain::kColorAntiAlias_DrawType :
                                          GrPathRendererChain::kColor_DrawType;
 
-    return NULL == context->getPathRenderer(gpu, &pipelineBuilder, viewMatrix, *path, stroke,
+    return nullptr == context->getPathRenderer(gpu, &pipelineBuilder, viewMatrix, *path, stroke,
                                             false, type);
 }
 }
@@ -210,7 +210,7 @@
     }
 
     if (failed) {
-        arfps->set(NULL);
+        arfps->set(nullptr);
     }
     return !failed;
 }
@@ -298,7 +298,7 @@
                                                     devBounds))) {
             SkIRect scissorSpaceIBounds(clipSpaceIBounds);
             scissorSpaceIBounds.offset(-clip.origin());
-            if (NULL == devBounds ||
+            if (nullptr == devBounds ||
                 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) {
                 scissorState->set(scissorSpaceIBounds);
             }
@@ -309,7 +309,7 @@
 
     // If MSAA is enabled we can do everything in the stencil buffer.
     if (0 == rt->numColorSamples() && requiresAA) {
-        GrTexture* result = NULL;
+        GrTexture* result = nullptr;
 
         // The top-left of the mask corresponds to the top-left corner of the bounds.
         SkVector clipToMaskOffset = {
@@ -422,14 +422,14 @@
                 path.toggleInverseFillType();
             }
             GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle);
-            if (NULL == pr) {
+            if (nullptr == pr) {
                 GrPathRendererChain::DrawType type;
                 type = element->isAA() ? GrPathRendererChain::kColorAntiAlias_DrawType :
                                          GrPathRendererChain::kColor_DrawType;
                 pr = this->getContext()->getPathRenderer(fClipTarget, pipelineBuilder, viewMatrix,
                                                          path, stroke, false, type);
             }
-            if (NULL == pr) {
+            if (nullptr == pr) {
                 return false;
             }
             GrPathRenderer::DrawPathArgs args;
@@ -518,12 +518,12 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// Return the texture currently in the cache if it exists. Otherwise, return NULL
+// Return the texture currently in the cache if it exists. Otherwise, return nullptr
 GrTexture* GrClipMaskManager::getCachedMaskTexture(int32_t elementsGenID,
                                                    const SkIRect& clipSpaceIBounds) {
     bool cached = fAACache.canReuse(elementsGenID, clipSpaceIBounds);
     if (!cached) {
-        return NULL;
+        return nullptr;
     }
 
     return fAACache.getLastMask();
@@ -531,7 +531,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 // Allocate a texture in the texture cache. This function returns the texture
-// allocated (or NULL on error).
+// allocated (or nullptr on error).
 GrTexture* GrClipMaskManager::allocMaskTexture(int32_t elementsGenID,
                                                const SkIRect& clipSpaceIBounds,
                                                bool willUpload) {
@@ -572,9 +572,9 @@
 
     // There's no texture in the cache. Let's try to allocate it then.
     result = this->allocMaskTexture(elementsGenID, clipSpaceIBounds, false);
-    if (NULL == result) {
+    if (nullptr == result) {
         fAACache.reset();
-        return NULL;
+        return nullptr;
     }
 
     // Set the matrix so that rendered clip elements are transformed to mask space from clip
@@ -609,7 +609,7 @@
             GrPipelineBuilder pipelineBuilder;
 
             pipelineBuilder.setClip(clip);
-            GrPathRenderer* pr = NULL;
+            GrPathRenderer* pr = nullptr;
             bool useTemp = !this->canStencilAndDrawElement(&pipelineBuilder, result, &pr, element);
             GrTexture* dst;
             // This is the bounds of the clip element in the space of the alpha-mask. The temporary
@@ -632,7 +632,7 @@
                                                     maskSpaceIBounds.fBottom));
                     if (!temp) {
                         fAACache.reset();
-                        return NULL;
+                        return nullptr;
                     }
                 }
                 dst = temp;
@@ -659,7 +659,7 @@
 
             if (!this->drawElement(&pipelineBuilder, translate, dst, element, pr)) {
                 fAACache.reset();
-                return NULL;
+                return nullptr;
             }
 
             if (useTemp) {
@@ -720,7 +720,7 @@
     SkASSERT(rt);
 
     GrStencilAttachment* stencilAttachment = rt->renderTargetPriv().attachStencilAttachment();
-    if (NULL == stencilAttachment) {
+    if (nullptr == stencilAttachment) {
         return false;
     }
 
@@ -774,7 +774,7 @@
             GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle);
             SkRegion::Op op = element->getOp();
 
-            GrPathRenderer* pr = NULL;
+            GrPathRenderer* pr = nullptr;
             SkPath clipPath;
             if (Element::kRect_Type == element->getType()) {
                 stencilSupport = GrPathRenderer::kNoRestriction_StencilSupport;
@@ -793,7 +793,7 @@
                                                          false,
                                                          GrPathRendererChain::kStencilOnly_DrawType,
                                                          &stencilSupport);
-                if (NULL == pr) {
+                if (nullptr == pr) {
                     return false;
                 }
             }
@@ -1135,9 +1135,9 @@
 
     // Allocate clip mask texture
     result = this->allocMaskTexture(elementsGenID, clipSpaceIBounds, true);
-    if (NULL == result) {
+    if (nullptr == result) {
         fAACache.reset();
-        return NULL;
+        return nullptr;
     }
     helper.toTexture(result);
 
diff --git a/src/gpu/GrClipMaskManager.h b/src/gpu/GrClipMaskManager.h
index 1fd3d96..a70ebce 100644
--- a/src/gpu/GrClipMaskManager.h
+++ b/src/gpu/GrClipMaskManager.h
@@ -116,7 +116,7 @@
                                       const SkIRect& clipSpaceIBounds);
 
     // Returns the cached mask texture if it matches the elementsGenID and the clipSpaceIBounds.
-    // Returns NULL if not found.
+    // Returns nullptr if not found.
     GrTexture* getCachedMaskTexture(int32_t elementsGenID, const SkIRect& clipSpaceIBounds);
 
     // Handles allocation (if needed) of a clip alpha-mask texture for both the sw-upload
@@ -136,7 +136,7 @@
                      const SkMatrix& viewMatrix,
                      GrTexture* target,
                      const SkClipStack::Element*,
-                     GrPathRenderer* pr = NULL);
+                     GrPathRenderer* pr = nullptr);
 
     // Determines whether it is possible to draw the element to both the stencil buffer and the
     // alpha mask simultaneously. If so and the element is a path a compatible path renderer is
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 0e01313..2fea2cb 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -55,7 +55,7 @@
 #define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == this)
 #define RETURN_IF_ABANDONED if (fDrawingMgr.abandoned()) { return; }
 #define RETURN_FALSE_IF_ABANDONED if (fDrawingMgr.abandoned()) { return false; }
-#define RETURN_NULL_IF_ABANDONED if (fDrawingMgr.abandoned()) { return NULL; }
+#define RETURN_NULL_IF_ABANDONED if (fDrawingMgr.abandoned()) { return nullptr; }
 
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -114,7 +114,7 @@
 
 GrDrawContext* GrContext::DrawingMgr::drawContext(const SkSurfaceProps* surfaceProps) { 
     if (this->abandoned()) {
-        return NULL;
+        return nullptr;
     }
 
     const SkSurfaceProps props(SkSurfacePropsCopyOrDefault(surfaceProps));
@@ -144,7 +144,7 @@
         return context;
     } else {
         context->unref();
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -158,13 +158,13 @@
 }
 
 GrContext::GrContext() : fUniqueID(next_id()) {
-    fGpu = NULL;
-    fCaps = NULL;
-    fResourceCache = NULL;
-    fResourceProvider = NULL;
-    fPathRendererChain = NULL;
-    fSoftwarePathRenderer = NULL;
-    fBatchFontCache = NULL;
+    fGpu = nullptr;
+    fCaps = nullptr;
+    fResourceCache = nullptr;
+    fResourceProvider = nullptr;
+    fPathRendererChain = nullptr;
+    fSoftwarePathRenderer = nullptr;
+    fBatchFontCache = nullptr;
     fFlushToReduceCacheSize = false;
 }
 
@@ -308,7 +308,7 @@
 bool sw_convert_to_premul(GrPixelConfig srcConfig, int width, int height, size_t inRowBytes,
                           const void* inPixels, size_t outRowBytes, void* outPixels) {
     SkSrcPixelInfo srcPI;
-    if (!GrPixelConfig2ColorAndProfileType(srcConfig, &srcPI.fColorType, NULL)) {
+    if (!GrPixelConfig2ColorAndProfileType(srcConfig, &srcPI.fColorType, nullptr)) {
         return false;
     }
     srcPI.fAlphaType = kUnpremul_SkAlphaType;
@@ -385,7 +385,7 @@
             // If premultiplying was the only reason for the draw, fall back to a straight write.
             if (!fp) {
                 if (GrGpu::kCallerPrefersDraw_DrawPreference == drawPreference) {
-                    tempTexture.reset(NULL);
+                    tempTexture.reset(nullptr);
                 }
             } else {
                 applyPremulToSrc = false;
@@ -429,7 +429,7 @@
             }
             paint.addColorFragmentProcessor(fp);
             SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
-            drawContext->drawRect(renderTarget, GrClip::WideOpen(), paint, matrix, rect, NULL);
+            drawContext->drawRect(renderTarget, GrClip::WideOpen(), paint, matrix, rect, nullptr);
 
             if (kFlushWrites_PixelOp & pixelOpsFlags) {
                 this->flushSurfaceWrites(surface);
@@ -523,7 +523,7 @@
                 } else if (GrGpu::kCallerPrefersDraw_DrawPreference == drawPreference) {
                     // We only wanted to do the draw in order to perform the unpremul so don't
                     // bother.
-                    temp.reset(NULL);
+                    temp.reset(nullptr);
                 }
             }
             if (!fp && temp) {
@@ -536,7 +536,7 @@
                 SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
                 GrDrawContext* drawContext = this->drawContext();
                 drawContext->drawRect(temp->asRenderTarget(), GrClip::WideOpen(), paint,
-                                      SkMatrix::I(), rect, NULL);
+                                      SkMatrix::I(), rect, nullptr);
                 surfaceToRead.reset(SkRef(temp.get()));
                 left = 0;
                 top = 0;
@@ -564,7 +564,7 @@
     // Perform umpremul conversion if we weren't able to perform it as a draw.
     if (unpremul) {
         SkDstPixelInfo dstPI;
-        if (!GrPixelConfig2ColorAndProfileType(dstConfig, &dstPI.fColorType, NULL)) {
+        if (!GrPixelConfig2ColorAndProfileType(dstConfig, &dstPI.fColorType, nullptr)) {
             return false;
         }
         dstPI.fAlphaType = kUnpremul_SkAlphaType;
@@ -708,7 +708,7 @@
         return GrConfigConversionEffect::Create(procDataManager, texture, swapRAndB, pmToUPM,
                                                 matrix);
     } else {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -726,7 +726,7 @@
         return GrConfigConversionEffect::Create(procDataManager, texture, swapRAndB, upmToPM,
                                                 matrix);
     } else {
-        return NULL;
+        return nullptr;
     }
 }
 
diff --git a/src/gpu/GrContextFactory.cpp b/src/gpu/GrContextFactory.cpp
index 1f37130..d84e589 100755
--- a/src/gpu/GrContextFactory.cpp
+++ b/src/gpu/GrContextFactory.cpp
@@ -55,8 +55,8 @@
             glCtx.reset(SkDebugGLContext::Create(forcedGpuAPI));
             break;
     }
-    if (NULL == glCtx.get()) {
-        return NULL;
+    if (nullptr == glCtx.get()) {
+        return nullptr;
     }
 
     SkASSERT(glCtx->isValid());
@@ -66,11 +66,11 @@
     if (kNVPR_GLContextType != type) {
         glInterface.reset(GrGLInterfaceRemoveNVPR(glInterface));
         if (!glInterface) {
-            return NULL;
+            return nullptr;
         }
     } else {
         if (!glInterface->hasExtension("GL_NV_path_rendering")) {
-            return NULL;
+            return nullptr;
         }
     }
 
@@ -82,7 +82,7 @@
     grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx, fGlobalOptions));
 #endif
     if (!grCtx.get()) {
-        return NULL;
+        return nullptr;
     }
     // Warn if path rendering support is not available for the NVPR type.
     if (kNVPR_GLContextType == type) {
diff --git a/src/gpu/GrContextFactory.h b/src/gpu/GrContextFactory.h
index 7fd4b77..b557f98 100644
--- a/src/gpu/GrContextFactory.h
+++ b/src/gpu/GrContextFactory.h
@@ -116,7 +116,7 @@
 
 
     // Returns the GLContext of the given type. If it has not been created yet,
-    // NULL is returned instead.
+    // nullptr is returned instead.
     SkGLContext* getGLContext(GLContextType type) {
         for (int i = 0; i < fContexts.count(); ++i) {
             if (fContexts[i].fType == type) {
@@ -124,7 +124,7 @@
             }
         }
 
-        return NULL;
+        return nullptr;
     }
 
     const GrContextOptions& getGlobalOptions() const { return fGlobalOptions; }
diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp
index d3363ef..2017173 100644
--- a/src/gpu/GrDefaultGeoProcFactory.cpp
+++ b/src/gpu/GrDefaultGeoProcFactory.cpp
@@ -194,10 +194,10 @@
                    uint8_t coverage,
                    bool localCoordsWillBeRead,
                    bool coverageWillBeIgnored)
-        : fInPosition(NULL)
-        , fInColor(NULL)
-        , fInLocalCoords(NULL)
-        , fInCoverage(NULL)
+        : fInPosition(nullptr)
+        , fInColor(nullptr)
+        , fInLocalCoords(nullptr)
+        , fInCoverage(nullptr)
         , fColor(color)
         , fViewMatrix(viewMatrix)
         , fLocalMatrix(localMatrix)
@@ -310,7 +310,7 @@
         SkASSERT(LocalCoords::kUsePosition_Type == localCoords.fType);
         if (!viewMatrix.isIdentity() && !viewMatrix.invert(&invert)) {
             SkDebugf("Could not invert\n");
-            return NULL;
+            return nullptr;
         }
 
         if (localCoords.hasLocalMatrix()) {
diff --git a/src/gpu/GrDefaultGeoProcFactory.h b/src/gpu/GrDefaultGeoProcFactory.h
index 2d80558..bf2db40 100644
--- a/src/gpu/GrDefaultGeoProcFactory.h
+++ b/src/gpu/GrDefaultGeoProcFactory.h
@@ -107,11 +107,11 @@
             kHasExplicit_Type,
             kHasTransformed_Type,
         };
-        LocalCoords(Type type) : fType(type), fMatrix(NULL) {}
+        LocalCoords(Type type) : fType(type), fMatrix(nullptr) {}
         LocalCoords(Type type, const SkMatrix* matrix) : fType(type), fMatrix(matrix) {
             SkASSERT(kUnused_Type != type);
         }
-        bool hasLocalMatrix() const { return NULL != fMatrix; }
+        bool hasLocalMatrix() const { return nullptr != fMatrix; }
 
         Type fType;
         const SkMatrix* fMatrix;
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index cf3f0d3..f4ce7c8 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -321,10 +321,10 @@
             return;
         }
 
-        const GrIndexBuffer* indexBuffer = NULL;
+        const GrIndexBuffer* indexBuffer = nullptr;
         int firstIndex = 0;
 
-        void* indices = NULL;
+        void* indices = nullptr;
         if (isIndexed) {
             indices = target->makeIndexSpace(maxIndices, &indexBuffer, &firstIndex);
 
@@ -569,7 +569,7 @@
         if (stencilOnly) {
             passes[0] = &gDirectToStencil;
         } else {
-            passes[0] = NULL;
+            passes[0] = nullptr;
         }
         lastPassIsBounds = false;
         drawFace[0] = GrPipelineBuilder::kBoth_DrawFace;
@@ -579,7 +579,7 @@
             if (stencilOnly) {
                 passes[0] = &gDirectToStencil;
             } else {
-                passes[0] = NULL;
+                passes[0] = nullptr;
             }
             drawFace[0] = GrPipelineBuilder::kBoth_DrawFace;
             lastPassIsBounds = false;
@@ -710,7 +710,7 @@
     // this class can draw any path with any fill but doesn't do any anti-aliasing.
     return !args.fAntiAlias && (args.fStroke->isFillStyle() ||
                                 IsStrokeHairlineOrEquivalent(*args.fStroke, *args.fViewMatrix,
-                                                             NULL));
+                                                             nullptr));
 }
 
 bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) {
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 7a508c7..e56a729 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -24,7 +24,7 @@
 #define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == fContext)
 #define RETURN_IF_ABANDONED        if (!fDrawTarget) { return; }
 #define RETURN_FALSE_IF_ABANDONED  if (!fDrawTarget) { return false; }
-#define RETURN_NULL_IF_ABANDONED   if (!fDrawTarget) { return NULL; }
+#define RETURN_NULL_IF_ABANDONED   if (!fDrawTarget) { return nullptr; }
 
 class AutoCheckFlush {
 public:
@@ -40,7 +40,7 @@
                              const SkSurfaceProps& surfaceProps)
     : fContext(context)
     , fDrawTarget(SkRef(drawTarget))
-    , fTextContext(NULL)
+    , fTextContext(nullptr)
     , fSurfaceProps(surfaceProps) {
 }
 
@@ -230,7 +230,7 @@
 
     GrPipelineBuilder pipelineBuilder(paint, rt, clip);
 
-    SkScalar width = NULL == strokeInfo ? -1 : strokeInfo->getWidth();
+    SkScalar width = nullptr == strokeInfo ? -1 : strokeInfo->getWidth();
 
     // Check if this is a full RT draw and can be replaced with a clear. We don't bother checking
     // cases where the RT is fully inside a stroke.
@@ -259,7 +259,7 @@
                 // Will it blend?
                 GrColor clearColor;
                 if (paint.isConstantBlendedColor(&clearColor)) {
-                    fDrawTarget->clear(NULL, clearColor, true, rt);
+                    fDrawTarget->clear(nullptr, clearColor, true, rt);
                     return;
                 }
             }
@@ -699,7 +699,7 @@
                                                     *strokeInfoPtr, false, type);
 
     GrStrokeInfo dashlessStrokeInfo(strokeInfo, false);
-    if (NULL == pr && strokeInfo.isDashed()) {
+    if (nullptr == pr && strokeInfo.isDashed()) {
         // It didn't work above, so try again with dashed stroke converted to a dashless stroke.
         if (!strokeInfo.applyDashToPath(tmpPath.init(), &dashlessStrokeInfo, *pathPtr)) {
             return;
@@ -713,8 +713,8 @@
                                        false, type);
     }
 
-    if (NULL == pr) {
-        if (!GrPathRenderer::IsStrokeHairlineOrEquivalent(*strokeInfoPtr, viewMatrix, NULL) &&
+    if (nullptr == pr) {
+        if (!GrPathRenderer::IsStrokeHairlineOrEquivalent(*strokeInfoPtr, viewMatrix, nullptr) &&
             !strokeInfoPtr->isFillStyle()) {
             // It didn't work above, so try again with stroke converted to a fill.
             if (!tmpPath.isValid()) {
@@ -737,7 +737,7 @@
                                        true, type);
     }
 
-    if (NULL == pr) {
+    if (nullptr == pr) {
 #ifdef SK_DEBUG
         SkDebugf("Unable to find path renderer compatible with path.\n");
 #endif
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 805cfaf..f3dd2db 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -203,7 +203,7 @@
     GrScissorState scissorState;
     GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps;
     GrPipelineBuilder::AutoRestoreStencil ars;
-    if (!this->setupClip(pipelineBuilder, &arfps, &ars, &scissorState, NULL)) {
+    if (!this->setupClip(pipelineBuilder, &arfps, &ars, &scissorState, nullptr)) {
         return;
     }
 
@@ -253,7 +253,7 @@
     // instead for it to just copy the entire dst. Realistically this is a moot
     // point, because any context that supports NV_path_rendering will also
     // support NV_blend_equation_advanced.
-    GrDrawTarget::PipelineInfo pipelineInfo(&pipelineBuilder, &scissorState, batch, NULL, this);
+    GrDrawTarget::PipelineInfo pipelineInfo(&pipelineBuilder, &scissorState, batch, nullptr, this);
 
     if (!pipelineInfo.valid()) {
         return;
@@ -286,7 +286,7 @@
     GrScissorState scissorState;
     GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps;
     GrPipelineBuilder::AutoRestoreStencil ars;
-    if (!this->setupClip(pipelineBuilder, &arfps, &ars, &scissorState, NULL)) {
+    if (!this->setupClip(pipelineBuilder, &arfps, &ars, &scissorState, nullptr)) {
         return;
     }
 
@@ -300,7 +300,7 @@
     // instead for it to just copy the entire dst. Realistically this is a moot
     // point, because any context that supports NV_path_rendering will also
     // support NV_blend_equation_advanced.
-    GrDrawTarget::PipelineInfo pipelineInfo(&pipelineBuilder, &scissorState, pathProc, NULL, this);
+    GrDrawTarget::PipelineInfo pipelineInfo(&pipelineBuilder, &scissorState, pathProc, nullptr, this);
     if (!pipelineInfo.valid()) {
         return;
     }
@@ -460,7 +460,7 @@
     fArgs.fCoveragePOI = fArgs.fPipelineBuilder->coverageProcInfo(primProc);
     if (!target->setupDstReadIfNecessary(*fArgs.fPipelineBuilder, fArgs.fColorPOI,
                                          fArgs.fCoveragePOI, &fArgs.fDstTexture, devBounds)) {
-        fArgs.fPipelineBuilder = NULL;
+        fArgs.fPipelineBuilder = nullptr;
     }
 }
 
@@ -476,7 +476,7 @@
     fArgs.fCoveragePOI = fArgs.fPipelineBuilder->coverageProcInfo(batch);
     if (!target->setupDstReadIfNecessary(*fArgs.fPipelineBuilder, fArgs.fColorPOI,
                                          fArgs.fCoveragePOI, &fArgs.fDstTexture, devBounds)) {
-        fArgs.fPipelineBuilder = NULL;
+        fArgs.fPipelineBuilder = nullptr;
     }
 }
 
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 48ac06d..13cf990 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -114,9 +114,9 @@
      *
      * @param rect        the rect to draw
      * @param localRect   optional rect that specifies local coords to map onto
-     *                    rect. If NULL then rect serves as the local coords.
+     *                    rect. If nullptr then rect serves as the local coords.
      * @param localMatrix Optional local matrix. The local coordinates are specified by localRect,
-     *                    or if it is NULL by rect. This matrix applies to the coordinate implied by
+     *                    or if it is nullptr by rect. This matrix applies to the coordinate implied by
      *                    that rectangle before it is input to GrCoordTransforms that read local
      *                    coordinates
      */
@@ -153,7 +153,7 @@
 
     /**
      * Clear the passed in render target. Ignores the GrPipelineBuilder and clip. Clears the whole
-     * thing if rect is NULL, otherwise just the rect. If canIgnoreRect is set then the entire
+     * thing if rect is nullptr, otherwise just the rect. If canIgnoreRect is set then the entire
      * render target can be optionally cleared.
      */
     void clear(const SkIRect* rect,
diff --git a/src/gpu/GrFontScaler.cpp b/src/gpu/GrFontScaler.cpp
index d923c7d..c841202 100644
--- a/src/gpu/GrFontScaler.cpp
+++ b/src/gpu/GrFontScaler.cpp
@@ -15,7 +15,7 @@
 
 GrFontScaler::GrFontScaler(SkGlyphCache* strike) {
     fStrike = strike;
-    fKey = NULL;
+    fKey = nullptr;
 }
 
 GrFontScaler::~GrFontScaler() {
@@ -40,7 +40,7 @@
 }
 
 const GrFontDescKey* GrFontScaler::getKey() {
-    if (NULL == fKey) {
+    if (nullptr == fKey) {
         fKey = new GrFontDescKey(fStrike->getDescriptor());
     }
     return fKey;
@@ -117,7 +117,7 @@
     SkASSERT(glyph.fWidth == width);
     SkASSERT(glyph.fHeight == height);
     const void* src = fStrike->findImage(glyph);
-    if (NULL == src) {
+    if (nullptr == src) {
         return false;
     }
 
@@ -171,7 +171,7 @@
     SkASSERT(glyph.fWidth + 2*SK_DistanceFieldPad == width);
     SkASSERT(glyph.fHeight + 2*SK_DistanceFieldPad == height);
     const void* image = fStrike->findImage(glyph);
-    if (NULL == image) {
+    if (nullptr == image) {
         return false;
     }
     // now generate the distance field
diff --git a/src/gpu/GrGeometryBuffer.h b/src/gpu/GrGeometryBuffer.h
index adccbf8..56a6cae 100644
--- a/src/gpu/GrGeometryBuffer.h
+++ b/src/gpu/GrGeometryBuffer.h
@@ -48,7 +48,7 @@
      * Note that buffer mapping does not go through GrContext and therefore is
      * not serialized with other operations.
      *
-     * @return a pointer to the data or NULL if the map fails.
+     * @return a pointer to the data or nullptr if the map fails.
      */
      void* map() { return (fMapPtr = this->onMap()); }
 
@@ -60,14 +60,14 @@
      void unmap() {
          SkASSERT(fMapPtr);
          this->onUnmap();
-         fMapPtr = NULL;
+         fMapPtr = nullptr;
      }
 
     /**
-     * Returns the same ptr that map() returned at time of map or NULL if the
+     * Returns the same ptr that map() returned at time of map or nullptr if the
      * is not mapped.
      *
-     * @return ptr to mapped buffer data or NULL if buffer is not mapped.
+     * @return ptr to mapped buffer data or nullptr if buffer is not mapped.
      */
      void* mapPtr() const { return fMapPtr; }
 
@@ -101,7 +101,7 @@
 protected:
     GrGeometryBuffer(GrGpu* gpu, size_t gpuMemorySize, bool dynamic, bool cpuBacked)
         : INHERITED(gpu, kCached_LifeCycle)
-        , fMapPtr(NULL)
+        , fMapPtr(nullptr)
         , fGpuMemorySize(gpuMemorySize)
         , fDynamic(dynamic)
         , fCPUBacked(cpuBacked) {}
diff --git a/src/gpu/GrGlyph.h b/src/gpu/GrGlyph.h
index 6a4166f..55e925f 100644
--- a/src/gpu/GrGlyph.h
+++ b/src/gpu/GrGlyph.h
@@ -41,7 +41,7 @@
 
     void init(GrGlyph::PackedID packed, const SkIRect& bounds, GrMaskFormat format) {
         fID = GrBatchAtlas::kInvalidAtlasID;
-        fPath = NULL;
+        fPath = nullptr;
         fPackedID = packed;
         fBounds.set(bounds);
         fMaskFormat = format;
@@ -52,7 +52,7 @@
     void free() {
         if (fPath) {
             delete fPath;
-            fPath = NULL;
+            fPath = nullptr;
         }
     }
 
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 6a1c1dd..2fdfbc4 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -71,30 +71,30 @@
     GrSurfaceDesc desc = origDesc;
 
     if (!this->caps()->isConfigTexturable(desc.fConfig)) {
-        return NULL;
+        return nullptr;
     }
 
     bool isRT = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag);
     if (isRT && !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
-        return NULL;
+        return nullptr;
     }
 
     // We currently do not support multisampled textures
     if (!isRT && desc.fSampleCnt > 0) {
-        return NULL;
+        return nullptr;
     }
 
-    GrTexture *tex = NULL;
+    GrTexture *tex = nullptr;
 
     if (isRT) {
         int maxRTSize = this->caps()->maxRenderTargetSize();
         if (desc.fWidth > maxRTSize || desc.fHeight > maxRTSize) {
-            return NULL;
+            return nullptr;
         }
     } else {
         int maxSize = this->caps()->maxTextureSize();
         if (desc.fWidth > maxSize || desc.fHeight > maxSize) {
-            return NULL;
+            return nullptr;
         }
     }
 
@@ -114,7 +114,7 @@
 
         if (!this->caps()->npotTextureTileSupport() &&
             (!SkIsPow2(desc.fWidth) || !SkIsPow2(desc.fHeight))) {
-            return NULL;
+            return nullptr;
         }
 
         this->handleDirtyContext();
@@ -136,7 +136,7 @@
 }
 
 bool GrGpu::attachStencilAttachmentToRenderTarget(GrRenderTarget* rt) {
-    SkASSERT(NULL == rt->renderTargetPriv().getStencilAttachment());
+    SkASSERT(nullptr == rt->renderTargetPriv().getStencilAttachment());
     GrUniqueKey sbKey;
 
     int width = rt->width();
@@ -180,14 +180,14 @@
 GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc, GrWrapOwnership ownership) {
     this->handleDirtyContext();
     GrTexture* tex = this->onWrapBackendTexture(desc, ownership);
-    if (NULL == tex) {
-        return NULL;
+    if (nullptr == tex) {
+        return nullptr;
     }
     // TODO: defer this and attach dynamically
     GrRenderTarget* tgt = tex->asRenderTarget();
     if (tgt && !this->attachStencilAttachmentToRenderTarget(tgt)) {
         tex->unref();
-        return NULL;
+        return nullptr;
     } else {
         return tex;
     }
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 783376d..290e981 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -38,7 +38,7 @@
 public:
     /**
      * Create an instance of GrGpu that matches the specified backend. If the requested backend is
-     * not supported (at compile-time or run-time) this returns NULL. The context will not be
+     * not supported (at compile-time or run-time) this returns nullptr. The context will not be
      * fully constructed and should not be used by GrGpu until after this function returns.
      */
     static GrGpu* Create(GrBackend, GrBackendContext, const GrContextOptions&, GrContext* context);
@@ -83,13 +83,13 @@
      * @param srcData     texel data to load texture. Begins with full-size
      *                    palette data for paletted textures. For compressed
      *                    formats it contains the compressed pixel data. Otherwise,
-     *                    it contains width*height texels. If NULL texture data
+     *                    it contains width*height texels. If nullptr texture data
      *                    is uninitialized.
      * @param rowBytes    the number of bytes between consecutive rows. Zero
      *                    means rows are tightly packed. This field is ignored
      *                    for compressed formats.
      *
-     * @return    The texture object if successful, otherwise NULL.
+     * @return    The texture object if successful, otherwise nullptr.
      */
     GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted,
                              const void* srcData, size_t rowBytes);
@@ -112,7 +112,7 @@
      *                by either GrVertexBuffer::map() or
      *                GrVertexBuffer::updateData().
      *
-     * @return    The vertex buffer if successful, otherwise NULL.
+     * @return    The vertex buffer if successful, otherwise nullptr.
      */
     GrVertexBuffer* createVertexBuffer(size_t size, bool dynamic);
 
@@ -124,7 +124,7 @@
      *                by either GrIndexBuffer::map() or
      *                GrIndexBuffer::updateData().
      *
-     * @return The index buffer if successful, otherwise NULL.
+     * @return The index buffer if successful, otherwise nullptr.
      */
     GrIndexBuffer* createIndexBuffer(size_t size, bool dynamic);
 
@@ -257,10 +257,10 @@
     void clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget* renderTarget);
 
     /**
-     * Discards the contents render target. NULL indicates that the current render target should
+     * Discards the contents render target. nullptr indicates that the current render target should
      * be discarded.
      **/
-    virtual void discard(GrRenderTarget* = NULL) = 0;
+    virtual void discard(GrRenderTarget* = nullptr) = 0;
 
     /**
      * This is can be called before allocating a texture to be a dst for copySurface. It will
@@ -393,7 +393,7 @@
     bool attachStencilAttachmentToRenderTarget(GrRenderTarget* target);
 
     // This is only to be used in GL-specific tests.
-    virtual const GrGLContext* glContextForTesting() const { return NULL; }
+    virtual const GrGLContext* glContextForTesting() const { return nullptr; }
 
 protected:
     // Functions used to map clip-respecting stencil tests into normal
diff --git a/src/gpu/GrGpuFactory.cpp b/src/gpu/GrGpuFactory.cpp
index 854e484..f769ce4 100644
--- a/src/gpu/GrGpuFactory.cpp
+++ b/src/gpu/GrGpuFactory.cpp
@@ -13,7 +13,7 @@
 #include "gl/GrGLConfig.h"
 #include "gl/GrGLGpu.h"
 
-static CreateGpuProc gGpuFactories[kBackendCount] = { GrGLGpu::Create, NULL };
+static CreateGpuProc gGpuFactories[kBackendCount] = { GrGLGpu::Create, nullptr };
 
 #ifdef SK_VULKAN
 extern GrGpu* vk_gpu_create(GrBackendContext backendContext, const GrContextOptions& options,
@@ -31,7 +31,7 @@
                      GrContext* context) {
     SkASSERT((int)backend < kBackendCount);
     if (!gGpuFactories[backend]) {
-        return NULL;
+        return nullptr;
     }
     return (gGpuFactories[backend])(backendContext, options, context);
 }
diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp
index 53782a7..df8301c 100644
--- a/src/gpu/GrGpuResource.cpp
+++ b/src/gpu/GrGpuResource.cpp
@@ -40,7 +40,7 @@
     SkASSERT(fGpu);
     this->onRelease();
     get_resource_cache(fGpu)->resourceAccess().removeResource(this);
-    fGpu = NULL;
+    fGpu = nullptr;
     fGpuMemorySize = 0;
 }
 
@@ -48,7 +48,7 @@
     SkASSERT(fGpu);
     this->onAbandon();
     get_resource_cache(fGpu)->resourceAccess().removeResource(this);
-    fGpu = NULL;
+    fGpu = nullptr;
     fGpuMemorySize = 0;
 }
 
@@ -62,7 +62,7 @@
     if (fGpu) {
         return fGpu->getContext();
     } else {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -70,7 +70,7 @@
     if (fGpu) {
         return fGpu->getContext();
     } else {
-        return NULL;
+        return nullptr;
     }
 }
 
diff --git a/src/gpu/GrGpuResourceRef.cpp b/src/gpu/GrGpuResourceRef.cpp
index 9e0e6f8..405679d 100644
--- a/src/gpu/GrGpuResourceRef.cpp
+++ b/src/gpu/GrGpuResourceRef.cpp
@@ -8,13 +8,13 @@
 #include "GrGpuResourceRef.h"
 
 GrGpuResourceRef::GrGpuResourceRef() {
-    fResource = NULL;
+    fResource = nullptr;
     fOwnRef = false;
     fPendingIO = false;
 }
 
 GrGpuResourceRef::GrGpuResourceRef(GrGpuResource* resource, GrIOType ioType) {
-    fResource = NULL;
+    fResource = nullptr;
     fOwnRef = false;
     fPendingIO = false;
     this->setResource(resource, ioType);
@@ -47,7 +47,7 @@
     if (fOwnRef) {
         fResource->unref();
         fOwnRef = false;
-        fResource = NULL;
+        fResource = nullptr;
     }
 }
 
@@ -55,8 +55,8 @@
     SkASSERT(!fPendingIO);
     SkASSERT(SkToBool(fResource) == fOwnRef);
     SkSafeUnref(fResource);
-    if (NULL == resource) {
-        fResource = NULL;
+    if (nullptr == resource) {
+        fResource = nullptr;
         fOwnRef = false;
     } else {
         fResource = resource;
diff --git a/src/gpu/GrInOrderCommandBuilder.cpp b/src/gpu/GrInOrderCommandBuilder.cpp
index f69dbb4..b9387e9 100644
--- a/src/gpu/GrInOrderCommandBuilder.cpp
+++ b/src/gpu/GrInOrderCommandBuilder.cpp
@@ -34,7 +34,7 @@
         if (previous->batch()->combineIfPossible(batch, caps)) {
             GrBATCH_INFO("\tBatching with (%s, %u)\n",
                          previous->batch()->name(), previous->batch()->uniqueID());
-            return NULL;
+            return nullptr;
         }
     }
 
@@ -88,7 +88,7 @@
                  &previous->fTransforms[previous->fCount * xformSize] == savedTransforms)) {
                 // Combine this DrawPaths call with the one previous.
                 previous->fCount += count;
-                return NULL;
+                return nullptr;
             }
         }
     }
diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp
index e894c30..f33384c 100644
--- a/src/gpu/GrLayerCache.cpp
+++ b/src/gpu/GrLayerCache.cpp
@@ -25,7 +25,7 @@
         }
     } else {
         SkASSERT(fRect.isEmpty());
-        SkASSERT(NULL == fPlot);
+        SkASSERT(nullptr == fPlot);
         SkASSERT(!fLocked);     // layers without a texture cannot be locked
     }
 
@@ -68,7 +68,7 @@
         }
     }
     void setBackingTexture(GrTexture* backingTexture) {
-        SkASSERT(NULL == fBackingTexture || fBackingTexture == backingTexture);
+        SkASSERT(nullptr == fBackingTexture || fBackingTexture == backingTexture);
         fBackingTexture = backingTexture;
     }
 
@@ -100,7 +100,7 @@
 }
 
 void GrLayerCache::initAtlas() {
-    SkASSERT(NULL == fAtlas.get());
+    SkASSERT(nullptr == fAtlas.get());
     GR_STATIC_ASSERT(kNumPlotsX*kNumPlotsX == GrPictureInfo::kNumPlots);
 
     SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight);
@@ -155,7 +155,7 @@
                                                const SkPaint* paint) {
     SkASSERT(pictureID != SK_InvalidGenID && start >= 0 && stop > 0);
     GrCachedLayer* layer = fLayerHash.find(GrCachedLayer::Key(pictureID, initialMat, key, keySize));
-    if (NULL == layer) {
+    if (nullptr == layer) {
         layer = this->createLayer(pictureID, start, stop,
                                   srcIR, dstIR, initialMat,
                                   key, keySize, paint);
@@ -167,7 +167,7 @@
 bool GrLayerCache::tryToAtlas(GrCachedLayer* layer,
                               const GrSurfaceDesc& desc,
                               bool* needsRendering) {
-    SkDEBUGCODE(GrAutoValidateLayer avl(fAtlas ? fAtlas->getTexture() : NULL, layer);)
+    SkDEBUGCODE(GrAutoValidateLayer avl(fAtlas ? fAtlas->getTexture() : nullptr, layer);)
 
     SkASSERT(PlausiblyAtlasable(desc.fWidth, desc.fHeight));
     SkASSERT(0 == desc.fSampleCnt);
@@ -198,7 +198,7 @@
         }
         // Not in the atlas - will it fit?
         GrPictureInfo* pictInfo = fPictureHash.find(layer->pictureID());
-        if (NULL == pictInfo) {
+        if (nullptr == pictInfo) {
             pictInfo = new GrPictureInfo(layer->pictureID());
             fPictureHash.add(pictInfo);
         }
@@ -207,7 +207,7 @@
         for (int i = 0; i < 2; ++i) { // extra pass in case we fail to add but are able to purge
             GrPlot* plot = fAtlas->addToAtlas(&pictInfo->fPlotUsage,
                                               desc.fWidth, desc.fHeight,
-                                              NULL, &loc);
+                                              nullptr, &loc);
             // addToAtlas can allocate the backing texture
             SkDEBUGCODE(avl.setBackingTexture(fAtlas->getTexture()));
             if (plot) {
@@ -267,9 +267,9 @@
 }
 
 void GrLayerCache::unlock(GrCachedLayer* layer) {
-    SkDEBUGCODE(GrAutoValidateLayer avl(fAtlas ? fAtlas->getTexture() : NULL, layer);)
+    SkDEBUGCODE(GrAutoValidateLayer avl(fAtlas ? fAtlas->getTexture() : nullptr, layer);)
 
-    if (NULL == layer || !layer->locked()) {
+    if (nullptr == layer || !layer->locked()) {
         // invalid or not locked
         return;
     }
@@ -298,12 +298,12 @@
             }
         }
 
-        layer->setPlot(NULL);
-        layer->setTexture(NULL, SkIRect::MakeEmpty());
+        layer->setPlot(nullptr);
+        layer->setTexture(nullptr, SkIRect::MakeEmpty());
 #endif
 
     } else {
-        layer->setTexture(NULL, SkIRect::MakeEmpty());
+        layer->setTexture(nullptr, SkIRect::MakeEmpty());
     }
 
     layer->setLocked(false);
@@ -318,7 +318,7 @@
     for (; !iter.done(); ++iter) {
         const GrCachedLayer* layer = &(*iter);
 
-        layer->validate(fAtlas.get() ? fAtlas->getTexture() : NULL);
+        layer->validate(fAtlas.get() ? fAtlas->getTexture() : nullptr);
 
         const GrPictureInfo* pictInfo = fPictureHash.find(layer->pictureID());
         if (!pictInfo) {
@@ -489,7 +489,7 @@
 
     if (fAtlas) {
         GrTexture* atlasTexture = fAtlas->getTexture();
-        if (NULL != atlasTexture) {
+        if (nullptr != atlasTexture) {
             SkString fileName(dirName);
             fileName.append("\\atlas.png");
 
diff --git a/src/gpu/GrLayerCache.h b/src/gpu/GrLayerCache.h
index 4ab0fa4..0fb23f2 100644
--- a/src/gpu/GrLayerCache.h
+++ b/src/gpu/GrLayerCache.h
@@ -158,11 +158,11 @@
         , fSrcIR(srcIR)
         , fDstIR(dstIR)
         , fOffset(SkIPoint::Make(0, 0))
-        , fPaint(paint ? new SkPaint(*paint) : NULL)
-        , fFilter(NULL)
-        , fTexture(NULL)
+        , fPaint(paint ? new SkPaint(*paint) : nullptr)
+        , fFilter(nullptr)
+        , fTexture(nullptr)
         , fRect(SkIRect::MakeEmpty())
-        , fPlot(NULL)
+        , fPlot(nullptr)
         , fUses(0)
         , fLocked(false) {
         SkASSERT(SK_InvalidGenID != pictureID);
@@ -170,7 +170,7 @@
         if (fPaint) {
             if (fPaint->getImageFilter()) {
                 fFilter = SkSafeRef(fPaint->getImageFilter());
-                fPaint->setImageFilter(NULL);
+                fPaint->setImageFilter(nullptr);
             }
         }
     }
@@ -207,7 +207,7 @@
     const SkIPoint& offset() const { return fOffset; }
 
     void setPlot(GrPlot* plot) {
-        SkASSERT(NULL == plot || NULL == fPlot);
+        SkASSERT(nullptr == plot || nullptr == fPlot);
         fPlot = plot;
     }
     GrPlot* plot() { return fPlot; }
@@ -237,7 +237,7 @@
     SkIPoint        fOffset;
 
     // The paint used when dropping the layer down into the owning canvas.
-    // Can be NULL. This class makes a copy for itself.
+    // Can be nullptr. This class makes a copy for itself.
     SkPaint*  fPaint;
 
     // The imagefilter that needs to be applied to the layer prior to it being
@@ -250,11 +250,11 @@
 
     // For both atlased and non-atlased layers 'fRect' contains the  bound of
     // the layer in whichever texture it resides. It is empty when 'fTexture'
-    // is NULL.
+    // is nullptr.
     SkIRect         fRect;
 
     // For atlased layers, fPlot stores the atlas plot in which the layer rests.
-    // It is always NULL for non-atlased layers.
+    // It is always nullptr for non-atlased layers.
     GrPlot*         fPlot;
 
     // The number of actively hoisted layers using this cached image (e.g.,
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index 59a4da1..baeb378 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -130,7 +130,7 @@
     GrLayerCache* layerCache = context->getLayerCache();
     layerCache->processDeletedPictures();
 
-    const SkBigPicture::AccelData* topLevelData = NULL;
+    const SkBigPicture::AccelData* topLevelData = nullptr;
     if (const SkBigPicture* bp = topLevelPicture->asSkBigPicture()) {
         topLevelData = bp->accelData();
     }
@@ -188,7 +188,7 @@
 
     layerCache->processDeletedPictures();
 
-    const SkBigPicture::AccelData* topLevelData = NULL;
+    const SkBigPicture::AccelData* topLevelData = nullptr;
     if (const SkBigPicture* bp = topLevelPicture->asSkBigPicture()) {
         topLevelData = bp->accelData();
     }
diff --git a/src/gpu/GrMemoryPool.cpp b/src/gpu/GrMemoryPool.cpp
index e59ed83..cc26452 100644
--- a/src/gpu/GrMemoryPool.cpp
+++ b/src/gpu/GrMemoryPool.cpp
@@ -25,8 +25,8 @@
 
     fHead = CreateBlock(fPreallocSize);
     fTail = fHead;
-    fHead->fNext = NULL;
-    fHead->fPrev = NULL;
+    fHead->fNext = nullptr;
+    fHead->fPrev = nullptr;
     VALIDATE;
 };
 
@@ -48,8 +48,8 @@
         BlockHeader* block = CreateBlock(blockSize);
 
         block->fPrev = fTail;
-        block->fNext = NULL;
-        SkASSERT(NULL == fTail->fNext);
+        block->fNext = nullptr;
+        SkASSERT(nullptr == fTail->fNext);
         fTail->fNext = block;
         fTail = block;
         fSize += block->fSize;
@@ -117,7 +117,7 @@
     block->fLiveCount = 0;
     block->fFreeSize = size;
     block->fCurrPtr = reinterpret_cast<intptr_t>(block) + kHeaderSize;
-    block->fPrevPtr = 0; // gcc warns on assigning NULL to an intptr_t.
+    block->fPrevPtr = 0; // gcc warns on assigning nullptr to an intptr_t.
     block->fSize = paddedSize;
     return block;
 }
@@ -129,7 +129,7 @@
 void GrMemoryPool::validate() {
 #ifdef SK_DEBUG
     BlockHeader* block = fHead;
-    BlockHeader* prev = NULL;
+    BlockHeader* prev = nullptr;
     SkASSERT(block);
     int allocCount = 0;
     do {
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 4847612..e2a4e9a 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -1046,13 +1046,13 @@
         // we only handle thick strokes for near-circular ellipses
         if (scaledStroke.length() > SK_ScalarHalf &&
             (SK_ScalarHalf*xRadius > yRadius || SK_ScalarHalf*yRadius > xRadius)) {
-            return NULL;
+            return nullptr;
         }
 
         // we don't handle it if curvature of the stroke is less than curvature of the ellipse
         if (scaledStroke.fX*(yRadius*yRadius) < (scaledStroke.fY*scaledStroke.fY)*xRadius ||
             scaledStroke.fY*(xRadius*xRadius) < (scaledStroke.fX*scaledStroke.fX)*yRadius) {
-            return NULL;
+            return nullptr;
         }
 
         // this is legit only if scale & translation (which should be the case at the moment)
@@ -1286,13 +1286,13 @@
         // we only handle thick strokes for near-circular ellipses
         if (strokeWidth > SK_ScalarHalf &&
             (SK_ScalarHalf*xRadius > yRadius || SK_ScalarHalf*yRadius > xRadius)) {
-            return NULL;
+            return nullptr;
         }
 
         // we don't handle it if curvature of the stroke is less than curvature of the ellipse
         if (strokeWidth*(yRadius*yRadius) < (strokeWidth*strokeWidth)*xRadius ||
             strokeWidth*(xRadius*xRadius) < (strokeWidth*strokeWidth)*yRadius) {
-            return NULL;
+            return nullptr;
         }
 
         // set inner radius (if needed)
@@ -1415,7 +1415,7 @@
                 kInverseFillBW_GrProcessorEdgeType;
         // TODO this needs to be a geometry processor
         GrFragmentProcessor* fp = GrRRectEffect::Create(edgeType, *inner);
-        if (NULL == fp) {
+        if (nullptr == fp) {
             return false;
         }
         arfps.set(&pipelineBuilder);
@@ -1437,7 +1437,7 @@
     GrPrimitiveEdgeType edgeType = applyAA ? kFillAA_GrProcessorEdgeType :
                                              kFillBW_GrProcessorEdgeType;
     GrFragmentProcessor* effect = GrRRectEffect::Create(edgeType, *outer);
-    if (NULL == effect) {
+    if (nullptr == effect) {
         return false;
     }
     if (!arfps.isSet()) {
@@ -1863,7 +1863,7 @@
 
         // if half of strokewidth is greater than radius, we don't handle that right now
         if (SK_ScalarHalf*scaledStroke.fX > xRadius || SK_ScalarHalf*scaledStroke.fY > yRadius) {
-            return NULL;
+            return nullptr;
         }
     }
 
@@ -1873,7 +1873,7 @@
     // We could consider falling back to rect rendering here, since a tiny radius is
     // indistinguishable from a square corner.
     if (!isStrokeOnly && (SK_ScalarHalf > xRadius || SK_ScalarHalf > yRadius)) {
-        return NULL;
+        return nullptr;
     }
 
     // if the corners are circles, use the circle renderer
@@ -1931,13 +1931,13 @@
             // we only handle thick strokes for near-circular ellipses
             if (scaledStroke.length() > SK_ScalarHalf &&
                 (SK_ScalarHalf*xRadius > yRadius || SK_ScalarHalf*yRadius > xRadius)) {
-                return NULL;
+                return nullptr;
             }
 
             // we don't handle it if curvature of the stroke is less than curvature of the ellipse
             if (scaledStroke.fX*(yRadius*yRadius) < (scaledStroke.fY*scaledStroke.fY)*xRadius ||
                 scaledStroke.fY*(xRadius*xRadius) < (scaledStroke.fX*scaledStroke.fX)*yRadius) {
-                return NULL;
+                return nullptr;
             }
 
             // this is legit only if scale & translation (which should be the case at the moment)
diff --git a/src/gpu/GrPathRange.h b/src/gpu/GrPathRange.h
index 0ba3996..a2483c1 100644
--- a/src/gpu/GrPathRange.h
+++ b/src/gpu/GrPathRange.h
@@ -72,7 +72,7 @@
 
 #ifdef SK_DEBUG
     virtual bool isEqualTo(const SkDescriptor& desc) const {
-        return NULL != fPathGenerator.get() && fPathGenerator->isEqualTo(desc);
+        return nullptr != fPathGenerator.get() && fPathGenerator->isEqualTo(desc);
     }
 #endif
 protected:
diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp
index 62193f3..e408762 100644
--- a/src/gpu/GrPathRendererChain.cpp
+++ b/src/gpu/GrPathRendererChain.cpp
@@ -80,7 +80,7 @@
             return fChain[i];
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 void GrPathRendererChain::init() {
diff --git a/src/gpu/GrPathRendering.cpp b/src/gpu/GrPathRendering.cpp
index 710b828..d98d9d2 100644
--- a/src/gpu/GrPathRendering.cpp
+++ b/src/gpu/GrPathRendering.cpp
@@ -57,9 +57,9 @@
 GrPathRange* GrPathRendering::createGlyphs(const SkTypeface* typeface,
                                            const SkDescriptor* desc,
                                            const GrStrokeInfo& stroke) {
-    if (NULL == typeface) {
+    if (nullptr == typeface) {
         typeface = SkTypeface::GetDefaultTypeface();
-        SkASSERT(NULL != typeface);
+        SkASSERT(nullptr != typeface);
     }
 
     if (desc) {
diff --git a/src/gpu/GrPathUtils.h b/src/gpu/GrPathUtils.h
index 8e52e33..385cc0e 100644
--- a/src/gpu/GrPathUtils.h
+++ b/src/gpu/GrPathUtils.h
@@ -129,11 +129,11 @@
     // the double point: ls and ms. We chop the cubic at these values if they are between 0 and 1.
     // Return value:
     // Value of 3: ls and ms are both between (0,1), and dst will contain the three cubics,
-    //             dst[0..3], dst[3..6], and dst[6..9] if dst is not NULL
+    //             dst[0..3], dst[3..6], and dst[6..9] if dst is not nullptr
     // Value of 2: Only one of ls and ms are between (0,1), and dst will contain the two cubics,
-    //             dst[0..3] and dst[3..6] if dst is not NULL
+    //             dst[0..3] and dst[3..6] if dst is not nullptr
     // Value of 1: Neither ls or ms are between (0,1), and dst will contain the one original cubic,
-    //             dst[0..3] if dst is not NULL
+    //             dst[0..3] if dst is not nullptr
     //
     // Optional KLM Calculation:
     // The function can also return the KLM linear functionals for the chopped cubic implicit form
@@ -153,8 +153,8 @@
     // Notice that the klm lines are calculated in the same space as the input control points.
     // If you transform the points the lines will also need to be transformed. This can be done
     // by mapping the lines with the inverse-transpose of the matrix used to map the points.
-    int chopCubicAtLoopIntersection(const SkPoint src[4], SkPoint dst[10] = NULL,
-                                    SkScalar klm[9] = NULL, SkScalar klm_rev[3] = NULL);
+    int chopCubicAtLoopIntersection(const SkPoint src[4], SkPoint dst[10] = nullptr,
+                                    SkScalar klm[9] = nullptr, SkScalar klm_rev[3] = nullptr);
 
     // Input is p which holds the 4 control points of a non-rational cubic Bezier curve.
     // Output is the coefficients of the three linear functionals K, L, & M which
diff --git a/src/gpu/GrPendingProgramElement.h b/src/gpu/GrPendingProgramElement.h
index 7285ecb..69e459f 100644
--- a/src/gpu/GrPendingProgramElement.h
+++ b/src/gpu/GrPendingProgramElement.h
@@ -18,7 +18,7 @@
  */
 template <typename T> class GrPendingProgramElement : SkNoncopyable {
 public:
-    GrPendingProgramElement() : fObj(NULL) { };
+    GrPendingProgramElement() : fObj(nullptr) { };
 
     // Adds a pending execution on obj.
     explicit GrPendingProgramElement(T* obj) : fObj(obj)  {
diff --git a/src/gpu/GrPipelineBuilder.cpp b/src/gpu/GrPipelineBuilder.cpp
index 0af0eab..54242e7 100644
--- a/src/gpu/GrPipelineBuilder.cpp
+++ b/src/gpu/GrPipelineBuilder.cpp
@@ -80,7 +80,7 @@
         fPipelineBuilder->getProcessorDataManager()->restoreToSaveMarker(/*fSaveMarker*/);
     }
     fPipelineBuilder = const_cast<GrPipelineBuilder*>(pipelineBuilder);
-    if (NULL != pipelineBuilder) {
+    if (nullptr != pipelineBuilder) {
         fColorEffectCnt = pipelineBuilder->numColorFragmentProcessors();
         fCoverageEffectCnt = pipelineBuilder->numCoverageFragmentProcessors();
         SkDEBUGCODE(++pipelineBuilder->fBlockEffectRemovalCnt;)
diff --git a/src/gpu/GrPipelineBuilder.h b/src/gpu/GrPipelineBuilder.h
index 47b996a..0ac6485 100644
--- a/src/gpu/GrPipelineBuilder.h
+++ b/src/gpu/GrPipelineBuilder.h
@@ -114,20 +114,20 @@
     class AutoRestoreFragmentProcessorState : public ::SkNoncopyable {
     public:
         AutoRestoreFragmentProcessorState() 
-            : fPipelineBuilder(NULL)
+            : fPipelineBuilder(nullptr)
             , fColorEffectCnt(0)
             , fCoverageEffectCnt(0)
             , fSaveMarker(0) {}
 
         AutoRestoreFragmentProcessorState(const GrPipelineBuilder& ds)
-            : fPipelineBuilder(NULL)
+            : fPipelineBuilder(nullptr)
             , fColorEffectCnt(0)
             , fCoverageEffectCnt(0)
             , fSaveMarker(0) {
             this->set(&ds);
         }
 
-        ~AutoRestoreFragmentProcessorState() { this->set(NULL); }
+        ~AutoRestoreFragmentProcessorState() { this->set(nullptr); }
 
         void set(const GrPipelineBuilder* ds);
 
@@ -257,11 +257,11 @@
      */
     class AutoRestoreStencil : public ::SkNoncopyable {
     public:
-        AutoRestoreStencil() : fPipelineBuilder(NULL) {}
+        AutoRestoreStencil() : fPipelineBuilder(nullptr) {}
 
-        AutoRestoreStencil(const GrPipelineBuilder& ds) : fPipelineBuilder(NULL) { this->set(&ds); }
+        AutoRestoreStencil(const GrPipelineBuilder& ds) : fPipelineBuilder(nullptr) { this->set(&ds); }
 
-        ~AutoRestoreStencil() { this->set(NULL); }
+        ~AutoRestoreStencil() { this->set(nullptr); }
 
         void set(const GrPipelineBuilder* ds) {
             if (fPipelineBuilder) {
diff --git a/src/gpu/GrPrimitiveProcessor.h b/src/gpu/GrPrimitiveProcessor.h
index 6c886ae..bd769e4 100644
--- a/src/gpu/GrPrimitiveProcessor.h
+++ b/src/gpu/GrPrimitiveProcessor.h
@@ -193,7 +193,7 @@
 
     struct Attribute {
         Attribute()
-            : fName(NULL)
+            : fName(nullptr)
             , fType(kFloat_GrVertexAttribType)
             , fOffset(0) {}
         Attribute(const char* name, GrVertexAttribType type,
diff --git a/src/gpu/GrRecordReplaceDraw.cpp b/src/gpu/GrRecordReplaceDraw.cpp
index 5f0adb1..bca9255 100644
--- a/src/gpu/GrRecordReplaceDraw.cpp
+++ b/src/gpu/GrRecordReplaceDraw.cpp
@@ -64,7 +64,7 @@
                 const SkMatrix& initialMatrix,
                 SkPicture::AbortCallback* callback,
                 const int* opIndices, int numIndices)
-        : INHERITED(canvas, drawablePicts, NULL, drawableCount)
+        : INHERITED(canvas, drawablePicts, nullptr, drawableCount)
         , fCanvas(canvas)
         , fLayerCache(layerCache)
         , fTopLevelPicture(topLevelPicture)
@@ -79,7 +79,7 @@
     int draw() {
         const SkBBoxHierarchy* bbh = fPicture->bbh();
         const SkRecord* record = fPicture->record();
-        if (NULL == record) {
+        if (nullptr == record) {
             return 0;
         }
 
@@ -218,9 +218,9 @@
 
     if (const SkBigPicture* bp = picture->asSkBigPicture()) {
         // TODO: drawablePicts?
-        ReplaceDraw draw(canvas, layerCache, NULL, 0,
+        ReplaceDraw draw(canvas, layerCache, nullptr, 0,
                          bp, bp,
-                         initialMatrix, callback, NULL, 0);
+                         initialMatrix, callback, nullptr, 0);
         return draw.draw();
     } else {
         // TODO: can we assume / assert this doesn't happen?
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
index ca97098..137c83e 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -34,7 +34,7 @@
     int numAAElements = 0;
     while ((kUnknown_InitialState == *initialState)) {
         const Element* element = iter.prev();
-        if (NULL == element) {
+        if (nullptr == element) {
             *initialState = GrReducedClip::kAllIn_InitialState;
             break;
         }
diff --git a/src/gpu/GrReducedClip.h b/src/gpu/GrReducedClip.h
index 21899c7..a0ce08a 100644
--- a/src/gpu/GrReducedClip.h
+++ b/src/gpu/GrReducedClip.h
@@ -27,10 +27,10 @@
      * the list of elements is returned in resultGenID. The initial state of the
      * query rectangle before the first clip element is applied is returned via
      * initialState. Optionally, the caller can request a tighter bounds on the
-     * clip be returned via tighterBounds. If not NULL, tighterBounds will
+     * clip be returned via tighterBounds. If not nullptr, tighterBounds will
      * always be contained by queryBounds after return. If tighterBounds is
      * specified then it is assumed that the caller will implicitly clip against
-     * it. If the caller specifies non-NULL for requiresAA then it will indicate
+     * it. If the caller specifies non-nullptr for requiresAA then it will indicate
      * whether anti-aliasing is required to process any of the elements in the
      * result.
      *
@@ -42,8 +42,8 @@
                                 ElementList* result,
                                 int32_t* resultGenID,
                                 InitialState* initialState,
-                                SkIRect* tighterBounds = NULL,
-                                bool* requiresAA = NULL);
+                                SkIRect* tighterBounds = nullptr,
+                                bool* requiresAA = nullptr);
 };
 
 #endif
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index 59a7ae5..0908349 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -18,7 +18,7 @@
 void GrRenderTarget::discard() {
     // go through context so that all necessary flushing occurs
     GrContext* context = this->getContext();
-    GrDrawContext* drawContext = context ? context->drawContext() : NULL;
+    GrDrawContext* drawContext = context ? context->drawContext() : nullptr;
     if (!drawContext) {
         return;
     }
@@ -51,13 +51,13 @@
 }
 
 void GrRenderTarget::onRelease() {
-    this->renderTargetPriv().didAttachStencilAttachment(NULL);
+    this->renderTargetPriv().didAttachStencilAttachment(nullptr);
 
     INHERITED::onRelease();
 }
 
 void GrRenderTarget::onAbandon() {
-    this->renderTargetPriv().didAttachStencilAttachment(NULL);
+    this->renderTargetPriv().didAttachStencilAttachment(nullptr);
 
     INHERITED::onAbandon();
 }
diff --git a/src/gpu/GrReorderCommandBuilder.cpp b/src/gpu/GrReorderCommandBuilder.cpp
index af34998..b0f9ee2 100644
--- a/src/gpu/GrReorderCommandBuilder.cpp
+++ b/src/gpu/GrReorderCommandBuilder.cpp
@@ -50,7 +50,7 @@
                 if (previous->batch()->combineIfPossible(batch, caps)) {
                     GrBATCH_INFO("\t\tCombining with (%s, B%u)\n",
                                  previous->batch()->name(), previous->batch()->uniqueID());
-                    return NULL;
+                    return nullptr;
                 }
 
                 if (intersect(previous->batch()->bounds(), batch->bounds())) {
diff --git a/src/gpu/GrReorderCommandBuilder.h b/src/gpu/GrReorderCommandBuilder.h
index a1c7fae..a5d6e48 100644
--- a/src/gpu/GrReorderCommandBuilder.h
+++ b/src/gpu/GrReorderCommandBuilder.h
@@ -31,7 +31,7 @@
                          const GrStencilSettings&,
                          const GrPipelineOptimizations&) override {
         SkFAIL("Unsupported\n");
-        return NULL;
+        return nullptr;
     }
 
 private:
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index 85a3021..e605856 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -72,13 +72,13 @@
     , fBytes(0)
     , fBudgetedCount(0)
     , fBudgetedBytes(0)
-    , fOverBudgetCB(NULL)
-    , fOverBudgetData(NULL)
-    , fFlushTimestamps(NULL)
+    , fOverBudgetCB(nullptr)
+    , fOverBudgetData(nullptr)
+    , fFlushTimestamps(nullptr)
     , fLastFlushTimestampIndex(0)
     , fPreferVRAMUseOverFlushes(caps->preferVRAMUseOverFlushes()) {
     SkDEBUGCODE(fCount = 0;)
-    SkDEBUGCODE(fNewlyPurgeableResourceForValidation = NULL;)
+    SkDEBUGCODE(fNewlyPurgeableResourceForValidation = nullptr;)
     this->resetFlushTimestamps();
 }
 
@@ -106,7 +106,7 @@
     static const int kMaxSupportedTimestampHistory = 128;
 
     if (fMaxUnusedFlushes > kMaxSupportedTimestampHistory) {
-        fFlushTimestamps = NULL;
+        fFlushTimestamps = nullptr;
         return;
     }
 
@@ -259,7 +259,7 @@
             this->validate();
             return resource;
         } else if (flags & kRequireNoPendingIO_ScratchFlag) {
-            return NULL;
+            return nullptr;
         }
         // We would prefer to consume more available VRAM rather than flushing
         // immediately, but on ANGLE this can lead to starving of the GPU.
@@ -267,7 +267,7 @@
             // kPrefer is specified, we didn't find a resource without pending io,
             // but there is still space in our budget for the resource so force
             // the caller to allocate a new resource.
-            return NULL;
+            return nullptr;
         }
     }
     resource = fScratchMap.find(scratchKey, AvailableForScratchUse(false));
@@ -302,7 +302,7 @@
     if (resource->getUniqueKey().isValid()) {
         SkASSERT(resource == fUniqueHash.find(resource->getUniqueKey()));
         fUniqueHash.remove(resource->getUniqueKey());
-        SkASSERT(NULL == fUniqueHash.find(resource->getUniqueKey()));
+        SkASSERT(nullptr == fUniqueHash.find(resource->getUniqueKey()));
     }
 
     // If another resource has the new key, remove its key then install the key on this resource.
@@ -319,7 +319,7 @@
                 old->cacheAccess().removeUniqueKey();
             }
         }
-        SkASSERT(NULL == fUniqueHash.find(newKey));
+        SkASSERT(nullptr == fUniqueHash.find(newKey));
         resource->cacheAccess().setUniqueKey(newKey);
         fUniqueHash.add(resource);
     } else {
@@ -363,7 +363,7 @@
         }
 #endif
         resource->cacheAccess().setTimestamp(this->getNextTimestamp());
-        SkDEBUGCODE(fNewlyPurgeableResourceForValidation = NULL);
+        SkDEBUGCODE(fNewlyPurgeableResourceForValidation = nullptr);
     }
 
     if (!SkToBool(ResourceAccess::kAllCntsReachedZero_RefNotificationFlag & flags)) {
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index e328c66..d3ab8cc 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -32,10 +32,10 @@
     GrIndexBuffer* buffer = this->createIndexBuffer(bufferSize, kStatic_BufferUsage,
                                                     kNoPendingIO_Flag);
     if (!buffer) {
-        return NULL;
+        return nullptr;
     }
     uint16_t* data = (uint16_t*) buffer->map();
-    bool useTempData = (NULL == data);
+    bool useTempData = (nullptr == data);
     if (useTempData) {
         data = new uint16_t[reps * patternSize];
     }
@@ -49,7 +49,7 @@
     if (useTempData) {
         if (!buffer->updateData(data, bufferSize)) {
             buffer->unref();
-            return NULL;
+            return nullptr;
         }
         delete[] data;
     } else {
@@ -88,7 +88,7 @@
 GrIndexBuffer* GrResourceProvider::createIndexBuffer(size_t size, BufferUsage usage,
                                                      uint32_t flags) {
     if (this->isAbandoned()) {
-        return NULL;
+        return nullptr;
     }
 
     bool noPendingIO = SkToBool(flags & kNoPendingIO_Flag);
@@ -117,7 +117,7 @@
 GrVertexBuffer* GrResourceProvider::createVertexBuffer(size_t size, BufferUsage usage,
                                                        uint32_t flags) {
     if (this->isAbandoned()) {
-        return NULL;
+        return nullptr;
     }
 
     bool noPendingIO = SkToBool(flags & kNoPendingIO_Flag);
@@ -159,7 +159,7 @@
     static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag;
     GrTexture* texture = this->createApproxTexture(desc, kFlags);
     if (!texture) {
-        return NULL;
+        return nullptr;
     }
     return new GrBatchAtlas(texture, numPlotsX, numPlotsY);
 }
diff --git a/src/gpu/GrResourceProvider.h b/src/gpu/GrResourceProvider.h
index f0f28ff..72efab1 100644
--- a/src/gpu/GrResourceProvider.h
+++ b/src/gpu/GrResourceProvider.h
@@ -50,7 +50,7 @@
      * @param vertCount   number of vertices the pattern references
      * @param key         Key to be assigned to the index buffer.
      *
-     * @return The index buffer if successful, otherwise NULL.
+     * @return The index buffer if successful, otherwise nullptr.
      */
     const GrIndexBuffer* findOrCreateInstancedIndexBuffer(const uint16_t* pattern,
                                                           int patternSize,
@@ -129,7 +129,7 @@
      *   @param data             User supplied data which will be passed into func whenver an
      *                           eviction occurs
      *
-     *   @return                 An initialized GrBatchAtlas, or NULL if creation fails
+     *   @return                 An initialized GrBatchAtlas, or nullptr if creation fails
      */
     GrBatchAtlas* createAtlas(GrPixelConfig, int width, int height, int numPlotsX, int numPlotsY,
                               GrBatchAtlas::EvictionFunc func, void* data);
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index ce00ad9..e5ee52c 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -70,7 +70,7 @@
 
 static bool choose_compressed_fmt(const GrCaps* caps,
                                   SkTextureCompressor::Format *fmt) {
-    if (NULL == fmt) {
+    if (nullptr == fmt) {
         return false;
     }
 
@@ -142,7 +142,7 @@
     paint.setAntiAlias(antiAlias);
 
     SkTBlitterAllocator allocator;
-    SkBlitter* blitter = NULL;
+    SkBlitter* blitter = nullptr;
     if (kBlitter_CompressionMode == fCompressionMode) {
         SkASSERT(fCompressedBuffer.get());
         blitter = SkTextureCompressor::CreateBlitterForFormat(
@@ -197,7 +197,7 @@
                 fCompressedFormat, cmpWidth, cmpHeight);
 
             SkASSERT(cmpSz > 0);
-            SkASSERT(NULL == fCompressedBuffer.get());
+            SkASSERT(nullptr == fCompressedBuffer.get());
             fCompressedBuffer.reset(cmpSz);
             fCompressionMode = kBlitter_CompressionMode;
         }
@@ -259,7 +259,7 @@
 
     // Since we're uploading to it, and it's compressed, 'texture' shouldn't
     // have a render target.
-    SkASSERT(NULL == texture->asRenderTarget());
+    SkASSERT(nullptr == texture->asRenderTarget());
 
     texture->writePixels(0, 0, desc.fWidth, desc.fHeight,
                          desc.fConfig, data, rowbytes,
@@ -316,7 +316,7 @@
 /**
  * Software rasterizes path to A8 mask (possibly using the context's matrix)
  * and uploads the result to a scratch texture. Returns the resulting
- * texture on success; NULL on failure.
+ * texture on success; nullptr on failure.
  */
 GrTexture* GrSWMaskHelper::DrawPathMaskToTexture(GrContext* context,
                                                  const SkPath& path,
@@ -327,14 +327,14 @@
     GrSWMaskHelper helper(context);
 
     if (!helper.init(resultBounds, matrix)) {
-        return NULL;
+        return nullptr;
     }
 
     helper.draw(path, stroke, SkRegion::kReplace_Op, antiAlias, 0xFF);
 
     GrTexture* texture(helper.createTexture());
     if (!texture) {
-        return NULL;
+        return nullptr;
     }
 
     helper.toTexture(texture);
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 613228e..f54d3b0 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -13,7 +13,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 bool GrSoftwarePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
-    if (NULL == fContext) {
+    if (nullptr == fContext) {
         return false;
     }
     if (args.fStroke->isDashed()) {
@@ -36,7 +36,7 @@
                               SkIRect* devClipBounds) {
     // compute bounds as intersection of rt size, clip, and path
     const GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
-    if (NULL == rt) {
+    if (nullptr == rt) {
         return false;
     }
 
@@ -105,7 +105,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 // return true on success; false on failure
 bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
-    if (NULL == fContext) {
+    if (nullptr == fContext) {
         return false;
     }
 
@@ -123,7 +123,7 @@
             GrSWMaskHelper::DrawPathMaskToTexture(fContext, *args.fPath, *args.fStroke,
                                                   devPathBounds,
                                                   args.fAntiAlias, args.fViewMatrix));
-    if (NULL == texture) {
+    if (nullptr == texture) {
         return false;
     }
 
diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp
index a5e34ff..1a32e3f 100644
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp
@@ -37,7 +37,7 @@
     if (caps.shaderCaps()->pathRenderingSupport()) {
         return new GrStencilAndCoverPathRenderer(resourceProvider);
     } else {
-        return NULL;
+        return nullptr;
     }
 }
 
diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp
index d63df88..78c3a2a 100644
--- a/src/gpu/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/GrStencilAndCoverTextContext.cpp
@@ -55,7 +55,7 @@
         return false;
     }
     if (SkPathEffect* pe = skPaint.getPathEffect()) {
-        if (pe->asADash(NULL) != SkPathEffect::kDash_DashType) {
+        if (pe->asADash(nullptr) != SkPathEffect::kDash_DashType) {
             return false;
         }
     }
@@ -69,7 +69,7 @@
 
     // No color bitmap fonts.
     SkScalerContext::Rec    rec;
-    SkScalerContext::MakeRec(skPaint, &fSurfaceProps, NULL, &rec);
+    SkScalerContext::MakeRec(skPaint, &fSurfaceProps, nullptr, &rec);
     return rec.getFormat() != SkMask::kARGB32_Format;
 }
 
@@ -82,9 +82,9 @@
                                               size_t byteLength,
                                               SkScalar x, SkScalar y,
                                               const SkIRect& regionClipBounds) {
-    SkASSERT(byteLength == 0 || text != NULL);
+    SkASSERT(byteLength == 0 || text != nullptr);
 
-    if (text == NULL || byteLength == 0 /*|| fRC->isEmpty()*/) {
+    if (text == nullptr || byteLength == 0 /*|| fRC->isEmpty()*/) {
         return;
     }
 
@@ -177,11 +177,11 @@
                                                  int scalarsPerPosition,
                                                  const SkPoint& offset,
                                                  const SkIRect& regionClipBounds) {
-    SkASSERT(byteLength == 0 || text != NULL);
+    SkASSERT(byteLength == 0 || text != nullptr);
     SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition);
 
     // nothing to draw
-    if (text == NULL || byteLength == 0/* || fRC->isEmpty()*/) {
+    if (text == nullptr || byteLength == 0/* || fRC->isEmpty()*/) {
         return;
     }
 
@@ -237,11 +237,11 @@
     SkAutoTUnref<GrPathRange> glyphs(
         static_cast<GrPathRange*>(
             ctx->resourceProvider()->findAndRefResourceByUniqueKey(glyphKey)));
-    if (NULL == glyphs) {
+    if (nullptr == glyphs) {
         glyphs.reset(ctx->resourceProvider()->createGlyphs(typeface, desc, stroke));
         ctx->resourceProvider()->assignUniqueKeyToResource(glyphKey, glyphs);
     } else {
-        SkASSERT(NULL == desc || glyphs->isEqualTo(*desc));
+        SkASSERT(nullptr == desc || glyphs->isEqualTo(*desc));
     }
 
     return glyphs.detach();
@@ -371,9 +371,9 @@
         fViewMatrix.preConcat(textMatrix);
         fLocalMatrix = textMatrix;
 
-        fGlyphCache = fSkPaint.detachCache(&fSurfaceProps, NULL, true /*ignoreGamma*/);
+        fGlyphCache = fSkPaint.detachCache(&fSurfaceProps, nullptr, true /*ignoreGamma*/);
         fGlyphs = canUseRawPaths ?
-                      get_gr_glyphs(fContext, fSkPaint.getTypeface(), NULL, fStroke) :
+                      get_gr_glyphs(fContext, fSkPaint.getTypeface(), nullptr, fStroke) :
                       get_gr_glyphs(fContext, fGlyphCache->getScalerContext()->getTypeface(),
                                     &fGlyphCache->getDescriptor(), fStroke);
     }
@@ -486,10 +486,10 @@
     this->flush();
 
     fGlyphs->unref();
-    fGlyphs = NULL;
+    fGlyphs = nullptr;
 
     SkGlyphCache::AttachCache(fGlyphCache);
-    fGlyphCache = NULL;
+    fGlyphCache = nullptr;
 
     fViewMatrix = fContextInitialMatrix;
 }
diff --git a/src/gpu/GrStrokeInfo.cpp b/src/gpu/GrStrokeInfo.cpp
index 03483af..f3c809d 100644
--- a/src/gpu/GrStrokeInfo.cpp
+++ b/src/gpu/GrStrokeInfo.cpp
@@ -17,7 +17,7 @@
         info.fCount = fIntervals.count();
         info.fPhase = fDashPhase;
         GrStrokeInfo filteredStroke(*this, false);
-        if (SkDashPath::FilterDashPath(dst, src, &filteredStroke, NULL, info)) {
+        if (SkDashPath::FilterDashPath(dst, src, &filteredStroke, nullptr, info)) {
             *dstStrokeInfo = filteredStroke;
             return true;
         }
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index 89cbf4a..a7be0f4 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -96,7 +96,7 @@
                             uint32_t pixelOpsFlags) {
     // go through context so that all necessary flushing occurs
     GrContext* context = this->getContext();
-    if (NULL == context) {
+    if (nullptr == context) {
         return false;
     }
     return context->writeSurfacePixels(this, left, top, width, height, config, buffer, rowBytes,
@@ -108,7 +108,7 @@
                            uint32_t pixelOpsFlags) {
     // go through context so that all necessary flushing occurs
     GrContext* context = this->getContext();
-    if (NULL == context) {
+    if (nullptr == context) {
         return false;
     }
     return context->readSurfacePixels(this, left, top, width, height, config, buffer,
diff --git a/src/gpu/GrTRecorder.h b/src/gpu/GrTRecorder.h
index deb007f..a838ad2 100644
--- a/src/gpu/GrTRecorder.h
+++ b/src/gpu/GrTRecorder.h
@@ -54,9 +54,9 @@
                                   and after calls to reset().
      */
     GrTRecorder(int initialSizeInBytes)
-        : fHeadBlock(MemBlock::Alloc(LengthOf(initialSizeInBytes), NULL)),
+        : fHeadBlock(MemBlock::Alloc(LengthOf(initialSizeInBytes), nullptr)),
           fTailBlock(fHeadBlock),
-          fLastItem(NULL) {}
+          fLastItem(nullptr) {}
 
     ~GrTRecorder() {
         this->reset();
@@ -112,17 +112,17 @@
     template<typename TItem> void* alloc_back(int dataLength);
 
     struct MemBlock : SkNoncopyable {
-        /** Allocates a new block and appends it to prev if not NULL. The length param is in units
+        /** Allocates a new block and appends it to prev if not nullptr. The length param is in units
             of TAlign. */
         static MemBlock* Alloc(int length, MemBlock* prev) {
             MemBlock* block = reinterpret_cast<MemBlock*>(
                 sk_malloc_throw(sizeof(TAlign) * (length_of<MemBlock>::kValue + length)));
             block->fLength = length;
             block->fBack = 0;
-            block->fNext = NULL;
+            block->fNext = nullptr;
             block->fPrev = prev;
             if (prev) {
-                SkASSERT(NULL == prev->fNext);
+                SkASSERT(nullptr == prev->fNext);
                 prev->fNext = block;
             }
             return block;
@@ -132,7 +132,7 @@
         static void Free(MemBlock* block) {
             if (block && block->fPrev) {
                 SkASSERT(block->fPrev->fNext == block);
-                block->fPrev->fNext = NULL;
+                block->fPrev->fNext = nullptr;
             }
             while (block) {
                 MemBlock* next = block->fNext;
@@ -180,7 +180,7 @@
     if (!header->fPrevLength) {
         // We popped the first entry in the recorder.
         SkASSERT(0 == fTailBlock->fBack);
-        fLastItem = NULL;
+        fLastItem = nullptr;
         return;
     }
     while (!fTailBlock->fBack) {
@@ -250,7 +250,7 @@
 template<typename TBase, typename TAlign>
 class GrTRecorder<TBase, TAlign>::Iter {
 public:
-    Iter(GrTRecorder& recorder) : fBlock(recorder.fHeadBlock), fPosition(0), fItem(NULL) {}
+    Iter(GrTRecorder& recorder) : fBlock(recorder.fHeadBlock), fPosition(0), fItem(nullptr) {}
 
     bool next() {
         while (fPosition >= fBlock->fBack) {
@@ -344,7 +344,7 @@
         MemBlock::Free(fTailBlock->fNext);
     } else if (fTailBlock->fNext) {
         MemBlock::Free(fTailBlock->fNext->fNext);
-        fTailBlock->fNext->fNext = NULL;
+        fTailBlock->fNext->fNext = nullptr;
     }
 
     for (MemBlock* block = fHeadBlock; block; block = block->fNext) {
@@ -352,7 +352,7 @@
     }
 
     fTailBlock = fHeadBlock;
-    fLastItem = NULL;
+    fLastItem = nullptr;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/GrTargetCommands.h b/src/gpu/GrTargetCommands.h
index 9b52837..4f804c3 100644
--- a/src/gpu/GrTargetCommands.h
+++ b/src/gpu/GrTargetCommands.h
@@ -76,7 +76,7 @@
     // TODO: This can be just a pipeline once paths are in batch, and it should live elsewhere
     struct StateForPathDraw : public SkNVRefCnt<StateForPathDraw> {
         // TODO get rid of the prim proc parameter when we use batch everywhere
-        StateForPathDraw(const GrPrimitiveProcessor* primProc = NULL)
+        StateForPathDraw(const GrPrimitiveProcessor* primProc = nullptr)
             : fPrimitiveProcessor(primProc)
             , fCompiled(false) {}
 
diff --git a/src/gpu/GrTessellatingPathRenderer.cpp b/src/gpu/GrTessellatingPathRenderer.cpp
index 55af044..46fa280 100644
--- a/src/gpu/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/GrTessellatingPathRenderer.cpp
@@ -125,7 +125,7 @@
     } else if (tail) {
         *tail = t->*Prev;
     }
-    t->*Prev = t->*Next = NULL;
+    t->*Prev = t->*Next = nullptr;
 }
 
 /**
@@ -141,9 +141,9 @@
 
 struct Vertex {
   Vertex(const SkPoint& point)
-    : fPoint(point), fPrev(NULL), fNext(NULL)
-    , fFirstEdgeAbove(NULL), fLastEdgeAbove(NULL)
-    , fFirstEdgeBelow(NULL), fLastEdgeBelow(NULL)
+    : fPoint(point), fPrev(nullptr), fNext(nullptr)
+    , fFirstEdgeAbove(nullptr), fLastEdgeAbove(nullptr)
+    , fFirstEdgeBelow(nullptr), fLastEdgeBelow(nullptr)
     , fProcessed(false)
 #if LOGGING_ENABLED
     , fID (-1.0f)
@@ -209,7 +209,7 @@
 }
 
 struct EdgeList {
-    EdgeList() : fHead(NULL), fTail(NULL) {}
+    EdgeList() : fHead(nullptr), fTail(nullptr) {}
     Edge* fHead;
     Edge* fTail;
 };
@@ -237,14 +237,14 @@
         : fWinding(winding)
         , fTop(top)
         , fBottom(bottom)
-        , fLeft(NULL)
-        , fRight(NULL)
-        , fPrevEdgeAbove(NULL)
-        , fNextEdgeAbove(NULL)
-        , fPrevEdgeBelow(NULL)
-        , fNextEdgeBelow(NULL)
-        , fLeftPoly(NULL)
-        , fRightPoly(NULL) {
+        , fLeft(nullptr)
+        , fRight(nullptr)
+        , fPrevEdgeAbove(nullptr)
+        , fNextEdgeAbove(nullptr)
+        , fPrevEdgeBelow(nullptr)
+        , fNextEdgeBelow(nullptr)
+        , fLeftPoly(nullptr)
+        , fRightPoly(nullptr) {
             recompute();
         }
     int      fWinding;          // 1 == edge goes downward; -1 = edge goes upward.
@@ -313,11 +313,11 @@
 struct Poly {
     Poly(int winding)
         : fWinding(winding)
-        , fHead(NULL)
-        , fTail(NULL)
-        , fActive(NULL)
-        , fNext(NULL)
-        , fPartner(NULL)
+        , fHead(nullptr)
+        , fTail(nullptr)
+        , fActive(nullptr)
+        , fNext(nullptr)
+        , fPartner(nullptr)
         , fCount(0)
     {
 #if LOGGING_ENABLED
@@ -330,10 +330,10 @@
     struct MonotonePoly {
         MonotonePoly()
             : fSide(kNeither_Side)
-            , fHead(NULL)
-            , fTail(NULL)
-            , fPrev(NULL)
-            , fNext(NULL) {}
+            , fHead(nullptr)
+            , fTail(nullptr)
+            , fPrev(nullptr)
+            , fNext(nullptr) {}
         Side          fSide;
         Vertex*       fHead;
         Vertex*       fTail;
@@ -347,7 +347,7 @@
             } else {
                 done = side != fSide;
             }
-            if (fHead == NULL) {
+            if (fHead == nullptr) {
                 fHead = fTail = newV;
             } else if (fSide == kRight_Side) {
                 newV->fPrev = fTail;
@@ -395,7 +395,7 @@
         Poly* partner = fPartner;
         Poly* poly = this;
         if (partner) {
-            fPartner = partner->fPartner = NULL;
+            fPartner = partner->fPartner = nullptr;
         }
         if (!fActive) {
             fActive = ALLOC_NEW(MonotonePoly, (), alloc);
@@ -425,7 +425,7 @@
     void end(Vertex* v, SkChunkAlloc& alloc) {
         LOG("end() %d at %g, %g\n", fID, v->fPoint.fX, v->fPoint.fY);
         if (fPartner) {
-            fPartner = fPartner->fPartner = NULL;
+            fPartner = fPartner->fPartner = nullptr;
         }
         addVertex(v, fActive->fSide == kLeft_Side ? kRight_Side : kLeft_Side, alloc);
     }
@@ -434,7 +434,7 @@
             return data;
         }
         LOG("emit() %d, size %d\n", fID, fCount);
-        for (MonotonePoly* m = fHead; m != NULL; m = m->fNext) {
+        for (MonotonePoly* m = fHead; m != nullptr; m = m->fNext) {
             data = m->emit(data);
         }
         return data;
@@ -548,8 +548,8 @@
     bool done = false;
     *isLinear = true;
     SkPath::Iter iter(path, false);
-    Vertex* prev = NULL;
-    Vertex* head = NULL;
+    Vertex* prev = nullptr;
+    Vertex* head = nullptr;
     if (path.isInverseFillType()) {
         SkPoint quad[4];
         clipBounds.toQuad(quad);
@@ -559,7 +559,7 @@
         head->fPrev = prev;
         prev->fNext = head;
         *contours++ = head;
-        head = prev = NULL;
+        head = prev = nullptr;
     }
     SkAutoConicToQuads converter;
     while (!done) {
@@ -583,7 +583,7 @@
                     prev->fNext = head;
                     *contours++ = head;
                 }
-                head = prev = NULL;
+                head = prev = nullptr;
                 prev = append_point_to_contour(pts[0], prev, &head, alloc);
                 break;
             case SkPath::kLine_Verb: {
@@ -610,7 +610,7 @@
                     prev->fNext = head;
                     *contours++ = head;
                 }
-                head = prev = NULL;
+                head = prev = nullptr;
                 break;
             case SkPath::kDone_Verb:
                 if (head) {
@@ -666,9 +666,9 @@
         *right = v->fLastEdgeAbove->fRight;
         return;
     }
-    Edge* next = NULL;
+    Edge* next = nullptr;
     Edge* prev;
-    for (prev = edges->fTail; prev != NULL; prev = prev->fLeft) {
+    for (prev = edges->fTail; prev != nullptr; prev = prev->fLeft) {
         if (prev->isLeftOf(v)) {
             break;
         }
@@ -680,9 +680,9 @@
 }
 
 void find_enclosing_edges(Edge* edge, EdgeList* edges, Comparator& c, Edge** left, Edge** right) {
-    Edge* prev = NULL;
+    Edge* prev = nullptr;
     Edge* next;
-    for (next = edges->fHead; next != NULL; next = next->fRight) {
+    for (next = edges->fHead; next != nullptr; next = next->fRight) {
         if ((c.sweep_gt(edge->fTop->fPoint, next->fTop->fPoint) && next->isRightOf(edge->fTop)) ||
             (c.sweep_gt(next->fTop->fPoint, edge->fTop->fPoint) && edge->isLeftOf(next->fTop)) ||
             (c.sweep_lt(edge->fBottom->fPoint, next->fBottom->fPoint) &&
@@ -717,7 +717,7 @@
         return;
     }
     LOG("insert edge (%g -> %g) above vertex %g\n", edge->fTop->fID, edge->fBottom->fID, v->fID);
-    Edge* prev = NULL;
+    Edge* prev = nullptr;
     Edge* next;
     for (next = v->fFirstEdgeAbove; next; next = next->fNextEdgeAbove) {
         if (next->isRightOf(edge->fTop)) {
@@ -735,7 +735,7 @@
         return;
     }
     LOG("insert edge (%g -> %g) below vertex %g\n", edge->fTop->fID, edge->fBottom->fID, v->fID);
-    Edge* prev = NULL;
+    Edge* prev = nullptr;
     Edge* next;
     for (next = v->fFirstEdgeBelow; next; next = next->fNextEdgeBelow) {
         if (next->isRightOf(edge->fBottom)) {
@@ -910,22 +910,22 @@
         src->fID, dst->fID);
     for (Edge* edge = src->fFirstEdgeAbove; edge;) {
         Edge* next = edge->fNextEdgeAbove;
-        set_bottom(edge, dst, NULL, c);
+        set_bottom(edge, dst, nullptr, c);
         edge = next;
     }
     for (Edge* edge = src->fFirstEdgeBelow; edge;) {
         Edge* next = edge->fNextEdgeBelow;
-        set_top(edge, dst, NULL, c);
+        set_top(edge, dst, nullptr, c);
         edge = next;
     }
-    remove<Vertex, &Vertex::fPrev, &Vertex::fNext>(src, head, NULL);
+    remove<Vertex, &Vertex::fPrev, &Vertex::fNext>(src, head, nullptr);
 }
 
 Vertex* check_for_intersection(Edge* edge, Edge* other, EdgeList* activeEdges, Comparator& c,
                                SkChunkAlloc& alloc) {
     SkPoint p;
     if (!edge || !other) {
-        return NULL;
+        return nullptr;
     }
     if (edge->intersect(*other, &p)) {
         Vertex* v;
@@ -973,7 +973,7 @@
         }
         return v;
     }
-    return NULL;
+    return nullptr;
 }
 
 void sanitize_contours(Vertex** contours, int contourCnt) {
@@ -983,7 +983,7 @@
             if (coincident(v->fPrev->fPoint, v->fPoint)) {
                 LOG("vertex %g,%g coincident; removing\n", v->fPoint.fX, v->fPoint.fY);
                 if (v->fPrev == v) {
-                    contours[i] = NULL;
+                    contours[i] = nullptr;
                     break;
                 }
                 v->fPrev->fNext = v->fNext;
@@ -1001,7 +1001,7 @@
 }
 
 void merge_coincident_vertices(Vertex** vertices, Comparator& c, SkChunkAlloc& alloc) {
-    for (Vertex* v = (*vertices)->fNext; v != NULL; v = v->fNext) {
+    for (Vertex* v = (*vertices)->fNext; v != nullptr; v = v->fNext) {
         if (c.sweep_lt(v->fPoint, v->fPrev->fPoint)) {
             v->fPoint = v->fPrev->fPoint;
         }
@@ -1014,10 +1014,10 @@
 // Stage 2: convert the contours to a mesh of edges connecting the vertices.
 
 Vertex* build_edges(Vertex** contours, int contourCnt, Comparator& c, SkChunkAlloc& alloc) {
-    Vertex* vertices = NULL;
-    Vertex* prev = NULL;
+    Vertex* vertices = nullptr;
+    Vertex* prev = nullptr;
     for (int i = 0; i < contourCnt; ++i) {
-        for (Vertex* v = contours[i]; v != NULL;) {
+        for (Vertex* v = contours[i]; v != nullptr;) {
             Vertex* vNext = v->fNext;
             Edge* edge = new_edge(v->fPrev, v, alloc, c);
             if (edge->fWinding > 0) {
@@ -1027,7 +1027,7 @@
                 insert_edge_below(edge, v, c);
                 insert_edge_above(edge, v->fPrev, c);
             }
-            merge_collinear_edges(edge, NULL, c);
+            merge_collinear_edges(edge, nullptr, c);
             if (prev) {
                 prev->fNext = v;
                 v->fPrev = prev;
@@ -1040,7 +1040,7 @@
         }
     }
     if (prev) {
-        prev->fNext = vertices->fPrev = NULL;
+        prev->fNext = vertices->fPrev = nullptr;
     }
     return vertices;
 }
@@ -1054,14 +1054,14 @@
     Vertex* slow;
     if (!v || !v->fNext) {
         *pFront = v;
-        *pBack = NULL;
+        *pBack = nullptr;
     } else {
         slow = v;
         fast = v->fNext;
 
-        while (fast != NULL) {
+        while (fast != nullptr) {
             fast = fast->fNext;
-            if (fast != NULL) {
+            if (fast != nullptr) {
                 slow = slow->fNext;
                 fast = fast->fNext;
             }
@@ -1069,8 +1069,8 @@
 
         *pFront = v;
         *pBack = slow->fNext;
-        slow->fNext->fPrev = NULL;
-        slow->fNext = NULL;
+        slow->fNext->fPrev = nullptr;
+        slow->fNext = nullptr;
     }
 }
 
@@ -1090,7 +1090,7 @@
 }
 
 inline void append_vertex(Vertex* v, Vertex** head, Vertex** tail) {
-    insert<Vertex, &Vertex::fPrev, &Vertex::fNext>(v, *tail, NULL, head, tail);
+    insert<Vertex, &Vertex::fPrev, &Vertex::fNext>(v, *tail, nullptr, head, tail);
 }
 
 inline void append_vertex_list(Vertex* v, Vertex** head, Vertex** tail) {
@@ -1098,8 +1098,8 @@
 }
 
 Vertex* sorted_merge(Vertex* a, Vertex* b, Comparator& c) {
-    Vertex* head = NULL;
-    Vertex* tail = NULL;
+    Vertex* head = nullptr;
+    Vertex* tail = nullptr;
 
     while (a && b) {
         if (c.sweep_lt(a->fPoint, b->fPoint)) {
@@ -1126,21 +1126,21 @@
 void simplify(Vertex* vertices, Comparator& c, SkChunkAlloc& alloc) {
     LOG("simplifying complex polygons\n");
     EdgeList activeEdges;
-    for (Vertex* v = vertices; v != NULL; v = v->fNext) {
+    for (Vertex* v = vertices; v != nullptr; v = v->fNext) {
         if (!v->fFirstEdgeAbove && !v->fFirstEdgeBelow) {
             continue;
         }
 #if LOGGING_ENABLED
         LOG("\nvertex %g: (%g,%g)\n", v->fID, v->fPoint.fX, v->fPoint.fY);
 #endif
-        Edge* leftEnclosingEdge = NULL;
-        Edge* rightEnclosingEdge = NULL;
+        Edge* leftEnclosingEdge = nullptr;
+        Edge* rightEnclosingEdge = nullptr;
         bool restartChecks;
         do {
             restartChecks = false;
             find_enclosing_edges(v, &activeEdges, &leftEnclosingEdge, &rightEnclosingEdge);
             if (v->fFirstEdgeBelow) {
-                for (Edge* edge = v->fFirstEdgeBelow; edge != NULL; edge = edge->fNextEdgeBelow) {
+                for (Edge* edge = v->fFirstEdgeBelow; edge != nullptr; edge = edge->fNextEdgeBelow) {
                     if (check_for_intersection(edge, leftEnclosingEdge, &activeEdges, c, alloc)) {
                         restartChecks = true;
                         break;
@@ -1178,25 +1178,25 @@
 Poly* tessellate(Vertex* vertices, SkChunkAlloc& alloc) {
     LOG("tessellating simple polygons\n");
     EdgeList activeEdges;
-    Poly* polys = NULL;
-    for (Vertex* v = vertices; v != NULL; v = v->fNext) {
+    Poly* polys = nullptr;
+    for (Vertex* v = vertices; v != nullptr; v = v->fNext) {
         if (!v->fFirstEdgeAbove && !v->fFirstEdgeBelow) {
             continue;
         }
 #if LOGGING_ENABLED
         LOG("\nvertex %g: (%g,%g)\n", v->fID, v->fPoint.fX, v->fPoint.fY);
 #endif
-        Edge* leftEnclosingEdge = NULL;
-        Edge* rightEnclosingEdge = NULL;
+        Edge* leftEnclosingEdge = nullptr;
+        Edge* rightEnclosingEdge = nullptr;
         find_enclosing_edges(v, &activeEdges, &leftEnclosingEdge, &rightEnclosingEdge);
-        Poly* leftPoly = NULL;
-        Poly* rightPoly = NULL;
+        Poly* leftPoly = nullptr;
+        Poly* rightPoly = nullptr;
         if (v->fFirstEdgeAbove) {
             leftPoly = v->fFirstEdgeAbove->fLeftPoly;
             rightPoly = v->fLastEdgeAbove->fRightPoly;
         } else {
-            leftPoly = leftEnclosingEdge ? leftEnclosingEdge->fRightPoly : NULL;
-            rightPoly = rightEnclosingEdge ? rightEnclosingEdge->fLeftPoly : NULL;
+            leftPoly = leftEnclosingEdge ? leftEnclosingEdge->fRightPoly : nullptr;
+            rightPoly = rightEnclosingEdge ? rightEnclosingEdge->fLeftPoly : nullptr;
         }
 #if LOGGING_ENABLED
         LOG("edges above:\n");
@@ -1232,7 +1232,7 @@
             remove_edge(v->fLastEdgeAbove, &activeEdges);
             if (!v->fFirstEdgeBelow) {
                 if (leftPoly && rightPoly && leftPoly != rightPoly) {
-                    SkASSERT(leftPoly->fPartner == NULL && rightPoly->fPartner == NULL);
+                    SkASSERT(leftPoly->fPartner == nullptr && rightPoly->fPartner == nullptr);
                     rightPoly->fPartner = leftPoly;
                     leftPoly->fPartner = rightPoly;
                 }
@@ -1282,7 +1282,7 @@
         }
 #if LOGGING_ENABLED
         LOG("\nactive edges:\n");
-        for (Edge* e = activeEdges.fHead; e != NULL; e = e->fRight) {
+        for (Edge* e = activeEdges.fHead; e != nullptr; e = e->fRight) {
             LOG("%g -> %g, lpoly %d, rpoly %d\n", e->fTop->fID, e->fBottom->fID,
                 e->fLeftPoly ? e->fLeftPoly->fID : -1, e->fRightPoly ? e->fRightPoly->fID : -1);
         }
@@ -1307,14 +1307,14 @@
     sanitize_contours(contours, contourCnt);
     Vertex* vertices = build_edges(contours, contourCnt, c, alloc);
     if (!vertices) {
-        return NULL;
+        return nullptr;
     }
 
     // Sort vertices in Y (secondarily in X).
     merge_sort(&vertices, c);
     merge_coincident_vertices(&vertices, c, alloc);
 #if LOGGING_ENABLED
-    for (Vertex* v = vertices; v != NULL; v = v->fNext) {
+    for (Vertex* v = vertices; v != nullptr; v = v->fNext) {
         static float gID = 0.0f;
         v->fID = gID++;
     }
@@ -1379,7 +1379,7 @@
     // This path renderer can draw all fill styles, all stroke styles except hairlines, but does
     // not do antialiasing. It can do convex and concave paths, but we'll leave the convex ones to
     // simpler algorithms.
-    return !IsStrokeHairlineOrEquivalent(*args.fStroke, *args.fViewMatrix, NULL) &&
+    return !IsStrokeHairlineOrEquivalent(*args.fStroke, *args.fViewMatrix, nullptr) &&
            !args.fAntiAlias && !args.fPath->isConvex();
 }
 
@@ -1619,7 +1619,7 @@
 bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) {
     SkASSERT(!args.fAntiAlias);
     const GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget();
-    if (NULL == rt) {
+    if (nullptr == rt) {
         return false;
     }
 
diff --git a/src/gpu/GrTest.cpp b/src/gpu/GrTest.cpp
index 1f5e2ce..566ae54 100644
--- a/src/gpu/GrTest.cpp
+++ b/src/gpu/GrTest.cpp
@@ -213,25 +213,25 @@
 
     GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCycle lifeCycle,
                                const void* srcData, size_t rowBytes) override {
-        return NULL;
+        return nullptr;
     }
 
     GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCycle,
                                          const void* srcData) override {
-        return NULL;
+        return nullptr;
     }
 
     GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&,
-                                    GrWrapOwnership) override { return NULL; }
+                                    GrWrapOwnership) override { return nullptr; }
 
     GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&,
                                               GrWrapOwnership) override {
-        return NULL;
+        return nullptr;
     }
 
-    GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override { return NULL; }
+    GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override { return nullptr; }
 
-    GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override { return NULL; }
+    GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override { return nullptr; }
 
     void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override {}
 
@@ -290,7 +290,7 @@
 void GrContext::initMockContext() {
     GrContextOptions options;
     options.fGeometryBufferMapThreshold = 0;
-    SkASSERT(NULL == fGpu);
+    SkASSERT(nullptr == fGpu);
     fGpu = new MockGpu(this, options);
     SkASSERT(fGpu);
     this->initCommon();
diff --git a/src/gpu/GrTextBlobCache.h b/src/gpu/GrTextBlobCache.h
index ee1f0d9..5f24e2a 100644
--- a/src/gpu/GrTextBlobCache.h
+++ b/src/gpu/GrTextBlobCache.h
@@ -112,12 +112,12 @@
 private:
     typedef SkTInternalLList<GrAtlasTextBlob> BitmapBlobList;
 
-    void checkPurge(GrAtlasTextBlob* blob = NULL) {
+    void checkPurge(GrAtlasTextBlob* blob = nullptr) {
         // If we are overbudget, then unref until we are below budget again
         if (fPool.size() > fBudget) {
             BitmapBlobList::Iter iter;
             iter.init(fBlobList, BitmapBlobList::Iter::kTail_IterStart);
-            GrAtlasTextBlob* lruBlob = NULL;
+            GrAtlasTextBlob* lruBlob = nullptr;
             while (fPool.size() > fBudget && (lruBlob = iter.get()) && lruBlob != blob) {
                 fCache.remove(lruBlob->fKey);
 
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index 387b7eb..bae8a72 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -22,7 +22,7 @@
 
 GrTextContext::GrTextContext(GrContext* context, GrDrawContext* drawContext,
                              const SkSurfaceProps& surfaceProps)
-    : fFallbackTextContext(NULL)
+    : fFallbackTextContext(nullptr)
     , fContext(context)
     , fSurfaceProps(surfaceProps)
     , fDrawContext(drawContext) {
@@ -200,10 +200,10 @@
 
     // Temporarily jam in kFill, so we only ever ask for the raw outline from the cache.
     paint.setStyle(SkPaint::kFill_Style);
-    paint.setPathEffect(NULL);
+    paint.setPathEffect(nullptr);
 
     SkDrawCacheProc     glyphCacheProc = paint.getDrawCacheProc();
-    SkAutoGlyphCache    autoCache(paint, &fSurfaceProps, NULL);
+    SkAutoGlyphCache    autoCache(paint, &fSurfaceProps, nullptr);
     SkGlyphCache*       cache = autoCache.getCache();
 
     const char*        stop = text + byteLength;
@@ -266,12 +266,12 @@
 
 GrFontScaler* GrTextContext::GetGrFontScaler(SkGlyphCache* cache) {
     void* auxData;
-    GrFontScaler* scaler = NULL;
+    GrFontScaler* scaler = nullptr;
 
     if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) {
         scaler = (GrFontScaler*)auxData;
     }
-    if (NULL == scaler) {
+    if (nullptr == scaler) {
         scaler = new GrFontScaler(cache);
         cache->setAuxProc(GlyphCacheAuxProc, scaler);
     }
diff --git a/src/gpu/GrTextureProvider.cpp b/src/gpu/GrTextureProvider.cpp
index 253fe03..26384ab 100644
--- a/src/gpu/GrTextureProvider.cpp
+++ b/src/gpu/GrTextureProvider.cpp
@@ -20,11 +20,11 @@
 GrTexture* GrTextureProvider::createTexture(const GrSurfaceDesc& desc, bool budgeted,
                                             const void* srcData, size_t rowBytes) {
     if (this->isAbandoned()) {
-        return NULL;
+        return nullptr;
     }
     if ((desc.fFlags & kRenderTarget_GrSurfaceFlag) &&
         !fGpu->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
-        return NULL;
+        return nullptr;
     }
     if (!GrPixelConfigIsCompressed(desc.fConfig)) {
         static const uint32_t kFlags = kExact_ScratchTextureFlag |
@@ -50,11 +50,11 @@
 GrTexture* GrTextureProvider::internalCreateApproxTexture(const GrSurfaceDesc& desc,
                                                           uint32_t scratchFlags) {
     if (this->isAbandoned()) {
-        return NULL;
+        return nullptr;
     }
     // Currently we don't recycle compressed textures as scratch.
     if (GrPixelConfigIsCompressed(desc.fConfig)) {
-        return NULL;
+        return nullptr;
     } else {
         return this->refScratchTexture(desc, scratchFlags);
     }
@@ -100,22 +100,22 @@
     }
 
     if (!(kNoCreate_ScratchTextureFlag & flags)) {
-        return fGpu->createTexture(*desc, true, NULL, 0);
+        return fGpu->createTexture(*desc, true, nullptr, 0);
     }
 
-    return NULL;
+    return nullptr;
 }
 
 GrTexture* GrTextureProvider::wrapBackendTexture(const GrBackendTextureDesc& desc,
                                                  GrWrapOwnership ownership) {
     if (this->isAbandoned()) {
-        return NULL;
+        return nullptr;
     }
     return fGpu->wrapBackendTexture(desc, ownership);
 }
 
 GrRenderTarget* GrTextureProvider::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc) {
-    return this->isAbandoned() ? NULL : fGpu->wrapBackendRenderTarget(desc,
+    return this->isAbandoned() ? nullptr : fGpu->wrapBackendRenderTarget(desc,
                                                                       kBorrow_GrWrapOwnership);
 }
 
@@ -131,5 +131,5 @@
 }
 
 GrGpuResource* GrTextureProvider::findAndRefResourceByUniqueKey(const GrUniqueKey& key) {
-    return this->isAbandoned() ? NULL : fCache->findAndRefUniqueResource(key);
+    return this->isAbandoned() ? nullptr : fCache->findAndRefUniqueResource(key);
 }
diff --git a/src/gpu/GrVertices.h b/src/gpu/GrVertices.h
index 10b2679..03ede07 100644
--- a/src/gpu/GrVertices.h
+++ b/src/gpu/GrVertices.h
@@ -53,7 +53,7 @@
         SkASSERT(startVertex >= 0);
         fPrimitiveType = primType;
         fVertexBuffer.reset(vertexBuffer);
-        fIndexBuffer.reset(NULL);
+        fIndexBuffer.reset(nullptr);
         fStartVertex = startVertex;
         fStartIndex = 0;
         fVertexCount = vertexCount;
@@ -154,7 +154,7 @@
 
         const GrNonInstancedVertices* next() {
             if (!fInstancesRemaining) {
-                return NULL;
+                return nullptr;
             }
             fInstanceBatch.fStartVertex += fInstanceBatch.fVertexCount;
             int instances = SkTMin(fInstancesRemaining, fVertices->fMaxInstancesPerDraw);
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 722f744..b9c2f7c 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -100,7 +100,7 @@
         // Either get the texture directly from the bitmap, or else use the cache and
         // remember to unref it.
         if (GrTexture* bmpTexture = bitmap.getTexture()) {
-            fTexture.reset(NULL);
+            fTexture.reset(nullptr);
             return bmpTexture;
         } else {
             fTexture.reset(GrRefCachedBitmapTexture(context, bitmap, params));
@@ -153,11 +153,11 @@
 SkGpuDevice* SkGpuDevice::Create(GrRenderTarget* rt, int width, int height,
                                  const SkSurfaceProps* props, InitContents init) {
     if (!rt || rt->wasDestroyed()) {
-        return NULL;
+        return nullptr;
     }
     unsigned flags;
-    if (!CheckAlphaTypeAndGetFlags(NULL, init, &flags)) {
-        return NULL;
+    if (!CheckAlphaTypeAndGetFlags(nullptr, init, &flags)) {
+        return nullptr;
     }
     return new SkGpuDevice(rt, width, height, props, flags);
 }
@@ -167,12 +167,12 @@
                                  const SkSurfaceProps* props, InitContents init) {
     unsigned flags;
     if (!CheckAlphaTypeAndGetFlags(&info, init, &flags)) {
-        return NULL;
+        return nullptr;
     }
 
     SkAutoTUnref<GrRenderTarget> rt(CreateRenderTarget(context, budgeted, info,  sampleCount));
-    if (NULL == rt) {
-        return NULL;
+    if (nullptr == rt) {
+        return nullptr;
     }
 
     return new SkGpuDevice(rt, info.width(), info.height(), props, flags);
@@ -182,7 +182,7 @@
                          const SkSurfaceProps* props, unsigned flags)
     : INHERITED(SkSurfacePropsCopyOrDefault(props))
 {
-    fDrawProcs = NULL;
+    fDrawProcs = nullptr;
 
     fContext = SkRef(rt->getContext());
     fNeedClear = SkToBool(flags & kNeedClear_Flag);
@@ -203,11 +203,11 @@
                                                 const SkImageInfo& origInfo, int sampleCount) {
     if (kUnknown_SkColorType == origInfo.colorType() ||
         origInfo.width() < 0 || origInfo.height() < 0) {
-        return NULL;
+        return nullptr;
     }
 
     if (!context) {
-        return NULL;
+        return nullptr;
     }
 
     SkColorType ct = origInfo.colorType();
@@ -230,11 +230,11 @@
     desc.fConfig = SkImageInfo2GrPixelConfig(info);
     desc.fSampleCnt = sampleCount;
     GrTexture* texture = context->textureProvider()->createTexture(
-        desc, SkToBool(budgeted), NULL, 0);
-    if (NULL == texture) {
-        return NULL;
+        desc, SkToBool(budgeted), nullptr, 0);
+    if (nullptr == texture) {
+        return nullptr;
     }
-    SkASSERT(NULL != texture->asRenderTarget());
+    SkASSERT(nullptr != texture->asRenderTarget());
     return texture->asRenderTarget();
 }
 
@@ -310,7 +310,7 @@
 void SkGpuDevice::onDetachFromCanvas() {
     INHERITED::onDetachFromCanvas();
     fClip.reset();
-    fClipStack.reset(NULL);
+    fClipStack.reset(nullptr);
 }
 
 // call this every draw call, to ensure that the context reflects our state,
@@ -349,7 +349,7 @@
     SkAutoTUnref<GrRenderTarget> newRT(CreateRenderTarget(
         fRenderTarget->getContext(), budgeted, this->imageInfo(), fRenderTarget->desc().fSampleCnt));
 
-    if (NULL == newRT) {
+    if (nullptr == newRT) {
         return;
     }
 
@@ -464,9 +464,9 @@
                                gPointMode2PrimtiveType[mode],
                                SkToS32(count),
                                (SkPoint*)pts,
-                               NULL,
-                               NULL,
-                               NULL,
+                               nullptr,
+                               nullptr,
+                               nullptr,
                                0);
 }
 
@@ -511,7 +511,7 @@
         SkPath path;
         path.setIsVolatile(true);
         path.addRect(rect);
-        this->drawPath(draw, path, paint, NULL, true);
+        this->drawPath(draw, path, paint, nullptr, true);
         return;
     }
 
@@ -587,7 +587,7 @@
         SkPath path;
         path.setIsVolatile(true);
         path.addRRect(rect);
-        this->drawPath(draw, path, paint, NULL, true);
+        this->drawPath(draw, path, paint, nullptr, true);
         return;
     }
 
@@ -608,7 +608,7 @@
             return;
         }
 
-        if (NULL == paint.getMaskFilter() && NULL == paint.getPathEffect()) {
+        if (nullptr == paint.getMaskFilter() && nullptr == paint.getPathEffect()) {
             fDrawContext->drawDRRect(fRenderTarget, fClip, grPaint, *draw.fMatrix, outer, inner);
             return;
         }
@@ -620,7 +620,7 @@
     path.addRRect(inner);
     path.setFillType(SkPath::kEvenOdd_FillType);
 
-    this->drawPath(draw, path, paint, NULL, true);
+    this->drawPath(draw, path, paint, nullptr, true);
 }
 
 
@@ -649,7 +649,7 @@
         SkPath path;
         path.setIsVolatile(true);
         path.addOval(oval);
-        this->drawPath(draw, path, paint, NULL, true);
+        this->drawPath(draw, path, paint, nullptr, true);
         return;
     }
 
@@ -719,7 +719,7 @@
                                        const SkBitmap& bitmap,
                                        const SkRect* srcRectPtr,
                                        SkIRect* clippedSrcIRect) {
-    clip.getConservativeBounds(rt, clippedSrcIRect, NULL);
+    clip.getConservativeBounds(rt, clippedSrcIRect, nullptr);
     SkMatrix inv;
     if (!viewMatrix.invert(&inv)) {
         clippedSrcIRect->setEmpty();
@@ -780,7 +780,7 @@
     // a texture
     size_t bmpSize = bitmap.getSize();
     size_t cacheSize;
-    fContext->getResourceCacheLimits(NULL, &cacheSize);
+    fContext->getResourceCacheLimits(nullptr, &cacheSize);
     if (bmpSize < cacheSize / 2) {
         return false;
     }
@@ -805,7 +805,7 @@
         concat.setConcat(*draw->fMatrix, m);
         draw.writable()->fMatrix = &concat;
     }
-    this->drawBitmapCommon(*draw, bitmap, NULL, NULL, paint, SkCanvas::kStrict_SrcRectConstraint);
+    this->drawBitmapCommon(*draw, bitmap, nullptr, nullptr, paint, SkCanvas::kStrict_SrcRectConstraint);
 }
 
 // This method outsets 'iRect' by 'outset' all around and then clamps its extents to
@@ -1007,7 +1007,7 @@
     SkSize dstSize;
     // If there is no src rect, or the src rect contains the entire bitmap then we're effectively
     // in the (easier) bleed case, so update flags.
-    if (NULL == srcRectPtr) {
+    if (nullptr == srcRectPtr) {
         SkScalar w = SkIntToScalar(bitmap.width());
         SkScalar h = SkIntToScalar(bitmap.height());
         dstSize.fWidth = w;
@@ -1246,7 +1246,7 @@
 
     GrTexture* texture;
     AutoBitmapTexture abt(fContext, bitmap, &params, &texture);
-    if (NULL == texture) {
+    if (nullptr == texture) {
         return;
     }
 
@@ -1350,7 +1350,7 @@
 
     GrTexture* texture;
     // draw sprite uses the default texture params
-    AutoBitmapTexture abt(fContext, bitmap, NULL, &texture);
+    AutoBitmapTexture abt(fContext, bitmap, nullptr, &texture);
     if (!texture) {
         return;
     }
@@ -1462,7 +1462,7 @@
 
     GrRenderTarget* devRT = dev->accessRenderTarget();
     GrTexture* devTex;
-    if (NULL == (devTex = devRT->asTexture())) {
+    if (nullptr == (devTex = devRT->asTexture())) {
         return;
     }
 
@@ -1537,7 +1537,7 @@
     GrTexture* texture;
     // We assume here that the filter will not attempt to tile the src. Otherwise, this cache lookup
     // must be pushed upstack.
-    AutoBitmapTexture abt(fContext, src, NULL, &texture);
+    AutoBitmapTexture abt(fContext, src, nullptr, &texture);
     if (!texture) {
         return false;
     }
@@ -1592,14 +1592,14 @@
     GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawVertices", fContext);
 
     const uint16_t* outIndices;
-    SkAutoTDeleteArray<uint16_t> outAlloc(NULL);
+    SkAutoTDeleteArray<uint16_t> outAlloc(nullptr);
     GrPrimitiveType primType;
     GrPaint grPaint;
 
-    // If both textures and vertex-colors are NULL, strokes hairlines with the paint's color.
-    if ((NULL == texs || NULL == paint.getShader()) && NULL == colors) {
+    // If both textures and vertex-colors are nullptr, strokes hairlines with the paint's color.
+    if ((nullptr == texs || nullptr == paint.getShader()) && nullptr == colors) {
 
-        texs = NULL;
+        texs = nullptr;
 
         SkPaint copy(paint);
         copy.setStyle(SkPaint::kStroke_Style);
@@ -1607,13 +1607,13 @@
 
         // we ignore the shader if texs is null.
         if (!SkPaint2GrPaintNoShader(this->context(), fRenderTarget, copy,
-                                     SkColor2GrColor(copy.getColor()), NULL == colors, &grPaint)) {
+                                     SkColor2GrColor(copy.getColor()), nullptr == colors, &grPaint)) {
             return;
         }
 
         primType = kLines_GrPrimitiveType;
         int triangleCount = 0;
-        int n = (NULL == indices) ? vertexCount : indexCount;
+        int n = (nullptr == indices) ? vertexCount : indexCount;
         switch (vmode) {
             case SkCanvas::kTriangles_VertexMode:
                 triangleCount = n / 3;
@@ -1647,15 +1647,15 @@
         outIndices = indices;
         primType = gVertexMode2PrimitiveType[vmode];
 
-        if (NULL == texs || NULL == paint.getShader()) {
+        if (nullptr == texs || nullptr == paint.getShader()) {
             if (!SkPaint2GrPaintNoShader(this->context(), fRenderTarget, paint,
                                          SkColor2GrColor(paint.getColor()),
-                                         NULL == colors, &grPaint)) {
+                                         nullptr == colors, &grPaint)) {
                 return;
             }
         } else {
             if (!SkPaint2GrPaint(this->context(), fRenderTarget, paint, *draw.fMatrix,
-                                 NULL == colors, &grPaint)) {
+                                 nullptr == colors, &grPaint)) {
                 return;
             }
         }
@@ -1822,7 +1822,7 @@
         SkErrorInternals::SetError( kInternalError_SkError,
                                     "---- failed to create gpu device texture [%d %d]\n",
                                     cinfo.fInfo.width(), cinfo.fInfo.height());
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -1841,7 +1841,7 @@
         return false;
     }
 
-    const SkBigPicture::AccelData* data = NULL;
+    const SkBigPicture::AccelData* data = nullptr;
     if (const SkBigPicture* bp = mainPicture->asSkBigPicture()) {
         data = bp->accelData();
     }
@@ -1887,7 +1887,7 @@
 
     // Render the entire picture using new layers
     GrRecordReplaceDraw(mainPicture, mainCanvas, fContext->getLayerCache(),
-                        initialMatrix, NULL);
+                        initialMatrix, nullptr);
 
     GrLayerHoister::UnlockLayers(fContext, needRendering);
     GrLayerHoister::UnlockLayers(fContext, recycled);
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index 8d557bc..5f876a3 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -50,7 +50,7 @@
     /**
      * New device that will create an offscreen renderTarget based on the ImageInfo and
      * sampleCount. The Budgeted param controls whether the device's backing store counts against
-     * the resource cache budget. On failure, returns NULL.
+     * the resource cache budget. On failure, returns nullptr.
      */
     static SkGpuDevice* Create(GrContext*, SkSurface::Budgeted, const SkImageInfo&,
                                int sampleCount, const SkSurfaceProps*, InitContents);
@@ -60,7 +60,7 @@
     SkGpuDevice* cloneDevice(const SkSurfaceProps& props) {
         SkBaseDevice* dev = this->onCreateDevice(CreateInfo(this->imageInfo(), kPossible_TileUsage,
                                                             props.pixelGeometry()),
-                                                 NULL);
+                                                 nullptr);
         return static_cast<SkGpuDevice*>(dev);
     }
 
@@ -184,7 +184,7 @@
     void drawBitmapCommon(const SkDraw&,
                           const SkBitmap& bitmap,
                           const SkRect* srcRectPtr,
-                          const SkSize* dstSizePtr,      // ignored iff srcRectPtr == NULL
+                          const SkSize* dstSizePtr,      // ignored iff srcRectPtr == nullptr
                           const SkPaint&,
                           SkCanvas::SrcRectConstraint);
 
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index f55aa6a..ca78ff1 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -280,24 +280,24 @@
             } else if (caps->isConfigRenderable(kSkia8888_GrPixelConfig, false)) {
                 rtDesc.fConfig = kSkia8888_GrPixelConfig;
             } else {
-                return NULL;
+                return nullptr;
             }
         } else if (kRGB_GrColorComponentFlags ==
                    (kRGB_GrColorComponentFlags & GrPixelConfigComponentMask(rtDesc.fConfig))) {
             if (caps->isConfigRenderable(kSkia8888_GrPixelConfig, false)) {
                 rtDesc.fConfig = kSkia8888_GrPixelConfig;
             } else {
-                return NULL;
+                return nullptr;
             }
         } else {
-            return NULL;
+            return nullptr;
         }
     }
 
-    GrTexture* stretched = create_texture_for_bmp(context, optionalKey, rtDesc, pixelRef, NULL, 0);
+    GrTexture* stretched = create_texture_for_bmp(context, optionalKey, rtDesc, pixelRef, nullptr, 0);
 
     if (!stretched) {
-        return NULL;
+        return nullptr;
     }
     GrPaint paint;
 
@@ -314,7 +314,7 @@
 
     GrDrawContext* drawContext = context->drawContext();
     if (!drawContext) {
-        return NULL;
+        return nullptr;
     }
 
     drawContext->drawNonAARectToRect(stretched->asRenderTarget(), GrClip::WideOpen(), paint,
@@ -329,8 +329,8 @@
     SkAutoTUnref<SkData> data(bm.pixelRef()->refEncodedData());
 
     // Is this even encoded data?
-    if (NULL == data) {
-        return NULL;
+    if (nullptr == data) {
+        return nullptr;
     }
 
     // Is this a valid PKM encoded data?
@@ -343,7 +343,7 @@
         // then we don't know how to scale the image to match it...
         if (encodedWidth != static_cast<uint32_t>(bm.width()) ||
             encodedHeight != static_cast<uint32_t>(bm.height())) {
-            return NULL;
+            return nullptr;
         }
 
         // Everything seems good... skip ahead to the data.
@@ -354,19 +354,19 @@
 
         // Is it actually an ETC1 texture?
         if (!ktx.isCompressedFormat(SkTextureCompressor::kETC1_Format)) {
-            return NULL;
+            return nullptr;
         }
 
         // Does the data match the dimensions of the bitmap? If not,
         // then we don't know how to scale the image to match it...
         if (ktx.width() != bm.width() || ktx.height() != bm.height()) {
-            return NULL;
+            return nullptr;
         }
 
         bytes = ktx.pixelData();
         desc.fConfig = kETC1_GrPixelConfig;
     } else {
-        return NULL;
+        return nullptr;
     }
 
     return create_texture_for_bmp(ctx, optionalKey, desc, bm.pixelRef(), bytes, 0);
@@ -377,10 +377,10 @@
                                    const SkBitmap& bm, const GrSurfaceDesc& desc) {
     // Subsets are not supported, the whole pixelRef is loaded when using YUV decoding
     SkPixelRef* pixelRef = bm.pixelRef();
-    if ((NULL == pixelRef) || 
+    if ((nullptr == pixelRef) || 
         (pixelRef->info().width()  != bm.info().width()) ||
         (pixelRef->info().height() != bm.info().height())) {
-        return NULL;
+        return nullptr;
     }
 
     const bool useCache = optionalKey.isValid();
@@ -399,8 +399,8 @@
     } else {
         // Fetch yuv plane sizes for memory allocation. Here, width and height can be
         // rounded up to JPEG block size and be larger than the image's width and height.
-        if (!pixelRef->getYUV8Planes(yuvInfo.fSize, NULL, NULL, NULL)) {
-            return NULL;
+        if (!pixelRef->getYUV8Planes(yuvInfo.fSize, nullptr, nullptr, nullptr)) {
+            return nullptr;
         }
 
         // Allocate the memory for YUV
@@ -423,7 +423,7 @@
         // Get the YUV planes and update plane sizes to actual image size
         if (!pixelRef->getYUV8Planes(yuvInfo.fSize, planes, yuvInfo.fRowBytes,
                                      &yuvInfo.fColorSpace)) {
-            return NULL;
+            return nullptr;
         }
 
         if (useCache) {
@@ -449,16 +449,16 @@
         if (!yuvTextures[i] ||
             !yuvTextures[i]->writePixels(0, 0, yuvDesc.fWidth, yuvDesc.fHeight,
                                          yuvDesc.fConfig, planes[i], yuvInfo.fRowBytes[i])) {
-            return NULL;
+            return nullptr;
         }
     }
 
     GrSurfaceDesc rtDesc = desc;
     rtDesc.fFlags = rtDesc.fFlags | kRenderTarget_GrSurfaceFlag;
 
-    GrTexture* result = create_texture_for_bmp(ctx, optionalKey, rtDesc, pixelRef, NULL, 0);
+    GrTexture* result = create_texture_for_bmp(ctx, optionalKey, rtDesc, pixelRef, nullptr, 0);
     if (!result) {
-        return NULL;
+        return nullptr;
     }
 
     GrRenderTarget* renderTarget = result->asRenderTarget();
@@ -475,7 +475,7 @@
 
     GrDrawContext* drawContext = ctx->drawContext();
     if (!drawContext) {
-        return NULL;
+        return nullptr;
     }
 
     drawContext->drawRect(renderTarget, GrClip::WideOpen(), paint, SkMatrix::I(), r);
@@ -488,7 +488,7 @@
                                                     const GrUniqueKey& optionalKey) {
     if (origBitmap.width() < ctx->caps()->minTextureSize() ||
         origBitmap.height() < ctx->caps()->minTextureSize()) {
-        return NULL;
+        return nullptr;
     }
     SkBitmap tmpBitmap;
 
@@ -541,7 +541,7 @@
 
     SkAutoLockPixels alp(*bitmap);
     if (!bitmap->readyToDraw()) {
-        return NULL;
+        return nullptr;
     }
 
     return create_texture_for_bmp(ctx, optionalKey, desc, origBitmap.pixelRef(),
@@ -680,7 +680,7 @@
                                 "---- failed to create texture for cache [%d %d]\n",
                                 bitmap.width(), bitmap.height());
 
-    return NULL;
+    return nullptr;
 }
 
 // TODO: make this be the canonical signature, and turn the version that takes GrTextureParams*
@@ -785,7 +785,7 @@
     grPaint->setAntiAlias(skPaint.isAntiAlias());
 
     SkXfermode* mode = skPaint.getXfermode();
-    GrXPFactory* xpFactory = NULL;
+    GrXPFactory* xpFactory = nullptr;
     if (!SkXfermode::AsXPFactory(mode, &xpFactory)) {
         // Fall back to src-over
         // return false here?
@@ -844,7 +844,7 @@
 bool SkPaint2GrPaint(GrContext* context, GrRenderTarget* rt, const SkPaint& skPaint,
                      const SkMatrix& viewM, bool constantColor, GrPaint* grPaint) {
     SkShader* shader = skPaint.getShader();
-    if (NULL == shader) {
+    if (nullptr == shader) {
         return SkPaint2GrPaintNoShader(context, rt, skPaint, SkColor2GrColor(skPaint.getColor()),
                                        constantColor, grPaint);
     }
@@ -857,8 +857,8 @@
     {
         // Allow the shader to modify paintColor and also create an effect to be installed as
         // the first color effect on the GrPaint.
-        GrFragmentProcessor* fp = NULL;
-        if (!shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintColor,
+        GrFragmentProcessor* fp = nullptr;
+        if (!shader->asFragmentProcessor(context, skPaint, viewM, nullptr, &paintColor,
                                          grPaint->getProcessorDataManager(), &fp)) {
             return false;
         }
@@ -882,7 +882,7 @@
     const GrPixelConfig config = tex->config();
     SkColorType ct;
     SkAlphaType at = isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
-    if (!GrPixelConfig2ColorAndProfileType(config, &ct, NULL)) {
+    if (!GrPixelConfig2ColorAndProfileType(config, &ct, nullptr)) {
         ct = kUnknown_SkColorType;
     }
     return SkImageInfo::Make(w, h, ct, at);
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp
index 50b1269..6e014fe 100644
--- a/src/gpu/SkGrPixelRef.cpp
+++ b/src/gpu/SkGrPixelRef.cpp
@@ -25,17 +25,17 @@
 bool SkROLockPixelsPixelRef::onNewLockPixels(LockRec* rec) {
     fBitmap.reset();
 //    SkDebugf("---------- calling readpixels in support of lockpixels\n");
-    if (!this->onReadPixels(&fBitmap, NULL)) {
+    if (!this->onReadPixels(&fBitmap, nullptr)) {
         SkDebugf("SkROLockPixelsPixelRef::onLockPixels failed!\n");
         return false;
     }
     fBitmap.lockPixels();
-    if (NULL == fBitmap.getPixels()) {
+    if (nullptr == fBitmap.getPixels()) {
         return false;
     }
 
     rec->fPixels = fBitmap.getPixels();
-    rec->fColorTable = NULL;
+    rec->fColorTable = nullptr;
     rec->fRowBytes = fBitmap.rowBytes();
     return true;
 }
@@ -52,12 +52,12 @@
 
 static SkGrPixelRef* copy_to_new_texture_pixelref(GrTexture* texture, SkColorType dstCT,
                                                   SkColorProfileType dstPT, const SkIRect* subset) {
-    if (NULL == texture || kUnknown_SkColorType == dstCT) {
-        return NULL;
+    if (nullptr == texture || kUnknown_SkColorType == dstCT) {
+        return nullptr;
     }
     GrContext* context = texture->getContext();
-    if (NULL == context) {
-        return NULL;
+    if (nullptr == context) {
+        return nullptr;
     }
     GrSurfaceDesc desc;
 
@@ -77,9 +77,9 @@
     desc.fFlags = kRenderTarget_GrSurfaceFlag;
     desc.fConfig = SkImageInfo2GrPixelConfig(dstCT, kPremul_SkAlphaType, dstPT);
 
-    GrTexture* dst = context->textureProvider()->createTexture(desc, false, NULL, 0);
-    if (NULL == dst) {
-        return NULL;
+    GrTexture* dst = context->textureProvider()->createTexture(desc, false, nullptr, 0);
+    if (nullptr == dst) {
+        return nullptr;
     }
 
     // Blink is relying on the above copy being sent to GL immediately in the case when the source
@@ -102,7 +102,7 @@
     // render target but not vice versa. So we ref the texture to keep both alive for
     // the lifetime of this pixel ref.
     fSurface = SkSafeRef(surface->asTexture());
-    if (NULL == fSurface) {
+    if (nullptr == fSurface) {
         fSurface = SkSafeRef(surface);
     }
 
@@ -120,7 +120,7 @@
     if (fSurface) {
         return fSurface->asTexture();
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkGrPixelRef::onNotifyPixelsChanged() {
@@ -132,8 +132,8 @@
 
 SkPixelRef* SkGrPixelRef::deepCopy(SkColorType dstCT, SkColorProfileType dstPT,
                                    const SkIRect* subset) {
-    if (NULL == fSurface) {
-        return NULL;
+    if (nullptr == fSurface) {
+        return nullptr;
     }
 
     // Note that when copying a render-target-backed pixel ref, we
@@ -147,7 +147,7 @@
 
 static bool tryAllocBitmapPixels(SkBitmap* bitmap) {
     SkBitmap::Allocator* allocator = SkBitmapCache::GetAllocator();
-    if (NULL != allocator) {
+    if (nullptr != allocator) {
         return allocator->allocPixelRef(bitmap, 0);
     } else {
         // DiscardableMemory is not available, fallback to default allocator
@@ -156,7 +156,7 @@
 }
 
 bool SkGrPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) {
-    if (NULL == fSurface || fSurface->wasDestroyed()) {
+    if (nullptr == fSurface || fSurface->wasDestroyed()) {
         return false;
     }
 
diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp
index 7ca24ea..69fd0ef 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -237,7 +237,7 @@
                           const GrPipelineOptimizations& opts) {
         generate_aa_fill_rect_geometry(vertices, vertexStride,
                                        geo.fColor, geo.fViewMatrix, geo.fRect, geo.fDevRect, opts,
-                                       NULL);
+                                       nullptr);
     }
 };
 
diff --git a/src/gpu/batches/GrCopySurfaceBatch.cpp b/src/gpu/batches/GrCopySurfaceBatch.cpp
index b4e7ce2..098f7c7 100644
--- a/src/gpu/batches/GrCopySurfaceBatch.cpp
+++ b/src/gpu/batches/GrCopySurfaceBatch.cpp
@@ -73,7 +73,7 @@
                                     dstPoint,
                                     &clippedSrcRect,
                                     &clippedDstPoint)) {
-        return NULL;
+        return nullptr;
     }
     return new GrCopySurfaceBatch(dst, src, clippedSrcRect, clippedDstPoint);
 }
diff --git a/src/gpu/batches/GrDrawVerticesBatch.cpp b/src/gpu/batches/GrDrawVerticesBatch.cpp
index bca7d23..f79b685 100644
--- a/src/gpu/batches/GrDrawVerticesBatch.cpp
+++ b/src/gpu/batches/GrDrawVerticesBatch.cpp
@@ -134,10 +134,10 @@
         return;
     }
 
-    const GrIndexBuffer* indexBuffer = NULL;
+    const GrIndexBuffer* indexBuffer = nullptr;
     int firstIndex = 0;
 
-    uint16_t* indices = NULL;
+    uint16_t* indices = nullptr;
     if (this->hasIndices()) {
         indices = target->makeIndexSpace(this->indexCount(), &indexBuffer, &firstIndex);
 
diff --git a/src/gpu/batches/GrVertexBatch.cpp b/src/gpu/batches/GrVertexBatch.cpp
index d61b511..5d10a72 100644
--- a/src/gpu/batches/GrVertexBatch.cpp
+++ b/src/gpu/batches/GrVertexBatch.cpp
@@ -22,7 +22,7 @@
                                            int instancesToDraw) {
     SkASSERT(target);
     if (!indexBuffer) {
-        return NULL;
+        return nullptr;
     }
     const GrVertexBuffer* vertexBuffer;
     int firstVertex;
@@ -30,7 +30,7 @@
     void* vertices = target->makeVertexSpace(vertexStride, vertexCount, &vertexBuffer, &firstVertex);
     if (!vertices) {
         SkDebugf("Vertices could not be allocated for instanced rendering.");
-        return NULL;
+        return nullptr;
     }
     SkASSERT(vertexBuffer);
     size_t ibSize = indexBuffer->gpuMemorySize();
@@ -53,7 +53,7 @@
         target->resourceProvider()->refQuadIndexBuffer());
     if (!quadIndexBuffer) {
         SkDebugf("Could not get quad index buffer.");
-        return NULL;
+        return nullptr;
     }
     return this->INHERITED::init(target, kTriangles_GrPrimitiveType, vertexStride,
                                  quadIndexBuffer, kVerticesPerQuad, kIndicesPerQuad, quadsToDraw);
diff --git a/src/gpu/batches/GrVertexBatch.h b/src/gpu/batches/GrVertexBatch.h
index 0ff5ac1..5ec9683 100644
--- a/src/gpu/batches/GrVertexBatch.h
+++ b/src/gpu/batches/GrVertexBatch.h
@@ -51,7 +51,7 @@
     class QuadHelper : private InstancedHelper {
     public:
         QuadHelper() : INHERITED() {}
-        /** Finds the cached quad index buffer and reserves vertex space. Returns NULL on failure
+        /** Finds the cached quad index buffer and reserves vertex space. Returns nullptr on failure
             and on sucess a pointer to the vertex data that the caller should populate before
             calling issueDraws(). */
         void* init(Target* batchTarget, size_t vertexStride, int quadsToDraw);
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index 23f1899..92cf9a2 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -226,7 +226,7 @@
         gp = GrConicEffect::Create(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom),
                                    edgeType, *d->fCaps,
                                    GrTest::TestMatrix(d->fRandom), d->fRandom->nextBool());
-    } while (NULL == gp);
+    } while (nullptr == gp);
     return gp;
 }
 
@@ -435,7 +435,7 @@
                                   edgeType, *d->fCaps,
                                   GrTest::TestMatrix(d->fRandom),
                                   d->fRandom->nextBool());
-    } while (NULL == gp);
+    } while (nullptr == gp);
     return gp;
 }
 
@@ -653,7 +653,7 @@
                         d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
         gp = GrCubicEffect::Create(GrRandomColor(d->fRandom),
                                    GrTest::TestMatrix(d->fRandom), edgeType, *d->fCaps);
-    } while (NULL == gp);
+    } while (nullptr == gp);
     return gp;
 }
 
diff --git a/src/gpu/effects/GrBezierEffect.h b/src/gpu/effects/GrBezierEffect.h
index b78c3f3..1c76c64 100644
--- a/src/gpu/effects/GrBezierEffect.h
+++ b/src/gpu/effects/GrBezierEffect.h
@@ -68,13 +68,13 @@
         switch (edgeType) {
             case kFillAA_GrProcessorEdgeType:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
-                    return NULL;
+                    return nullptr;
                 }
                 return new GrConicEffect(color, viewMatrix, coverage, kFillAA_GrProcessorEdgeType,
                                          localMatrix, usesLocalCoords);
             case kHairlineAA_GrProcessorEdgeType:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
-                    return NULL;
+                    return nullptr;
                 }
                 return new GrConicEffect(color, viewMatrix, coverage,
                                          kHairlineAA_GrProcessorEdgeType, localMatrix,
@@ -83,7 +83,7 @@
                 return new GrConicEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType,
                                          localMatrix, usesLocalCoords);
             default:
-                return NULL;
+                return nullptr;
         }
     }
 
@@ -151,13 +151,13 @@
         switch (edgeType) {
             case kFillAA_GrProcessorEdgeType:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
-                    return NULL;
+                    return nullptr;
                 }
                 return new GrQuadEffect(color, viewMatrix, coverage, kFillAA_GrProcessorEdgeType,
                                         localMatrix, usesLocalCoords);
             case kHairlineAA_GrProcessorEdgeType:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
-                    return NULL;
+                    return nullptr;
                 }
                 return new GrQuadEffect(color, viewMatrix, coverage,
                                         kHairlineAA_GrProcessorEdgeType, localMatrix,
@@ -166,7 +166,7 @@
                 return new GrQuadEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType,
                                         localMatrix, usesLocalCoords);
             default:
-                return NULL;
+                return nullptr;
         }
     }
 
@@ -233,18 +233,18 @@
         switch (edgeType) {
             case kFillAA_GrProcessorEdgeType:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
-                    return NULL;
+                    return nullptr;
                 }
                 return new GrCubicEffect(color, viewMatrix, kFillAA_GrProcessorEdgeType);
             case kHairlineAA_GrProcessorEdgeType:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
-                    return NULL;
+                    return nullptr;
                 }
                 return new GrCubicEffect(color, viewMatrix, kHairlineAA_GrProcessorEdgeType);
             case kFillBW_GrProcessorEdgeType:
                 return new GrCubicEffect(color, viewMatrix, kFillBW_GrProcessorEdgeType);
             default:
-                return NULL;
+                return nullptr;
         }
     }
 
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h
index ff2d60e..18382a3 100644
--- a/src/gpu/effects/GrBicubicEffect.h
+++ b/src/gpu/effects/GrBicubicEffect.h
@@ -34,8 +34,8 @@
      */
     static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
                                        const SkScalar coefficients[16],
-                                       const SkRect* domain = NULL) {
-        if (NULL == domain) {
+                                       const SkRect* domain = nullptr) {
+        if (nullptr == domain) {
             static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_TileMode,
                                                              SkShader::kClamp_TileMode };
             return Create(procDataManager, tex, coefficients,
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 3b4f24c..85d0862 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -127,7 +127,7 @@
     , fLocalMatrix(localMatrix)
     , fUsesLocalCoords(usesLocalCoords)
     , fTextureAccess(texture, params)
-    , fInColor(NULL)
+    , fInColor(nullptr)
     , fMaskFormat(format) {
     this->initClassID<GrBitmapTextGeoProc>();
     fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType));
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index cee0f2f..838dc1c 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -182,11 +182,11 @@
     desc.fHeight = 256;
     desc.fConfig = kRGBA_8888_GrPixelConfig;
 
-    SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(desc, true, NULL, 0));
+    SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(desc, true, nullptr, 0));
     if (!readTex.get()) {
         return;
     }
-    SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(desc, true, NULL, 0));
+    SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(desc, true, nullptr, 0));
     if (!tempTex.get()) {
         return;
     }
@@ -303,7 +303,7 @@
             kBGRA_8888_GrPixelConfig != texture->config() &&
             kNone_PMConversion != pmConversion) {
             // The PM conversions assume colors are 0..255
-            return NULL;
+            return nullptr;
         }
         return new GrConfigConversionEffect(procDataManager, texture, swapRedAndBlue, pmConversion,
                                             matrix);
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 92ec518..2504fd4 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -71,7 +71,7 @@
                 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
 
         fp = AARectEffect::Create(edgeType, rect);
-    } while (NULL == fp);
+    } while (nullptr == fp);
     return fp;
 }
 
@@ -243,15 +243,15 @@
 GrFragmentProcessor* GrConvexPolyEffect::Create(GrPrimitiveEdgeType type, const SkPath& path,
                                                 const SkVector* offset) {
     if (kHairlineAA_GrProcessorEdgeType == type) {
-        return NULL;
+        return nullptr;
     }
     if (path.getSegmentMasks() != SkPath::kLine_SegmentMask ||
         !path.isConvex()) {
-        return NULL;
+        return nullptr;
     }
 
     if (path.countPoints() > kMaxEdges) {
-        return NULL;
+        return nullptr;
     }
 
     SkPoint pts[kMaxEdges];
@@ -261,7 +261,7 @@
     SkAssertResult(SkPathPriv::CheapComputeFirstDirection(path, &dir));
 
     SkVector t;
-    if (NULL == offset) {
+    if (nullptr == offset) {
         t.set(0, 0);
     } else {
         t = *offset;
@@ -293,7 +293,7 @@
 
 GrFragmentProcessor* GrConvexPolyEffect::Create(GrPrimitiveEdgeType edgeType, const SkRect& rect) {
     if (kHairlineAA_GrProcessorEdgeType == edgeType){
-        return NULL;
+        return nullptr;
     }
     return AARectEffect::Create(edgeType, rect);
 }
@@ -351,6 +351,6 @@
         GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
                 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
         fp = GrConvexPolyEffect::Create(edgeType, count, edges);
-    } while (NULL == fp);
+    } while (nullptr == fp);
     return fp;
 }
diff --git a/src/gpu/effects/GrConvexPolyEffect.h b/src/gpu/effects/GrConvexPolyEffect.h
index 68cd9ec..9e7f154 100644
--- a/src/gpu/effects/GrConvexPolyEffect.h
+++ b/src/gpu/effects/GrConvexPolyEffect.h
@@ -41,18 +41,18 @@
     static GrFragmentProcessor* Create(GrPrimitiveEdgeType edgeType, int n,
                                        const SkScalar edges[]) {
         if (n <= 0 || n > kMaxEdges || kHairlineAA_GrProcessorEdgeType == edgeType) {
-            return NULL;
+            return nullptr;
         }
         return new GrConvexPolyEffect(edgeType, n, edges);
     }
 
     /**
      * Creates an effect that clips against the path. If the path is not a convex polygon, is
-     * inverse filled, or has too many edges, this will return NULL. If offset is non-NULL, then
+     * inverse filled, or has too many edges, this will return nullptr. If offset is non-nullptr, then
      * the path is translated by the vector.
      */
     static GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkPath&,
-                                       const SkVector* offset = NULL);
+                                       const SkVector* offset = nullptr);
 
     /**
      * Creates an effect that fills inside the rect with AA edges..
diff --git a/src/gpu/effects/GrCoverageSetOpXP.cpp b/src/gpu/effects/GrCoverageSetOpXP.cpp
index 8a7c83b..8c45d22 100644
--- a/src/gpu/effects/GrCoverageSetOpXP.cpp
+++ b/src/gpu/effects/GrCoverageSetOpXP.cpp
@@ -216,7 +216,7 @@
             break;
         }
         default:
-            return NULL;
+            return nullptr;
     }
 }
 
@@ -231,7 +231,7 @@
     // modulation table. Note that an inverted table still won't work if there are coverage procs.
     if (fInvertCoverage && hasMixedSamples) {
         SkASSERT(false);
-        return NULL;
+        return nullptr;
     }
 
     return CoverageSetOpXP::Create(fRegionOp, fInvertCoverage);
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index 1fcdb12..58591e5 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -298,7 +298,7 @@
                                       const char* inputColor,
                                       const char* dstColor) {
     // We don't try to optimize for this case at all
-    if (NULL == inputColor) {
+    if (nullptr == inputColor) {
         fsBuilder->codeAppendf("const vec4 ones = vec4(1);");
         inputColor = "ones";
     }
@@ -434,7 +434,7 @@
 GrFragmentProcessor* GrCustomXfermode::CreateFP(GrProcessorDataManager* procDataManager,
                                                 SkXfermode::Mode mode, GrTexture* background) {
     if (!GrCustomXfermode::IsSupportedMode(mode)) {
-        return NULL;
+        return nullptr;
     } else {
         return new GrCustomXferFP(procDataManager, mode, background);
     }
@@ -569,7 +569,7 @@
 
 GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) {
     if (!GrCustomXfermode::IsSupportedMode(mode)) {
-        return NULL;
+        return nullptr;
     } else {
         return new GrCustomXPFactory(mode);
     }
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index 89fa423..ed64737 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -103,7 +103,7 @@
 
 // calculates the rotation needed to aligned pts to the x axis with pts[0] < pts[1]
 // Stores the rotation matrix in rotMatrix, and the mapped points in ptsRot
-static void align_to_x_axis(const SkPoint pts[2], SkMatrix* rotMatrix, SkPoint ptsRot[2] = NULL) {
+static void align_to_x_axis(const SkPoint pts[2], SkMatrix* rotMatrix, SkPoint ptsRot[2] = nullptr) {
     SkVector vec = pts[1] - pts[0];
     SkScalar mag = vec.length();
     SkScalar inv = mag ? SkScalarInvert(mag) : 0;
@@ -695,7 +695,7 @@
         align_to_x_axis(pts, &rotMatrix, geometry.fPtsRot);
         if(!rotMatrix.invert(&geometry.fSrcRotInv)) {
             SkDebugf("Failed to create invertible rotation matrix!\n");
-            return NULL;
+            return nullptr;
         }
     } else {
         geometry.fSrcRotInv.reset();
@@ -1212,7 +1212,7 @@
     SkMatrix invert;
     if (usesLocalCoords && !viewMatrix.invert(&invert)) {
         SkDebugf("Failed to invert\n");
-        return NULL;
+        return nullptr;
     }
 
     switch (cap) {
@@ -1221,7 +1221,7 @@
         case kNonRound_DashCap:
             return DashingLineEffect::Create(color, dashAAMode, invert, usesLocalCoords);
     }
-    return NULL;
+    return nullptr;
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 5d6df72..d0c1a3f 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -45,7 +45,7 @@
 
 #ifdef SK_GAMMA_APPLY_TO_A8
         // adjust based on gamma
-        const char* distanceAdjustUniName = NULL;
+        const char* distanceAdjustUniName = nullptr;
         // width, height, 1/(3*width)
         fDistanceAdjustUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility,
             kFloat_GrSLType, kDefault_GrSLPrecision,
@@ -222,7 +222,7 @@
     , fDistanceAdjust(distanceAdjust)
 #endif
     , fFlags(flags & kNonLCD_DistanceFieldEffectMask)
-    , fInColor(NULL)
+    , fInColor(nullptr)
     , fUsesLocalCoords(usesLocalCoords) {
     SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask));
     this->initClassID<GrDistanceFieldA8TextGeoProc>();
@@ -322,7 +322,7 @@
         this->emitTransforms(args.fPB, gpArgs->fPositionVar, dfTexEffect.inPosition()->fName,
                              args.fTransformsIn, args.fTransformsOut);
 
-        const char* textureSizeUniName = NULL;
+        const char* textureSizeUniName = nullptr;
         fTextureSizeUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility,
                                               kVec2f_GrSLType, kDefault_GrSLPrecision,
                                               "TextureSize", &textureSizeUniName);
@@ -446,7 +446,7 @@
     , fViewMatrix(viewMatrix)
     , fTextureAccess(texture, params)
     , fFlags(flags & kNonLCD_DistanceFieldEffectMask)
-    , fInColor(NULL)
+    , fInColor(nullptr)
     , fUsesLocalCoords(usesLocalCoords) {
     SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask));
     this->initClassID<GrDistanceFieldPathGeoProc>();
@@ -606,7 +606,7 @@
            "vec3(" SK_DistanceFieldMultiplier ")*(distance - vec3(" SK_DistanceFieldThreshold"));");
 
         // adjust width based on gamma
-        const char* distanceAdjustUniName = NULL;
+        const char* distanceAdjustUniName = nullptr;
         fDistanceAdjustUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility,
             kVec3f_GrSLType, kDefault_GrSLPrecision,
             "DistanceAdjust", &distanceAdjustUniName);
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index dec6ae2..0f3df7d 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -360,7 +360,7 @@
 
 GrFragmentProcessor* GrOvalEffect::Create(GrPrimitiveEdgeType edgeType, const SkRect& oval) {
     if (kHairlineAA_GrProcessorEdgeType == edgeType) {
-        return NULL;
+        return nullptr;
     }
     SkScalar w = oval.width();
     SkScalar h = oval.height();
@@ -373,5 +373,5 @@
         return EllipseEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, oval.fTop + h), w, h);
     }
 
-    return NULL;
+    return nullptr;
 }
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
index 4a86aab..ff857f4 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
@@ -600,11 +600,11 @@
 GrXferProcessor* PDLCDXferProcessor::Create(SkXfermode::Mode xfermode,
                                             const GrProcOptInfo& colorPOI) {
     if (SkXfermode::kSrcOver_Mode != xfermode) {
-        return NULL;
+        return nullptr;
     }
 
     if (kRGBA_GrColorComponentFlags != colorPOI.validFlags()) {
-        return NULL;
+        return nullptr;
     }
 
     GrColor blendConstant = GrUnPreMulColor(colorPOI.color());
@@ -673,7 +673,7 @@
     GR_STATIC_ASSERT(SK_ARRAY_COUNT(gFactories) == SkXfermode::kLastCoeffMode + 1);
 
     if (xfermode < 0 || xfermode > SkXfermode::kLastCoeffMode) {
-        return NULL;
+        return nullptr;
     }
     return SkRef(gFactories[xfermode]);
 }
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index 62c6d3b..af0f1fc 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -79,7 +79,7 @@
                                                  uint32_t circularCornerFlags,
                                                  const SkRRect& rrect) {
     if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdgeType != edgeType) {
-        return NULL;
+        return nullptr;
     }
     return new CircularRRectEffect(edgeType, circularCornerFlags, rrect);
 }
@@ -118,7 +118,7 @@
         GrPrimitiveEdgeType et =
                 (GrPrimitiveEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
         fp = GrRRectEffect::Create(et, rrect);
-    } while (NULL == fp);
+    } while (nullptr == fp);
     return fp;
 }
 
@@ -407,7 +407,7 @@
 GrFragmentProcessor*
 EllipticalRRectEffect::Create(GrPrimitiveEdgeType edgeType, const SkRRect& rrect) {
     if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdgeType != edgeType) {
-        return NULL;
+        return nullptr;
     }
     return new EllipticalRRectEffect(edgeType, rrect);
 }
@@ -464,7 +464,7 @@
         GrPrimitiveEdgeType et =
                 (GrPrimitiveEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
         fp = GrRRectEffect::Create(et, rrect);
-    } while (NULL == fp);
+    } while (nullptr == fp);
     return fp;
 }
 
@@ -706,15 +706,15 @@
                     // If we got here then we squashed some but not all the radii to zero. (If all
                     // had been squashed cornerFlags would be 0.) The elliptical effect doesn't
                     // support some rounded and some square corners.
-                    return NULL;
+                    return nullptr;
                 }
                 if (rrect.isNinePatch()) {
                     return EllipticalRRectEffect::Create(edgeType, rrect);
                 }
-                return NULL;
+                return nullptr;
             }
         }
     }
 
-    return NULL;
+    return nullptr;
 }
diff --git a/src/gpu/effects/GrRRectEffect.h b/src/gpu/effects/GrRRectEffect.h
index d3901f3..63e08a4 100644
--- a/src/gpu/effects/GrRRectEffect.h
+++ b/src/gpu/effects/GrRRectEffect.h
@@ -18,7 +18,7 @@
 namespace GrRRectEffect {
     /**
      * Creates an effect that performs anti-aliased clipping against a SkRRect. It doesn't support
-     * all varieties of SkRRect so the caller must check for a NULL return.
+     * all varieties of SkRRect so the caller must check for a nullptr return.
      */
     GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkRRect&);
 };
diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h
index 11760fb..f4c5e9c 100644
--- a/src/gpu/effects/GrTextureDomain.h
+++ b/src/gpu/effects/GrTextureDomain.h
@@ -108,7 +108,7 @@
          * @param outcolor  name of vec4 variable to hold the sampled color.
          * @param inCoords  name of vec2 variable containing the coords to be used with the domain.
          *                  It is assumed that this is a variable and not an expression.
-         * @param inModulateColor   if non-NULL the sampled color will be modulated with this
+         * @param inModulateColor   if non-nullptr the sampled color will be modulated with this
          *                          expression before being written to outColor.
          */
         void sampleTexture(GrGLShaderBuilder* builder,
@@ -116,7 +116,7 @@
                            const char* outColor,
                            const SkString& inCoords,
                            const GrGLProcessor::TextureSampler sampler,
-                           const char* inModulateColor = NULL);
+                           const char* inModulateColor = nullptr);
 
         /**
          * Call this from GrGLProcessor::setData() to upload uniforms necessary for the texture
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp
index 6aeaf6f..ca688d8 100644
--- a/src/gpu/effects/GrTextureStripAtlas.cpp
+++ b/src/gpu/effects/GrTextureStripAtlas.cpp
@@ -22,11 +22,11 @@
 
 int32_t GrTextureStripAtlas::gCacheCount = 0;
 
-GrTextureStripAtlas::Hash* GrTextureStripAtlas::gAtlasCache = NULL;
+GrTextureStripAtlas::Hash* GrTextureStripAtlas::gAtlasCache = nullptr;
 
 GrTextureStripAtlas::Hash* GrTextureStripAtlas::GetCache() {
 
-    if (NULL == gAtlasCache) {
+    if (nullptr == gAtlasCache) {
         gAtlasCache = new Hash;
     }
 
@@ -47,13 +47,13 @@
 
     if (0 == GetCache()->count()) {
         delete gAtlasCache;
-        gAtlasCache = NULL;
+        gAtlasCache = nullptr;
     }
 }
 
 GrTextureStripAtlas* GrTextureStripAtlas::GetAtlas(const GrTextureStripAtlas::Desc& desc) {
     AtlasEntry* entry = GetCache()->find(desc);
-    if (NULL == entry) {
+    if (nullptr == entry) {
         entry = new AtlasEntry;
 
         entry->fAtlas = new GrTextureStripAtlas(desc);
@@ -72,10 +72,10 @@
     , fLockedRows(0)
     , fDesc(desc)
     , fNumRows(desc.fHeight / desc.fRowHeight)
-    , fTexture(NULL)
+    , fTexture(nullptr)
     , fRows(new AtlasRow[fNumRows])
-    , fLRUFront(NULL)
-    , fLRUBack(NULL) {
+    , fLRUFront(nullptr)
+    , fLRUBack(nullptr) {
     SkASSERT(fNumRows * fDesc.fRowHeight == fDesc.fHeight);
     this->initLRU();
     fNormalizedYHeight = SK_Scalar1 / fDesc.fHeight;
@@ -118,11 +118,11 @@
 
         ++fLockedRows;
 
-        if (NULL == row) {
+        if (nullptr == row) {
             // force a flush, which should unlock all the rows; then try again
             fDesc.fContext->flush();
             row = this->getLRU();
-            if (NULL == row) {
+            if (nullptr == row) {
                 --fLockedRows;
                 return -1;
             }
@@ -201,8 +201,8 @@
     builder.finish();
 
     fTexture = fDesc.fContext->textureProvider()->findAndRefTextureByUniqueKey(key);
-    if (NULL == fTexture) {
-        fTexture = fDesc.fContext->textureProvider()->createTexture(texDesc, true, NULL, 0);
+    if (nullptr == fTexture) {
+        fTexture = fDesc.fContext->textureProvider()->createTexture(texDesc, true, nullptr, 0);
         if (!fTexture) {
             return;
         }
@@ -217,26 +217,26 @@
 void GrTextureStripAtlas::unlockTexture() {
     SkASSERT(fTexture && 0 == fLockedRows);
     fTexture->unref();
-    fTexture = NULL;
+    fTexture = nullptr;
 }
 
 void GrTextureStripAtlas::initLRU() {
-    fLRUFront = NULL;
-    fLRUBack = NULL;
+    fLRUFront = nullptr;
+    fLRUBack = nullptr;
     // Initially all the rows are in the LRU list
     for (int i = 0; i < fNumRows; ++i) {
         fRows[i].fKey = kEmptyAtlasRowKey;
-        fRows[i].fNext = NULL;
-        fRows[i].fPrev = NULL;
+        fRows[i].fNext = nullptr;
+        fRows[i].fPrev = nullptr;
         this->appendLRU(fRows + i);
     }
-    SkASSERT(NULL == fLRUFront || NULL == fLRUFront->fPrev);
-    SkASSERT(NULL == fLRUBack || NULL == fLRUBack->fNext);
+    SkASSERT(nullptr == fLRUFront || nullptr == fLRUFront->fPrev);
+    SkASSERT(nullptr == fLRUBack || nullptr == fLRUBack->fNext);
 }
 
 void GrTextureStripAtlas::appendLRU(AtlasRow* row) {
-    SkASSERT(NULL == row->fPrev && NULL == row->fNext);
-    if (NULL == fLRUFront && NULL == fLRUBack) {
+    SkASSERT(nullptr == row->fPrev && nullptr == row->fNext);
+    if (nullptr == fLRUFront && nullptr == fLRUBack) {
         fLRUFront = row;
         fLRUBack = row;
     } else {
@@ -252,23 +252,23 @@
         row->fPrev->fNext = row->fNext;
         row->fNext->fPrev = row->fPrev;
     } else {
-        if (NULL == row->fNext) {
+        if (nullptr == row->fNext) {
             SkASSERT(row == fLRUBack);
             fLRUBack = row->fPrev;
             if (fLRUBack) {
-                fLRUBack->fNext = NULL;
+                fLRUBack->fNext = nullptr;
             }
         }
-        if (NULL == row->fPrev) {
+        if (nullptr == row->fPrev) {
             SkASSERT(row == fLRUFront);
             fLRUFront = row->fNext;
             if (fLRUFront) {
-                fLRUFront->fPrev = NULL;
+                fLRUFront->fPrev = nullptr;
             }
         }
     }
-    row->fNext = NULL;
-    row->fPrev = NULL;
+    row->fNext = nullptr;
+    row->fPrev = nullptr;
 }
 
 int GrTextureStripAtlas::searchByKey(uint32_t key) {
@@ -294,10 +294,10 @@
 
     int lruCount = 0;
     // Validate LRU pointers, and count LRU entries
-    SkASSERT(NULL == fLRUFront || NULL == fLRUFront->fPrev);
-    SkASSERT(NULL == fLRUBack  || NULL == fLRUBack->fNext);
-    for (AtlasRow* r = fLRUFront; r != NULL; r = r->fNext) {
-        if (NULL == r->fNext) {
+    SkASSERT(nullptr == fLRUFront || nullptr == fLRUFront->fPrev);
+    SkASSERT(nullptr == fLRUBack  || nullptr == fLRUBack->fNext);
+    for (AtlasRow* r = fLRUFront; r != nullptr; r = r->fNext) {
+        if (nullptr == r->fNext) {
             SkASSERT(r == fLRUBack);
         } else {
             SkASSERT(r->fNext->fPrev == r);
@@ -314,7 +314,7 @@
             ++freeRows;
             bool inLRU = false;
             // Step through the LRU and make sure it's present
-            for (AtlasRow* r = fLRUFront; r != NULL; r = r->fNext) {
+            for (AtlasRow* r = fLRUFront; r != nullptr; r = r->fNext) {
                 if (r == &fRows[i]) {
                     inLRU = true;
                     break;
@@ -341,7 +341,7 @@
     // If we have locked rows, we should have a locked texture, otherwise
     // it should be unlocked
     if (fLockedRows == 0) {
-        SkASSERT(NULL == fTexture);
+        SkASSERT(nullptr == fTexture);
     } else {
         SkASSERT(fTexture);
     }
diff --git a/src/gpu/effects/GrTextureStripAtlas.h b/src/gpu/effects/GrTextureStripAtlas.h
index 98ac52a..91ce61c 100644
--- a/src/gpu/effects/GrTextureStripAtlas.h
+++ b/src/gpu/effects/GrTextureStripAtlas.h
@@ -83,7 +83,7 @@
      * together to represent LRU status
      */
     struct AtlasRow : SkNoncopyable {
-        AtlasRow() : fKey(kEmptyAtlasRowKey), fLocks(0), fNext(NULL), fPrev(NULL) { }
+        AtlasRow() : fKey(kEmptyAtlasRowKey), fLocks(0), fNext(nullptr), fPrev(nullptr) { }
         // GenerationID of the bitmap that is represented by this row, 0xffffffff means "empty"
         uint32_t fKey;
         // How many times this has been locked (0 == unlocked)
@@ -107,7 +107,7 @@
     void initLRU();
 
     /**
-     * Grabs the least recently used free row out of the LRU list, returns NULL if no rows are free.
+     * Grabs the least recently used free row out of the LRU list, returns nullptr if no rows are free.
      */
     AtlasRow* getLRU();
 
@@ -145,7 +145,7 @@
         static uint32_t Hash(const Desc& desc) { return SkChecksum::Murmur3(&desc, sizeof(Desc)); }
 
         // AtlasEntry proper
-        AtlasEntry() : fAtlas(NULL) {}
+        AtlasEntry() : fAtlas(nullptr) {}
         ~AtlasEntry() { delete fAtlas; }
         Desc fDesc;
         GrTextureStripAtlas* fAtlas;
diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp
index 84be8c3..ba975f7 100644
--- a/src/gpu/effects/GrYUVtoRGBEffect.cpp
+++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp
@@ -64,7 +64,7 @@
         virtual void emitCode(EmitArgs& args) override {
             GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
 
-            const char* yuvMatrix   = NULL;
+            const char* yuvMatrix   = nullptr;
             fMatrixUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
                                              kMat44f_GrSLType, kDefault_GrSLPrecision,
                                              "YUVMatrix", &yuvMatrix);
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp
index adb11df..f19a1cb 100644
--- a/src/gpu/gl/GrGLAssembleInterface.cpp
+++ b/src/gpu/gl/GrGLAssembleInterface.cpp
@@ -16,13 +16,13 @@
 
 const GrGLInterface* GrGLAssembleInterface(void* ctx, GrGLGetProc get) {
     GET_PROC_LOCAL(GetString);
-    if (NULL == GetString) {
-        return NULL;
+    if (nullptr == GetString) {
+        return nullptr;
     }
 
     const char* verStr = reinterpret_cast<const char*>(GetString(GR_GL_VERSION));
-    if (NULL == verStr) {
-        return NULL;
+    if (nullptr == verStr) {
+        return nullptr;
     }
 
     GrGLStandard standard = GrGLGetStandardInUseFromString(verStr);
@@ -32,7 +32,7 @@
     } else if (kGL_GrGLStandard == standard) {
         return GrGLAssembleGLInterface(ctx, get);
     }
-    return NULL;
+    return nullptr;
 }
 
 const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
@@ -40,9 +40,9 @@
     GET_PROC_LOCAL(GetStringi);
     GET_PROC_LOCAL(GetIntegerv);
 
-    // GetStringi may be NULL depending on the GL version.
-    if (NULL == GetString || NULL == GetIntegerv) {
-        return NULL;
+    // GetStringi may be nullptr depending on the GL version.
+    if (nullptr == GetString || nullptr == GetIntegerv) {
+        return nullptr;
     }
 
     const char* versionString = (const char*) GetString(GR_GL_VERSION);
@@ -50,12 +50,12 @@
 
     if (glVer < GR_GL_VER(1,5) || GR_GL_INVALID_VER == glVer) {
         // We must have array and element_array buffer objects.
-        return NULL;
+        return nullptr;
     }
 
     GrGLExtensions extensions;
     if (!extensions.init(kGL_GrGLStandard, GetString, GetStringi, GetIntegerv)) {
-        return NULL;
+        return nullptr;
     }
 
     GrGLInterface* interface = new GrGLInterface();
@@ -266,7 +266,7 @@
     } else {
         // we must have FBOs
         delete interface;
-        return NULL;
+        return nullptr;
     }
 
     if (extensions.has("GL_NV_path_rendering")) {
@@ -469,22 +469,22 @@
 
 const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
     GET_PROC_LOCAL(GetString);
-    if (NULL == GetString) {
-        return NULL;
+    if (nullptr == GetString) {
+        return nullptr;
     }
 
     const char* verStr = reinterpret_cast<const char*>(GetString(GR_GL_VERSION));
     GrGLVersion version = GrGLGetVersionFromString(verStr);
 
     if (version < GR_GL_VER(2,0)) {
-        return NULL;
+        return nullptr;
     }
 
     GET_PROC_LOCAL(GetIntegerv);
     GET_PROC_LOCAL(GetStringi);
     GrGLExtensions extensions;
     if (!extensions.init(kGLES_GrGLStandard, GetString, GetStringi, GetIntegerv)) {
-        return NULL;
+        return nullptr;
     }
 
     GrGLInterface* interface = new GrGLInterface;
@@ -670,10 +670,10 @@
         GET_PROC(PushGroupMarker);
         GET_PROC(PopGroupMarker);
         // The below check is here because a device has been found that has the extension string but
-        // returns NULL from the eglGetProcAddress for the functions
-        if (NULL == functions->fInsertEventMarker ||
-            NULL == functions->fPushGroupMarker ||
-            NULL == functions->fPopGroupMarker) {
+        // returns nullptr from the eglGetProcAddress for the functions
+        if (nullptr == functions->fInsertEventMarker ||
+            nullptr == functions->fPushGroupMarker ||
+            nullptr == functions->fPopGroupMarker) {
             extensions.remove("GL_EXT_debug_marker");
         }
     }
diff --git a/src/gpu/gl/GrGLBufferImpl.cpp b/src/gpu/gl/GrGLBufferImpl.cpp
index 0e2990e..52ef946 100644
--- a/src/gpu/gl/GrGLBufferImpl.cpp
+++ b/src/gpu/gl/GrGLBufferImpl.cpp
@@ -23,7 +23,7 @@
 GrGLBufferImpl::GrGLBufferImpl(GrGLGpu* gpu, const Desc& desc, GrGLenum bufferType)
     : fDesc(desc)
     , fBufferType(bufferType)
-    , fMapPtr(NULL) {
+    , fMapPtr(nullptr) {
     if (0 == desc.fID) {
         if (gpu->caps()->mustClearUploadedBufferData()) {
             fCPUData = sk_calloc_throw(desc.fSizeInBytes);
@@ -32,7 +32,7 @@
         }
         fGLSizeInBytes = 0;
     } else {
-        fCPUData = NULL;
+        fCPUData = nullptr;
         // We assume that the GL buffer was created at the desc's size initially.
         fGLSizeInBytes = fDesc.fSizeInBytes;
     }
@@ -44,7 +44,7 @@
     // make sure we've not been abandoned or already released
     if (fCPUData) {
         sk_free(fCPUData);
-        fCPUData = NULL;
+        fCPUData = nullptr;
     } else if (fDesc.fID) {
         GL_CALL(gpu, DeleteBuffers(1, &fDesc.fID));
         if (GR_GL_ARRAY_BUFFER == fBufferType) {
@@ -56,16 +56,16 @@
         fDesc.fID = 0;
         fGLSizeInBytes = 0;
     }
-    fMapPtr = NULL;
+    fMapPtr = nullptr;
     VALIDATE();
 }
 
 void GrGLBufferImpl::abandon() {
     fDesc.fID = 0;
     fGLSizeInBytes = 0;
-    fMapPtr = NULL;
+    fMapPtr = nullptr;
     sk_free(fCPUData);
-    fCPUData = NULL;
+    fCPUData = nullptr;
     VALIDATE();
 }
 
@@ -89,14 +89,14 @@
         switch (gpu->glCaps().mapBufferType()) {
             case GrGLCaps::kNone_MapBufferType:
                 VALIDATE();
-                return NULL;
+                return nullptr;
             case GrGLCaps::kMapBuffer_MapBufferType:
                 this->bind(gpu);
                 // Let driver know it can discard the old data
                 if (GR_GL_USE_BUFFER_DATA_NULL_HINT || fDesc.fSizeInBytes != fGLSizeInBytes) {
                     fGLSizeInBytes = fDesc.fSizeInBytes;
                     GL_CALL(gpu,
-                            BufferData(fBufferType, fGLSizeInBytes, NULL,
+                            BufferData(fBufferType, fGLSizeInBytes, nullptr,
                                        fDesc.fDynamic ? DYNAMIC_USAGE_PARAM : GR_GL_STATIC_DRAW));
                 }
                 GR_GL_CALL_RET(gpu->glInterface(), fMapPtr,
@@ -108,7 +108,7 @@
                 if (fDesc.fSizeInBytes != fGLSizeInBytes) {
                     fGLSizeInBytes = fDesc.fSizeInBytes;
                     GL_CALL(gpu,
-                            BufferData(fBufferType, fGLSizeInBytes, NULL,
+                            BufferData(fBufferType, fGLSizeInBytes, nullptr,
                                        fDesc.fDynamic ? DYNAMIC_USAGE_PARAM : GR_GL_STATIC_DRAW));
                 }
                 static const GrGLbitfield kAccess = GR_GL_MAP_INVALIDATE_BUFFER_BIT |
@@ -124,7 +124,7 @@
                 if (fDesc.fSizeInBytes != fGLSizeInBytes) {
                     fGLSizeInBytes = fDesc.fSizeInBytes;
                     GL_CALL(gpu,
-                            BufferData(fBufferType, fGLSizeInBytes, NULL,
+                            BufferData(fBufferType, fGLSizeInBytes, nullptr,
                                        fDesc.fDynamic ? DYNAMIC_USAGE_PARAM : GR_GL_STATIC_DRAW));
                 }
                 GR_GL_CALL_RET(gpu->glInterface(),
@@ -156,7 +156,7 @@
                 break;
         }
     }
-    fMapPtr = NULL;
+    fMapPtr = nullptr;
 }
 
 bool GrGLBufferImpl::isMapped() const {
@@ -182,19 +182,19 @@
         GL_CALL(gpu, BufferData(fBufferType, (GrGLsizeiptr) srcSizeInBytes, src, usage));
     } else {
         // Before we call glBufferSubData we give the driver a hint using
-        // glBufferData with NULL. This makes the old buffer contents
+        // glBufferData with nullptr. This makes the old buffer contents
         // inaccessible to future draws. The GPU may still be processing
         // draws that reference the old contents. With this hint it can
         // assign a different allocation for the new contents to avoid
         // flushing the gpu past draws consuming the old contents.
         fGLSizeInBytes = fDesc.fSizeInBytes;
-        GL_CALL(gpu, BufferData(fBufferType, fGLSizeInBytes, NULL, usage));
+        GL_CALL(gpu, BufferData(fBufferType, fGLSizeInBytes, nullptr, usage));
         GL_CALL(gpu, BufferSubData(fBufferType, 0, (GrGLsizeiptr) srcSizeInBytes, src));
     }
 #else
     // Note that we're cheating on the size here. Currently no methods
     // allow a partial update that preserves contents of non-updated
-    // portions of the buffer (map() does a glBufferData(..size, NULL..))
+    // portions of the buffer (map() does a glBufferData(..size, nullptr..))
     bool doSubData = false;
 #if GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND
     static int N = 0;
@@ -209,7 +209,7 @@
         // exactly matches the buffer size into a glBufferData. So we tack 1
         // extra byte onto the glBufferData.
         fGLSizeInBytes = srcSizeInBytes + 1;
-        GL_CALL(gpu, BufferData(fBufferType, fGLSizeInBytes, NULL, usage));
+        GL_CALL(gpu, BufferData(fBufferType, fGLSizeInBytes, nullptr, usage));
         GL_CALL(gpu, BufferSubData(fBufferType, 0, srcSizeInBytes, src));
     } else {
         fGLSizeInBytes = srcSizeInBytes;
@@ -223,7 +223,7 @@
     SkASSERT(GR_GL_ARRAY_BUFFER == fBufferType || GR_GL_ELEMENT_ARRAY_BUFFER == fBufferType);
     // The following assert isn't valid when the buffer has been abandoned:
     // SkASSERT((0 == fDesc.fID) == (fCPUData));
-    SkASSERT(NULL == fCPUData || 0 == fGLSizeInBytes);
-    SkASSERT(NULL == fMapPtr || fCPUData || fGLSizeInBytes == fDesc.fSizeInBytes);
-    SkASSERT(NULL == fCPUData || NULL == fMapPtr || fCPUData == fMapPtr);
+    SkASSERT(nullptr == fCPUData || 0 == fGLSizeInBytes);
+    SkASSERT(nullptr == fMapPtr || fCPUData || fGLSizeInBytes == fDesc.fSizeInBytes);
+    SkASSERT(nullptr == fCPUData || nullptr == fMapPtr || fCPUData == fMapPtr);
 }
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 19d6a80..ea2daee 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -538,11 +538,11 @@
     // additions are detected by checking the existence of the function.
     // We also use *Then* functions that not all drivers might have. Check
     // them for consistency.
-    if (NULL == gli->fFunctions.fStencilThenCoverFillPath ||
-        NULL == gli->fFunctions.fStencilThenCoverStrokePath ||
-        NULL == gli->fFunctions.fStencilThenCoverFillPathInstanced ||
-        NULL == gli->fFunctions.fStencilThenCoverStrokePathInstanced ||
-        NULL == gli->fFunctions.fProgramPathFragmentInputGen) {
+    if (nullptr == gli->fFunctions.fStencilThenCoverFillPath ||
+        nullptr == gli->fFunctions.fStencilThenCoverStrokePath ||
+        nullptr == gli->fFunctions.fStencilThenCoverFillPathInstanced ||
+        nullptr == gli->fFunctions.fStencilThenCoverStrokePathInstanced ||
+        nullptr == gli->fFunctions.fProgramPathFragmentInputGen) {
         return false;
     }
     return true;
@@ -1192,7 +1192,7 @@
             if (kGeometry_GrShaderType != s) {
                 GrShaderType shaderType = static_cast<GrShaderType>(s);
                 GrGLenum glShader = shader_type_to_gl_shader(shaderType);
-                GrShaderCaps::PrecisionInfo* first = NULL;
+                GrShaderCaps::PrecisionInfo* first = nullptr;
                 glslCaps->fShaderPrecisionVaries = false;
                 for (int p = 0; p < kGrSLPrecisionCount; ++p) {
                     GrSLPrecision precision = static_cast<GrSLPrecision>(p);
diff --git a/src/gpu/gl/GrGLContext.cpp b/src/gpu/gl/GrGLContext.cpp
index b4fb3ea..9e70b47 100644
--- a/src/gpu/gl/GrGLContext.cpp
+++ b/src/gpu/gl/GrGLContext.cpp
@@ -13,7 +13,7 @@
 GrGLContext* GrGLContext::Create(const GrGLInterface* interface, const GrContextOptions& options) {
     // We haven't validated the GrGLInterface yet, so check for GetString function pointer
     if (!interface->fFunctions.fGetString) {
-        return NULL;
+        return nullptr;
     }
     ConstructorArgs args;
     args.fInterface = interface;
@@ -27,16 +27,16 @@
     const char* renderer = reinterpret_cast<const char*>(rendererUByte);
 
     if (!interface->validate()) {
-        return NULL;
+        return nullptr;
     }
 
     args.fGLVersion = GrGLGetVersionFromString(ver);
     if (GR_GL_INVALID_VER == args.fGLVersion) {
-        return NULL;
+        return nullptr;
     }
 
     if (!GrGLGetGLSLGeneration(interface, &args.fGLSLGeneration)) {
-        return NULL;
+        return nullptr;
     }
 
     args.fVendor = GrGLGetVendor(interface);
diff --git a/src/gpu/gl/GrGLCreateNativeInterface_none.cpp b/src/gpu/gl/GrGLCreateNativeInterface_none.cpp
index e0c72c5..0a0f279 100644
--- a/src/gpu/gl/GrGLCreateNativeInterface_none.cpp
+++ b/src/gpu/gl/GrGLCreateNativeInterface_none.cpp
@@ -8,5 +8,5 @@
 #include "gl/GrGLInterface.h"
 
 const GrGLInterface* GrGLCreateNativeInterface() {
-    return NULL;
+    return nullptr;
 }
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp
index 37d0285..1ed5f65 100644
--- a/src/gpu/gl/GrGLCreateNullInterface.cpp
+++ b/src/gpu/gl/GrGLCreateNullInterface.cpp
@@ -22,7 +22,7 @@
 public:
     
 
-    BufferObj(GrGLuint id) : fID(id), fDataPtr(NULL), fSize(0), fMapped(false) {
+    BufferObj(GrGLuint id) : fID(id), fDataPtr(nullptr), fSize(0), fMapped(false) {
     }
     ~BufferObj() { delete[] fDataPtr; }
 
@@ -58,11 +58,11 @@
     BufferManager() : fFreeListHead(kFreeListEnd) {}
 
     ~BufferManager() {
-        // NULL out the entries that are really free list links rather than ptrs before deleting.
+        // nullptr out the entries that are really free list links rather than ptrs before deleting.
         intptr_t curr = fFreeListHead;
         while (kFreeListEnd != curr) {
             intptr_t next = reinterpret_cast<intptr_t>(fBuffers[SkToS32(curr)]);
-            fBuffers[SkToS32(curr)] = NULL;
+            fBuffers[SkToS32(curr)] = nullptr;
             curr = next;
         }
 
@@ -260,7 +260,7 @@
         buffer->setMapped(true);
         return buffer->dataPtr();
     }
-    return NULL;
+    return nullptr;
 }
 
 GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access) {
@@ -283,7 +283,7 @@
     }
 
     SkASSERT(false);
-    return NULL;            // no buffer bound to target
+    return nullptr;            // no buffer bound to target
 }
 
 GrGLvoid GR_GL_FUNCTION_TYPE nullGLFlushMappedBufferRange(GrGLenum target,
diff --git a/src/gpu/gl/GrGLDefaultInterface_none.cpp b/src/gpu/gl/GrGLDefaultInterface_none.cpp
index 84c7f7c..f9e5247 100644
--- a/src/gpu/gl/GrGLDefaultInterface_none.cpp
+++ b/src/gpu/gl/GrGLDefaultInterface_none.cpp
@@ -8,5 +8,5 @@
 #include "gl/GrGLInterface.h"
 
 const GrGLInterface* GrGLDefaultInterface() {
-    return NULL;
+    return nullptr;
 }
diff --git a/src/gpu/gl/GrGLExtensions.cpp b/src/gpu/gl/GrGLExtensions.cpp
index f2d54ff..6d716d1 100644
--- a/src/gpu/gl/GrGLExtensions.cpp
+++ b/src/gpu/gl/GrGLExtensions.cpp
@@ -48,7 +48,7 @@
     fInitialized = false;
     fStrings->reset();
 
-    if (NULL == getString) {
+    if (nullptr == getString) {
         return false;
     }
 
@@ -62,7 +62,7 @@
     bool indexed = version >= GR_GL_VER(3, 0);
 
     if (indexed) {
-        if (NULL == getStringi || NULL == getIntegerv) {
+        if (nullptr == getStringi || nullptr == getIntegerv) {
             return false;
         }
         GrGLint extensionCnt = 0;
@@ -74,7 +74,7 @@
         }
     } else {
         const char* extensions = (const char*) getString(GR_GL_EXTENSIONS);
-        if (NULL == extensions) {
+        if (nullptr == extensions) {
             return false;
         }
         while (true) {
@@ -133,7 +133,7 @@
 }
 
 void GrGLExtensions::print(const char* sep) const {
-    if (NULL == sep) {
+    if (nullptr == sep) {
         sep = " ";
     }
     int cnt = fStrings->count();
diff --git a/src/gpu/gl/GrGLFragmentProcessor.h b/src/gpu/gl/GrGLFragmentProcessor.h
index 05ee375..b8e2afc 100644
--- a/src/gpu/gl/GrGLFragmentProcessor.h
+++ b/src/gpu/gl/GrGLFragmentProcessor.h
@@ -38,7 +38,7 @@
         @param outputColor  A predefined vec4 in the FS in which the stage should place its output
                             color (or coverage).
         @param inputColor   A vec4 that holds the input color to the stage in the FS. This may be
-                            NULL in which case the implied input is solid white (all ones).
+                            nullptr in which case the implied input is solid white (all ones).
                             TODO: Better system for communicating optimization info (e.g. input
                             color is solid white, trans black, known to be opaque, etc.) that allows
                             the processor to communicate back similar known info about its output.
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 92cfba1..1a28963 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -169,13 +169,13 @@
         glInterface->ref();
     }
     if (!glInterface) {
-        return NULL;
+        return nullptr;
     }
     GrGLContext* glContext = GrGLContext::Create(glInterface, options);
     if (glContext) {
         return new GrGLGpu(glContext, context);
     }
-    return NULL;
+    return nullptr;
 }
 
 static bool gPrintStartupSpew;
@@ -398,17 +398,17 @@
 
 GrTexture* GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
                                          GrWrapOwnership ownership) {
-    if (!this->configToGLFormats(desc.fConfig, false, NULL, NULL, NULL)) {
-        return NULL;
+    if (!this->configToGLFormats(desc.fConfig, false, nullptr, nullptr, nullptr)) {
+        return nullptr;
     }
 
     if (0 == desc.fTextureHandle) {
-        return NULL;
+        return nullptr;
     }
 
     int maxSize = this->caps()->maxTextureSize();
     if (desc.fWidth > maxSize || desc.fHeight > maxSize) {
-        return NULL;
+        return nullptr;
     }
 
     GrGLTexture::IDDesc idDesc;
@@ -442,19 +442,19 @@
         surfDesc.fOrigin = desc.fOrigin;
     }
 
-    GrGLTexture* texture = NULL;
+    GrGLTexture* texture = nullptr;
     if (renderTarget) {
         GrGLRenderTarget::IDDesc rtIDDesc;
         if (!this->createRenderTargetObjects(surfDesc, GrGpuResource::kUncached_LifeCycle,
                                              idDesc.fTextureID, &rtIDDesc)) {
-            return NULL;
+            return nullptr;
         }
         texture = new GrGLTextureRenderTarget(this, surfDesc, idDesc, rtIDDesc);
     } else {
         texture = new GrGLTexture(this, surfDesc, idDesc);
     }
-    if (NULL == texture) {
-        return NULL;
+    if (nullptr == texture) {
+        return nullptr;
     }
 
     return texture;
@@ -564,7 +564,7 @@
                             int left, int top, int width, int height,
                             GrPixelConfig config, const void* buffer,
                             size_t rowBytes) {
-    if (NULL == buffer) {
+    if (nullptr == buffer) {
         return false;
     }
 
@@ -813,7 +813,7 @@
 
     // We only need the internal format for compressed 2D textures.
     GrGLenum internalFormat = 0;
-    if (!this->configToGLFormats(desc.fConfig, false, &internalFormat, NULL, NULL)) {
+    if (!this->configToGLFormats(desc.fConfig, false, &internalFormat, nullptr, nullptr)) {
         return false;
     }
 
@@ -926,8 +926,8 @@
                                      // ES2 and ES3 require sized internal formats for rb storage.
                                      kGLES_GrGLStandard == this->glStandard(),
                                      &msColorFormat,
-                                     NULL,
-                                     NULL)) {
+                                     nullptr,
+                                     nullptr)) {
             goto FAILED;
         }
     } else {
@@ -1001,7 +1001,7 @@
 // good to set a break-point here to know when createTexture fails
 static GrTexture* return_null_texture() {
 //    SkDEBUGFAIL("null texture");
-    return NULL;
+    return nullptr;
 }
 
 #if 0 && defined(SK_DEBUG)
@@ -1294,7 +1294,7 @@
 
     GrGLuint fbo = glrt->renderFBOID();
 
-    if (NULL == sb) {
+    if (nullptr == sb) {
         if (rt->renderTargetPriv().getStencilAttachment()) {
             GL_CALL(FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
                                             GR_GL_STENCIL_ATTACHMENT,
@@ -1372,17 +1372,17 @@
             GL_ALLOC_CALL(this->glInterface(),
                           BufferData(GR_GL_ARRAY_BUFFER,
                                      (GrGLsizeiptr) desc.fSizeInBytes,
-                                     NULL,   // data ptr
+                                     nullptr,   // data ptr
                                      desc.fDynamic ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW));
             if (CHECK_ALLOC_ERROR(this->glInterface()) != GR_GL_NO_ERROR) {
                 GL_CALL(DeleteBuffers(1, &desc.fID));
                 this->notifyVertexBufferDelete(desc.fID);
-                return NULL;
+                return nullptr;
             }
             GrGLVertexBuffer* vertexBuffer = new GrGLVertexBuffer(this, desc);
             return vertexBuffer;
         }
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -1404,17 +1404,17 @@
             GL_ALLOC_CALL(this->glInterface(),
                           BufferData(GR_GL_ELEMENT_ARRAY_BUFFER,
                                      (GrGLsizeiptr) desc.fSizeInBytes,
-                                     NULL,  // data ptr
+                                     nullptr,  // data ptr
                                      desc.fDynamic ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW));
             if (CHECK_ALLOC_ERROR(this->glInterface()) != GR_GL_NO_ERROR) {
                 GL_CALL(DeleteBuffers(1, &desc.fID));
                 this->notifyIndexBufferDelete(desc.fID);
-                return NULL;
+                return nullptr;
             }
             GrIndexBuffer* indexBuffer = new GrGLIndexBuffer(this, desc);
             return indexBuffer;
         }
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -1489,7 +1489,7 @@
 
     // This must come after textures are flushed because a texture may need
     // to be msaa-resolved (which will modify bound FBO state).
-    this->flushRenderTarget(glRT, NULL);
+    this->flushRenderTarget(glRT, nullptr);
 
     return true;
 }
@@ -1503,7 +1503,7 @@
     SkASSERT(vbuf);
     SkASSERT(!vbuf->isMapped());
 
-    GrGLIndexBuffer* ibuf = NULL;
+    GrGLIndexBuffer* ibuf = nullptr;
     if (vertices.isIndexed()) {
         SkASSERT(indexOffsetInBytes);
 
@@ -1638,7 +1638,7 @@
 }
 
 void GrGLGpu::clearStencil(GrRenderTarget* target) {
-    if (NULL == target) {
+    if (nullptr == target) {
         return;
     }
     GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target);
@@ -1799,7 +1799,7 @@
     GrGLenum format = 0;
     GrGLenum type = 0;
     bool flipY = kBottomLeft_GrSurfaceOrigin == surface->origin();
-    if (!this->configToGLFormats(config, false, NULL, &format, &type)) {
+    if (!this->configToGLFormats(config, false, nullptr, &format, &type)) {
         return false;
     }
 
@@ -1947,7 +1947,7 @@
             }
         }
     }
-    if (NULL == bound || !bound->isEmpty()) {
+    if (nullptr == bound || !bound->isEmpty()) {
         target->flagAsNeedingResolve(bound);
     }
 
@@ -2409,13 +2409,13 @@
                                 GrGLenum* externalFormat,
                                 GrGLenum* externalType) const {
     GrGLenum dontCare;
-    if (NULL == internalFormat) {
+    if (nullptr == internalFormat) {
         internalFormat = &dontCare;
     }
-    if (NULL == externalFormat) {
+    if (nullptr == externalFormat) {
         externalFormat = &dontCare;
     }
-    if (NULL == externalType) {
+    if (nullptr == externalType) {
         externalType = &dontCare;
     }
 
@@ -2670,7 +2670,7 @@
 GrGLuint GrGLGpu::bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect* viewport,
                                    TempFBOTarget tempFBOTarget) {
     GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(surface->asRenderTarget());
-    if (NULL == rt) {
+    if (nullptr == rt) {
         SkASSERT(surface->asTexture());
         GrGLuint texID = static_cast<GrGLTexture*>(surface->asTexture())->textureID();
         GrGLuint* tempFBOID;
@@ -2736,7 +2736,7 @@
             return true;
         }
         return false;
-    } else if (NULL == src->asRenderTarget()) {
+    } else if (nullptr == src->asRenderTarget()) {
         // CopyTexSubImage2D or fbo blit would require creating a temp fbo for the src.
         return false;
     }
@@ -3147,7 +3147,7 @@
                                                 const GrGLIndexBuffer* ibuffer) {
     SkASSERT(vbuffer);
     GrGLuint vbufferID = vbuffer->bufferID();
-    GrGLuint* ibufferIDPtr = NULL;
+    GrGLuint* ibufferIDPtr = nullptr;
     GrGLuint ibufferID;
     if (ibuffer) {
         ibufferID = ibuffer->bufferID();
@@ -3158,7 +3158,7 @@
 
 GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBufferToDraw(GrGLGpu* gpu,
                                                                          GrGLuint vbufferID) {
-    return this->internalBind(gpu, vbufferID, NULL);
+    return this->internalBind(gpu, vbufferID, nullptr);
 }
 
 GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBuffersToDraw(GrGLGpu* gpu,
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 4be8a76..f6d6a47 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -254,7 +254,7 @@
     void setScratchTextureUnit();
 
     // bounds is region that may be modified and therefore has to be resolved.
-    // NULL means whole target. Can be an empty rect.
+    // nullptr means whole target. Can be an empty rect.
     void flushRenderTarget(GrGLRenderTarget*, const SkIRect* bounds);
 
     void flushStencil(const GrStencilSettings&);
@@ -339,7 +339,7 @@
      */
     class HWGeometryState {
     public:
-        HWGeometryState() { fVBOVertexArray = NULL; this->invalidate(); }
+        HWGeometryState() { fVBOVertexArray = nullptr; this->invalidate(); }
 
         ~HWGeometryState() { delete fVBOVertexArray; }
 
@@ -418,7 +418,7 @@
         /**
          * Binds the vertex array object that should be used to render from the vertex buffer.
          * The vertex array is bound and its attrib array state object is returned. The vertex
-         * buffer is bound. The index buffer (if non-NULL) is bound to the vertex array. The
+         * buffer is bound. The index buffer (if non-nullptr) is bound to the vertex array. The
          * returned GrGLAttribArrayState should be used to set vertex attribute arrays.
          */
         GrGLAttribArrayState* bindArrayAndBuffersToDraw(GrGLGpu* gpu,
diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp
index c6b673b..d74b54a 100644
--- a/src/gpu/gl/GrGLGpuProgramCache.cpp
+++ b/src/gpu/gl/GrGLGpuProgramCache.cpp
@@ -23,7 +23,7 @@
 
 struct GrGLGpu::ProgramCache::Entry {
     
-    Entry() : fProgram(NULL), fLRUStamp(0) {}
+    Entry() : fProgram(nullptr), fLRUStamp(0) {}
 
     SkAutoTUnref<GrGLProgram>   fProgram;
     unsigned int                fLRUStamp;
@@ -52,7 +52,7 @@
 #endif
 {
     for (int i = 0; i < 1 << kHashBits; ++i) {
-        fHashTable[i] = NULL;
+        fHashTable[i] = nullptr;
     }
 }
 
@@ -95,7 +95,7 @@
     ++fTotalRequests;
 #endif
 
-    Entry* entry = NULL;
+    Entry* entry = nullptr;
 
     uint32_t hashIdx = args.fDesc->getChecksum();
     hashIdx ^= hashIdx >> 16;
@@ -110,7 +110,7 @@
     }
 
     int entryIdx;
-    if (NULL == entry) {
+    if (nullptr == entry) {
         entryIdx = this->search(*args.fDesc);
         if (entryIdx >= 0) {
             entry = fEntries[entryIdx];
@@ -120,14 +120,14 @@
         }
     }
 
-    if (NULL == entry) {
+    if (nullptr == entry) {
         // We have a cache miss
 #ifdef PROGRAM_CACHE_STATS
         ++fCacheMisses;
 #endif
         GrGLProgram* program = GrGLProgramBuilder::CreateProgram(args, fGpu);
-        if (NULL == program) {
-            return NULL;
+        if (nullptr == program) {
+            return nullptr;
         }
         int purgeIdx = 0;
         if (fCount < kMaxEntries) {
@@ -145,7 +145,7 @@
             entry = fEntries[purgeIdx];
             int purgedHashIdx = entry->fProgram->getDesc().getChecksum() & ((1 << kHashBits) - 1);
             if (fHashTable[purgedHashIdx] == entry) {
-                fHashTable[purgedHashIdx] = NULL;
+                fHashTable[purgedHashIdx] = nullptr;
             }
         }
         SkASSERT(fEntries[purgeIdx] == entry);
diff --git a/src/gpu/gl/GrGLIndexBuffer.cpp b/src/gpu/gl/GrGLIndexBuffer.cpp
index 52cf5f8..d60d391 100644
--- a/src/gpu/gl/GrGLIndexBuffer.cpp
+++ b/src/gpu/gl/GrGLIndexBuffer.cpp
@@ -31,7 +31,7 @@
     if (!this->wasDestroyed()) {
         return fImpl.map(this->getGpuGL());
     } else {
-        return NULL;
+        return nullptr;
     }
 }
 
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp
index fca7bf2..ec51797 100644
--- a/src/gpu/gl/GrGLInterface.cpp
+++ b/src/gpu/gl/GrGLInterface.cpp
@@ -39,27 +39,27 @@
     GrGLInterface* newInterface = GrGLInterface::NewClone(interface);
 
     newInterface->fExtensions.remove("GL_NV_path_rendering");
-    newInterface->fFunctions.fPathCommands = NULL;
-    newInterface->fFunctions.fPathParameteri = NULL;
-    newInterface->fFunctions.fPathParameterf = NULL;
-    newInterface->fFunctions.fGenPaths = NULL;
-    newInterface->fFunctions.fDeletePaths = NULL;
-    newInterface->fFunctions.fIsPath = NULL;
-    newInterface->fFunctions.fPathStencilFunc = NULL;
-    newInterface->fFunctions.fStencilFillPath = NULL;
-    newInterface->fFunctions.fStencilStrokePath = NULL;
-    newInterface->fFunctions.fStencilFillPathInstanced = NULL;
-    newInterface->fFunctions.fStencilStrokePathInstanced = NULL;
-    newInterface->fFunctions.fCoverFillPath = NULL;
-    newInterface->fFunctions.fCoverStrokePath = NULL;
-    newInterface->fFunctions.fCoverFillPathInstanced = NULL;
-    newInterface->fFunctions.fCoverStrokePathInstanced = NULL;
-    newInterface->fFunctions.fStencilThenCoverFillPath = NULL;
-    newInterface->fFunctions.fStencilThenCoverStrokePath = NULL;
-    newInterface->fFunctions.fStencilThenCoverFillPathInstanced = NULL;
-    newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = NULL;
-    newInterface->fFunctions.fProgramPathFragmentInputGen = NULL;
-    newInterface->fFunctions.fBindFragmentInputLocation = NULL;
+    newInterface->fFunctions.fPathCommands = nullptr;
+    newInterface->fFunctions.fPathParameteri = nullptr;
+    newInterface->fFunctions.fPathParameterf = nullptr;
+    newInterface->fFunctions.fGenPaths = nullptr;
+    newInterface->fFunctions.fDeletePaths = nullptr;
+    newInterface->fFunctions.fIsPath = nullptr;
+    newInterface->fFunctions.fPathStencilFunc = nullptr;
+    newInterface->fFunctions.fStencilFillPath = nullptr;
+    newInterface->fFunctions.fStencilStrokePath = nullptr;
+    newInterface->fFunctions.fStencilFillPathInstanced = nullptr;
+    newInterface->fFunctions.fStencilStrokePathInstanced = nullptr;
+    newInterface->fFunctions.fCoverFillPath = nullptr;
+    newInterface->fFunctions.fCoverStrokePath = nullptr;
+    newInterface->fFunctions.fCoverFillPathInstanced = nullptr;
+    newInterface->fFunctions.fCoverStrokePathInstanced = nullptr;
+    newInterface->fFunctions.fStencilThenCoverFillPath = nullptr;
+    newInterface->fFunctions.fStencilThenCoverStrokePath = nullptr;
+    newInterface->fFunctions.fStencilThenCoverFillPathInstanced = nullptr;
+    newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = nullptr;
+    newInterface->fFunctions.fProgramPathFragmentInputGen = nullptr;
+    newInterface->fFunctions.fBindFragmentInputLocation = nullptr;
     return newInterface;
 }
 
@@ -107,105 +107,105 @@
     }
 
     // functions that are always required
-    if (NULL == fFunctions.fActiveTexture ||
-        NULL == fFunctions.fAttachShader ||
-        NULL == fFunctions.fBindAttribLocation ||
-        NULL == fFunctions.fBindBuffer ||
-        NULL == fFunctions.fBindTexture ||
-        NULL == fFunctions.fBlendColor ||      // -> GL >= 1.4 or extension, ES >= 2.0
-        NULL == fFunctions.fBlendEquation ||   // -> GL >= 1.4 or extension, ES >= 2.0
-        NULL == fFunctions.fBlendFunc ||
-        NULL == fFunctions.fBufferData ||
-        NULL == fFunctions.fBufferSubData ||
-        NULL == fFunctions.fClear ||
-        NULL == fFunctions.fClearColor ||
-        NULL == fFunctions.fClearStencil ||
-        NULL == fFunctions.fColorMask ||
-        NULL == fFunctions.fCompileShader ||
-        NULL == fFunctions.fCopyTexSubImage2D ||
-        NULL == fFunctions.fCreateProgram ||
-        NULL == fFunctions.fCreateShader ||
-        NULL == fFunctions.fCullFace ||
-        NULL == fFunctions.fDeleteBuffers ||
-        NULL == fFunctions.fDeleteProgram ||
-        NULL == fFunctions.fDeleteShader ||
-        NULL == fFunctions.fDeleteTextures ||
-        NULL == fFunctions.fDepthMask ||
-        NULL == fFunctions.fDisable ||
-        NULL == fFunctions.fDisableVertexAttribArray ||
-        NULL == fFunctions.fDrawArrays ||
-        NULL == fFunctions.fDrawElements ||
-        NULL == fFunctions.fEnable ||
-        NULL == fFunctions.fEnableVertexAttribArray ||
-        NULL == fFunctions.fFrontFace ||
-        NULL == fFunctions.fGenBuffers ||
-        NULL == fFunctions.fGenTextures ||
-        NULL == fFunctions.fGetBufferParameteriv ||
-        NULL == fFunctions.fGenerateMipmap ||
-        NULL == fFunctions.fGetError ||
-        NULL == fFunctions.fGetIntegerv ||
-        NULL == fFunctions.fGetProgramInfoLog ||
-        NULL == fFunctions.fGetProgramiv ||
-        NULL == fFunctions.fGetShaderInfoLog ||
-        NULL == fFunctions.fGetShaderiv ||
-        NULL == fFunctions.fGetString ||
-        NULL == fFunctions.fGetUniformLocation ||
+    if (nullptr == fFunctions.fActiveTexture ||
+        nullptr == fFunctions.fAttachShader ||
+        nullptr == fFunctions.fBindAttribLocation ||
+        nullptr == fFunctions.fBindBuffer ||
+        nullptr == fFunctions.fBindTexture ||
+        nullptr == fFunctions.fBlendColor ||      // -> GL >= 1.4 or extension, ES >= 2.0
+        nullptr == fFunctions.fBlendEquation ||   // -> GL >= 1.4 or extension, ES >= 2.0
+        nullptr == fFunctions.fBlendFunc ||
+        nullptr == fFunctions.fBufferData ||
+        nullptr == fFunctions.fBufferSubData ||
+        nullptr == fFunctions.fClear ||
+        nullptr == fFunctions.fClearColor ||
+        nullptr == fFunctions.fClearStencil ||
+        nullptr == fFunctions.fColorMask ||
+        nullptr == fFunctions.fCompileShader ||
+        nullptr == fFunctions.fCopyTexSubImage2D ||
+        nullptr == fFunctions.fCreateProgram ||
+        nullptr == fFunctions.fCreateShader ||
+        nullptr == fFunctions.fCullFace ||
+        nullptr == fFunctions.fDeleteBuffers ||
+        nullptr == fFunctions.fDeleteProgram ||
+        nullptr == fFunctions.fDeleteShader ||
+        nullptr == fFunctions.fDeleteTextures ||
+        nullptr == fFunctions.fDepthMask ||
+        nullptr == fFunctions.fDisable ||
+        nullptr == fFunctions.fDisableVertexAttribArray ||
+        nullptr == fFunctions.fDrawArrays ||
+        nullptr == fFunctions.fDrawElements ||
+        nullptr == fFunctions.fEnable ||
+        nullptr == fFunctions.fEnableVertexAttribArray ||
+        nullptr == fFunctions.fFrontFace ||
+        nullptr == fFunctions.fGenBuffers ||
+        nullptr == fFunctions.fGenTextures ||
+        nullptr == fFunctions.fGetBufferParameteriv ||
+        nullptr == fFunctions.fGenerateMipmap ||
+        nullptr == fFunctions.fGetError ||
+        nullptr == fFunctions.fGetIntegerv ||
+        nullptr == fFunctions.fGetProgramInfoLog ||
+        nullptr == fFunctions.fGetProgramiv ||
+        nullptr == fFunctions.fGetShaderInfoLog ||
+        nullptr == fFunctions.fGetShaderiv ||
+        nullptr == fFunctions.fGetString ||
+        nullptr == fFunctions.fGetUniformLocation ||
 #if 0 //  Not included in Chrome yet
-        NULL == fFunctions.fIsTexture ||
+        nullptr == fFunctions.fIsTexture ||
 #endif
-        NULL == fFunctions.fLinkProgram ||
-        NULL == fFunctions.fLineWidth ||
-        NULL == fFunctions.fPixelStorei ||
-        NULL == fFunctions.fReadPixels ||
-        NULL == fFunctions.fScissor ||
-        NULL == fFunctions.fShaderSource ||
-        NULL == fFunctions.fStencilFunc ||
-        NULL == fFunctions.fStencilMask ||
-        NULL == fFunctions.fStencilOp ||
-        NULL == fFunctions.fTexImage2D ||
-        NULL == fFunctions.fTexParameteri ||
-        NULL == fFunctions.fTexParameteriv ||
-        NULL == fFunctions.fTexSubImage2D ||
-        NULL == fFunctions.fUniform1f ||
-        NULL == fFunctions.fUniform1i ||
-        NULL == fFunctions.fUniform1fv ||
-        NULL == fFunctions.fUniform1iv ||
-        NULL == fFunctions.fUniform2f ||
-        NULL == fFunctions.fUniform2i ||
-        NULL == fFunctions.fUniform2fv ||
-        NULL == fFunctions.fUniform2iv ||
-        NULL == fFunctions.fUniform3f ||
-        NULL == fFunctions.fUniform3i ||
-        NULL == fFunctions.fUniform3fv ||
-        NULL == fFunctions.fUniform3iv ||
-        NULL == fFunctions.fUniform4f ||
-        NULL == fFunctions.fUniform4i ||
-        NULL == fFunctions.fUniform4fv ||
-        NULL == fFunctions.fUniform4iv ||
-        NULL == fFunctions.fUniformMatrix2fv ||
-        NULL == fFunctions.fUniformMatrix3fv ||
-        NULL == fFunctions.fUniformMatrix4fv ||
-        NULL == fFunctions.fUseProgram ||
-        NULL == fFunctions.fVertexAttrib1f ||
-        NULL == fFunctions.fVertexAttrib2fv ||
-        NULL == fFunctions.fVertexAttrib3fv ||
-        NULL == fFunctions.fVertexAttrib4fv ||
-        NULL == fFunctions.fVertexAttribPointer ||
-        NULL == fFunctions.fViewport ||
-        NULL == fFunctions.fBindFramebuffer ||
-        NULL == fFunctions.fBindRenderbuffer ||
-        NULL == fFunctions.fCheckFramebufferStatus ||
-        NULL == fFunctions.fDeleteFramebuffers ||
-        NULL == fFunctions.fDeleteRenderbuffers ||
-        NULL == fFunctions.fFinish ||
-        NULL == fFunctions.fFlush ||
-        NULL == fFunctions.fFramebufferRenderbuffer ||
-        NULL == fFunctions.fFramebufferTexture2D ||
-        NULL == fFunctions.fGetFramebufferAttachmentParameteriv ||
-        NULL == fFunctions.fGetRenderbufferParameteriv ||
-        NULL == fFunctions.fGenFramebuffers ||
-        NULL == fFunctions.fGenRenderbuffers ||
-        NULL == fFunctions.fRenderbufferStorage) {
+        nullptr == fFunctions.fLinkProgram ||
+        nullptr == fFunctions.fLineWidth ||
+        nullptr == fFunctions.fPixelStorei ||
+        nullptr == fFunctions.fReadPixels ||
+        nullptr == fFunctions.fScissor ||
+        nullptr == fFunctions.fShaderSource ||
+        nullptr == fFunctions.fStencilFunc ||
+        nullptr == fFunctions.fStencilMask ||
+        nullptr == fFunctions.fStencilOp ||
+        nullptr == fFunctions.fTexImage2D ||
+        nullptr == fFunctions.fTexParameteri ||
+        nullptr == fFunctions.fTexParameteriv ||
+        nullptr == fFunctions.fTexSubImage2D ||
+        nullptr == fFunctions.fUniform1f ||
+        nullptr == fFunctions.fUniform1i ||
+        nullptr == fFunctions.fUniform1fv ||
+        nullptr == fFunctions.fUniform1iv ||
+        nullptr == fFunctions.fUniform2f ||
+        nullptr == fFunctions.fUniform2i ||
+        nullptr == fFunctions.fUniform2fv ||
+        nullptr == fFunctions.fUniform2iv ||
+        nullptr == fFunctions.fUniform3f ||
+        nullptr == fFunctions.fUniform3i ||
+        nullptr == fFunctions.fUniform3fv ||
+        nullptr == fFunctions.fUniform3iv ||
+        nullptr == fFunctions.fUniform4f ||
+        nullptr == fFunctions.fUniform4i ||
+        nullptr == fFunctions.fUniform4fv ||
+        nullptr == fFunctions.fUniform4iv ||
+        nullptr == fFunctions.fUniformMatrix2fv ||
+        nullptr == fFunctions.fUniformMatrix3fv ||
+        nullptr == fFunctions.fUniformMatrix4fv ||
+        nullptr == fFunctions.fUseProgram ||
+        nullptr == fFunctions.fVertexAttrib1f ||
+        nullptr == fFunctions.fVertexAttrib2fv ||
+        nullptr == fFunctions.fVertexAttrib3fv ||
+        nullptr == fFunctions.fVertexAttrib4fv ||
+        nullptr == fFunctions.fVertexAttribPointer ||
+        nullptr == fFunctions.fViewport ||
+        nullptr == fFunctions.fBindFramebuffer ||
+        nullptr == fFunctions.fBindRenderbuffer ||
+        nullptr == fFunctions.fCheckFramebufferStatus ||
+        nullptr == fFunctions.fDeleteFramebuffers ||
+        nullptr == fFunctions.fDeleteRenderbuffers ||
+        nullptr == fFunctions.fFinish ||
+        nullptr == fFunctions.fFlush ||
+        nullptr == fFunctions.fFramebufferRenderbuffer ||
+        nullptr == fFunctions.fFramebufferTexture2D ||
+        nullptr == fFunctions.fGetFramebufferAttachmentParameteriv ||
+        nullptr == fFunctions.fGetRenderbufferParameteriv ||
+        nullptr == fFunctions.fGenFramebuffers ||
+        nullptr == fFunctions.fGenRenderbuffers ||
+        nullptr == fFunctions.fRenderbufferStorage) {
         RETURN_FALSE_INTERFACE
     }
 
@@ -222,50 +222,50 @@
     // On the desktop we assume they are available if the extension
     // is present or GL version is high enough.
     if (kGLES_GrGLStandard == fStandard) {
-        if (NULL == fFunctions.fStencilFuncSeparate ||
-            NULL == fFunctions.fStencilMaskSeparate ||
-            NULL == fFunctions.fStencilOpSeparate) {
+        if (nullptr == fFunctions.fStencilFuncSeparate ||
+            nullptr == fFunctions.fStencilMaskSeparate ||
+            nullptr == fFunctions.fStencilOpSeparate) {
             RETURN_FALSE_INTERFACE
         }
     } else if (kGL_GrGLStandard == fStandard) {
 
         if (glVer >= GR_GL_VER(2,0)) {
-            if (NULL == fFunctions.fStencilFuncSeparate ||
-                NULL == fFunctions.fStencilMaskSeparate ||
-                NULL == fFunctions.fStencilOpSeparate) {
+            if (nullptr == fFunctions.fStencilFuncSeparate ||
+                nullptr == fFunctions.fStencilMaskSeparate ||
+                nullptr == fFunctions.fStencilOpSeparate) {
                 RETURN_FALSE_INTERFACE
             }
         }
-        if (glVer >= GR_GL_VER(3,0) && NULL == fFunctions.fBindFragDataLocation) {
+        if (glVer >= GR_GL_VER(3,0) && nullptr == fFunctions.fBindFragDataLocation) {
             RETURN_FALSE_INTERFACE
         }
         if (glVer >= GR_GL_VER(2,0) || fExtensions.has("GL_ARB_draw_buffers")) {
-            if (NULL == fFunctions.fDrawBuffers) {
+            if (nullptr == fFunctions.fDrawBuffers) {
                 RETURN_FALSE_INTERFACE
             }
         }
 
         if (glVer >= GR_GL_VER(1,5) || fExtensions.has("GL_ARB_occlusion_query")) {
-            if (NULL == fFunctions.fGenQueries ||
-                NULL == fFunctions.fDeleteQueries ||
-                NULL == fFunctions.fBeginQuery ||
-                NULL == fFunctions.fEndQuery ||
-                NULL == fFunctions.fGetQueryiv ||
-                NULL == fFunctions.fGetQueryObjectiv ||
-                NULL == fFunctions.fGetQueryObjectuiv) {
+            if (nullptr == fFunctions.fGenQueries ||
+                nullptr == fFunctions.fDeleteQueries ||
+                nullptr == fFunctions.fBeginQuery ||
+                nullptr == fFunctions.fEndQuery ||
+                nullptr == fFunctions.fGetQueryiv ||
+                nullptr == fFunctions.fGetQueryObjectiv ||
+                nullptr == fFunctions.fGetQueryObjectuiv) {
                 RETURN_FALSE_INTERFACE
             }
         }
         if (glVer >= GR_GL_VER(3,3) ||
             fExtensions.has("GL_ARB_timer_query") ||
             fExtensions.has("GL_EXT_timer_query")) {
-            if (NULL == fFunctions.fGetQueryObjecti64v ||
-                NULL == fFunctions.fGetQueryObjectui64v) {
+            if (nullptr == fFunctions.fGetQueryObjecti64v ||
+                nullptr == fFunctions.fGetQueryObjectui64v) {
                 RETURN_FALSE_INTERFACE
             }
         }
         if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) {
-            if (NULL == fFunctions.fQueryCounter) {
+            if (nullptr == fFunctions.fQueryCounter) {
                 RETURN_FALSE_INTERFACE
             }
         }
@@ -275,9 +275,9 @@
     if (kGL_GrGLStandard != fStandard ||
         (glVer >= GR_GL_VER(1,3)) ||
         fExtensions.has("GL_ARB_texture_compression")) {
-        if (NULL == fFunctions.fCompressedTexImage2D
+        if (nullptr == fFunctions.fCompressedTexImage2D
 #if 0
-            || NULL == fFunctions.fCompressedTexSubImage2D
+            || nullptr == fFunctions.fCompressedTexSubImage2D
 #endif
             ) {
             RETURN_FALSE_INTERFACE
@@ -286,9 +286,9 @@
 
     // part of desktop GL, but not ES
     if (kGL_GrGLStandard == fStandard &&
-        (NULL == fFunctions.fGetTexLevelParameteriv ||
-         NULL == fFunctions.fDrawBuffer ||
-         NULL == fFunctions.fReadBuffer)) {
+        (nullptr == fFunctions.fGetTexLevelParameteriv ||
+         nullptr == fFunctions.fDrawBuffer ||
+         nullptr == fFunctions.fReadBuffer)) {
         RETURN_FALSE_INTERFACE
     }
 
@@ -298,12 +298,12 @@
         if (glVer >= GR_GL_VER(4,2) ||
             fExtensions.has("GL_ARB_texture_storage") ||
             fExtensions.has("GL_EXT_texture_storage")) {
-            if (NULL == fFunctions.fTexStorage2D) {
+            if (nullptr == fFunctions.fTexStorage2D) {
                 RETURN_FALSE_INTERFACE
             }
         }
     } else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storage")) {
-        if (NULL == fFunctions.fTexStorage2D) {
+        if (nullptr == fFunctions.fTexStorage2D) {
             RETURN_FALSE_INTERFACE
         }
     }
@@ -313,19 +313,19 @@
         if (glVer >= GR_GL_VER(4,5) ||
             fExtensions.has("GL_ARB_texture_barrier") ||
             fExtensions.has("GL_NV_texture_barrier")) {
-            if (NULL == fFunctions.fTextureBarrier) {
+            if (nullptr == fFunctions.fTextureBarrier) {
                 RETURN_FALSE_INTERFACE
             }
         }
     } else if (fExtensions.has("GL_NV_texture_barrier")) {
-        if (NULL == fFunctions.fTextureBarrier) {
+        if (nullptr == fFunctions.fTextureBarrier) {
             RETURN_FALSE_INTERFACE
         }
     }
 
     if (fExtensions.has("GL_KHR_blend_equation_advanced") ||
         fExtensions.has("GL_NV_blend_equation_advanced")) {
-        if (NULL == fFunctions.fBlendBarrier) {
+        if (nullptr == fFunctions.fBlendBarrier) {
             RETURN_FALSE_INTERFACE
         }
     }
@@ -333,7 +333,7 @@
     if (fExtensions.has("GL_EXT_discard_framebuffer")) {
 // FIXME: Remove this once Chromium is updated to provide this function
 #if 0
-        if (NULL == fFunctions.fDiscardFramebuffer) {
+        if (nullptr == fFunctions.fDiscardFramebuffer) {
             RETURN_FALSE_INTERFACE
         }
 #endif
@@ -343,37 +343,37 @@
     if (kGL_GrGLStandard == fStandard) {
         // GL 3.0 and the ARB extension have multisample + blit
         if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_ARB_framebuffer_object")) {
-            if (NULL == fFunctions.fRenderbufferStorageMultisample ||
-                NULL == fFunctions.fBlitFramebuffer) {
+            if (nullptr == fFunctions.fRenderbufferStorageMultisample ||
+                nullptr == fFunctions.fBlitFramebuffer) {
                 RETURN_FALSE_INTERFACE
             }
         } else {
             if (fExtensions.has("GL_EXT_framebuffer_blit") &&
-                NULL == fFunctions.fBlitFramebuffer) {
+                nullptr == fFunctions.fBlitFramebuffer) {
                 RETURN_FALSE_INTERFACE
             }
             if (fExtensions.has("GL_EXT_framebuffer_multisample") &&
-                NULL == fFunctions.fRenderbufferStorageMultisample) {
+                nullptr == fFunctions.fRenderbufferStorageMultisample) {
                 RETURN_FALSE_INTERFACE
             }
         }
     } else {
         if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_CHROMIUM_framebuffer_multisample")) {
-            if (NULL == fFunctions.fRenderbufferStorageMultisample ||
-                NULL == fFunctions.fBlitFramebuffer) {
+            if (nullptr == fFunctions.fRenderbufferStorageMultisample ||
+                nullptr == fFunctions.fBlitFramebuffer) {
                 RETURN_FALSE_INTERFACE
             }
         }
         if (fExtensions.has("GL_APPLE_framebuffer_multisample")) {
-            if (NULL == fFunctions.fRenderbufferStorageMultisampleES2APPLE ||
-                NULL == fFunctions.fResolveMultisampleFramebuffer) {
+            if (nullptr == fFunctions.fRenderbufferStorageMultisampleES2APPLE ||
+                nullptr == fFunctions.fResolveMultisampleFramebuffer) {
                 RETURN_FALSE_INTERFACE
             }
         }
         if (fExtensions.has("GL_IMG_multisampled_render_to_texture") ||
             fExtensions.has("GL_EXT_multisampled_render_to_texture")) {
-            if (NULL == fFunctions.fRenderbufferStorageMultisampleES2EXT ||
-                NULL == fFunctions.fFramebufferTexture2DMultisample) {
+            if (nullptr == fFunctions.fRenderbufferStorageMultisampleES2EXT ||
+                nullptr == fFunctions.fFramebufferTexture2DMultisample) {
                 RETURN_FALSE_INTERFACE
             }
         }
@@ -383,8 +383,8 @@
     // buffer mapping was part of original VBO extension
     // which we require.
     if (kGL_GrGLStandard == fStandard || fExtensions.has("GL_OES_mapbuffer")) {
-        if (NULL == fFunctions.fMapBuffer ||
-            NULL == fFunctions.fUnmapBuffer) {
+        if (nullptr == fFunctions.fMapBuffer ||
+            nullptr == fFunctions.fUnmapBuffer) {
             RETURN_FALSE_INTERFACE
         }
     }
@@ -392,14 +392,14 @@
     // Dual source blending
     if (kGL_GrGLStandard == fStandard) {
         if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_blend_func_extended")) {
-            if (NULL == fFunctions.fBindFragDataLocationIndexed) {
+            if (nullptr == fFunctions.fBindFragDataLocationIndexed) {
                 RETURN_FALSE_INTERFACE
             }
         }
     } else {
         if (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extended")) {
-            if (NULL == fFunctions.fBindFragDataLocation ||
-                NULL == fFunctions.fBindFragDataLocationIndexed) {
+            if (nullptr == fFunctions.fBindFragDataLocation ||
+                nullptr == fFunctions.fBindFragDataLocationIndexed) {
                 RETURN_FALSE_INTERFACE
             }
         }
@@ -408,60 +408,60 @@
 
     // glGetStringi was added in version 3.0 of both desktop and ES.
     if (glVer >= GR_GL_VER(3, 0)) {
-        if (NULL == fFunctions.fGetStringi) {
+        if (nullptr == fFunctions.fGetStringi) {
             RETURN_FALSE_INTERFACE
         }
     }
 
     if (kGL_GrGLStandard == fStandard) {
         if (glVer >= GR_GL_VER(3, 0) || fExtensions.has("GL_ARB_vertex_array_object")) {
-            if (NULL == fFunctions.fBindVertexArray ||
-                NULL == fFunctions.fDeleteVertexArrays ||
-                NULL == fFunctions.fGenVertexArrays) {
+            if (nullptr == fFunctions.fBindVertexArray ||
+                nullptr == fFunctions.fDeleteVertexArrays ||
+                nullptr == fFunctions.fGenVertexArrays) {
                 RETURN_FALSE_INTERFACE
             }
         }
     } else {
         if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_object")) {
-            if (NULL == fFunctions.fBindVertexArray ||
-                NULL == fFunctions.fDeleteVertexArrays ||
-                NULL == fFunctions.fGenVertexArrays) {
+            if (nullptr == fFunctions.fBindVertexArray ||
+                nullptr == fFunctions.fDeleteVertexArrays ||
+                nullptr == fFunctions.fGenVertexArrays) {
                 RETURN_FALSE_INTERFACE
             }
         }
     }
 
     if (fExtensions.has("GL_EXT_debug_marker")) {
-        if (NULL == fFunctions.fInsertEventMarker ||
-            NULL == fFunctions.fPushGroupMarker ||
-            NULL == fFunctions.fPopGroupMarker) {
+        if (nullptr == fFunctions.fInsertEventMarker ||
+            nullptr == fFunctions.fPushGroupMarker ||
+            nullptr == fFunctions.fPopGroupMarker) {
             RETURN_FALSE_INTERFACE
         }
     }
 
     if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
         fExtensions.has("GL_ARB_invalidate_subdata")) {
-        if (NULL == fFunctions.fInvalidateBufferData ||
-            NULL == fFunctions.fInvalidateBufferSubData ||
-            NULL == fFunctions.fInvalidateFramebuffer ||
-            NULL == fFunctions.fInvalidateSubFramebuffer ||
-            NULL == fFunctions.fInvalidateTexImage ||
-            NULL == fFunctions.fInvalidateTexSubImage) {
+        if (nullptr == fFunctions.fInvalidateBufferData ||
+            nullptr == fFunctions.fInvalidateBufferSubData ||
+            nullptr == fFunctions.fInvalidateFramebuffer ||
+            nullptr == fFunctions.fInvalidateSubFramebuffer ||
+            nullptr == fFunctions.fInvalidateTexImage ||
+            nullptr == fFunctions.fInvalidateTexSubImage) {
             RETURN_FALSE_INTERFACE;
         }
     } else if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) {
         // ES 3.0 adds the framebuffer functions but not the others.
-        if (NULL == fFunctions.fInvalidateFramebuffer ||
-            NULL == fFunctions.fInvalidateSubFramebuffer) {
+        if (nullptr == fFunctions.fInvalidateFramebuffer ||
+            nullptr == fFunctions.fInvalidateSubFramebuffer) {
             RETURN_FALSE_INTERFACE;
         }
     }
 
     if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub")) {
-        if (NULL == fFunctions.fMapBufferSubData ||
-            NULL == fFunctions.fMapTexSubImage2D ||
-            NULL == fFunctions.fUnmapBufferSubData ||
-            NULL == fFunctions.fUnmapTexSubImage2D) {
+        if (nullptr == fFunctions.fMapBufferSubData ||
+            nullptr == fFunctions.fMapTexSubImage2D ||
+            nullptr == fFunctions.fUnmapBufferSubData ||
+            nullptr == fFunctions.fUnmapTexSubImage2D) {
             RETURN_FALSE_INTERFACE;
         }
     }
@@ -470,8 +470,8 @@
     if (glVer >= GR_GL_VER(3,0) ||
         (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_range")) ||
         (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_range"))) {
-        if (NULL == fFunctions.fMapBufferRange ||
-            NULL == fFunctions.fFlushMappedBufferRange) {
+        if (nullptr == fFunctions.fMapBufferRange ||
+            nullptr == fFunctions.fFlushMappedBufferRange) {
             RETURN_FALSE_INTERFACE;
         }
     }
@@ -479,7 +479,7 @@
     if ((kGL_GrGLStandard == fStandard &&
          (glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_program_interface_query"))) ||
         (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) {
-        if (NULL == fFunctions.fGetProgramResourceLocation) {
+        if (nullptr == fFunctions.fGetProgramResourceLocation) {
             RETURN_FALSE_INTERFACE
         }
     }
@@ -487,59 +487,59 @@
     if (kGLES_GrGLStandard == fStandard || glVer >= GR_GL_VER(4,1) ||
         fExtensions.has("GL_ARB_ES2_compatibility")) {
 #if 0 // Enable this once Chrome gives us the function ptr
-        if (NULL == fFunctions.fGetShaderPrecisionFormat) {
+        if (nullptr == fFunctions.fGetShaderPrecisionFormat) {
             RETURN_FALSE_INTERFACE
         }
 #endif
     }
 
     if (fExtensions.has("GL_NV_path_rendering") || fExtensions.has("GL_CHROMIUM_path_rendering")) {
-        if (NULL == fFunctions.fMatrixLoadf ||
-            NULL == fFunctions.fMatrixLoadIdentity ||
-            NULL == fFunctions.fPathCommands ||
-            NULL == fFunctions.fPathParameteri ||
-            NULL == fFunctions.fPathParameterf ||
-            NULL == fFunctions.fGenPaths ||
-            NULL == fFunctions.fDeletePaths ||
-            NULL == fFunctions.fIsPath ||
-            NULL == fFunctions.fPathStencilFunc ||
-            NULL == fFunctions.fStencilFillPath ||
-            NULL == fFunctions.fStencilStrokePath ||
-            NULL == fFunctions.fStencilFillPathInstanced ||
-            NULL == fFunctions.fStencilStrokePathInstanced ||
-            NULL == fFunctions.fCoverFillPath ||
-            NULL == fFunctions.fCoverStrokePath ||
-            NULL == fFunctions.fCoverFillPathInstanced ||
-            NULL == fFunctions.fCoverStrokePathInstanced
+        if (nullptr == fFunctions.fMatrixLoadf ||
+            nullptr == fFunctions.fMatrixLoadIdentity ||
+            nullptr == fFunctions.fPathCommands ||
+            nullptr == fFunctions.fPathParameteri ||
+            nullptr == fFunctions.fPathParameterf ||
+            nullptr == fFunctions.fGenPaths ||
+            nullptr == fFunctions.fDeletePaths ||
+            nullptr == fFunctions.fIsPath ||
+            nullptr == fFunctions.fPathStencilFunc ||
+            nullptr == fFunctions.fStencilFillPath ||
+            nullptr == fFunctions.fStencilStrokePath ||
+            nullptr == fFunctions.fStencilFillPathInstanced ||
+            nullptr == fFunctions.fStencilStrokePathInstanced ||
+            nullptr == fFunctions.fCoverFillPath ||
+            nullptr == fFunctions.fCoverStrokePath ||
+            nullptr == fFunctions.fCoverFillPathInstanced ||
+            nullptr == fFunctions.fCoverStrokePathInstanced
 #if 0
             // List of functions that Skia uses, but which have been added since the initial release
             // of NV_path_rendering driver. We do not want to fail interface validation due to
             // missing features, we will just not use the extension.
             // Update this list -> update GrGLCaps::hasPathRenderingSupport too.
-            || NULL == fFunctions.fStencilThenCoverFillPath ||
-            NULL == fFunctions.fStencilThenCoverStrokePath ||
-            NULL == fFunctions.fStencilThenCoverFillPathInstanced ||
-            NULL == fFunctions.fStencilThenCoverStrokePathInstanced ||
-            NULL == fFunctions.fProgramPathFragmentInputGen
+            || nullptr == fFunctions.fStencilThenCoverFillPath ||
+            nullptr == fFunctions.fStencilThenCoverStrokePath ||
+            nullptr == fFunctions.fStencilThenCoverFillPathInstanced ||
+            nullptr == fFunctions.fStencilThenCoverStrokePathInstanced ||
+            nullptr == fFunctions.fProgramPathFragmentInputGen
 #endif
             ) {
             RETURN_FALSE_INTERFACE
         }
         if (fExtensions.has("GL_CHROMIUM_path_rendering")) {
-            if (NULL == fFunctions.fBindFragmentInputLocation) {
+            if (nullptr == fFunctions.fBindFragmentInputLocation) {
                 RETURN_FALSE_INTERFACE
             }
         }
     }
 
     if (fExtensions.has("GL_EXT_raster_multisample")) {
-        if (NULL == fFunctions.fRasterSamples) {
+        if (nullptr == fFunctions.fRasterSamples) {
             RETURN_FALSE_INTERFACE
         }
     }
 
     if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) {
-        if (NULL == fFunctions.fCoverageModulation) {
+        if (nullptr == fFunctions.fCoverageModulation) {
             RETURN_FALSE_INTERFACE
         }
     }
@@ -548,8 +548,8 @@
         (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
         fExtensions.has("GL_ARB_draw_instanced") ||
         fExtensions.has("GL_EXT_draw_instanced")) {
-        if (NULL == fFunctions.fDrawArraysInstanced ||
-            NULL == fFunctions.fDrawElementsInstanced) {
+        if (nullptr == fFunctions.fDrawArraysInstanced ||
+            nullptr == fFunctions.fDrawElementsInstanced) {
             RETURN_FALSE_INTERFACE
         }
     }
@@ -558,144 +558,144 @@
         (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
         fExtensions.has("GL_ARB_instanced_arrays") ||
         fExtensions.has("GL_EXT_instanced_arrays")) {
-        if (NULL == fFunctions.fVertexAttribDivisor) {
+        if (nullptr == fFunctions.fVertexAttribDivisor) {
             RETURN_FALSE_INTERFACE
         }
     }
 
     if (fExtensions.has("GL_NV_bindless_texture")) {
-        if (NULL == fFunctions.fGetTextureHandle ||
-            NULL == fFunctions.fGetTextureSamplerHandle ||
-            NULL == fFunctions.fMakeTextureHandleResident ||
-            NULL == fFunctions.fMakeTextureHandleNonResident ||
-            NULL == fFunctions.fGetImageHandle ||
-            NULL == fFunctions.fMakeImageHandleResident ||
-            NULL == fFunctions.fMakeImageHandleNonResident ||
-            NULL == fFunctions.fIsTextureHandleResident ||
-            NULL == fFunctions.fIsImageHandleResident ||
-            NULL == fFunctions.fUniformHandleui64 ||
-            NULL == fFunctions.fUniformHandleui64v ||
-            NULL == fFunctions.fProgramUniformHandleui64 ||
-            NULL == fFunctions.fProgramUniformHandleui64v) {
+        if (nullptr == fFunctions.fGetTextureHandle ||
+            nullptr == fFunctions.fGetTextureSamplerHandle ||
+            nullptr == fFunctions.fMakeTextureHandleResident ||
+            nullptr == fFunctions.fMakeTextureHandleNonResident ||
+            nullptr == fFunctions.fGetImageHandle ||
+            nullptr == fFunctions.fMakeImageHandleResident ||
+            nullptr == fFunctions.fMakeImageHandleNonResident ||
+            nullptr == fFunctions.fIsTextureHandleResident ||
+            nullptr == fFunctions.fIsImageHandleResident ||
+            nullptr == fFunctions.fUniformHandleui64 ||
+            nullptr == fFunctions.fUniformHandleui64v ||
+            nullptr == fFunctions.fProgramUniformHandleui64 ||
+            nullptr == fFunctions.fProgramUniformHandleui64v) {
             RETURN_FALSE_INTERFACE
         }
     }
 
     if (kGL_GrGLStandard == fStandard && fExtensions.has("GL_EXT_direct_state_access")) {
-        if (NULL == fFunctions.fTextureParameteri ||
-            NULL == fFunctions.fTextureParameteriv ||
-            NULL == fFunctions.fTextureParameterf ||
-            NULL == fFunctions.fTextureParameterfv ||
-            NULL == fFunctions.fTextureImage1D ||
-            NULL == fFunctions.fTextureImage2D ||
-            NULL == fFunctions.fTextureSubImage1D ||
-            NULL == fFunctions.fTextureSubImage2D ||
-            NULL == fFunctions.fCopyTextureImage1D ||
-            NULL == fFunctions.fCopyTextureImage2D ||
-            NULL == fFunctions.fCopyTextureSubImage1D ||
-            NULL == fFunctions.fCopyTextureSubImage2D ||
-            NULL == fFunctions.fGetTextureImage ||
-            NULL == fFunctions.fGetTextureParameterfv ||
-            NULL == fFunctions.fGetTextureParameteriv ||
-            NULL == fFunctions.fGetTextureLevelParameterfv ||
-            NULL == fFunctions.fGetTextureLevelParameteriv) {
+        if (nullptr == fFunctions.fTextureParameteri ||
+            nullptr == fFunctions.fTextureParameteriv ||
+            nullptr == fFunctions.fTextureParameterf ||
+            nullptr == fFunctions.fTextureParameterfv ||
+            nullptr == fFunctions.fTextureImage1D ||
+            nullptr == fFunctions.fTextureImage2D ||
+            nullptr == fFunctions.fTextureSubImage1D ||
+            nullptr == fFunctions.fTextureSubImage2D ||
+            nullptr == fFunctions.fCopyTextureImage1D ||
+            nullptr == fFunctions.fCopyTextureImage2D ||
+            nullptr == fFunctions.fCopyTextureSubImage1D ||
+            nullptr == fFunctions.fCopyTextureSubImage2D ||
+            nullptr == fFunctions.fGetTextureImage ||
+            nullptr == fFunctions.fGetTextureParameterfv ||
+            nullptr == fFunctions.fGetTextureParameteriv ||
+            nullptr == fFunctions.fGetTextureLevelParameterfv ||
+            nullptr == fFunctions.fGetTextureLevelParameteriv) {
             RETURN_FALSE_INTERFACE
         }
         if (glVer >= GR_GL_VER(1,2)) {
-            if (NULL == fFunctions.fTextureImage3D ||
-                NULL == fFunctions.fTextureSubImage3D ||
-                NULL == fFunctions.fCopyTextureSubImage3D ||
-                NULL == fFunctions.fCompressedTextureImage3D ||
-                NULL == fFunctions.fCompressedTextureImage2D ||
-                NULL == fFunctions.fCompressedTextureImage1D ||
-                NULL == fFunctions.fCompressedTextureSubImage3D ||
-                NULL == fFunctions.fCompressedTextureSubImage2D ||
-                NULL == fFunctions.fCompressedTextureSubImage1D ||
-                NULL == fFunctions.fGetCompressedTextureImage) {
+            if (nullptr == fFunctions.fTextureImage3D ||
+                nullptr == fFunctions.fTextureSubImage3D ||
+                nullptr == fFunctions.fCopyTextureSubImage3D ||
+                nullptr == fFunctions.fCompressedTextureImage3D ||
+                nullptr == fFunctions.fCompressedTextureImage2D ||
+                nullptr == fFunctions.fCompressedTextureImage1D ||
+                nullptr == fFunctions.fCompressedTextureSubImage3D ||
+                nullptr == fFunctions.fCompressedTextureSubImage2D ||
+                nullptr == fFunctions.fCompressedTextureSubImage1D ||
+                nullptr == fFunctions.fGetCompressedTextureImage) {
                 RETURN_FALSE_INTERFACE
             }
         }
         if (glVer >= GR_GL_VER(1,5)) {
-            if (NULL == fFunctions.fNamedBufferData ||
-                NULL == fFunctions.fNamedBufferSubData ||
-                NULL == fFunctions.fMapNamedBuffer ||
-                NULL == fFunctions.fUnmapNamedBuffer ||
-                NULL == fFunctions.fGetNamedBufferParameteriv ||
-                NULL == fFunctions.fGetNamedBufferPointerv ||
-                NULL == fFunctions.fGetNamedBufferSubData) {
+            if (nullptr == fFunctions.fNamedBufferData ||
+                nullptr == fFunctions.fNamedBufferSubData ||
+                nullptr == fFunctions.fMapNamedBuffer ||
+                nullptr == fFunctions.fUnmapNamedBuffer ||
+                nullptr == fFunctions.fGetNamedBufferParameteriv ||
+                nullptr == fFunctions.fGetNamedBufferPointerv ||
+                nullptr == fFunctions.fGetNamedBufferSubData) {
                 RETURN_FALSE_INTERFACE
             }
         }
         if (glVer >= GR_GL_VER(2,0)) {
-            if (NULL == fFunctions.fProgramUniform1f ||
-                NULL == fFunctions.fProgramUniform2f ||
-                NULL == fFunctions.fProgramUniform3f ||
-                NULL == fFunctions.fProgramUniform4f ||
-                NULL == fFunctions.fProgramUniform1i ||
-                NULL == fFunctions.fProgramUniform2i ||
-                NULL == fFunctions.fProgramUniform3i ||
-                NULL == fFunctions.fProgramUniform4i ||
-                NULL == fFunctions.fProgramUniform1fv ||
-                NULL == fFunctions.fProgramUniform2fv ||
-                NULL == fFunctions.fProgramUniform3fv ||
-                NULL == fFunctions.fProgramUniform4fv ||
-                NULL == fFunctions.fProgramUniform1iv ||
-                NULL == fFunctions.fProgramUniform2iv ||
-                NULL == fFunctions.fProgramUniform3iv ||
-                NULL == fFunctions.fProgramUniform4iv ||
-                NULL == fFunctions.fProgramUniformMatrix2fv ||
-                NULL == fFunctions.fProgramUniformMatrix3fv ||
-                NULL == fFunctions.fProgramUniformMatrix4fv) {
+            if (nullptr == fFunctions.fProgramUniform1f ||
+                nullptr == fFunctions.fProgramUniform2f ||
+                nullptr == fFunctions.fProgramUniform3f ||
+                nullptr == fFunctions.fProgramUniform4f ||
+                nullptr == fFunctions.fProgramUniform1i ||
+                nullptr == fFunctions.fProgramUniform2i ||
+                nullptr == fFunctions.fProgramUniform3i ||
+                nullptr == fFunctions.fProgramUniform4i ||
+                nullptr == fFunctions.fProgramUniform1fv ||
+                nullptr == fFunctions.fProgramUniform2fv ||
+                nullptr == fFunctions.fProgramUniform3fv ||
+                nullptr == fFunctions.fProgramUniform4fv ||
+                nullptr == fFunctions.fProgramUniform1iv ||
+                nullptr == fFunctions.fProgramUniform2iv ||
+                nullptr == fFunctions.fProgramUniform3iv ||
+                nullptr == fFunctions.fProgramUniform4iv ||
+                nullptr == fFunctions.fProgramUniformMatrix2fv ||
+                nullptr == fFunctions.fProgramUniformMatrix3fv ||
+                nullptr == fFunctions.fProgramUniformMatrix4fv) {
                 RETURN_FALSE_INTERFACE
             }
         }
         if (glVer >= GR_GL_VER(2,1)) {
-            if (NULL == fFunctions.fProgramUniformMatrix2x3fv ||
-                NULL == fFunctions.fProgramUniformMatrix3x2fv ||
-                NULL == fFunctions.fProgramUniformMatrix2x4fv ||
-                NULL == fFunctions.fProgramUniformMatrix4x2fv ||
-                NULL == fFunctions.fProgramUniformMatrix3x4fv ||
-                NULL == fFunctions.fProgramUniformMatrix4x3fv) {
+            if (nullptr == fFunctions.fProgramUniformMatrix2x3fv ||
+                nullptr == fFunctions.fProgramUniformMatrix3x2fv ||
+                nullptr == fFunctions.fProgramUniformMatrix2x4fv ||
+                nullptr == fFunctions.fProgramUniformMatrix4x2fv ||
+                nullptr == fFunctions.fProgramUniformMatrix3x4fv ||
+                nullptr == fFunctions.fProgramUniformMatrix4x3fv) {
                 RETURN_FALSE_INTERFACE
             }
         }
         if (glVer >= GR_GL_VER(3,0)) {
-            if (NULL == fFunctions.fNamedRenderbufferStorage ||
-                NULL == fFunctions.fGetNamedRenderbufferParameteriv ||
-                NULL == fFunctions.fNamedRenderbufferStorageMultisample ||
-                NULL == fFunctions.fCheckNamedFramebufferStatus ||
-                NULL == fFunctions.fNamedFramebufferTexture1D ||
-                NULL == fFunctions.fNamedFramebufferTexture2D ||
-                NULL == fFunctions.fNamedFramebufferTexture3D ||
-                NULL == fFunctions.fNamedFramebufferRenderbuffer ||
-                NULL == fFunctions.fGetNamedFramebufferAttachmentParameteriv ||
-                NULL == fFunctions.fGenerateTextureMipmap ||
-                NULL == fFunctions.fFramebufferDrawBuffer ||
-                NULL == fFunctions.fFramebufferDrawBuffers ||
-                NULL == fFunctions.fFramebufferReadBuffer ||
-                NULL == fFunctions.fGetFramebufferParameteriv ||
-                NULL == fFunctions.fNamedCopyBufferSubData ||
-                NULL == fFunctions.fVertexArrayVertexOffset ||
-                NULL == fFunctions.fVertexArrayColorOffset ||
-                NULL == fFunctions.fVertexArrayEdgeFlagOffset ||
-                NULL == fFunctions.fVertexArrayIndexOffset ||
-                NULL == fFunctions.fVertexArrayNormalOffset ||
-                NULL == fFunctions.fVertexArrayTexCoordOffset ||
-                NULL == fFunctions.fVertexArrayMultiTexCoordOffset ||
-                NULL == fFunctions.fVertexArrayFogCoordOffset ||
-                NULL == fFunctions.fVertexArraySecondaryColorOffset ||
-                NULL == fFunctions.fVertexArrayVertexAttribOffset ||
-                NULL == fFunctions.fVertexArrayVertexAttribIOffset ||
-                NULL == fFunctions.fEnableVertexArray ||
-                NULL == fFunctions.fDisableVertexArray ||
-                NULL == fFunctions.fEnableVertexArrayAttrib ||
-                NULL == fFunctions.fDisableVertexArrayAttrib ||
-                NULL == fFunctions.fGetVertexArrayIntegerv ||
-                NULL == fFunctions.fGetVertexArrayPointerv ||
-                NULL == fFunctions.fGetVertexArrayIntegeri_v ||
-                NULL == fFunctions.fGetVertexArrayPointeri_v ||
-                NULL == fFunctions.fMapNamedBufferRange ||
-                NULL == fFunctions.fFlushMappedNamedBufferRange) {
+            if (nullptr == fFunctions.fNamedRenderbufferStorage ||
+                nullptr == fFunctions.fGetNamedRenderbufferParameteriv ||
+                nullptr == fFunctions.fNamedRenderbufferStorageMultisample ||
+                nullptr == fFunctions.fCheckNamedFramebufferStatus ||
+                nullptr == fFunctions.fNamedFramebufferTexture1D ||
+                nullptr == fFunctions.fNamedFramebufferTexture2D ||
+                nullptr == fFunctions.fNamedFramebufferTexture3D ||
+                nullptr == fFunctions.fNamedFramebufferRenderbuffer ||
+                nullptr == fFunctions.fGetNamedFramebufferAttachmentParameteriv ||
+                nullptr == fFunctions.fGenerateTextureMipmap ||
+                nullptr == fFunctions.fFramebufferDrawBuffer ||
+                nullptr == fFunctions.fFramebufferDrawBuffers ||
+                nullptr == fFunctions.fFramebufferReadBuffer ||
+                nullptr == fFunctions.fGetFramebufferParameteriv ||
+                nullptr == fFunctions.fNamedCopyBufferSubData ||
+                nullptr == fFunctions.fVertexArrayVertexOffset ||
+                nullptr == fFunctions.fVertexArrayColorOffset ||
+                nullptr == fFunctions.fVertexArrayEdgeFlagOffset ||
+                nullptr == fFunctions.fVertexArrayIndexOffset ||
+                nullptr == fFunctions.fVertexArrayNormalOffset ||
+                nullptr == fFunctions.fVertexArrayTexCoordOffset ||
+                nullptr == fFunctions.fVertexArrayMultiTexCoordOffset ||
+                nullptr == fFunctions.fVertexArrayFogCoordOffset ||
+                nullptr == fFunctions.fVertexArraySecondaryColorOffset ||
+                nullptr == fFunctions.fVertexArrayVertexAttribOffset ||
+                nullptr == fFunctions.fVertexArrayVertexAttribIOffset ||
+                nullptr == fFunctions.fEnableVertexArray ||
+                nullptr == fFunctions.fDisableVertexArray ||
+                nullptr == fFunctions.fEnableVertexArrayAttrib ||
+                nullptr == fFunctions.fDisableVertexArrayAttrib ||
+                nullptr == fFunctions.fGetVertexArrayIntegerv ||
+                nullptr == fFunctions.fGetVertexArrayPointerv ||
+                nullptr == fFunctions.fGetVertexArrayIntegeri_v ||
+                nullptr == fFunctions.fGetVertexArrayPointeri_v ||
+                nullptr == fFunctions.fMapNamedBufferRange ||
+                nullptr == fFunctions.fFlushMappedNamedBufferRange) {
                 RETURN_FALSE_INTERFACE
             }
         }
@@ -703,13 +703,13 @@
 
     if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
         fExtensions.has("GL_KHR_debug")) {
-        if (NULL == fFunctions.fDebugMessageControl ||
-            NULL == fFunctions.fDebugMessageInsert ||
-            NULL == fFunctions.fDebugMessageCallback ||
-            NULL == fFunctions.fGetDebugMessageLog ||
-            NULL == fFunctions.fPushDebugGroup ||
-            NULL == fFunctions.fPopDebugGroup ||
-            NULL == fFunctions.fObjectLabel) {
+        if (nullptr == fFunctions.fDebugMessageControl ||
+            nullptr == fFunctions.fDebugMessageInsert ||
+            nullptr == fFunctions.fDebugMessageCallback ||
+            nullptr == fFunctions.fGetDebugMessageLog ||
+            nullptr == fFunctions.fPushDebugGroup ||
+            nullptr == fFunctions.fPopDebugGroup ||
+            nullptr == fFunctions.fObjectLabel) {
             RETURN_FALSE_INTERFACE
         }
     }
diff --git a/src/gpu/gl/GrGLNameAllocator.cpp b/src/gpu/gl/GrGLNameAllocator.cpp
index 49d4564..03123a6 100644
--- a/src/gpu/gl/GrGLNameAllocator.cpp
+++ b/src/gpu/gl/GrGLNameAllocator.cpp
@@ -64,7 +64,7 @@
      *
      * @param removedCount A pointer that receives the size of the contiguous
                            range that was removed.
-     * @return The resulting SparseNameRange after the removal (or NULL if it
+     * @return The resulting SparseNameRange after the removal (or nullptr if it
      *         became empty). Note that this call is destructive, so the
      *         original SparseNameRange will no longer be valid afterward. The
      *         caller must always update its pointer with the new
@@ -100,7 +100,7 @@
      *
      * @param name The name to free. Not-allocated names are silently ignored
      *             the same way they are in the OpenGL spec.
-     * @return The resulting SparseNameRange after the free (or NULL if it
+     * @return The resulting SparseNameRange after the free (or nullptr if it
      *         became empty). Note that this call is destructive, so the
      *         original SparseNameRange will no longer be valid afterward. The
      *         caller must always update its pointer with the new
@@ -146,7 +146,7 @@
             GrGLuint removedCount;
             fRight.reset(fRight->removeLeftmostContiguousRange(&removedCount));
             *outName = fLeft->appendNames(1 + removedCount);
-            if (NULL == fRight.get()) {
+            if (nullptr == fRight.get()) {
                 return fLeft.detach();
             }
             this->updateStats();
@@ -162,7 +162,7 @@
 
     SparseNameRange* SK_WARN_UNUSED_RESULT removeLeftmostContiguousRange(GrGLuint* removedCount) override {
         fLeft.reset(fLeft->removeLeftmostContiguousRange(removedCount));
-        if (NULL == fLeft) {
+        if (nullptr == fLeft) {
             return fRight.detach();
         }
         this->updateStats();
@@ -188,7 +188,7 @@
     SparseNameRange* SK_WARN_UNUSED_RESULT free(GrGLuint name) override {
         if (name < fLeft->end()) {
             fLeft.reset(fLeft->free(name));
-            if (NULL == fLeft) {
+            if (nullptr == fLeft) {
                 // fLeft became empty after the free.
                 return fRight.detach();
             }
@@ -196,7 +196,7 @@
             return this->rebalance();
         } else {
             fRight.reset(fRight->free(name));
-            if (NULL == fRight) {
+            if (nullptr == fRight) {
                 // fRight became empty after the free.
                 return fLeft.detach();
             }
@@ -287,7 +287,7 @@
 
     SparseNameRange* SK_WARN_UNUSED_RESULT removeLeftmostContiguousRange(GrGLuint* removedCount) override {
         *removedCount = fEnd - fFirst;
-        return NULL;
+        return nullptr;
     }
 
     GrGLuint appendNames(GrGLuint count) override {
@@ -311,7 +311,7 @@
 
         if (fFirst == name) {
             ++fFirst;
-            return (fEnd == fFirst) ? NULL : this->takeRef();
+            return (fEnd == fFirst) ? nullptr : this->takeRef();
         }
 
         if (fEnd == name + 1) {
@@ -337,7 +337,7 @@
 }
 
 GrGLuint GrGLNameAllocator::allocateName() {
-    if (NULL == fAllocatedNames.get()) {
+    if (nullptr == fAllocatedNames.get()) {
         fAllocatedNames.reset(new ContiguousNameRange(fFirstName, fFirstName + 1));
         return fFirstName;
     }
diff --git a/src/gpu/gl/GrGLNoOpInterface.cpp b/src/gpu/gl/GrGLNoOpInterface.cpp
index f47f254..113c47d 100644
--- a/src/gpu/gl/GrGLNoOpInterface.cpp
+++ b/src/gpu/gl/GrGLNoOpInterface.cpp
@@ -642,7 +642,7 @@
             return (const GrGLubyte*)"The Debug (Non-)Renderer";
         default:
             SkFAIL("Unexpected name passed to GetString");
-            return NULL;
+            return nullptr;
    }
 }
 
@@ -652,11 +652,11 @@
             if (static_cast<size_t>(i) <= SK_ARRAY_COUNT(kExtensions)) {
                 return (const GrGLubyte*) kExtensions[i];
             } else {
-                return NULL;
+                return nullptr;
             }
         default:
             SkFAIL("Unexpected name passed to GetStringi");
-            return NULL;
+            return nullptr;
     }
 }
 
diff --git a/src/gpu/gl/GrGLPath.cpp b/src/gpu/gl/GrGLPath.cpp
index 9a4aa0c..1dfeaee 100644
--- a/src/gpu/gl/GrGLPath.cpp
+++ b/src/gpu/gl/GrGLPath.cpp
@@ -166,7 +166,7 @@
         GR_GL_CALL(gpu->glInterface(), PathCommands(pathID, pathCommands.count(), &pathCommands[0],
                    pathCoords.count(), GR_GL_FLOAT, &pathCoords[0]));
     } else {
-        GR_GL_CALL(gpu->glInterface(), PathCommands(pathID, 0, NULL, 0, GR_GL_FLOAT, NULL));
+        GR_GL_CALL(gpu->glInterface(), PathCommands(pathID, 0, nullptr, 0, GR_GL_FLOAT, nullptr));
     }
 
     if (stroke.needToApply()) {
diff --git a/src/gpu/gl/GrGLPathRange.cpp b/src/gpu/gl/GrGLPathRange.cpp
index 071fa42..bd213d4 100644
--- a/src/gpu/gl/GrGLPathRange.cpp
+++ b/src/gpu/gl/GrGLPathRange.cpp
@@ -46,7 +46,7 @@
 
 void GrGLPathRange::onInitPath(int index, const SkPath& origSkPath) const {
     GrGLGpu* gpu = static_cast<GrGLGpu*>(this->getGpu());
-    if (NULL == gpu) {
+    if (nullptr == gpu) {
         return;
     }
 
diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp
index 22b12bf..78f78ba 100644
--- a/src/gpu/gl/GrGLPathRendering.cpp
+++ b/src/gpu/gl/GrGLPathRendering.cpp
@@ -63,14 +63,14 @@
     : GrPathRendering(gpu) {
     const GrGLInterface* glInterface = gpu->glInterface();
     fCaps.bindFragmentInputSupport =
-        NULL != glInterface->fFunctions.fBindFragmentInputLocation;
+        nullptr != glInterface->fFunctions.fBindFragmentInputLocation;
 }
 
 GrGLPathRendering::~GrGLPathRendering() {
 }
 
 void GrGLPathRendering::abandonGpuResources() {
-    fPathNameAllocator.reset(NULL);
+    fPathNameAllocator.reset(nullptr);
 }
 
 void GrGLPathRendering::resetContext() {
@@ -101,7 +101,7 @@
     this->setProjectionMatrix(*args.fViewMatrix, size, rt->origin());
     gpu->flushScissor(*args.fScissor, rt->getViewport(), rt->origin());
     gpu->flushHWAAState(rt, args.fUseHWAA);
-    gpu->flushRenderTarget(rt, NULL);
+    gpu->flushRenderTarget(rt, nullptr);
 
     const GrGLPath* glPath = static_cast<const GrGLPath*>(path);
 
@@ -236,7 +236,7 @@
         return name;
     }
 
-    if (NULL == fPathNameAllocator.get()) {
+    if (nullptr == fPathNameAllocator.get()) {
         static const int range = 65536;
         GrGLuint firstName;
         GL_CALL_RET(firstName, GenPaths(range));
@@ -259,14 +259,14 @@
     if (range > 1) {
         // It is not supported to delete names in ranges that were allocated
         // individually using GrGLPathNameAllocator.
-        SkASSERT(NULL == fPathNameAllocator.get() ||
+        SkASSERT(nullptr == fPathNameAllocator.get() ||
                  path + range <= fPathNameAllocator->firstName() ||
                  path >= fPathNameAllocator->endName());
         GL_CALL(DeletePaths(path, range));
         return;
     }
 
-    if (NULL == fPathNameAllocator.get() ||
+    if (nullptr == fPathNameAllocator.get() ||
         path < fPathNameAllocator->firstName() ||
         path >= fPathNameAllocator->endName()) {
         // If we aren't inside fPathNameAllocator's range then this name was
@@ -276,7 +276,7 @@
     }
 
     // Make the path empty to save memory, but don't free the name in the driver.
-    GL_CALL(PathCommands(path, 0, NULL, 0, GR_GL_FLOAT, NULL));
+    GL_CALL(PathCommands(path, 0, nullptr, 0, GR_GL_FLOAT, nullptr));
     fPathNameAllocator->free(path);
 }
 
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index 34276e2..5579701 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -63,8 +63,8 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 GrGLStandard GrGLGetStandardInUseFromString(const char* versionString) {
-    if (NULL == versionString) {
-        SkDebugf("NULL GL version string.");
+    if (nullptr == versionString) {
+        SkDebugf("nullptr GL version string.");
         return kNone_GrGLStandard;
     }
 
@@ -165,8 +165,8 @@
 }
 
 GrGLVersion GrGLGetVersionFromString(const char* versionString) {
-    if (NULL == versionString) {
-        SkDebugf("NULL GL version string.");
+    if (nullptr == versionString) {
+        SkDebugf("nullptr GL version string.");
         return GR_GL_INVALID_VER;
     }
 
@@ -200,8 +200,8 @@
 }
 
 GrGLSLVersion GrGLGetGLSLVersionFromString(const char* versionString) {
-    if (NULL == versionString) {
-        SkDebugf("NULL GLSL version string.");
+    if (nullptr == versionString) {
+        SkDebugf("nullptr GLSL version string.");
         return GR_GLSL_INVALID_VER;
     }
 
diff --git a/src/gpu/gl/GrGLVertexArray.cpp b/src/gpu/gl/GrGLVertexArray.cpp
index 265b5b3..8cfa8d6 100644
--- a/src/gpu/gl/GrGLVertexArray.cpp
+++ b/src/gpu/gl/GrGLVertexArray.cpp
@@ -75,7 +75,7 @@
 
 GrGLAttribArrayState* GrGLVertexArray::bind(GrGLGpu* gpu) {
     if (0 == fID) {
-        return NULL;
+        return nullptr;
     }
     gpu->bindVertexArray(fID);
     return &fAttribArrays;
diff --git a/src/gpu/gl/GrGLVertexArray.h b/src/gpu/gl/GrGLVertexArray.h
index afb23c5..66bc142 100644
--- a/src/gpu/gl/GrGLVertexArray.h
+++ b/src/gpu/gl/GrGLVertexArray.h
@@ -137,7 +137,7 @@
     GrGLVertexArray(GrGLint id, int attribCount);
 
     /**
-     * Binds this vertex array. If the ID has been deleted or abandoned then NULL is returned.
+     * Binds this vertex array. If the ID has been deleted or abandoned then nullptr is returned.
      * Otherwise, the GrGLAttribArrayState that is tracking this vertex array's attrib bindings is
      * returned.
      */
diff --git a/src/gpu/gl/GrGLVertexBuffer.cpp b/src/gpu/gl/GrGLVertexBuffer.cpp
index 61936f2..cd9d52a 100644
--- a/src/gpu/gl/GrGLVertexBuffer.cpp
+++ b/src/gpu/gl/GrGLVertexBuffer.cpp
@@ -31,7 +31,7 @@
     if (!this->wasDestroyed()) {
         return fImpl.map(this->getGpuGL());
     } else {
-        return NULL;
+        return nullptr;
     }
 }
 
diff --git a/src/gpu/gl/SkGLContext.cpp b/src/gpu/gl/SkGLContext.cpp
index 75fbf2b..ec318cb 100644
--- a/src/gpu/gl/SkGLContext.cpp
+++ b/src/gpu/gl/SkGLContext.cpp
@@ -49,8 +49,8 @@
         SkASSERT(0 == fFrameFences[i]);
     }
 #endif
-    SkASSERT(NULL == fGL.get());
-    SkASSERT(NULL == fFenceSync.get());
+    SkASSERT(nullptr == fGL.get());
+    SkASSERT(nullptr == fFenceSync.get());
 }
 
 void SkGLContext::init(const GrGLInterface* gl, SkGpuFenceSync* fenceSync) {
@@ -67,10 +67,10 @@
                 fFrameFences[i] = 0;
             }
         }
-        fFenceSync.reset(NULL);
+        fFenceSync.reset(nullptr);
     }
 
-    fGL.reset(NULL);
+    fGL.reset(nullptr);
 }
 
 void SkGLContext::makeCurrent() const {
@@ -112,7 +112,7 @@
         SK_GL_RET(*ctx, versionStr, GetString(GR_GL_VERSION));
         GrGLVersion version = GrGLGetVersionFromString(reinterpret_cast<const char*>(versionStr));
         if (version < GR_GL_VER(3,2) && !ctx->gl()->hasExtension("GL_ARB_sync")) {
-            return NULL;
+            return nullptr;
         }
         ret->fGLFenceSync = reinterpret_cast<GLFenceSyncProc>(
             ctx->onPlatformGetProcAddress("glFenceSync"));
@@ -122,7 +122,7 @@
             ctx->onPlatformGetProcAddress("glDeleteSync"));
     } else {
         if (!ctx->gl()->hasExtension("GL_APPLE_sync")) {
-            return NULL;
+            return nullptr;
         }
         ret->fGLFenceSync = reinterpret_cast<GLFenceSyncProc>(
             ctx->onPlatformGetProcAddress("glFenceSyncAPPLE"));
@@ -133,7 +133,7 @@
     }
 
     if (!ret->fGLFenceSync || !ret->fGLClientWaitSync || !ret->fGLDeleteSync) {
-        return NULL;
+        return nullptr;
     }
 
     return ret.detach();
diff --git a/src/gpu/gl/SkNullGLContext.cpp b/src/gpu/gl/SkNullGLContext.cpp
index dddea76..877eed9 100644
--- a/src/gpu/gl/SkNullGLContext.cpp
+++ b/src/gpu/gl/SkNullGLContext.cpp
@@ -21,7 +21,7 @@
 public:
     
 
-    BufferObj(GrGLuint id) : fID(id), fDataPtr(NULL), fSize(0), fMapped(false) {}
+    BufferObj(GrGLuint id) : fID(id), fDataPtr(nullptr), fSize(0), fMapped(false) {}
     ~BufferObj() { delete[] fDataPtr; }
 
     void allocate(GrGLsizeiptr size, const GrGLchar* dataPtr) {
@@ -56,11 +56,11 @@
     BufferManager() : fFreeListHead(kFreeListEnd) {}
 
     ~BufferManager() {
-        // NULL out the entries that are really free list links rather than ptrs before deleting.
+        // nullptr out the entries that are really free list links rather than ptrs before deleting.
         intptr_t curr = fFreeListHead;
         while (kFreeListEnd != curr) {
             intptr_t next = reinterpret_cast<intptr_t>(fBuffers[SkToS32(curr)]);
-            fBuffers[SkToS32(curr)] = NULL;
+            fBuffers[SkToS32(curr)] = nullptr;
             curr = next;
         }
 
@@ -254,7 +254,7 @@
         buffer->setMapped(true);
         return buffer->dataPtr();
     }
-    return NULL;
+    return nullptr;
 }
 
 GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access) {
@@ -277,7 +277,7 @@
     }
 
     SkASSERT(false);
-    return NULL;            // no buffer bound to target
+    return nullptr;            // no buffer bound to target
 }
 
 GrGLvoid GR_GL_FUNCTION_TYPE nullGLFlushMappedBufferRange(GrGLenum target,
@@ -499,7 +499,7 @@
 
 static void* create_tls() {
     State** current = new State*;
-    *current = NULL;
+    *current = nullptr;
     return current;
 }
 
@@ -534,12 +534,12 @@
 
 SkNullGLContext* SkNullGLContext::Create(GrGLStandard forcedGpuAPI) {
     if (kGLES_GrGLStandard == forcedGpuAPI) {
-        return NULL;
+        return nullptr;
     }
     SkNullGLContext* ctx = new SkNullGLContext;
     if (!ctx->isValid()) {
         delete ctx;
-        return NULL;
+        return nullptr;
     }
     return ctx;
 }
diff --git a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
index 4569cc8..39a6673 100644
--- a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
+++ b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
@@ -13,7 +13,7 @@
 #include <GLES2/gl2.h>
 
 static GrGLFuncPtr android_get_gl_proc(void* ctx, const char name[]) {
-    SkASSERT(NULL == ctx);
+    SkASSERT(nullptr == ctx);
     // Some older drivers on Android have busted eglGetProcAdddress Functions that
     // will return the wrong pointer for built in GLES2 functions. This set of functions
     // was generated on a Xoom by finding mismatches between the function pulled in via gl2.h and
@@ -225,5 +225,5 @@
 }
 
 const GrGLInterface* GrGLCreateNativeInterface() {
-    return GrGLAssembleInterface(NULL, android_get_gl_proc);
+    return GrGLAssembleInterface(nullptr, android_get_gl_proc);
 }
diff --git a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
index e4f5467..4f26c06 100644
--- a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
+++ b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
@@ -24,15 +24,15 @@
 
 const GrGLInterface* GrGLCreateANGLEInterface() {
 
-    static HMODULE ghANGLELib = NULL;
+    static HMODULE ghANGLELib = nullptr;
 
-    if (NULL == ghANGLELib) {
+    if (nullptr == ghANGLELib) {
         // We load the ANGLE library and never let it go
         ghANGLELib = LoadLibrary("libGLESv2.dll");
     }
-    if (NULL == ghANGLELib) {
+    if (nullptr == ghANGLELib) {
         // We can't setup the interface correctly w/o the DLL
-        return NULL;
+        return nullptr;
     }
 
     return GrGLAssembleGLESInterface(ghANGLELib, angle_get_gl_proc);
diff --git a/src/gpu/gl/angle/SkANGLEGLContext.cpp b/src/gpu/gl/angle/SkANGLEGLContext.cpp
index db34c56..8ebdcb6 100644
--- a/src/gpu/gl/angle/SkANGLEGLContext.cpp
+++ b/src/gpu/gl/angle/SkANGLEGLContext.cpp
@@ -80,7 +80,7 @@
         EGL_CONTEXT_CLIENT_VERSION, 2,
         EGL_NONE
     };
-    fContext = eglCreateContext(fDisplay, surfaceConfig, NULL, contextAttribs);
+    fContext = eglCreateContext(fDisplay, surfaceConfig, nullptr, contextAttribs);
 
 
     static const EGLint surfaceAttribs[] = {
@@ -94,7 +94,7 @@
     eglMakeCurrent(fDisplay, fSurface, fSurface, fContext);
 
     SkAutoTUnref<const GrGLInterface> gl(GrGLCreateANGLEInterface());
-    if (NULL == gl.get()) {
+    if (nullptr == gl.get()) {
         SkDebugf("Could not create ANGLE GL interface!\n");
         this->destroyGLContext();
         return;
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
index 8746fff..912de0a 100644
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
@@ -112,7 +112,7 @@
 public:
     GrGLXPFragmentBuilder(GrGLProgramBuilder* program) : INHERITED(program) {}
 
-    /** Returns the variable name that holds the color of the destination pixel. This may be NULL if
+    /** Returns the variable name that holds the color of the destination pixel. This may be nullptr if
         no effect advertised that it will read the destination. */
     virtual const char* dstColor() = 0;
 
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index d0eb4d4..e6e93e9 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -43,7 +43,7 @@
     GrGLSLExpr4 inputCoverage;
 
     if (!pb->emitAndInstallProcs(&inputColor, &inputCoverage)) {
-        return NULL;
+        return nullptr;
     }
 
     return pb->finalize();
@@ -69,8 +69,8 @@
     , fFS(this, args.fDesc->header().fFragPosKey)
     , fOutOfStage(true)
     , fStageIndex(-1)
-    , fGeometryProcessor(NULL)
-    , fXferProcessor(NULL)
+    , fGeometryProcessor(nullptr)
+    , fXferProcessor(nullptr)
     , fArgs(args)
     , fGpu(gpu)
     , fUniforms(kVarsPerBlock)
@@ -252,7 +252,7 @@
     openBrace.printf("{ // Stage %d, %s\n", fStageIndex, fp.name());
     fFS.codeAppend(openBrace.c_str());
 
-    this->emitAndInstallProc(fp, index, output->c_str(), input.isOnes() ? NULL : input.c_str());
+    this->emitAndInstallProc(fp, index, output->c_str(), input.isOnes() ? nullptr : input.c_str());
 
     fFS.codeAppend("}");
 }
@@ -390,7 +390,7 @@
     GrGLuint programID;
     GL_CALL_RET(programID, CreateProgram());
     if (0 == programID) {
-        return NULL;
+        return nullptr;
     }
 
     // compile shaders and bind attributes / uniforms
@@ -398,7 +398,7 @@
 
     if (!fVS.compileAndAttachShaders(programID, &shadersToDelete)) {
         this->cleanupProgram(programID, shadersToDelete);
-        return NULL;
+        return nullptr;
     }
 
     // NVPR actually requires a vertex shader to compile
@@ -409,7 +409,7 @@
 
     if (!fFS.compileAndAttachShaders(programID, &shadersToDelete)) {
         this->cleanupProgram(programID, shadersToDelete);
-        return NULL;
+        return nullptr;
     }
 
     this->bindProgramResourceLocations(programID);
@@ -432,7 +432,7 @@
 }
 
 void GrGLProgramBuilder::bindProgramResourceLocations(GrGLuint programID) {
-    bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != NULL;
+    bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != nullptr;
     if (usingBindUniform) {
         int count = fUniforms.count();
         for (int i = 0; i < count; ++i) {
@@ -469,7 +469,7 @@
 }
 
 void GrGLProgramBuilder::resolveProgramResourceLocations(GrGLuint programID) {
-    bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != NULL;
+    bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != nullptr;
     if (!usingBindUniform) {
         int count = fUniforms.count();
         for (int i = 0; i < count; ++i) {
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h
index 06d0fa0..1d5e5fb 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h
@@ -49,14 +49,14 @@
     /** Add a uniform variable to the current program, that has visibility in one or more shaders.
         visibility is a bitfield of ShaderVisibility values indicating from which shaders the
         uniform should be accessible. At least one bit must be set. Geometry shader uniforms are not
-        supported at this time. The actual uniform name will be mangled. If outName is not NULL then
+        supported at this time. The actual uniform name will be mangled. If outName is not nullptr then
         it will refer to the final uniform name after return. Use the addUniformArray variant to add
         an array of uniforms. */
     UniformHandle addUniform(uint32_t visibility,
                              GrSLType type,
                              GrSLPrecision precision,
                              const char* name,
-                             const char** outName = NULL) {
+                             const char** outName = nullptr) {
         return this->addUniformArray(visibility, type, precision, name, 0, outName);
     }
 
@@ -66,7 +66,7 @@
         GrSLPrecision precision,
         const char* name,
         int arrayCount,
-        const char** outName = NULL) = 0;
+        const char** outName = nullptr) = 0;
 
     virtual const GrGLShaderVar& getUniformVariable(UniformHandle u) const = 0;
 
@@ -105,8 +105,8 @@
     };
 
     GrGLVarying(GrSLType type, Varying varying)
-        : fVarying(varying), fType(type), fVsOut(NULL), fGsIn(NULL), fGsOut(NULL),
-          fFsIn(NULL) {}
+        : fVarying(varying), fType(type), fVsOut(nullptr), fGsIn(nullptr), fGsOut(nullptr),
+          fFsIn(nullptr) {}
 
     Varying fVarying;
 
diff --git a/src/gpu/gl/builders/GrGLShaderBuilder.cpp b/src/gpu/gl/builders/GrGLShaderBuilder.cpp
index f0408af..84c3c65 100644
--- a/src/gpu/gl/builders/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLShaderBuilder.cpp
@@ -58,7 +58,7 @@
     // We push back some dummy pointers which will later become our header
     for (int i = 0; i <= kCode; i++) {
         fShaderStrings.push_back();
-        fCompilerStrings.push_back(NULL);
+        fCompilerStrings.push_back(nullptr);
         fCompilerStringLengths.push_back(0);
     }
 
diff --git a/src/gpu/gl/builders/GrGLShaderBuilder.h b/src/gpu/gl/builders/GrGLShaderBuilder.h
index 4a6d2e1..427c659 100644
--- a/src/gpu/gl/builders/GrGLShaderBuilder.h
+++ b/src/gpu/gl/builders/GrGLShaderBuilder.h
@@ -57,7 +57,7 @@
 
     /** Does the work of appendTextureLookup and modulates the result by modulation. The result is
         always a vec4. modulation and the swizzle specified by TextureSampler must both be vec4 or
-        float. If modulation is "" or NULL it this function acts as though appendTextureLookup were
+        float. If modulation is "" or nullptr it this function acts as though appendTextureLookup were
         called. */
     void appendTextureLookupAndModulate(const char* modulation,
                                         const TextureSampler&,
diff --git a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
index 983de21..0189932 100644
--- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
@@ -15,7 +15,7 @@
 
 GrGLVertexBuilder::GrGLVertexBuilder(GrGLProgramBuilder* program)
     : INHERITED(program)
-    , fRtAdjustName(NULL) {
+    , fRtAdjustName(nullptr) {
 }
 
 void GrGLVertexBuilder::addVarying(const char* name, GrGLVarying* v) {
diff --git a/src/gpu/gl/debug/GrBufferObj.h b/src/gpu/gl/debug/GrBufferObj.h
index 3c7a30b..65b1caf 100644
--- a/src/gpu/gl/debug/GrBufferObj.h
+++ b/src/gpu/gl/debug/GrBufferObj.h
@@ -19,7 +19,7 @@
 public:
     GrBufferObj()
         : GrFakeRefObj()
-        , fDataPtr(NULL)
+        , fDataPtr(nullptr)
         , fMapped(false)
         , fBound(false)
         , fSize(0)
diff --git a/src/gpu/gl/debug/GrDebugGL.cpp b/src/gpu/gl/debug/GrDebugGL.cpp
index ad06862..2de349b 100644
--- a/src/gpu/gl/debug/GrDebugGL.cpp
+++ b/src/gpu/gl/debug/GrDebugGL.cpp
@@ -16,7 +16,7 @@
 #include "GrTextureUnitObj.h"
 #include "GrVertexArrayObj.h"
 
-GrDebugGL* GrDebugGL::gObj = NULL;
+GrDebugGL* GrDebugGL::gObj = nullptr;
 int GrDebugGL::gStaticRefCount = 0;
 GrDebugGL::Create GrDebugGL::gFactoryFunc[kObjTypeCount] = {
     GrTextureObj::createGrTextureObj,
@@ -34,13 +34,13 @@
     : fPackRowLength(0)
     , fUnPackRowLength(0)
     , fCurTextureUnit(0)
-    , fArrayBuffer(NULL)
-    , fElementArrayBuffer(NULL)
-    , fFrameBuffer(NULL)
-    , fRenderBuffer(NULL)
-    , fProgram(NULL)
-    , fTexture(NULL)
-    , fVertexArray(NULL)
+    , fArrayBuffer(nullptr)
+    , fElementArrayBuffer(nullptr)
+    , fFrameBuffer(nullptr)
+    , fRenderBuffer(nullptr)
+    , fProgram(nullptr)
+    , fTexture(nullptr)
+    , fVertexArray(nullptr)
     , fAbandoned(false) {
 
     for (int i = 0; i < kDefaultMaxTextureUnits; ++i) {
@@ -67,13 +67,13 @@
     }
     fObjects.reset();
 
-    fArrayBuffer = NULL;
-    fElementArrayBuffer = NULL;
-    fFrameBuffer = NULL;
-    fRenderBuffer = NULL;
-    fProgram = NULL;
-    fTexture = NULL;
-    fVertexArray = NULL;
+    fArrayBuffer = nullptr;
+    fElementArrayBuffer = nullptr;
+    fFrameBuffer = nullptr;
+    fRenderBuffer = nullptr;
+    fProgram = nullptr;
+    fTexture = nullptr;
+    fVertexArray = nullptr;
 }
 
 GrFakeRefObj *GrDebugGL::findObject(GrGLuint ID, GrObjTypes type) {
@@ -87,7 +87,7 @@
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 void GrDebugGL::setArrayBuffer(GrBufferObj *arrayBuffer) {
diff --git a/src/gpu/gl/debug/GrDebugGL.h b/src/gpu/gl/debug/GrDebugGL.h
index ae6a978..2560879 100644
--- a/src/gpu/gl/debug/GrDebugGL.h
+++ b/src/gpu/gl/debug/GrDebugGL.h
@@ -92,7 +92,7 @@
         // someone should admit to actually using this class
         SkASSERT(0 < gStaticRefCount);
 
-        if (NULL == gObj) {
+        if (nullptr == gObj) {
             gObj = new GrDebugGL;
         }
 
@@ -110,7 +110,7 @@
         gStaticRefCount--;
         if (0 == gStaticRefCount) {
             delete gObj;
-            gObj = NULL;
+            gObj = nullptr;
         }
     }
 
diff --git a/src/gpu/gl/debug/GrFrameBufferObj.h b/src/gpu/gl/debug/GrFrameBufferObj.h
index 794450c..42a0eff 100644
--- a/src/gpu/gl/debug/GrFrameBufferObj.h
+++ b/src/gpu/gl/debug/GrFrameBufferObj.h
@@ -22,15 +22,15 @@
     GrFrameBufferObj()
         : GrFakeRefObj()
         , fBound(false)
-        , fColorBuffer(NULL)
-        , fDepthBuffer(NULL)
-        , fStencilBuffer(NULL) {
+        , fColorBuffer(nullptr)
+        , fDepthBuffer(nullptr)
+        , fStencilBuffer(nullptr) {
     }
 
     virtual ~GrFrameBufferObj() {
-        fColorBuffer = NULL;
-        fDepthBuffer = NULL;
-        fStencilBuffer = NULL;
+        fColorBuffer = nullptr;
+        fDepthBuffer = nullptr;
+        fStencilBuffer = nullptr;
     }
 
     void setBound()         { fBound = true; }
@@ -48,9 +48,9 @@
 
     void deleteAction() override {
 
-        setColor(NULL);
-        setDepth(NULL);
-        setStencil(NULL);
+        setColor(nullptr);
+        setDepth(nullptr);
+        setStencil(nullptr);
 
         this->INHERITED::deleteAction();
     }
diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
index ef52fb6..75b6736 100644
--- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
+++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
@@ -84,7 +84,7 @@
                    GR_GL_STATIC_DRAW == usage ||
                    GR_GL_DYNAMIC_DRAW == usage);
 
-    GrBufferObj *buffer = NULL;
+    GrBufferObj *buffer = nullptr;
     switch (target) {
         case GR_GL_ARRAY_BUFFER:
             buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -241,7 +241,7 @@
 
                  if (textures[j] == pTU->getTexture()->getID()) {
                      // this ID is the current texture - revert the binding to 0
-                     pTU->setTexture(NULL);
+                     pTU->setTexture(nullptr);
                  }
              }
          }
@@ -258,15 +258,15 @@
 
              if (frameBuffer->getColor() &&
                  textures[i] == frameBuffer->getColor()->getID()) {
-                 frameBuffer->setColor(NULL);
+                 frameBuffer->setColor(nullptr);
              }
              if (frameBuffer->getDepth() &&
                  textures[i] == frameBuffer->getDepth()->getID()) {
-                 frameBuffer->setDepth(NULL);
+                 frameBuffer->setDepth(nullptr);
              }
              if (frameBuffer->getStencil() &&
                  textures[i] == frameBuffer->getStencil()->getID()) {
-                 frameBuffer->setStencil(NULL);
+                 frameBuffer->setStencil(nullptr);
              }
          }
      }
@@ -298,7 +298,7 @@
              if (frameBuffers[i] ==
                  GrDebugGL::getInstance()->getFrameBuffer()->getID()) {
                  // this ID is the current frame buffer - rebind to the default
-                 GrDebugGL::getInstance()->setFrameBuffer(NULL);
+                 GrDebugGL::getInstance()->setFrameBuffer(nullptr);
              }
          }
      }
@@ -326,7 +326,7 @@
                  GrDebugGL::getInstance()->getRenderBuffer()->getID()) {
                  // this ID is the current render buffer - make no
                  // render buffer be bound
-                 GrDebugGL::getInstance()->setRenderBuffer(NULL);
+                 GrDebugGL::getInstance()->setRenderBuffer(nullptr);
              }
          }
      }
@@ -343,15 +343,15 @@
 
              if (frameBuffer->getColor() &&
                  renderBuffers[i] == frameBuffer->getColor()->getID()) {
-                 frameBuffer->setColor(NULL);
+                 frameBuffer->setColor(nullptr);
              }
              if (frameBuffer->getDepth() &&
                  renderBuffers[i] == frameBuffer->getDepth()->getID()) {
-                 frameBuffer->setDepth(NULL);
+                 frameBuffer->setDepth(nullptr);
              }
              if (frameBuffer->getStencil() &&
                  renderBuffers[i] == frameBuffer->getStencil()->getID()) {
-                 frameBuffer->setStencil(NULL);
+                 frameBuffer->setStencil(nullptr);
              }
          }
      }
@@ -552,7 +552,7 @@
 
         // Deleting the current vertex array binds object 0
         if (GrDebugGL::getInstance()->getVertexArray() == array) {
-            GrDebugGL::getInstance()->setVertexArray(NULL);
+            GrDebugGL::getInstance()->setVertexArray(nullptr);
         }
 
         if (array->getRefCount()) {
@@ -599,13 +599,13 @@
         if (GrDebugGL::getInstance()->getArrayBuffer() &&
             ids[i] == GrDebugGL::getInstance()->getArrayBuffer()->getID()) {
             // this ID is the current array buffer
-            GrDebugGL::getInstance()->setArrayBuffer(NULL);
+            GrDebugGL::getInstance()->setArrayBuffer(nullptr);
         }
         if (GrDebugGL::getInstance()->getElementArrayBuffer() &&
             ids[i] ==
                 GrDebugGL::getInstance()->getElementArrayBuffer()->getID()) {
             // this ID is the current element array buffer
-            GrDebugGL::getInstance()->setElementArrayBuffer(NULL);
+            GrDebugGL::getInstance()->setElementArrayBuffer(nullptr);
         }
     }
 
@@ -631,7 +631,7 @@
     GrAlwaysAssert(!SkToBool(GR_GL_MAP_READ_BIT & access));
     GrAlwaysAssert((GR_GL_MAP_INVALIDATE_BUFFER_BIT | GR_GL_MAP_INVALIDATE_RANGE_BIT) & access);
 
-    GrBufferObj *buffer = NULL;
+    GrBufferObj *buffer = nullptr;
     switch (target) {
         case GR_GL_ARRAY_BUFFER:
             buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -652,13 +652,13 @@
     }
 
     GrAlwaysAssert(false);
-    return NULL;        // no buffer bound to the target
+    return nullptr;        // no buffer bound to the target
 }
 
 GrGLvoid* GR_GL_FUNCTION_TYPE debugGLMapBuffer(GrGLenum target, GrGLenum access) {
     GrAlwaysAssert(GR_GL_WRITE_ONLY == access);
 
-    GrBufferObj *buffer = NULL;
+    GrBufferObj *buffer = nullptr;
     switch (target) {
         case GR_GL_ARRAY_BUFFER:
             buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -682,7 +682,7 @@
     GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target ||
                    GR_GL_ELEMENT_ARRAY_BUFFER == target);
 
-    GrBufferObj *buffer = NULL;
+    GrBufferObj *buffer = nullptr;
     switch (target) {
         case GR_GL_ARRAY_BUFFER:
             buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -711,7 +711,7 @@
     GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target ||
                    GR_GL_ELEMENT_ARRAY_BUFFER == target);
 
-    GrBufferObj *buffer = NULL;
+    GrBufferObj *buffer = nullptr;
     switch (target) {
         case GR_GL_ARRAY_BUFFER:
             buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -742,7 +742,7 @@
     GrAlwaysAssert(GR_GL_BUFFER_SIZE == value ||
                    GR_GL_BUFFER_USAGE == value);
 
-    GrBufferObj *buffer = NULL;
+    GrBufferObj *buffer = nullptr;
     switch (target) {
         case GR_GL_ARRAY_BUFFER:
             buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -784,7 +784,7 @@
     
 
     GrDebugGLInterface()
-        : fWrapped(NULL) {
+        : fWrapped(nullptr) {
         GrDebugGL::staticRef();
     }
 
diff --git a/src/gpu/gl/debug/GrTextureUnitObj.h b/src/gpu/gl/debug/GrTextureUnitObj.h
index 7d9ed2e..b0254a0 100644
--- a/src/gpu/gl/debug/GrTextureUnitObj.h
+++ b/src/gpu/gl/debug/GrTextureUnitObj.h
@@ -22,7 +22,7 @@
     GrTextureUnitObj()
         : GrFakeRefObj()
         , fNumber(0)
-        , fTexture(NULL) {
+        , fTexture(nullptr) {
     }
 
     void setNumber(GrGLenum number) {
diff --git a/src/gpu/gl/debug/SkDebugGLContext.h b/src/gpu/gl/debug/SkDebugGLContext.h
index 0a61f72..abbcf55 100644
--- a/src/gpu/gl/debug/SkDebugGLContext.h
+++ b/src/gpu/gl/debug/SkDebugGLContext.h
@@ -16,14 +16,14 @@
 
     static SkDebugGLContext* Create(GrGLStandard forcedGpuAPI) {
         if (kGLES_GrGLStandard == forcedGpuAPI) {
-            return NULL;
+            return nullptr;
         }
         return new SkDebugGLContext;
     }
 private:
     void onPlatformMakeCurrent() const override {}
     void onPlatformSwapBuffers() const override {}
-    GrGLFuncPtr onPlatformGetProcAddress(const char*) const override { return NULL; }
+    GrGLFuncPtr onPlatformGetProcAddress(const char*) const override { return nullptr; }
 
     SkDebugGLContext();
 };
diff --git a/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp b/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp
index ddc9e69..703e39d 100644
--- a/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp
+++ b/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp
@@ -13,10 +13,10 @@
 #include <GLES2/gl2.h>
 
 static GrGLFuncPtr egl_get_gl_proc(void* ctx, const char name[]) {
-    SkASSERT(NULL == ctx);
+    SkASSERT(nullptr == ctx);
     return eglGetProcAddress(name);
 }
 
 const GrGLInterface* GrGLCreateNativeInterface() {
-    return GrGLAssembleInterface(NULL, egl_get_gl_proc);
+    return GrGLAssembleInterface(nullptr, egl_get_gl_proc);
 }
diff --git a/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp b/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp
index 9bdedf7..d1335d3 100644
--- a/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp
+++ b/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp
@@ -93,7 +93,7 @@
 
     SkAutoTUnref<const GrGLInterface> gl;
 
-    for (; NULL == gl.get() && api < apiLimit; ++api) {
+    for (; nullptr == gl.get() && api < apiLimit; ++api) {
         fDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
 
         EGLint majorVersion;
@@ -133,7 +133,7 @@
             continue;
         }
 
-        fContext = eglCreateContext(fDisplay, surfaceConfig, NULL, kAPIs[api].fContextAttribs);
+        fContext = eglCreateContext(fDisplay, surfaceConfig, nullptr, kAPIs[api].fContextAttribs);
         if (EGL_NO_CONTEXT == fContext) {
             SkDebugf("eglCreateContext failed.  EGL Error: 0x%08x\n", eglGetError());
             continue;
@@ -159,7 +159,7 @@
         }
 
         gl.reset(GrGLCreateNativeInterface());
-        if (NULL == gl.get()) {
+        if (nullptr == gl.get()) {
             SkDebugf("Failed to create gl interface.\n");
             this->destroyGLContext();
             continue;
@@ -234,13 +234,13 @@
 
 SkEGLFenceSync* SkEGLFenceSync::CreateIfSupported(EGLDisplay display) {
     if (!display || !supports_egl_extension(display, "EGL_KHR_fence_sync")) {
-        return NULL;
+        return nullptr;
     }
     return new SkEGLFenceSync(display);
 }
 
 SkPlatformGpuFence SkEGLFenceSync::insertFence() const {
-    return eglCreateSyncKHR(fDisplay, EGL_SYNC_FENCE_KHR, NULL);
+    return eglCreateSyncKHR(fDisplay, EGL_SYNC_FENCE_KHR, nullptr);
 }
 
 bool SkEGLFenceSync::flushAndWaitFence(SkPlatformGpuFence platformFence) const {
@@ -262,7 +262,7 @@
     EGLGLContext* ctx = new EGLGLContext(forcedGpuAPI);
     if (!ctx->isValid()) {
         delete ctx;
-        return NULL;
+        return nullptr;
     }
     return ctx;
 }
diff --git a/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp b/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp
index 19eec7e..e3d37bd 100644
--- a/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp
+++ b/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp
@@ -13,15 +13,15 @@
 #include <GL/glx.h>
 
 static GrGLFuncPtr glx_get(void* ctx, const char name[]) {
-    SkASSERT(NULL == ctx);
+    SkASSERT(nullptr == ctx);
     SkASSERT(glXGetCurrentContext());
     return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name));
 }
 
 const GrGLInterface* GrGLCreateNativeInterface() {
-    if (NULL == glXGetCurrentContext()) {
-        return NULL;
+    if (nullptr == glXGetCurrentContext()) {
+        return nullptr;
     }
 
-    return GrGLAssembleInterface(NULL, glx_get);
+    return GrGLAssembleInterface(nullptr, glx_get);
 }
diff --git a/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp b/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp
index cabd443..8c58a53 100644
--- a/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp
+++ b/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp
@@ -63,8 +63,8 @@
 };
 
 GLXGLContext::GLXGLContext(GrGLStandard forcedGpuAPI)
-    : fContext(NULL)
-    , fDisplay(NULL)
+    : fContext(nullptr)
+    , fDisplay(nullptr)
     , fPixmap(0)
     , fGlxPixmap(0) {
 
@@ -270,7 +270,7 @@
     }
 
     SkAutoTUnref<const GrGLInterface> gl(GrGLCreateNativeInterface());
-    if (NULL == gl.get()) {
+    if (nullptr == gl.get()) {
         SkDebugf("Failed to create gl interface");
         this->destroyGLContext();
         return;
@@ -297,7 +297,7 @@
 
         if (fContext) {
             glXDestroyContext(fDisplay, fContext);
-            fContext = NULL;
+            fContext = nullptr;
         }
 
         if (fGlxPixmap) {
@@ -311,7 +311,7 @@
         }
 
         XCloseDisplay(fDisplay);
-        fDisplay = NULL;
+        fDisplay = nullptr;
     }
 }
 
@@ -335,7 +335,7 @@
     GLXGLContext *ctx = new GLXGLContext(forcedGpuAPI);
     if (!ctx->isValid()) {
         delete ctx;
-        return NULL;
+        return nullptr;
     }
     return ctx;
 }
diff --git a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
index ccbc50f..c85f05c 100644
--- a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
+++ b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
@@ -25,7 +25,7 @@
     }
 
     void* handle() const {
-        return NULL == fLibrary ? RTLD_DEFAULT : fLibrary;
+        return nullptr == fLibrary ? RTLD_DEFAULT : fLibrary;
     }
 
 private:
diff --git a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
index a0c50c7..9a2abfe 100644
--- a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
+++ b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
@@ -27,7 +27,7 @@
     }
 
     void* handle() const {
-        return NULL == fLibrary ? RTLD_DEFAULT : fLibrary;
+        return nullptr == fLibrary ? RTLD_DEFAULT : fLibrary;
     }
 
 private:
diff --git a/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp b/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp
index 4754c01..fa4126a 100644
--- a/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp
+++ b/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp
@@ -29,7 +29,7 @@
 };
 
 MacGLContext::MacGLContext()
-    : fContext(NULL)
+    : fContext(nullptr)
     , fGLLibrary(RTLD_DEFAULT) {
     CGLPixelFormatAttribute attributes[] = {
 #if MAC_OS_X_VERSION_10_7
@@ -43,15 +43,15 @@
 
     CGLChoosePixelFormat(attributes, &pixFormat, &npix);
 
-    if (NULL == pixFormat) {
+    if (nullptr == pixFormat) {
         SkDebugf("CGLChoosePixelFormat failed.");
         return;
     }
 
-    CGLCreateContext(pixFormat, NULL, &fContext);
+    CGLCreateContext(pixFormat, nullptr, &fContext);
     CGLReleasePixelFormat(pixFormat);
 
-    if (NULL == fContext) {
+    if (nullptr == fContext) {
         SkDebugf("CGLCreateContext failed.");
         return;
     }
@@ -59,7 +59,7 @@
     CGLSetCurrentContext(fContext);
 
     SkAutoTUnref<const GrGLInterface> gl(GrGLCreateNativeInterface());
-    if (NULL == gl.get()) {
+    if (nullptr == gl.get()) {
         SkDebugf("Context could not create GL interface.\n");
         this->destroyGLContext();
         return;
@@ -85,7 +85,7 @@
 void MacGLContext::destroyGLContext() {
     if (fContext) {
         CGLReleaseContext(fContext);
-        fContext = NULL;
+        fContext = nullptr;
     }
     if (RTLD_DEFAULT != fGLLibrary) {
         dlclose(fGLLibrary);
@@ -108,12 +108,12 @@
 
 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
     if (kGLES_GrGLStandard == forcedGpuAPI) {
-        return NULL;
+        return nullptr;
     }
     MacGLContext* ctx = new MacGLContext;
     if (!ctx->isValid()) {
         delete ctx;
-        return NULL;
+        return nullptr;
     }
     return ctx;
 }
diff --git a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
index ab48718..734c1fe 100644
--- a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
+++ b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
@@ -12,14 +12,14 @@
 #include "osmesa_wrapper.h"
 
 static GrGLFuncPtr osmesa_get(void* ctx, const char name[]) {
-    SkASSERT(NULL == ctx);
+    SkASSERT(nullptr == ctx);
     SkASSERT(OSMesaGetCurrentContext());
     return OSMesaGetProcAddress(name);
 }
 
 const GrGLInterface* GrGLCreateMesaInterface() {
-    if (NULL == OSMesaGetCurrentContext()) {
-        return NULL;
+    if (nullptr == OSMesaGetCurrentContext()) {
+        return nullptr;
     }
-    return GrGLAssembleInterface(NULL, osmesa_get);
+    return GrGLAssembleInterface(nullptr, osmesa_get);
 }
diff --git a/src/gpu/gl/mesa/SkMesaGLContext.cpp b/src/gpu/gl/mesa/SkMesaGLContext.cpp
index 701cc0d..730206e 100644
--- a/src/gpu/gl/mesa/SkMesaGLContext.cpp
+++ b/src/gpu/gl/mesa/SkMesaGLContext.cpp
@@ -14,16 +14,16 @@
 static const GrGLint gBOGUS_SIZE = 16;
 
 SkMesaGLContext::SkMesaGLContext()
-    : fContext(static_cast<Context>(NULL))
-    , fImage(NULL) {
+    : fContext(static_cast<Context>(nullptr))
+    , fImage(nullptr) {
     GR_STATIC_ASSERT(sizeof(Context) == sizeof(OSMesaContext));
 
     /* Create an RGBA-mode context */
 #if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305
     /* specify Z, stencil, accum sizes */
-    fContext = (Context)OSMesaCreateContextExt(OSMESA_BGRA, 0, 0, 0, NULL);
+    fContext = (Context)OSMesaCreateContextExt(OSMESA_BGRA, 0, 0, 0, nullptr);
 #else
-    fContext = (Context)OSMesaCreateContext(OSMESA_BGRA, NULL);
+    fContext = (Context)OSMesaCreateContext(OSMESA_BGRA, nullptr);
 #endif
     if (!fContext) {
         SkDebugf("OSMesaCreateContext failed!\n");
@@ -51,7 +51,7 @@
     }
 
     SkAutoTUnref<const GrGLInterface> gl(GrGLCreateMesaInterface());
-    if (NULL == gl.get()) {
+    if (nullptr == gl.get()) {
         SkDebugf("Could not create GL interface!\n");
         this->destroyGLContext();
         return;
@@ -74,12 +74,12 @@
 void SkMesaGLContext::destroyGLContext() {
     if (fImage) {
         sk_free(fImage);
-        fImage = NULL;
+        fImage = nullptr;
     }
 
     if (fContext) {
         OSMesaDestroyContext((OSMesaContext)fContext);
-        fContext = static_cast<Context>(NULL);
+        fContext = static_cast<Context>(nullptr);
     }
 }
 
diff --git a/src/gpu/gl/mesa/SkMesaGLContext.h b/src/gpu/gl/mesa/SkMesaGLContext.h
index 1548bfd..a58f1c8 100644
--- a/src/gpu/gl/mesa/SkMesaGLContext.h
+++ b/src/gpu/gl/mesa/SkMesaGLContext.h
@@ -21,12 +21,12 @@
 
     static SkMesaGLContext* Create(GrGLStandard forcedGpuAPI) {
         if (kGLES_GrGLStandard == forcedGpuAPI) {
-            return NULL;
+            return nullptr;
         }
         SkMesaGLContext* ctx = new SkMesaGLContext;
         if (!ctx->isValid()) {
             delete ctx;
-            return NULL;
+            return nullptr;
         }
         return ctx;
     }
diff --git a/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp b/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp
index 5cb4423..21f3001 100644
--- a/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp
+++ b/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp
@@ -8,7 +8,7 @@
 #include "gl/SkGLContext.h"
 
 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
-    return NULL;
+    return nullptr;
 }
 
 
diff --git a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
index cba380b..c2fcca5 100644
--- a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
+++ b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
@@ -42,7 +42,7 @@
         if ((proc = (GrGLFuncPtr) wglGetProcAddress(name))) {
             return proc;
         }
-        return NULL;
+        return nullptr;
     }
 
 private:
@@ -62,18 +62,18 @@
  * Otherwise, a springboard would be needed that hides the calling convention.
  */
 const GrGLInterface* GrGLCreateNativeInterface() {
-    if (NULL == wglGetCurrentContext()) {
-        return NULL;
+    if (nullptr == wglGetCurrentContext()) {
+        return nullptr;
     }
 
     GLProcGetter getter;
     if (!getter.isInitialized()) {
-        return NULL;
+        return nullptr;
     }
 
     GrGLGetStringProc getString = (GrGLGetStringProc)getter.getProc("glGetString");
-    if (NULL == getString) {
-        return NULL;
+    if (nullptr == getString) {
+        return nullptr;
     }
     const char* verStr = reinterpret_cast<const char*>(getString(GR_GL_VERSION));
     GrGLStandard standard = GrGLGetStandardInUseFromString(verStr);
@@ -83,5 +83,5 @@
     } else if (kGL_GrGLStandard == standard) {
         return GrGLAssembleGLInterface(&getter, win_get_gl_proc);
     }
-    return NULL;
+    return nullptr;
 }
diff --git a/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp b/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp
index 0517f73..f795f52 100644
--- a/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp
+++ b/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp
@@ -39,23 +39,23 @@
 ATOM WinGLContext::gWC = 0;
 
 WinGLContext::WinGLContext(GrGLStandard forcedGpuAPI)
-    : fWindow(NULL)
-    , fDeviceContext(NULL)
+    : fWindow(nullptr)
+    , fDeviceContext(nullptr)
     , fGlRenderContext(0)
-    , fPbufferContext(NULL) {
-    HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL);
+    , fPbufferContext(nullptr) {
+    HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(nullptr);
 
     if (!gWC) {
         WNDCLASS wc;
         wc.cbClsExtra = 0;
         wc.cbWndExtra = 0;
-        wc.hbrBackground = NULL;
-        wc.hCursor = LoadCursor(NULL, IDC_ARROW);
-        wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
+        wc.hbrBackground = nullptr;
+        wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
+        wc.hIcon = LoadIcon(nullptr, IDI_APPLICATION);
         wc.hInstance = hInstance;
         wc.lpfnWndProc = (WNDPROC) DefWindowProc;
         wc.lpszClassName = TEXT("Griffin");
-        wc.lpszMenuName = NULL;
+        wc.lpszMenuName = nullptr;
         wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
 
         gWC = RegisterClass(&wc);
@@ -69,8 +69,8 @@
                                  TEXT("The Invisible Man"),
                                  WS_OVERLAPPEDWINDOW,
                                  0, 0, 1, 1,
-                                 NULL, NULL,
-                                 hInstance, NULL))) {
+                                 nullptr, nullptr,
+                                 hInstance, nullptr))) {
         SkDebugf("Could not create window.\n");
         return;
     }
@@ -91,7 +91,7 @@
     HDC dc;
     HGLRC glrc;
 
-    if (NULL == fPbufferContext) {
+    if (nullptr == fPbufferContext) {
         if (!(fGlRenderContext = SkCreateWGLContext(fDeviceContext, 0, contextType))) {
             SkDebugf("Could not create rendering context.\n");
             this->destroyGLContext();
@@ -116,7 +116,7 @@
     }
 
     SkAutoTUnref<const GrGLInterface> gl(GrGLCreateNativeInterface());
-    if (NULL == gl.get()) {
+    if (nullptr == gl.get()) {
         SkDebugf("Could not create GL interface.\n");
         this->destroyGLContext();
         return;
@@ -155,7 +155,7 @@
     HDC dc;
     HGLRC glrc;
 
-    if (NULL == fPbufferContext) {
+    if (nullptr == fPbufferContext) {
         dc = fDeviceContext;
         glrc = fGlRenderContext;
     } else {
@@ -171,7 +171,7 @@
 void WinGLContext::onPlatformSwapBuffers() const {
     HDC dc;
 
-    if (NULL == fPbufferContext) {
+    if (nullptr == fPbufferContext) {
         dc = fDeviceContext;
     } else {
         dc = fPbufferContext->getDC();
@@ -191,7 +191,7 @@
     WinGLContext* ctx = new WinGLContext(forcedGpuAPI);
     if (!ctx->isValid()) {
         delete ctx;
-        return NULL;
+        return nullptr;
     }
     return ctx;
 }
diff --git a/src/gpu/glsl/GrGLSL.h b/src/gpu/glsl/GrGLSL.h
index efe31fe..87b3d2d 100644
--- a/src/gpu/glsl/GrGLSL.h
+++ b/src/gpu/glsl/GrGLSL.h
@@ -135,7 +135,7 @@
      * Argument expr is a simple expression or a parenthesized expression. */
     // TODO: make explicit once effects input Exprs.
     GrGLSLExpr(const char expr[]) {
-        if (NULL == expr) {  // TODO: remove this once effects input Exprs.
+        if (nullptr == expr) {  // TODO: remove this once effects input Exprs.
             fType = kOnes_ExprType;
         } else {
             fType = kFullExpr_ExprType;
diff --git a/src/gpu/glsl/GrGLSLCaps.cpp b/src/gpu/glsl/GrGLSLCaps.cpp
index e862499..38105ef 100755
--- a/src/gpu/glsl/GrGLSLCaps.cpp
+++ b/src/gpu/glsl/GrGLSLCaps.cpp
@@ -17,8 +17,8 @@
     fFBFetchSupport = false;
     fFBFetchNeedsCustomOutput = false;
     fBindlessTextureSupport = false;
-    fFBFetchColorName = NULL;
-    fFBFetchExtensionString = NULL;
+    fFBFetchColorName = nullptr;
+    fFBFetchExtensionString = nullptr;
     fAdvBlendEqInteraction = kNotSupported_AdvBlendEqInteraction;
 }
 
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);
 }
diff --git a/src/images/SkDecodingImageGenerator.cpp b/src/images/SkDecodingImageGenerator.cpp
index 5d71ab8..8cfacc3 100644
--- a/src/images/SkDecodingImageGenerator.cpp
+++ b/src/images/SkDecodingImageGenerator.cpp
@@ -61,20 +61,20 @@
         , fRowBytes(rowBytes)
     {}
 
-    bool isReady() { return (fTarget != NULL); }
+    bool isReady() { return (fTarget != nullptr); }
 
     virtual bool allocPixelRef(SkBitmap* bm, SkColorTable* ct) {
-        if (NULL == fTarget || !equal_modulo_alpha(fInfo, bm->info())) {
+        if (nullptr == fTarget || !equal_modulo_alpha(fInfo, bm->info())) {
             // Call default allocator.
-            return bm->tryAllocPixels(NULL, ct);
+            return bm->tryAllocPixels(nullptr, ct);
         }
 
         // TODO(halcanary): verify that all callers of this function
         // will respect new RowBytes.  Will be moot once rowbytes belongs
         // to PixelRef.
-        bm->installPixels(fInfo, fTarget, fRowBytes, ct, NULL, NULL);
+        bm->installPixels(fInfo, fTarget, fRowBytes, ct, nullptr, nullptr);
 
-        fTarget = NULL;  // never alloc same pixels twice!
+        fTarget = nullptr;  // never alloc same pixels twice!
         return true;
     }
 
@@ -118,8 +118,8 @@
     , fSampleSize(sampleSize)
     , fDitherImage(ditherImage)
 {
-    SkASSERT(stream != NULL);
-    SkSafeRef(fData);  // may be NULL.
+    SkASSERT(stream != nullptr);
+    SkSafeRef(fData);  // may be nullptr.
 }
 
 DecodingImageGenerator::~DecodingImageGenerator() {
@@ -129,11 +129,11 @@
 SkData* DecodingImageGenerator::onRefEncodedData() {
     // This functionality is used in `gm --serialize`
     // Does not encode options.
-    if (NULL == fData) {
+    if (nullptr == fData) {
         // TODO(halcanary): SkStreamRewindable needs a refData() function
         // which returns a cheap copy of the underlying data.
         if (!fStream->rewind()) {
-            return NULL;
+            return nullptr;
         }
         size_t length = fStream->getLength();
         if (length) {
@@ -154,7 +154,7 @@
 
     SkAssertResult(fStream->rewind());
     SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(fStream));
-    if (NULL == decoder.get()) {
+    if (nullptr == decoder.get()) {
         return false;
     }
     decoder->setDitherImage(fDitherImage);
@@ -166,7 +166,7 @@
     decoder->setAllocator(&allocator);
     const SkImageDecoder::Result decodeResult = decoder->decode(fStream, &bitmap, info.colorType(),
                                                                 SkImageDecoder::kDecodePixels_Mode);
-    decoder->setAllocator(NULL);
+    decoder->setAllocator(nullptr);
     if (SkImageDecoder::kFailure == decodeResult) {
         return false;
     }
@@ -190,7 +190,7 @@
             return false;
         }
         SkColorTable* ctable = bitmap.getColorTable();
-        if (NULL == ctable) {
+        if (nullptr == ctable) {
             return false;
         }
         const int count = ctable->count();
@@ -207,14 +207,14 @@
     }
 
     SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(fStream));
-    if (NULL == decoder.get()) {
+    if (nullptr == decoder.get()) {
         return false;
     }
 
     return decoder->decodeYUV8Planes(fStream, sizes, planes, rowBytes, colorSpace);
 }
 
-// A contructor-type function that returns NULL on failure.  This
+// A contructor-type function that returns nullptr on failure.  This
 // prevents the returned SkImageGenerator from ever being in a bad
 // state.  Called by both Create() functions
 SkImageGenerator* CreateDecodingImageGenerator(
@@ -225,17 +225,17 @@
     SkAutoTDelete<SkStreamRewindable> autoStream(stream);  // always delete this
     SkAssertResult(autoStream->rewind());
     SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(autoStream));
-    if (NULL == decoder.get()) {
-        return NULL;
+    if (nullptr == decoder.get()) {
+        return nullptr;
     }
     SkBitmap bitmap;
     decoder->setSampleSize(opts.fSampleSize);
     decoder->setRequireUnpremultipliedColors(opts.fRequireUnpremul);
     if (!decoder->decode(stream, &bitmap, SkImageDecoder::kDecodeBounds_Mode)) {
-        return NULL;
+        return nullptr;
     }
     if (kUnknown_SkColorType == bitmap.colorType()) {
-        return NULL;
+        return nullptr;
     }
 
     SkImageInfo info = bitmap.info();
@@ -243,7 +243,7 @@
     if (opts.fUseRequestedColorType && (opts.fRequestedColorType != info.colorType())) {
         if (!bitmap.canCopyTo(opts.fRequestedColorType)) {
             SkASSERT(bitmap.colorType() != opts.fRequestedColorType);
-            return NULL;  // Can not translate to needed config.
+            return nullptr;  // Can not translate to needed config.
         }
         info = info.makeColorType(opts.fRequestedColorType);
     }
@@ -254,7 +254,7 @@
 
     SkAlphaType newAlphaType = info.alphaType();
     if (!SkColorTypeValidateAlphaType(info.colorType(), info.alphaType(), &newAlphaType)) {
-        return NULL;
+        return nullptr;
     }
 
     return new DecodingImageGenerator(data, autoStream.detach(), info.makeAlphaType(newAlphaType),
@@ -268,21 +268,21 @@
 SkImageGenerator* SkDecodingImageGenerator::Create(
         SkData* data,
         const SkDecodingImageGenerator::Options& opts) {
-    SkASSERT(data != NULL);
-    if (NULL == data) {
-        return NULL;
+    SkASSERT(data != nullptr);
+    if (nullptr == data) {
+        return nullptr;
     }
     SkStreamRewindable* stream = new SkMemoryStream(data);
-    SkASSERT(stream != NULL);
+    SkASSERT(stream != nullptr);
     return CreateDecodingImageGenerator(data, stream, opts);
 }
 
 SkImageGenerator* SkDecodingImageGenerator::Create(
         SkStreamRewindable* stream,
         const SkDecodingImageGenerator::Options& opts) {
-    SkASSERT(stream != NULL);
-    if (stream == NULL) {
-        return NULL;
+    SkASSERT(stream != nullptr);
+    if (stream == nullptr) {
+        return nullptr;
     }
-    return CreateDecodingImageGenerator(NULL, stream, opts);
+    return CreateDecodingImageGenerator(nullptr, stream, opts);
 }
diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp
index 0be295c..daeee9f 100644
--- a/src/images/SkImageDecoder.cpp
+++ b/src/images/SkImageDecoder.cpp
@@ -15,8 +15,8 @@
 #include "SkCanvas.h"
 
 SkImageDecoder::SkImageDecoder()
-    : fPeeker(NULL)
-    , fAllocator(NULL)
+    : fPeeker(nullptr)
+    , fAllocator(nullptr)
     , fSampleSize(1)
     , fDefaultPref(kUnknown_SkColorType)
     , fPreserveSrcDepth(false)
@@ -32,7 +32,7 @@
 }
 
 void SkImageDecoder::copyFieldsToOther(SkImageDecoder* other) {
-    if (NULL == other) {
+    if (nullptr == other) {
         return;
     }
     other->setPeeker(fPeeker);
@@ -188,7 +188,7 @@
     if (dst->isNull()) {
         dst->setInfo(src->info().makeWH(w, h));
 
-        if (!this->allocPixelRef(dst, NULL)) {
+        if (!this->allocPixelRef(dst, nullptr)) {
             SkDEBUGF(("failed to allocate pixels needed to crop the bitmap"));
             return false;
         }
diff --git a/src/images/SkImageDecoder_FactoryDefault.cpp b/src/images/SkImageDecoder_FactoryDefault.cpp
index e959c8b..77c0a0a 100644
--- a/src/images/SkImageDecoder_FactoryDefault.cpp
+++ b/src/images/SkImageDecoder_FactoryDefault.cpp
@@ -27,10 +27,10 @@
         if (movie) {
             return movie;
         }
-        // we must rewind only if we got NULL, since we gave the stream to the
+        // we must rewind only if we got nullptr, since we gave the stream to the
         // movie, who may have already started reading from it
         stream->rewind();
         curr = curr->next();
     }
-    return NULL;
+    return nullptr;
 }
diff --git a/src/images/SkImageDecoder_FactoryRegistrar.cpp b/src/images/SkImageDecoder_FactoryRegistrar.cpp
index 68202a9..36034d2 100644
--- a/src/images/SkImageDecoder_FactoryRegistrar.cpp
+++ b/src/images/SkImageDecoder_FactoryRegistrar.cpp
@@ -19,7 +19,7 @@
 SkImageDecoder* image_decoder_from_stream(SkStreamRewindable*);
 
 SkImageDecoder* image_decoder_from_stream(SkStreamRewindable* stream) {
-    SkImageDecoder* codec = NULL;
+    SkImageDecoder* codec = nullptr;
     const SkImageDecoder_DecodeReg* curr = SkImageDecoder_DecodeReg::Head();
     while (curr) {
         codec = curr->factory()(stream);
@@ -32,7 +32,7 @@
         if (!rewindSuceeded) {
             SkDEBUGF(("Unable to rewind the image stream."));
             delete codec;
-            return NULL;
+            return nullptr;
         }
 
         if (codec) {
@@ -40,14 +40,14 @@
         }
         curr = curr->next();
     }
-    return NULL;
+    return nullptr;
 }
 
 template SkImageDecoder_FormatReg* SkImageDecoder_FormatReg::gHead;
 
 SkImageDecoder::Format SkImageDecoder::GetStreamFormat(SkStreamRewindable* stream) {
     const SkImageDecoder_FormatReg* curr = SkImageDecoder_FormatReg::Head();
-    while (curr != NULL) {
+    while (curr != nullptr) {
         Format format = curr->factory()(stream);
         if (!stream->rewind()) {
             SkErrorInternals::SetError(kInvalidOperation_SkError,
diff --git a/src/images/SkImageDecoder_astc.cpp b/src/images/SkImageDecoder_astc.cpp
index cb29b4d..e1a6a06 100644
--- a/src/images/SkImageDecoder_astc.cpp
+++ b/src/images/SkImageDecoder_astc.cpp
@@ -135,7 +135,7 @@
         return kSuccess;
     }
 
-    if (!this->allocPixelRef(bm, NULL)) {
+    if (!this->allocPixelRef(bm, nullptr)) {
         return kFailure;
     }
 
@@ -188,7 +188,7 @@
     if (is_astc(stream)) {
         return new SkASTCImageDecoder;
     }
-    return NULL;
+    return nullptr;
 }
 
 static SkImageDecoder_DecodeReg gReg(sk_libastc_dfactory);
diff --git a/src/images/SkImageDecoder_ktx.cpp b/src/images/SkImageDecoder_ktx.cpp
index a7e1a70..a95ab6f 100644
--- a/src/images/SkImageDecoder_ktx.cpp
+++ b/src/images/SkImageDecoder_ktx.cpp
@@ -50,7 +50,7 @@
 SkImageDecoder::Result SkKTXImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
     // TODO: Implement SkStream::copyToData() that's cheap for memory and file streams
     SkAutoDataUnref data(SkCopyStreamToData(stream));
-    if (NULL == data) {
+    if (nullptr == data) {
         return kFailure;
     }
 
@@ -118,7 +118,7 @@
     }
 
     // If we've made it this far, then we know how to grok the data.
-    if (!this->allocPixelRef(bm, NULL)) {
+    if (!this->allocPixelRef(bm, nullptr)) {
         return kFailure;
     }
 
@@ -311,7 +311,7 @@
     if (SkKTXFile::is_ktx(stream)) {
         return new SkKTXImageDecoder;
     }
-    return NULL;
+    return nullptr;
 }
 
 static SkImageDecoder::Format get_format_ktx(SkStreamRewindable* stream) {
@@ -322,7 +322,7 @@
 }
 
 SkImageEncoder* sk_libktx_efactory(SkImageEncoder::Type t) {
-    return (SkImageEncoder::kKTX_Type == t) ? new SkKTXImageEncoder : NULL;
+    return (SkImageEncoder::kKTX_Type == t) ? new SkKTXImageEncoder : nullptr;
 }
 
 static SkImageDecoder_DecodeReg gReg(sk_libktx_dfactory);
diff --git a/src/images/SkImageDecoder_libbmp.cpp b/src/images/SkImageDecoder_libbmp.cpp
index 3884508..1791623 100644
--- a/src/images/SkImageDecoder_libbmp.cpp
+++ b/src/images/SkImageDecoder_libbmp.cpp
@@ -48,7 +48,7 @@
     if (is_bmp(stream)) {
         return new SkBMPImageDecoder;
     }
-    return NULL;
+    return nullptr;
 }
 
 static SkImageDecoder_DecodeReg gReg(sk_libbmp_dfactory);
@@ -74,7 +74,7 @@
         fWidth = width;
         fHeight = height;
         if (fJustBounds) {
-            return NULL;
+            return nullptr;
         }
 
         fRGB.setCount(width * height * 3);  // 3 == r, g, b
@@ -139,7 +139,7 @@
         return kSuccess;
     }
 
-    if (!this->allocPixelRef(bm, NULL)) {
+    if (!this->allocPixelRef(bm, nullptr)) {
         return kFailure;
     }
 
diff --git a/src/images/SkImageDecoder_libgif.cpp b/src/images/SkImageDecoder_libgif.cpp
index 65172ac..ef55a8f 100644
--- a/src/images/SkImageDecoder_libgif.cpp
+++ b/src/images/SkImageDecoder_libgif.cpp
@@ -77,8 +77,8 @@
             if (gStartingIterlaceYValue +
                     SK_ARRAY_COUNT(gStartingIterlaceYValue) == fStartYPtr) {
                 // we done
-                SkDEBUGCODE(fStartYPtr = NULL;)
-                SkDEBUGCODE(fDeltaYPtr = NULL;)
+                SkDEBUGCODE(fStartYPtr = nullptr;)
+                SkDEBUGCODE(fDeltaYPtr = nullptr;)
                 y = 0;
             } else {
                 y = *fStartYPtr++;
@@ -114,21 +114,21 @@
     }
 }
 
-// return NULL on failure
+// return nullptr on failure
 static const ColorMapObject* find_colormap(const GifFileType* gif) {
     const ColorMapObject* cmap = gif->Image.ColorMap;
-    if (NULL == cmap) {
+    if (nullptr == cmap) {
         cmap = gif->SColorMap;
     }
 
-    if (NULL == cmap) {
+    if (nullptr == cmap) {
         // no colormap found
-        return NULL;
+        return nullptr;
     }
     // some sanity checks
     if (cmap && ((unsigned)cmap->ColorCount > 256 ||
                  cmap->ColorCount != (1 << cmap->BitsPerPixel))) {
-        cmap = NULL;
+        cmap = nullptr;
     }
     return cmap;
 }
@@ -197,7 +197,7 @@
         SkAutoLockPixels alp(*bm);
         if (bm->getPixels()) {
             SkColorTable* ct = bm->getColorTable();  // Index8 must have it.
-            SkASSERT(ct != NULL);
+            SkASSERT(ct != nullptr);
             uint32_t count = ct->count();
             SkASSERT(count > 0);
             SkASSERT(count <= 0x100);
@@ -235,7 +235,7 @@
 #if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)
     return DGifCloseFile(gif);
 #else
-    return DGifCloseFile(gif, NULL);
+    return DGifCloseFile(gif, nullptr);
 #endif
 }
 }//namespace
@@ -244,16 +244,16 @@
 #if GIFLIB_MAJOR < 5
     GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc);
 #else
-    GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc, NULL);
+    GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc, nullptr);
 #endif
-    if (NULL == gif) {
+    if (nullptr == gif) {
         return error_return(*bm, "DGifOpen");
     }
 
     SkAutoTCallIProc<GifFileType, close_gif> acp(gif);
 
     SavedImage temp_save;
-    temp_save.ExtensionBlocks=NULL;
+    temp_save.ExtensionBlocks=nullptr;
     temp_save.ExtensionBlockCount=0;
     SkAutoTCallVProc<SavedImage, CheckFreeExtension> acp2(&temp_save);
 
@@ -337,7 +337,7 @@
                 // Declare colorPtr here for scope.
                 SkPMColor colorPtr[256]; // storage for worst-case
                 const ColorMapObject* cmap = find_colormap(gif);
-                if (cmap != NULL) {
+                if (cmap != nullptr) {
                     SkASSERT(cmap->ColorCount == (1 << (cmap->BitsPerPixel)));
                     colorCount = cmap->ColorCount;
                     if (colorCount > 256) {
@@ -350,7 +350,7 @@
                                                        cmap->Colors[index].Blue);
                     }
                 } else {
-                    // find_colormap() returned NULL.  Some (rare, broken)
+                    // find_colormap() returned nullptr.  Some (rare, broken)
                     // GIFs don't have a color table, so we force one.
                     gif_warning(*bm, "missing colormap");
                     colorCount = 256;
@@ -471,7 +471,7 @@
                 return error_return(*bm, "DGifGetExtension");
             }
 
-            while (extData != NULL) {
+            while (extData != nullptr) {
                 /* Create an extension block with our data */
 #if GIFLIB_MAJOR < 5
                 if (AddExtensionBlock(&temp_save, extData[0],
@@ -526,7 +526,7 @@
     if (is_gif(stream)) {
         return new SkGIFImageDecoder;
     }
-    return NULL;
+    return nullptr;
 }
 
 static SkImageDecoder_DecodeReg gReg(sk_libgif_dfactory);
diff --git a/src/images/SkImageDecoder_libico.cpp b/src/images/SkImageDecoder_libico.cpp
index 78f41d9..e8b4bc5 100644
--- a/src/images/SkImageDecoder_libico.cpp
+++ b/src/images/SkImageDecoder_libico.cpp
@@ -127,7 +127,7 @@
     {
         SkMemoryStream subStream(buf + offset, size, false);
         SkAutoTDelete<SkImageDecoder> otherDecoder(SkImageDecoder::Factory(&subStream));
-        if (otherDecoder.get() != NULL) {
+        if (otherDecoder.get() != nullptr) {
             // Disallow nesting ICO files within one another
             // FIXME: Can ICO files contain other formats besides PNG?
             if (otherDecoder->getFormat() == SkImageDecoder::kICO_Format) {
@@ -167,7 +167,7 @@
 
     void (*placePixel)(const int pixelNo, const unsigned char* buf,
         const int xorOffset, int& x, int y, const int w,
-        SkBitmap* bm, int alphaByte, int m, int shift, SkPMColor* colors) = NULL;
+        SkBitmap* bm, int alphaByte, int m, int shift, SkPMColor* colors) = nullptr;
     switch (bitCount)
     {
         case 1:
@@ -212,7 +212,7 @@
 
     //this array represents the colortable
     //if i allow other types of bitmaps, it may actually be used as a part of the bitmap
-    SkPMColor* colors = NULL;
+    SkPMColor* colors = nullptr;
     int blue, green, red;
     if (colorCount)
     {
@@ -252,7 +252,7 @@
         return kSuccess;
     }
 
-    if (!this->allocPixelRef(bm, NULL))
+    if (!this->allocPixelRef(bm, nullptr))
     {
         delete[] colors;
         return kFailure;
@@ -437,7 +437,7 @@
     if (is_ico(stream)) {
         return new SkICOImageDecoder;
     }
-    return NULL;
+    return nullptr;
 }
 
 static SkImageDecoder_DecodeReg gReg(sk_libico_dfactory);
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index d403b74..4b0d18b 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -65,8 +65,8 @@
 }
 
 static void initialize_info(jpeg_decompress_struct* cinfo, skjpeg_source_mgr* src_mgr) {
-    SkASSERT(cinfo != NULL);
-    SkASSERT(src_mgr != NULL);
+    SkASSERT(cinfo != nullptr);
+    SkASSERT(src_mgr != nullptr);
     jpeg_create_decompress(cinfo);
     cinfo->src = src_mgr;
     /* To suppress warnings with a SK_DEBUG binary, set the
@@ -205,7 +205,7 @@
 public:
 #ifdef SK_BUILD_FOR_ANDROID
     SkJPEGImageDecoder() {
-        fImageIndex = NULL;
+        fImageIndex = nullptr;
         fImageWidth = 0;
         fImageHeight = 0;
     }
@@ -250,7 +250,7 @@
 /* Automatically clean up after throwing an exception */
 class JPEGAutoClean {
 public:
-    JPEGAutoClean(): cinfo_ptr(NULL) {}
+    JPEGAutoClean(): cinfo_ptr(nullptr) {}
     ~JPEGAutoClean() {
         if (cinfo_ptr) {
             jpeg_destroy_decompress(cinfo_ptr);
@@ -372,8 +372,8 @@
  *  Common code for setting the error manager.
  */
 static void set_error_mgr(jpeg_decompress_struct* cinfo, skjpeg_error_mgr* errorManager) {
-    SkASSERT(cinfo != NULL);
-    SkASSERT(errorManager != NULL);
+    SkASSERT(cinfo != nullptr);
+    SkASSERT(errorManager != nullptr);
     cinfo->err = jpeg_std_error(errorManager);
     errorManager->error_exit = skjpeg_error_exit;
 }
@@ -384,7 +384,7 @@
  *  resulting bitmap.
  */
 static void turn_off_visual_optimizations(jpeg_decompress_struct* cinfo) {
-    SkASSERT(cinfo != NULL);
+    SkASSERT(cinfo != nullptr);
     /* this gives about 30% performance improvement. In theory it may
        reduce the visual quality, in practice I'm not seeing a difference
      */
@@ -398,7 +398,7 @@
  * Common code for setting the dct method.
  */
 static void set_dct_method(const SkImageDecoder& decoder, jpeg_decompress_struct* cinfo) {
-    SkASSERT(cinfo != NULL);
+    SkASSERT(cinfo != nullptr);
 #ifdef DCT_IFAST_SUPPORTED
     if (decoder.getPreferQualityOverSpeed()) {
         cinfo->dct_method = JDCT_ISLOW;
@@ -411,7 +411,7 @@
 }
 
 SkColorType SkJPEGImageDecoder::getBitmapColorType(jpeg_decompress_struct* cinfo) {
-    SkASSERT(cinfo != NULL);
+    SkASSERT(cinfo != nullptr);
 
     SrcDepth srcDepth = k32Bit_SrcDepth;
     if (JCS_GRAYSCALE == cinfo->jpeg_color_space) {
@@ -471,7 +471,7 @@
 static void adjust_out_color_space_and_dither(jpeg_decompress_struct* cinfo,
                                               SkColorType colorType,
                                               const SkImageDecoder& decoder) {
-    SkASSERT(cinfo != NULL);
+    SkASSERT(cinfo != nullptr);
 #ifdef ANDROID_RGB
     cinfo->dither_mode = JDITHER_NONE;
     if (JCS_CMYK == cinfo->out_color_space) {
@@ -511,7 +511,7 @@
 static bool get_src_config(const jpeg_decompress_struct& cinfo,
                            SkScaledBitmapSampler::SrcConfig* sc,
                            int* srcBytesPerPixel) {
-    SkASSERT(sc != NULL && srcBytesPerPixel != NULL);
+    SkASSERT(sc != nullptr && srcBytesPerPixel != nullptr);
     if (JCS_CMYK == cinfo.out_color_space) {
         // In this case we will manually convert the CMYK values to RGB
         *sc = SkScaledBitmapSampler::kRGBX;
@@ -634,7 +634,7 @@
     if (SkImageDecoder::kDecodeBounds_Mode == mode) {
         return kSuccess;
     }
-    if (!this->allocPixelRef(bm, NULL)) {
+    if (!this->allocPixelRef(bm, nullptr)) {
         return return_failure(cinfo, *bm, "allocPixelRef");
     }
 
@@ -930,7 +930,7 @@
     update_components_sizes(cinfo, componentSizes, kActualSize_SizeType);
     jpeg_finish_decompress(&cinfo);
 
-    if (NULL != colorSpace) {
+    if (nullptr != colorSpace) {
         *colorSpace = kJPEG_SkYUVColorSpace;
     }
 
@@ -1004,7 +1004,7 @@
 }
 
 bool SkJPEGImageDecoder::onDecodeSubset(SkBitmap* bm, const SkIRect& region) {
-    if (NULL == fImageIndex) {
+    if (nullptr == fImageIndex) {
         return false;
     }
     jpeg_decompress_struct* cinfo = fImageIndex->cinfo();
@@ -1063,7 +1063,7 @@
                     ((startX - rect.x()) / actualSampleSize == 0) &&
                     ((startY - rect.y()) / actualSampleSize == 0);
     if (swapOnly) {
-        if (!this->allocPixelRef(&bitmap, NULL)) {
+        if (!this->allocPixelRef(&bitmap, nullptr)) {
             return return_false(*cinfo, bitmap, "allocPixelRef");
         }
     } else {
@@ -1333,7 +1333,7 @@
         case kIndex_8_SkColorType:
             return Write_Index_YUV;
         default:
-            return NULL;
+            return nullptr;
     }
 }
 
@@ -1345,7 +1345,7 @@
 #endif
 
         SkAutoLockPixels alp(bm);
-        if (NULL == bm.getPixels()) {
+        if (nullptr == bm.getPixels()) {
             return false;
         }
 
@@ -1364,7 +1364,7 @@
 
         // Keep after setjmp or mark volatile.
         const WriteScanline writer = ChooseWriter(bm);
-        if (NULL == writer) {
+        if (nullptr == writer) {
             return false;
         }
 
@@ -1391,7 +1391,7 @@
         const int       width = bm.width();
         uint8_t*        oneRowP = (uint8_t*)oneRow.reset(width * 3);
 
-        const SkPMColor* colors = bm.getColorTable() ? bm.getColorTable()->readColors() : NULL;
+        const SkPMColor* colors = bm.getColorTable() ? bm.getColorTable()->readColors() : nullptr;
         const void*      srcRow = bm.getPixels();
 
         while (cinfo.next_scanline < cinfo.image_height) {
@@ -1436,7 +1436,7 @@
     if (is_jpeg(stream)) {
         return new SkJPEGImageDecoder;
     }
-    return NULL;
+    return nullptr;
 }
 
 static SkImageDecoder::Format get_format_jpeg(SkStreamRewindable* stream) {
@@ -1447,7 +1447,7 @@
 }
 
 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) {
-    return (SkImageEncoder::kJPEG_Type == t) ? new SkJPEGImageEncoder : NULL;
+    return (SkImageEncoder::kJPEG_Type == t) ? new SkJPEGImageEncoder : nullptr;
 }
 
 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory);
diff --git a/src/images/SkImageDecoder_libpng.cpp b/src/images/SkImageDecoder_libpng.cpp
index bccdfc8..31ec4dd 100644
--- a/src/images/SkImageDecoder_libpng.cpp
+++ b/src/images/SkImageDecoder_libpng.cpp
@@ -26,19 +26,19 @@
 
 /* These were dropped in libpng >= 1.4 */
 #ifndef png_infopp_NULL
-#define png_infopp_NULL NULL
+#define png_infopp_NULL nullptr
 #endif
 
 #ifndef png_bytepp_NULL
-#define png_bytepp_NULL NULL
+#define png_bytepp_NULL nullptr
 #endif
 
 #ifndef int_p_NULL
-#define int_p_NULL NULL
+#define int_p_NULL nullptr
 #endif
 
 #ifndef png_flush_ptr_NULL
-#define png_flush_ptr_NULL NULL
+#define png_flush_ptr_NULL nullptr
 #endif
 
 #if defined(SK_DEBUG)
@@ -62,7 +62,7 @@
         , fPng_ptr(png_ptr)
         , fInfo_ptr(info_ptr)
         , fColorType(kUnknown_SkColorType) {
-        SkASSERT(stream != NULL);
+        SkASSERT(stream != nullptr);
     }
     ~SkPNGImageIndex() {
         if (fPng_ptr) {
@@ -79,7 +79,7 @@
 class SkPNGImageDecoder : public SkImageDecoder {
 public:
     SkPNGImageDecoder() {
-        fImageIndex = NULL;
+        fImageIndex = nullptr;
     }
     Format getFormat() const override {
         return kPNG_Format;
@@ -205,7 +205,7 @@
     int num_trans;
 
     if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
-        png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, NULL);
+        png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, nullptr);
         return num_trans > 0;
     }
     return false;
@@ -219,13 +219,13 @@
                                      png_infop *info_ptrp) {
     /* Create and initialize the png_struct with the desired error handler
     * functions.  If you want to use the default stderr and longjump method,
-    * you can supply NULL for the last three parameters.  We also supply the
+    * you can supply nullptr for the last three parameters.  We also supply the
     * the compiler header file version, so that we know if the application
     * was compiled with a compatible version of the library.  */
 
     png_error_ptr user_warning_fn =
-        (c_suppressPNGImageDecoderWarnings) ? (&do_nothing_warning_fn) : NULL;
-    /* NULL means to leave as default library behavior. */
+        (c_suppressPNGImageDecoderWarnings) ? (&do_nothing_warning_fn) : nullptr;
+    /* nullptr means to leave as default library behavior. */
     /* c_suppressPNGImageDecoderWarnings default depends on SK_DEBUG. */
     /* To suppress warnings with a SK_DEBUG binary, set the
      * environment variable "skia_images_png_suppressDecoderWarnings"
@@ -233,9 +233,9 @@
      * SK_CONF_SET("images.png.suppressDecoderWarnings", true); */
 
     png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
-        NULL, sk_error_fn, user_warning_fn);
+        nullptr, sk_error_fn, user_warning_fn);
     //   png_voidp user_error_ptr, user_error_fn, user_warning_fn);
-    if (png_ptr == NULL) {
+    if (png_ptr == nullptr) {
         return false;
     }
 
@@ -243,7 +243,7 @@
 
     /* Allocate/initialize the memory for image information. */
     png_infop info_ptr = png_create_info_struct(png_ptr);
-    if (info_ptr == NULL) {
+    if (info_ptr == nullptr) {
         png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
         return false;
     }
@@ -348,7 +348,7 @@
     // to |= PNG_COLOR_MASK_ALPHA, but all of its pixels are in fact opaque. We care, since we
     // draw lots faster if we can flag the bitmap has being opaque
     bool reallyHasAlpha = false;
-    SkColorTable* colorTable = NULL;
+    SkColorTable* colorTable = nullptr;
 
     if (pngColorType == PNG_COLOR_TYPE_PALETTE) {
         decodePalette(png_ptr, info_ptr, bitDepth, &hasAlpha, &reallyHasAlpha, &colorTable);
@@ -357,7 +357,7 @@
     SkAutoUnref aur(colorTable);
 
     if (!this->allocPixelRef(decodedBitmap,
-                             kIndex_8_SkColorType == colorType ? colorTable : NULL)) {
+                             kIndex_8_SkColorType == colorType ? colorTable : nullptr)) {
         return kFailure;
     }
 
@@ -402,7 +402,7 @@
         SkScaledBitmapSampler::SrcConfig sc;
         int srcBytesPerPixel = 4;
 
-        if (colorTable != NULL) {
+        if (colorTable != nullptr) {
             sc = SkScaledBitmapSampler::kIndex;
             srcBytesPerPixel = 1;
         } else if (kAlpha_8_SkColorType == colorType) {
@@ -420,7 +420,7 @@
             even if our decodedBitmap doesn't, due to the request that we
             upscale png's palette to a direct model
          */
-        const SkPMColor* colors = colorTable ? colorTable->readColors() : NULL;
+        const SkPMColor* colors = colorTable ? colorTable->readColors() : nullptr;
         if (!sampler.begin(decodedBitmap, sc, *this, colors)) {
             return kFailure;
         }
@@ -532,14 +532,14 @@
             *colorTypep = kIndex_8_SkColorType;
         }
     } else {
-        png_color_16p transpColor = NULL;
+        png_color_16p transpColor = nullptr;
         int numTransp = 0;
 
-        png_get_tRNS(png_ptr, info_ptr, NULL, &numTransp, &transpColor);
+        png_get_tRNS(png_ptr, info_ptr, nullptr, &numTransp, &transpColor);
 
         bool valid = png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS);
 
-        if (valid && numTransp == 1 && transpColor != NULL) {
+        if (valid && numTransp == 1 && transpColor != nullptr) {
             /*  Compute our transparent color, which we'll match against later.
                 We don't really handle 16bit components properly here, since we
                 do our compare *after* the values have been knocked down to 8bit
@@ -627,7 +627,7 @@
         *colorTypep = kN32_SkColorType;
     }
 
-    if (fImageIndex != NULL) {
+    if (fImageIndex != nullptr) {
         if (kUnknown_SkColorType == fImageIndex->fColorType) {
             // This is the first time for this subset decode. From now on,
             // all decodes must be in the same colortype.
@@ -672,7 +672,7 @@
     SkPMColor* colorPtr = colorStorage;
 
     if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
-        png_get_tRNS(png_ptr, info_ptr, &trans, &numTrans, NULL);
+        png_get_tRNS(png_ptr, info_ptr, &trans, &numTrans, nullptr);
         *hasAlphap = (numTrans > 0);
     } else {
         numTrans = 0;
@@ -761,7 +761,7 @@
 }
 
 bool SkPNGImageDecoder::onDecodeSubset(SkBitmap* bm, const SkIRect& region) {
-    if (NULL == fImageIndex) {
+    if (nullptr == fImageIndex) {
         return false;
     }
 
@@ -805,7 +805,7 @@
     // to |= PNG_COLOR_MASK_ALPHA, but all of its pixels are in fact opaque. We care, since we
     // draw lots faster if we can flag the bitmap has being opaque
     bool reallyHasAlpha = false;
-    SkColorTable* colorTable = NULL;
+    SkColorTable* colorTable = nullptr;
 
     if (pngColorType == PNG_COLOR_TYPE_PALETTE) {
         decodePalette(png_ptr, info_ptr, bitDepth, &hasAlpha, &reallyHasAlpha, &colorTable);
@@ -822,11 +822,11 @@
                           (h == decodedBitmap.height()) && bm->isNull();
     const bool needColorTable = kIndex_8_SkColorType == colorType;
     if (swapOnly) {
-        if (!this->allocPixelRef(&decodedBitmap, needColorTable ? colorTable : NULL)) {
+        if (!this->allocPixelRef(&decodedBitmap, needColorTable ? colorTable : nullptr)) {
             return false;
         }
     } else {
-        if (!decodedBitmap.tryAllocPixels(NULL, needColorTable ? colorTable : NULL)) {
+        if (!decodedBitmap.tryAllocPixels(nullptr, needColorTable ? colorTable : nullptr)) {
             return false;
         }
     }
@@ -882,7 +882,7 @@
         SkScaledBitmapSampler::SrcConfig sc;
         int srcBytesPerPixel = 4;
 
-        if (colorTable != NULL) {
+        if (colorTable != nullptr) {
             sc = SkScaledBitmapSampler::kIndex;
             srcBytesPerPixel = 1;
         } else if (kAlpha_8_SkColorType == colorType) {
@@ -900,7 +900,7 @@
             even if our decodedBitmap doesn't, due to the request that we
             upscale png's palette to a direct model
          */
-        const SkPMColor* colors = colorTable ? colorTable->readColors() : NULL;
+        const SkPMColor* colors = colorTable ? colorTable->readColors() : nullptr;
         if (!sampler.begin(&decodedBitmap, sc, *this, colors)) {
             return false;
         }
@@ -1025,7 +1025,7 @@
         }
     }
     sk_throw();
-    return NULL;
+    return nullptr;
 }
 
 // return the minimum legal bitdepth (by png standards) for this many colortable
@@ -1053,7 +1053,7 @@
 static inline int pack_palette(SkColorTable* ctable,
                                png_color* SK_RESTRICT palette,
                                png_byte* SK_RESTRICT trans, bool hasAlpha) {
-    const SkPMColor* SK_RESTRICT colors = ctable ? ctable->readColors() : NULL;
+    const SkPMColor* SK_RESTRICT colors = ctable ? ctable->readColors() : nullptr;
     const int ctCount = ctable->count();
     int i, num_trans = 0;
 
@@ -1182,14 +1182,14 @@
     png_structp png_ptr;
     png_infop info_ptr;
 
-    png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, sk_error_fn,
-                                      NULL);
-    if (NULL == png_ptr) {
+    png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, sk_error_fn,
+                                      nullptr);
+    if (nullptr == png_ptr) {
         return false;
     }
 
     info_ptr = png_create_info_struct(png_ptr);
-    if (NULL == info_ptr) {
+    if (nullptr == info_ptr) {
         png_destroy_write_struct(&png_ptr,  png_infopp_NULL);
         return false;
     }
@@ -1226,7 +1226,7 @@
         int numTrans = pack_palette(ct, paletteColors, trans, hasAlpha);
         png_set_PLTE(png_ptr, info_ptr, paletteColors, ct->count());
         if (numTrans > 0) {
-            png_set_tRNS(png_ptr, info_ptr, trans, numTrans, NULL);
+            png_set_tRNS(png_ptr, info_ptr, trans, numTrans, nullptr);
         }
     }
 #ifdef PNG_sBIT_SUPPORTED
@@ -1271,7 +1271,7 @@
     if (is_png(stream)) {
         return new SkPNGImageDecoder;
     }
-    return NULL;
+    return nullptr;
 }
 
 static SkImageDecoder::Format get_format_png(SkStreamRewindable* stream) {
@@ -1282,7 +1282,7 @@
 }
 
 SkImageEncoder* sk_libpng_efactory(SkImageEncoder::Type t) {
-    return (SkImageEncoder::kPNG_Type == t) ? new SkPNGImageEncoder : NULL;
+    return (SkImageEncoder::kPNG_Type == t) ? new SkPNGImageEncoder : nullptr;
 }
 
 static SkImageDecoder_DecodeReg gDReg(sk_libpng_dfactory);
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp
index e0c1d64..6fe4771 100644
--- a/src/images/SkImageDecoder_libwebp.cpp
+++ b/src/images/SkImageDecoder_libwebp.cpp
@@ -137,7 +137,7 @@
 public:
     AutoTimeMillis(const char label[]) :
         fLabel(label) {
-        if (NULL == fLabel) {
+        if (nullptr == fLabel) {
             fLabel = "";
         }
         fNow = SkTime::GetMSecs();
@@ -196,8 +196,8 @@
 // Incremental WebP image decoding. Reads input buffer of 64K size iteratively
 // and decodes this block to appropriate color-space as per config object.
 static bool webp_idecode(SkStream* stream, WebPDecoderConfig* config) {
-    WebPIDecoder* idec = WebPIDecode(NULL, 0, config);
-    if (NULL == idec) {
+    WebPIDecoder* idec = WebPIDecode(nullptr, 0, config);
+    if (nullptr == idec) {
         WebPFreeDecBuffer(&config->output);
         return false;
     }
@@ -210,7 +210,7 @@
             SkTMin(stream->getLength(), WEBP_IDECODE_BUFFER_SZ) : WEBP_IDECODE_BUFFER_SZ;
     SkAutoMalloc srcStorage(readBufferSize);
     unsigned char* input = (uint8_t*)srcStorage.get();
-    if (NULL == input) {
+    if (nullptr == input) {
         WebPIDelete(idec);
         WebPFreeDecBuffer(&config->output);
         return false;
@@ -374,7 +374,7 @@
         }
         // alloc from native heap if it is a temp bitmap. (prevent GC)
         bool allocResult = (bitmap == decodedBitmap)
-                               ? allocPixelRef(bitmap, NULL)
+                               ? allocPixelRef(bitmap, nullptr)
                                : bitmap->tryAllocPixels();
         if (!allocResult) {
             return return_false(*decodedBitmap, "allocPixelRef");
@@ -425,7 +425,7 @@
         return kSuccess;
     }
 
-    if (!this->allocPixelRef(decodedBitmap, NULL)) {
+    if (!this->allocPixelRef(decodedBitmap, nullptr)) {
         return return_failure(*decodedBitmap, "allocPixelRef");
     }
 
@@ -571,7 +571,7 @@
             *bpp = 3;
             return Index8_To_RGB;
         default:
-            return NULL;
+            return nullptr;
     }
 }
 
@@ -594,7 +594,7 @@
     const bool hasAlpha = !bm.isOpaque();
     int bpp = -1;
     const ScanlineImporter scanline_import = ChooseImporter(bm.colorType(), hasAlpha, &bpp);
-    if (NULL == scanline_import) {
+    if (nullptr == scanline_import) {
         return false;
     }
     if (-1 == bpp) {
@@ -602,7 +602,7 @@
     }
 
     SkAutoLockPixels alp(bm);
-    if (NULL == bm.getPixels()) {
+    if (nullptr == bm.getPixels()) {
         return false;
     }
 
@@ -618,7 +618,7 @@
     pic.writer = stream_writer;
     pic.custom_ptr = (void*)stream;
 
-    const SkPMColor* colors = bm.getColorTable() ? bm.getColorTable()->readColors() : NULL;
+    const SkPMColor* colors = bm.getColorTable() ? bm.getColorTable()->readColors() : nullptr;
     const uint8_t* src = (uint8_t*)bm.getPixels();
     const int rgbStride = pic.width * bpp;
 
@@ -653,7 +653,7 @@
 static SkImageDecoder* sk_libwebp_dfactory(SkStreamRewindable* stream) {
     int width, height, hasAlpha;
     if (!webp_parse_header(stream, &width, &height, &hasAlpha)) {
-        return NULL;
+        return nullptr;
     }
 
     // Magic matches, call decoder
@@ -669,7 +669,7 @@
 }
 
 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) {
-    return (SkImageEncoder::kWEBP_Type == t) ? new SkWEBPImageEncoder : NULL;
+    return (SkImageEncoder::kWEBP_Type == t) ? new SkWEBPImageEncoder : nullptr;
 }
 
 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory);
diff --git a/src/images/SkImageDecoder_pkm.cpp b/src/images/SkImageDecoder_pkm.cpp
index f407308..7100461 100644
--- a/src/images/SkImageDecoder_pkm.cpp
+++ b/src/images/SkImageDecoder_pkm.cpp
@@ -57,7 +57,7 @@
         return kSuccess;
     }
 
-    if (!this->allocPixelRef(bm, NULL)) {
+    if (!this->allocPixelRef(bm, nullptr)) {
         return kFailure;
     }
 
@@ -113,7 +113,7 @@
     if (is_pkm(stream)) {
         return new SkPKMImageDecoder;
     }
-    return NULL;
+    return nullptr;
 }
 
 static SkImageDecoder_DecodeReg gReg(sk_libpkm_dfactory);
diff --git a/src/images/SkImageDecoder_wbmp.cpp b/src/images/SkImageDecoder_wbmp.cpp
index 82127c3..335966b 100644
--- a/src/images/SkImageDecoder_wbmp.cpp
+++ b/src/images/SkImageDecoder_wbmp.cpp
@@ -158,7 +158,7 @@
     if (head.init(stream)) {
         return new SkWBMPImageDecoder;
     }
-    return NULL;
+    return nullptr;
 }
 
 static SkImageDecoder::Format get_format_wbmp(SkStreamRewindable* stream) {
diff --git a/src/images/SkImageEncoder.cpp b/src/images/SkImageEncoder.cpp
index a6f109a..cc1b73b 100644
--- a/src/images/SkImageEncoder.cpp
+++ b/src/images/SkImageEncoder.cpp
@@ -31,7 +31,7 @@
     if (this->onEncode(&stream, bm, quality)) {
         return stream.copyToData();
     }
-    return NULL;
+    return nullptr;
 }
 
 bool SkImageEncoder::EncodeFile(const char file[], const SkBitmap& bm, Type t,
@@ -48,15 +48,15 @@
 
 SkData* SkImageEncoder::EncodeData(const SkBitmap& bm, Type t, int quality) {
     SkAutoTDelete<SkImageEncoder> enc(SkImageEncoder::Create(t));
-    return enc.get() ? enc.get()->encodeData(bm, quality) : NULL;
+    return enc.get() ? enc.get()->encodeData(bm, quality) : nullptr;
 }
 
 SkData* SkImageEncoder::EncodeData(const SkImageInfo& info, const void* pixels, size_t rowBytes,
                                    Type t, int quality) {
     SkBitmap bm;
     if (!bm.installPixels(info, const_cast<void*>(pixels), rowBytes)) {
-        return NULL;
+        return nullptr;
     }
     SkAutoTDelete<SkImageEncoder> enc(SkImageEncoder::Create(t));
-    return enc.get() ? enc.get()->encodeData(bm, quality) : NULL;
+    return enc.get() ? enc.get()->encodeData(bm, quality) : nullptr;
 }
diff --git a/src/images/SkImageEncoder_Factory.cpp b/src/images/SkImageEncoder_Factory.cpp
index 2931d12..8d4cc65 100644
--- a/src/images/SkImageEncoder_Factory.cpp
+++ b/src/images/SkImageEncoder_Factory.cpp
@@ -11,13 +11,13 @@
 template SkImageEncoder_EncodeReg* SkImageEncoder_EncodeReg::gHead;
 
 SkImageEncoder* SkImageEncoder::Create(Type t) {
-    SkImageEncoder* codec = NULL;
+    SkImageEncoder* codec = nullptr;
     const SkImageEncoder_EncodeReg* curr = SkImageEncoder_EncodeReg::Head();
     while (curr) {
-        if ((codec = curr->factory()(t)) != NULL) {
+        if ((codec = curr->factory()(t)) != nullptr) {
             return codec;
         }
         curr = curr->next();
     }
-    return NULL;
+    return nullptr;
 }
diff --git a/src/images/SkImageEncoder_argb.cpp b/src/images/SkImageEncoder_argb.cpp
index 9da15cf..3cd0388 100644
--- a/src/images/SkImageEncoder_argb.cpp
+++ b/src/images/SkImageEncoder_argb.cpp
@@ -82,23 +82,23 @@
         case kIndex_8_SkColorType:
             return Index8_To_ARGB;
         default:
-            return NULL;
+            return nullptr;
     }
 }
 
 bool SkARGBImageEncoder::onEncode(SkWStream* stream, const SkBitmap& bitmap, int) {
     const ScanlineImporter scanline_import = ChooseImporter(bitmap.colorType());
-    if (NULL == scanline_import) {
+    if (nullptr == scanline_import) {
         return false;
     }
 
     SkAutoLockPixels alp(bitmap);
     const uint8_t* src = (uint8_t*)bitmap.getPixels();
-    if (NULL == bitmap.getPixels()) {
+    if (nullptr == bitmap.getPixels()) {
         return false;
     }
 
-    const SkPMColor* colors = bitmap.getColorTable() ? bitmap.getColorTable()->readColors() : NULL;
+    const SkPMColor* colors = bitmap.getColorTable() ? bitmap.getColorTable()->readColors() : nullptr;
 
     const int argbStride = bitmap.width() * 4;
     SkAutoTDeleteArray<uint8_t> ada(new uint8_t[argbStride]);
diff --git a/src/images/SkJpegUtility.cpp b/src/images/SkJpegUtility.cpp
index 937c5ec..10249ea 100644
--- a/src/images/SkJpegUtility.cpp
+++ b/src/images/SkJpegUtility.cpp
@@ -47,7 +47,7 @@
 
 static boolean sk_fill_input_buffer(j_decompress_ptr cinfo) {
     skjpeg_source_mgr* src = (skjpeg_source_mgr*)cinfo->src;
-    if (src->fDecoder != NULL && src->fDecoder->shouldCancelDecode()) {
+    if (src->fDecoder != nullptr && src->fDecoder->shouldCancelDecode()) {
         return FALSE;
     }
     size_t bytes = src->fStream->read(src->fBuffer, skjpeg_source_mgr::kBufferSize);
diff --git a/src/images/SkMovie.cpp b/src/images/SkMovie.cpp
index 2a1339f..9749011 100644
--- a/src/images/SkMovie.cpp
+++ b/src/images/SkMovie.cpp
@@ -91,5 +91,5 @@
 
 SkMovie* SkMovie::DecodeFile(const char path[]) {
     SkAutoTDelete<SkStreamRewindable> stream(SkStream::NewFromFile(path));
-    return stream.get() ? SkMovie::DecodeStream(stream) : NULL;
+    return stream.get() ? SkMovie::DecodeStream(stream) : nullptr;
 }
diff --git a/src/images/SkMovie_gif.cpp b/src/images/SkMovie_gif.cpp
index c40f552..1031079 100644
--- a/src/images/SkMovie_gif.cpp
+++ b/src/images/SkMovie_gif.cpp
@@ -48,15 +48,15 @@
 #if GIFLIB_MAJOR < 5
     fGIF = DGifOpen( stream, Decode );
 #else
-    fGIF = DGifOpen( stream, Decode, NULL );
+    fGIF = DGifOpen( stream, Decode, nullptr );
 #endif
-    if (NULL == fGIF)
+    if (nullptr == fGIF)
         return;
 
     if (DGifSlurp(fGIF) != GIF_OK)
     {
-        DGifCloseFile(fGIF, NULL);
-        fGIF = NULL;
+        DGifCloseFile(fGIF, nullptr);
+        fGIF = nullptr;
     }
     fCurrIndex = -1;
     fLastDrawIndex = -1;
@@ -66,7 +66,7 @@
 SkGIFMovie::~SkGIFMovie()
 {
     if (fGIF)
-        DGifCloseFile(fGIF, NULL);
+        DGifCloseFile(fGIF, nullptr);
 }
 
 static SkMSec savedimage_duration(const SavedImage* image)
@@ -85,7 +85,7 @@
 
 bool SkGIFMovie::onGetInfo(Info* info)
 {
-    if (NULL == fGIF)
+    if (nullptr == fGIF)
         return false;
 
     SkMSec dur = 0;
@@ -101,7 +101,7 @@
 
 bool SkGIFMovie::onSetTime(SkMSec time)
 {
-    if (NULL == fGIF)
+    if (nullptr == fGIF)
         return false;
 
     SkMSec dur = 0;
@@ -239,12 +239,12 @@
         }
     }
 
-    if (frame->ImageDesc.ColorMap != NULL) {
+    if (frame->ImageDesc.ColorMap != nullptr) {
         // use local color table
         cmap = frame->ImageDesc.ColorMap;
     }
 
-    if (cmap == NULL || cmap->ColorCount != (1 << cmap->BitsPerPixel)) {
+    if (cmap == nullptr || cmap->ColorCount != (1 << cmap->BitsPerPixel)) {
         SkDEBUGFAIL("bad colortable setup");
         return;
     }
@@ -345,7 +345,7 @@
 bool SkGIFMovie::onGetBitmap(SkBitmap* bm)
 {
     const GifFileType* gif = fGIF;
-    if (NULL == gif)
+    if (nullptr == gif)
         return false;
 
     if (gif->ImageCount < 1) {
@@ -392,7 +392,7 @@
     }
 
     SkColor bgColor = SkPackARGB32(0, 0, 0, 0);
-    if (gif->SColorMap != NULL) {
+    if (gif->SColorMap != nullptr) {
         const GifColorType& col = gif->SColorMap->Colors[fGIF->SBackGroundColor];
         bgColor = SkColorSetARGB(0xFF, col.Red, col.Green, col.Blue);
     }
@@ -404,7 +404,7 @@
             bool trans;
             int disposal;
             getTransparencyAndDisposalMethod(cur, &trans, &disposal);
-            if (!trans && gif->SColorMap != NULL) {
+            if (!trans && gif->SColorMap != nullptr) {
                 fPaintingColor = bgColor;
             } else {
                 fPaintingColor = SkColorSetARGB(0, 0, 0, 0);
@@ -446,7 +446,7 @@
             return new SkGIFMovie(stream);
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 static SkTRegistry<SkMovie*(*)(SkStreamRewindable*)> gReg(Factory);
diff --git a/src/images/SkScaledBitmapSampler.cpp b/src/images/SkScaledBitmapSampler.cpp
index 1d8d98d..5ffd648 100644
--- a/src/images/SkScaledBitmapSampler.cpp
+++ b/src/images/SkScaledBitmapSampler.cpp
@@ -343,7 +343,7 @@
 get_RGBA_to_4444_proc(const SkScaledBitmapSampler::Options& opts) {
     if (!opts.fPremultiplyAlpha) {
         // Unpremultiplied is not supported for 4444
-        return NULL;
+        return nullptr;
     }
     if (opts.fSkipZeros) {
         if (opts.fDither) {
@@ -515,7 +515,7 @@
 get_index_to_4444_proc(const SkScaledBitmapSampler::Options& opts) {
     // Unpremul not allowed
     if (!opts.fPremultiplyAlpha) {
-        return NULL;
+        return nullptr;
     }
     if (opts.fSkipZeros) {
         if (opts.fDither) {
@@ -548,7 +548,7 @@
 get_index_to_index_proc(const SkScaledBitmapSampler::Options& opts) {
     // Unpremul not allowed
     if (!opts.fPremultiplyAlpha) {
-        return NULL;
+        return nullptr;
     }
     // Ignore dither and skip zeroes
     return Sample_Index_DI;
@@ -563,14 +563,14 @@
     // except we assume that there is alpha for speed, since an A8
     // bitmap with no alpha is not interesting.
     (void) Sample_Index_DI(dstRow, src, width, deltaSrc, /* y unused */ 0,
-                           /* ctable unused */ NULL);
+                           /* ctable unused */ nullptr);
     return true;
 }
 
 static SkScaledBitmapSampler::RowProc
 get_gray_to_A8_proc(const SkScaledBitmapSampler::Options& opts) {
     if (!opts.fPremultiplyAlpha) {
-        return NULL;
+        return nullptr;
     }
     // Ignore skip and dither.
     return Sample_Gray_DA8;
@@ -583,9 +583,9 @@
 
 SkScaledBitmapSampler::SkScaledBitmapSampler(int width, int height,
                                              int sampleSize) {
-    fCTable = NULL;
-    fDstRow = NULL;
-    fRowProc = NULL;
+    fCTable = nullptr;
+    fDstRow = nullptr;
+    fRowProc = nullptr;
 
     if (width <= 0 || height <= 0) {
         sk_throw();
@@ -631,7 +631,7 @@
         get_RGBx_to_8888_proc,
         get_RGBA_to_8888_proc,
         get_index_to_8888_proc,
-        NULL, // 565 to 8888
+        nullptr, // 565 to 8888
 
         get_gray_to_565_proc,
         get_RGBx_to_565_proc,
@@ -643,19 +643,19 @@
         get_RGBx_to_4444_proc,
         get_RGBA_to_4444_proc,
         get_index_to_4444_proc,
-        NULL, // 565 to 4444
+        nullptr, // 565 to 4444
 
-        NULL, // gray to index
-        NULL, // rgbx to index
-        NULL, // rgba to index
+        nullptr, // gray to index
+        nullptr, // rgbx to index
+        nullptr, // rgba to index
         get_index_to_index_proc,
-        NULL, // 565 to index
+        nullptr, // 565 to index
 
         get_gray_to_A8_proc,
-        NULL, // rgbx to a8
-        NULL, // rgba to a8
-        NULL, // index to a8
-        NULL, // 565 to a8
+        nullptr, // rgbx to a8
+        nullptr, // rgba to a8
+        nullptr, // index to a8
+        nullptr, // 565 to a8
     };
 
     // The jump between dst configs in the table
@@ -716,15 +716,15 @@
     }
 
     RowProcChooser chooser = gProcChoosers[index];
-    if (NULL == chooser) {
-        fRowProc = NULL;
+    if (nullptr == chooser) {
+        fRowProc = nullptr;
     } else {
         fRowProc = chooser(opts);
     }
     fDstRow = (char*)dst->getPixels();
     fDstRowBytes = dst->rowBytes();
     fCurrY = 0;
-    return fRowProc != NULL;
+    return fRowProc != nullptr;
 }
 
 bool SkScaledBitmapSampler::begin(SkBitmap* dst, SrcConfig sc,
@@ -794,41 +794,41 @@
 //  ~D~U                D~U                     ~DU                         DU
 SkScaledBitmapSampler::RowProc gTestProcs[] = {
     // Gray
-    Sample_Gray_DA8,    Sample_Gray_DA8,        NULL,                       NULL,                       // to A8
-    NULL,               NULL,                   NULL,                       NULL,                       // to Index8
+    Sample_Gray_DA8,    Sample_Gray_DA8,        nullptr,                       nullptr,                       // to A8
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to Index8
     Sample_Gray_D565,   Sample_Gray_D565_D,     Sample_Gray_D565,           Sample_Gray_D565_D,         // to 565
     Sample_Gray_D4444,  Sample_Gray_D4444_D,    Sample_Gray_D4444,          Sample_Gray_D4444_D,        // to 4444
     Sample_Gray_D8888,  Sample_Gray_D8888,      Sample_Gray_D8888,          Sample_Gray_D8888,          // to 8888
     // Index
-    NULL,               NULL,                   NULL,                       NULL,                       // to A8
-    Sample_Index_DI,    Sample_Index_DI,        NULL,                       NULL,                       // to Index8
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to A8
+    Sample_Index_DI,    Sample_Index_DI,        nullptr,                       nullptr,                       // to Index8
     Sample_Index_D565,  Sample_Index_D565_D,    Sample_Index_D565,          Sample_Index_D565_D,        // to 565
-    Sample_Index_D4444, Sample_Index_D4444_D,   NULL,                       NULL,                       // to 4444
+    Sample_Index_D4444, Sample_Index_D4444_D,   nullptr,                       nullptr,                       // to 4444
     Sample_Index_D8888, Sample_Index_D8888,     Sample_Index_D8888,         Sample_Index_D8888,         // to 8888
     // RGB
-    NULL,               NULL,                   NULL,                       NULL,                       // to A8
-    NULL,               NULL,                   NULL,                       NULL,                       // to Index8
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to A8
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to Index8
     Sample_RGBx_D565,   Sample_RGBx_D565_D,     Sample_RGBx_D565,           Sample_RGBx_D565_D,         // to 565
     Sample_RGBx_D4444,  Sample_RGBx_D4444_D,    Sample_RGBx_D4444,          Sample_RGBx_D4444_D,        // to 4444
     Sample_RGBx_D8888,  Sample_RGBx_D8888,      Sample_RGBx_D8888,          Sample_RGBx_D8888,          // to 8888
     // RGBx is the same as RGB
-    NULL,               NULL,                   NULL,                       NULL,                       // to A8
-    NULL,               NULL,                   NULL,                       NULL,                       // to Index8
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to A8
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to Index8
     Sample_RGBx_D565,   Sample_RGBx_D565_D,     Sample_RGBx_D565,           Sample_RGBx_D565_D,         // to 565
     Sample_RGBx_D4444,  Sample_RGBx_D4444_D,    Sample_RGBx_D4444,          Sample_RGBx_D4444_D,        // to 4444
     Sample_RGBx_D8888,  Sample_RGBx_D8888,      Sample_RGBx_D8888,          Sample_RGBx_D8888,          // to 8888
     // RGBA
-    NULL,               NULL,                   NULL,                       NULL,                       // to A8
-    NULL,               NULL,                   NULL,                       NULL,                       // to Index8
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to A8
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to Index8
     Sample_RGBx_D565,   Sample_RGBx_D565_D,     Sample_RGBx_D565,           Sample_RGBx_D565_D,         // to 565
-    Sample_RGBA_D4444,  Sample_RGBA_D4444_D,    NULL,                       NULL,                       // to 4444
+    Sample_RGBA_D4444,  Sample_RGBA_D4444_D,    nullptr,                       nullptr,                       // to 4444
     Sample_RGBA_D8888,  Sample_RGBA_D8888,      Sample_RGBA_D8888_Unpremul, Sample_RGBA_D8888_Unpremul, // to 8888
     // RGB_565
-    NULL,               NULL,                   NULL,                       NULL,                       // to A8
-    NULL,               NULL,                   NULL,                       NULL,                       // to Index8
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to A8
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to Index8
     Sample_D565_D565,   Sample_D565_D565,       Sample_D565_D565,           Sample_D565_D565,           // to 565
-    NULL,               NULL,                   NULL,                       NULL,                       // to 4444
-    NULL,               NULL,                   NULL,                       NULL,                       // to 8888
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to 4444
+    nullptr,               nullptr,                   nullptr,                       nullptr,                       // to 8888
 };
 
 // Dummy class that allows instantiation of an ImageDecoder, so begin can query its fields.
diff --git a/src/images/SkScaledBitmapSampler.h b/src/images/SkScaledBitmapSampler.h
index 90c4142..198dc07 100644
--- a/src/images/SkScaledBitmapSampler.h
+++ b/src/images/SkScaledBitmapSampler.h
@@ -49,9 +49,9 @@
     // prepares iterator to process the src colors and write them into dst.
     // Returns false if the request cannot be fulfulled.
     bool begin(SkBitmap* dst, SrcConfig sc, const SkImageDecoder& decoder,
-               const SkPMColor* = NULL);
+               const SkPMColor* = nullptr);
     bool begin(SkBitmap* dst, SrcConfig sc, const Options& opts,
-               const SkPMColor* = NULL);
+               const SkPMColor* = nullptr);
     // call with row of src pixels, for y = 0...scaledHeight-1.
     // returns true if the row had non-opaque alpha in it
     bool next(const uint8_t* SK_RESTRICT src);
diff --git a/src/images/bmpdecoderhelper.cpp b/src/images/bmpdecoderhelper.cpp
index 5a1b39a..9171b5d 100644
--- a/src/images/bmpdecoderhelper.cpp
+++ b/src/images/bmpdecoderhelper.cpp
@@ -163,7 +163,7 @@
   }
 
   output_ = callback->SetSize(width_, height_);
-  if (NULL == output_) {
+  if (nullptr == output_) {
     return true;  // meaning we succeeded, but they want us to stop now
   }
 
diff --git a/src/images/bmpdecoderhelper.h b/src/images/bmpdecoderhelper.h
index a0116de..b448734 100644
--- a/src/images/bmpdecoderhelper.h
+++ b/src/images/bmpdecoderhelper.h
@@ -57,7 +57,7 @@
   /**
    * This is called once for an image. It is passed the width and height and
    * should return the address of a buffer that is large enough to store
-   * all of the resulting pixels (widht * height * 3 bytes). If it returns NULL,
+   * all of the resulting pixels (widht * height * 3 bytes). If it returns nullptr,
    * then the decoder will abort, but return true, as the caller has received
    * valid dimensions.
    */
diff --git a/src/lazy/SkCachingPixelRef.cpp b/src/lazy/SkCachingPixelRef.cpp
index f65e545..692e4ea 100644
--- a/src/lazy/SkCachingPixelRef.cpp
+++ b/src/lazy/SkCachingPixelRef.cpp
@@ -11,8 +11,8 @@
 
 bool SkCachingPixelRef::Install(SkImageGenerator* generator,
                                 SkBitmap* dst) {
-    SkASSERT(dst != NULL);
-    if (NULL == generator) {
+    SkASSERT(dst != nullptr);
+    if (nullptr == generator) {
         return false;
     }
     const SkImageInfo info = generator->getInfo();
@@ -32,7 +32,7 @@
     , fImageGenerator(generator)
     , fErrorInDecoding(false)
     , fRowBytes(rowBytes) {
-    SkASSERT(fImageGenerator != NULL);
+    SkASSERT(fImageGenerator != nullptr);
 }
 SkCachingPixelRef::~SkCachingPixelRef() {
     delete fImageGenerator;
@@ -62,9 +62,9 @@
 
     // Now bitmap should contain a concrete PixelRef of the decoded image.
     void* pixels = fLockedBitmap.getPixels();
-    SkASSERT(pixels != NULL);
+    SkASSERT(pixels != nullptr);
     rec->fPixels = pixels;
-    rec->fColorTable = NULL;
+    rec->fColorTable = nullptr;
     rec->fRowBytes = fLockedBitmap.rowBytes();
     return true;
 }
diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp
index 898d766..17b8c23 100644
--- a/src/lazy/SkDiscardableMemoryPool.cpp
+++ b/src/lazy/SkDiscardableMemoryPool.cpp
@@ -29,7 +29,7 @@
     /**
      *  Without mutex, will be not be thread safe.
      */
-    DiscardableMemoryPool(size_t budget, SkBaseMutex* mutex = NULL);
+    DiscardableMemoryPool(size_t budget, SkBaseMutex* mutex = nullptr);
     virtual ~DiscardableMemoryPool();
 
     SkDiscardableMemory* create(size_t bytes) override;
@@ -99,8 +99,8 @@
     , fLocked(true)
     , fPointer(pointer)
     , fBytes(bytes) {
-    SkASSERT(fPool != NULL);
-    SkASSERT(fPointer != NULL);
+    SkASSERT(fPool != nullptr);
+    SkASSERT(fPointer != nullptr);
     SkASSERT(fBytes > 0);
     fPool->ref();
 }
@@ -146,7 +146,7 @@
 }
 
 void DiscardableMemoryPool::dumpDownTo(size_t budget) {
-    if (fMutex != NULL) {
+    if (fMutex != nullptr) {
         fMutex->assertHeld();
     }
     if (fUsed <= budget) {
@@ -158,9 +158,9 @@
     while ((fUsed > budget) && (cur)) {
         if (!cur->fLocked) {
             PoolDiscardableMemory* dm = cur;
-            SkASSERT(dm->fPointer != NULL);
+            SkASSERT(dm->fPointer != nullptr);
             sk_free(dm->fPointer);
-            dm->fPointer = NULL;
+            dm->fPointer = nullptr;
             SkASSERT(fUsed >= dm->fBytes);
             fUsed -= dm->fBytes;
             cur = iter.prev();
@@ -175,8 +175,8 @@
 
 SkDiscardableMemory* DiscardableMemoryPool::create(size_t bytes) {
     void* addr = sk_malloc_flags(bytes, 0);
-    if (NULL == addr) {
-        return NULL;
+    if (nullptr == addr) {
+        return nullptr;
     }
     PoolDiscardableMemory* dm = new PoolDiscardableMemory(this, addr, bytes);
     SkAutoMutexAcquire autoMutexAcquire(fMutex);
@@ -189,9 +189,9 @@
 void DiscardableMemoryPool::free(PoolDiscardableMemory* dm) {
     SkAutoMutexAcquire autoMutexAcquire(fMutex);
     // This is called by dm's destructor.
-    if (dm->fPointer != NULL) {
+    if (dm->fPointer != nullptr) {
         sk_free(dm->fPointer);
-        dm->fPointer = NULL;
+        dm->fPointer = nullptr;
         SkASSERT(fUsed >= dm->fBytes);
         fUsed -= dm->fBytes;
         fList.remove(dm);
@@ -201,8 +201,8 @@
 }
 
 bool DiscardableMemoryPool::lock(PoolDiscardableMemory* dm) {
-    SkASSERT(dm != NULL);
-    if (NULL == dm->fPointer) {
+    SkASSERT(dm != nullptr);
+    if (nullptr == dm->fPointer) {
         #if SK_LAZY_CACHE_STATS
         SkAutoMutexAcquire autoMutexAcquire(fMutex);
         ++fCacheMisses;
@@ -210,7 +210,7 @@
         return false;
     }
     SkAutoMutexAcquire autoMutexAcquire(fMutex);
-    if (NULL == dm->fPointer) {
+    if (nullptr == dm->fPointer) {
         // May have been purged while waiting for lock.
         #if SK_LAZY_CACHE_STATS
         ++fCacheMisses;
@@ -227,7 +227,7 @@
 }
 
 void DiscardableMemoryPool::unlock(PoolDiscardableMemory* dm) {
-    SkASSERT(dm != NULL);
+    SkASSERT(dm != nullptr);
     SkAutoMutexAcquire autoMutexAcquire(fMutex);
     dm->fLocked = false;
     this->dumpDownTo(fBudget);
diff --git a/src/lazy/SkDiscardableMemoryPool.h b/src/lazy/SkDiscardableMemoryPool.h
index 33c176d..92ba48b 100644
--- a/src/lazy/SkDiscardableMemoryPool.h
+++ b/src/lazy/SkDiscardableMemoryPool.h
@@ -53,7 +53,7 @@
      *  Without mutex, will be not be thread safe.
      */
     static SkDiscardableMemoryPool* Create(
-            size_t size, SkBaseMutex* mutex = NULL);
+            size_t size, SkBaseMutex* mutex = nullptr);
 };
 
 /**
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
index 01bfd83..9ac9819 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -17,10 +17,10 @@
     , 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 @@
 }
 
 bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
-    if (fDiscardableMemory != NULL) {
+    if (fDiscardableMemory != nullptr) {
         if (fDiscardableMemory->lock()) {
             fDiscardableMemoryIsLocked = true;
             rec->fPixels = fDiscardableMemory->data();
@@ -48,20 +48,20 @@
             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 @@
         fDiscardableMemory->unlock();
         fDiscardableMemoryIsLocked = false;
         delete fDiscardableMemory;
-        fDiscardableMemory = NULL;
+        fDiscardableMemory = nullptr;
         return false;
     }
 
@@ -87,7 +87,7 @@
     if (colorCount > 0) {
         fCTable.reset(new SkColorTable(colors, colorCount));
     } else {
-        fCTable.reset(NULL);
+        fCTable.reset(nullptr);
     }
 
     rec->fPixels = pixels;
@@ -104,7 +104,7 @@
 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 @@
 // 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;
 }
diff --git a/src/opts/SkBitmapProcState_arm_neon.cpp b/src/opts/SkBitmapProcState_arm_neon.cpp
index fa30242..d1f71c2 100644
--- a/src/opts/SkBitmapProcState_arm_neon.cpp
+++ b/src/opts/SkBitmapProcState_arm_neon.cpp
@@ -96,11 +96,11 @@
     SI8_D16_filter_DX_neon,
 
     // Don't support 4444 -> 565
-    NULL, NULL, NULL, NULL,
+    nullptr, nullptr, nullptr, nullptr,
     // Don't support A8 -> 565
-    NULL, NULL, NULL, NULL,
+    nullptr, nullptr, nullptr, nullptr,
     // Don't support G8 -> 565 (but we could)
-    NULL, NULL, NULL, NULL,
+    nullptr, nullptr, nullptr, nullptr,
 };
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/src/opts/SkBitmapProcState_opts_SSE2.cpp b/src/opts/SkBitmapProcState_opts_SSE2.cpp
index f55a099..68d920d 100644
--- a/src/opts/SkBitmapProcState_opts_SSE2.cpp
+++ b/src/opts/SkBitmapProcState_opts_SSE2.cpp
@@ -14,7 +14,7 @@
 void S32_opaque_D32_filter_DX_SSE2(const SkBitmapProcState& s,
                                    const uint32_t* xy,
                                    int count, uint32_t* colors) {
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
     SkASSERT(kN32_SkColorType == s.fPixmap.colorType());
     SkASSERT(s.fAlphaScale == 256);
@@ -120,7 +120,7 @@
 void S32_alpha_D32_filter_DX_SSE2(const SkBitmapProcState& s,
                                   const uint32_t* xy,
                                   int count, uint32_t* colors) {
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
     SkASSERT(kN32_SkColorType == s.fPixmap.colorType());
     SkASSERT(s.fAlphaScale < 256);
@@ -640,7 +640,7 @@
 void S32_D16_filter_DX_SSE2(const SkBitmapProcState& s,
                             const uint32_t* xy,
                             int count, uint16_t* colors) {
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
     SkASSERT(kN32_SkColorType == s.fPixmap.colorType());
     SkASSERT(s.fPixmap.isOpaque());
diff --git a/src/opts/SkBitmapProcState_opts_SSSE3.cpp b/src/opts/SkBitmapProcState_opts_SSSE3.cpp
index 15a9664..8e381eb 100644
--- a/src/opts/SkBitmapProcState_opts_SSSE3.cpp
+++ b/src/opts/SkBitmapProcState_opts_SSSE3.cpp
@@ -393,7 +393,7 @@
 void S32_generic_D32_filter_DX_SSSE3(const SkBitmapProcState& s,
                                      const uint32_t* xy,
                                      int count, uint32_t* colors) {
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
     SkASSERT(kN32_SkColorType == s.fPixmap.colorType());
     if (has_alpha) {
@@ -585,7 +585,7 @@
 void S32_generic_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s,
                                        const uint32_t* xy,
                                        int count, uint32_t* colors) {
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
     SkASSERT(kN32_SkColorType == s.fPixmap.colorType());
     if (has_alpha) {
diff --git a/src/opts/SkBitmapProcState_opts_mips_dsp.cpp b/src/opts/SkBitmapProcState_opts_mips_dsp.cpp
index 6b8195c..dac4e20 100644
--- a/src/opts/SkBitmapProcState_opts_mips_dsp.cpp
+++ b/src/opts/SkBitmapProcState_opts_mips_dsp.cpp
@@ -15,7 +15,7 @@
 static void SI8_D16_nofilter_DX_mips_dsp(const SkBitmapProcState& s,
                                          const uint32_t* SK_RESTRICT xy,
                                          int count, uint16_t* SK_RESTRICT colors) {
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
     SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
     const uint16_t* SK_RESTRICT table = s.fPixmap.ctable()->read16BitCache();
@@ -147,7 +147,7 @@
 static void SI8_opaque_D32_nofilter_DX_mips_dsp(const SkBitmapProcState& s,
                                                 const uint32_t* SK_RESTRICT xy,
                                                 int count, SkPMColor* SK_RESTRICT colors) {
-    SkASSERT(count > 0 && colors != NULL);
+    SkASSERT(count > 0 && colors != nullptr);
     SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
     SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
     const SkPMColor* SK_RESTRICT table = s.fPixmap.ctable()->readColors();
@@ -380,10 +380,10 @@
         case kIndex_8_SkColorType:
             if (justDx && kNone_SkFilterQuality == fFilterLevel) {
                 fSampleProc16 = SI8_D16_nofilter_DX_mips_dsp;
-                fShaderProc16 = NULL;
+                fShaderProc16 = nullptr;
                 if (isOpaque) {
                     fSampleProc32 = SI8_opaque_D32_nofilter_DX_mips_dsp;
-                    fShaderProc32 = NULL;
+                    fShaderProc32 = nullptr;
                 }
             }
             break;
diff --git a/src/opts/SkBlitMask_opts_arm.cpp b/src/opts/SkBlitMask_opts_arm.cpp
index e58be5c..c5a9ea4 100644
--- a/src/opts/SkBlitMask_opts_arm.cpp
+++ b/src/opts/SkBlitMask_opts_arm.cpp
@@ -22,5 +22,5 @@
 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType dstCT,
                                                  SkMask::Format maskFormat,
                                                  RowFlags flags) {
-    return NULL;
+    return nullptr;
 }
diff --git a/src/opts/SkBlitMask_opts_none.cpp b/src/opts/SkBlitMask_opts_none.cpp
index 5c318c7..f26ee78 100644
--- a/src/opts/SkBlitMask_opts_none.cpp
+++ b/src/opts/SkBlitMask_opts_none.cpp
@@ -8,11 +8,11 @@
 #include "SkBlitMask.h"
 
 SkBlitMask::BlitLCD16RowProc SkBlitMask::PlatformBlitRowProcs16(bool isOpaque) {
-    return NULL;
+    return nullptr;
 }
 
 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType dstCT,
                                                  SkMask::Format maskFormat,
                                                  RowFlags flags) {
-    return NULL;
+    return nullptr;
 }
diff --git a/src/opts/SkBlitRow_opts_arm.cpp b/src/opts/SkBlitRow_opts_arm.cpp
index d51b24b..5770c1f 100644
--- a/src/opts/SkBlitRow_opts_arm.cpp
+++ b/src/opts/SkBlitRow_opts_arm.cpp
@@ -11,15 +11,15 @@
 #include "SkBlitRow_opts_arm_neon.h"
 
 static const SkBlitRow::Proc16 sk_blitrow_platform_565_procs_arm[] = {
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
 };
 
 static const SkBlitRow::ColorProc16 sk_blitrow_platform_565_colorprocs_arm[] = {
-    NULL, NULL,
+    nullptr, nullptr,
 };
 
 static const SkBlitRow::Proc32 sk_blitrow_platform_32_procs_arm[] = {
-    NULL, NULL, NULL, NULL,
+    nullptr, nullptr, nullptr, nullptr,
 };
 
 SkBlitRow::Proc16 SkBlitRow::PlatformFactory565(unsigned flags) {
@@ -35,6 +35,6 @@
 }
 
 SkBlitRow::Color32Proc SkBlitRow::PlatformColor32Proc() {
-    #define sk_blitrow_color32_arm NULL
+    #define sk_blitrow_color32_arm nullptr
     return SK_ARM_NEON_WRAP(sk_blitrow_color32_arm);
 }
diff --git a/src/opts/SkBlitRow_opts_arm_neon.cpp b/src/opts/SkBlitRow_opts_arm_neon.cpp
index 4db82a5..d5260af 100644
--- a/src/opts/SkBlitRow_opts_arm_neon.cpp
+++ b/src/opts/SkBlitRow_opts_arm_neon.cpp
@@ -1541,14 +1541,14 @@
 #if 0
     S32A_D565_Blend_neon,
 #else
-    NULL,   // https://code.google.com/p/skia/issues/detail?id=2797
+    nullptr,   // https://code.google.com/p/skia/issues/detail?id=2797
 #endif
 
     // dither
     S32_D565_Opaque_Dither_neon,
     S32_D565_Blend_Dither_neon,
     S32A_D565_Opaque_Dither_neon,
-    NULL,   // S32A_D565_Blend_Dither
+    nullptr,   // S32A_D565_Blend_Dither
 };
 
 const SkBlitRow::ColorProc16 sk_blitrow_platform_565_colorprocs_arm_neon[] = {
@@ -1559,7 +1559,7 @@
 };
 
 const SkBlitRow::Proc32 sk_blitrow_platform_32_procs_arm_neon[] = {
-    NULL,   // S32_Opaque,
+    nullptr,   // S32_Opaque,
     S32_Blend_BlitRow32_neon,        // S32_Blend,
     /*
      * We have two choices for S32A_Opaque procs. The one reads the src alpha
@@ -1579,7 +1579,7 @@
 #ifdef SK_CPU_ARM32
     S32A_Blend_BlitRow32_neon        // S32A_Blend
 #else
-    NULL
+    nullptr
 #endif
 };
 
diff --git a/src/opts/SkBlitRow_opts_mips_dsp.cpp b/src/opts/SkBlitRow_opts_mips_dsp.cpp
index c6747f0..e25f7c5 100644
--- a/src/opts/SkBlitRow_opts_mips_dsp.cpp
+++ b/src/opts/SkBlitRow_opts_mips_dsp.cpp
@@ -920,7 +920,7 @@
 
 const SkBlitRow::Proc16 platform_565_procs_mips_dsp[] = {
     // no dither
-    NULL,
+    nullptr,
     S32_D565_Blend_mips_dsp,
     S32A_D565_Opaque_mips_dsp,
     S32A_D565_Blend_mips_dsp,
@@ -929,14 +929,14 @@
     S32_D565_Opaque_Dither_mips_dsp,
     S32_D565_Blend_Dither_mips_dsp,
     S32A_D565_Opaque_Dither_mips_dsp,
-    NULL,
+    nullptr,
 };
 
 static const SkBlitRow::Proc32 platform_32_procs_mips_dsp[] = {
-    NULL,   // S32_Opaque,
+    nullptr,   // S32_Opaque,
     S32_Blend_BlitRow32_mips_dsp,   // S32_Blend,
-    NULL,   // S32A_Opaque,
-    NULL,   // S32A_Blend,
+    nullptr,   // S32A_Opaque,
+    nullptr,   // S32A_Blend,
 };
 
 SkBlitRow::Proc16 SkBlitRow::PlatformFactory565(unsigned flags) {
@@ -944,7 +944,7 @@
 }
 
 SkBlitRow::ColorProc16 SkBlitRow::PlatformColorFactory565(unsigned flags) {
-    return NULL;
+    return nullptr;
 }
 
 SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) {
diff --git a/src/opts/SkBlitRow_opts_none.cpp b/src/opts/SkBlitRow_opts_none.cpp
index 86bb221..03298e8 100644
--- a/src/opts/SkBlitRow_opts_none.cpp
+++ b/src/opts/SkBlitRow_opts_none.cpp
@@ -10,15 +10,15 @@
 // Platform impl of Platform_procs with no overrides
 
 SkBlitRow::Proc16 SkBlitRow::PlatformFactory565(unsigned flags) {
-    return NULL;
+    return nullptr;
 }
 
 SkBlitRow::ColorProc16 SkBlitRow::PlatformColorFactory565(unsigned flags) {
-    return NULL;
+    return nullptr;
 }
 
 SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) {
-    return NULL;
+    return nullptr;
 }
 
-SkBlitRow::Color32Proc SkBlitRow::PlatformColor32Proc() { return NULL; }
+SkBlitRow::Color32Proc SkBlitRow::PlatformColor32Proc() { return nullptr; }
diff --git a/src/opts/SkXfermode_opts.h b/src/opts/SkXfermode_opts.h
index 673387b..7005d59 100644
--- a/src/opts/SkXfermode_opts.h
+++ b/src/opts/SkXfermode_opts.h
@@ -201,7 +201,7 @@
         , fAAProc4(aaproc4) {}
 
     void xfer32(SkPMColor dst[], const SkPMColor src[], int n, const SkAlpha aa[]) const override {
-        if (NULL == aa) {
+        if (nullptr == aa) {
             Sk4px::MapDstSrc(n, dst, src, [&](const Sk4px& dst4, const Sk4px& src4) {
                 return fProc4(src4, dst4);
             });
@@ -214,7 +214,7 @@
     }
 
     void xfer16(uint16_t dst[], const SkPMColor src[], int n, const SkAlpha aa[]) const override {
-        if (NULL == aa) {
+        if (nullptr == aa) {
             Sk4px::MapDstSrc(n, dst, src, [&](const Sk4px& dst4, const Sk4px& src4) {
                 return fProc4(src4, dst4);
             });
diff --git a/src/opts/opts_check_x86.cpp b/src/opts/opts_check_x86.cpp
index 2e140e8..d3450c1 100644
--- a/src/opts/opts_check_x86.cpp
+++ b/src/opts/opts_check_x86.cpp
@@ -190,26 +190,26 @@
 
 static const SkBlitRow::Proc16 platform_16_procs[] = {
     S32_D565_Opaque_SSE2,               // S32_D565_Opaque
-    NULL,                               // S32_D565_Blend
+    nullptr,                               // S32_D565_Blend
     S32A_D565_Opaque_SSE2,              // S32A_D565_Opaque
-    NULL,                               // S32A_D565_Blend
+    nullptr,                               // S32A_D565_Blend
     S32_D565_Opaque_Dither_SSE2,        // S32_D565_Opaque_Dither
-    NULL,                               // S32_D565_Blend_Dither
+    nullptr,                               // S32_D565_Blend_Dither
     S32A_D565_Opaque_Dither_SSE2,       // S32A_D565_Opaque_Dither
-    NULL,                               // S32A_D565_Blend_Dither
+    nullptr,                               // S32A_D565_Blend_Dither
 };
 
 SkBlitRow::Proc16 SkBlitRow::PlatformFactory565(unsigned flags) {
     if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) {
         return platform_16_procs[flags];
     } else {
-        return NULL;
+        return nullptr;
     }
 }
 
 static const SkBlitRow::ColorProc16 platform_565_colorprocs_SSE2[] = {
     Color32A_D565_SSE2,                 // Color32A_D565,
-    NULL,                               // Color32A_D565_Dither
+    nullptr,                               // Color32A_D565_Dither
 };
 
 SkBlitRow::ColorProc16 SkBlitRow::PlatformColorFactory565(unsigned flags) {
@@ -221,19 +221,19 @@
     if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) {
         return platform_565_colorprocs_SSE2[flags];
     } else {
-        return NULL;
+        return nullptr;
     }
 }
 
 static const SkBlitRow::Proc32 platform_32_procs_SSE2[] = {
-    NULL,                               // S32_Opaque,
+    nullptr,                               // S32_Opaque,
     S32_Blend_BlitRow32_SSE2,           // S32_Blend,
     S32A_Opaque_BlitRow32_SSE2,         // S32A_Opaque
     S32A_Blend_BlitRow32_SSE2,          // S32A_Blend,
 };
 
 static const SkBlitRow::Proc32 platform_32_procs_SSE4[] = {
-    NULL,                               // S32_Opaque,
+    nullptr,                               // S32_Opaque,
     S32_Blend_BlitRow32_SSE2,           // S32_Blend,
     S32A_Opaque_BlitRow32_SSE4,         // S32A_Opaque
     S32A_Blend_BlitRow32_SSE2,          // S32A_Blend,
@@ -246,7 +246,7 @@
     if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) {
         return platform_32_procs_SSE2[flags];
     } else {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -260,11 +260,11 @@
             return SkBlitLCD16Row_SSE2;
         }
     } else {
-        return NULL;
+        return nullptr;
     }
 
 }
 
 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType, SkMask::Format, RowFlags) {
-    return NULL;
+    return nullptr;
 }
diff --git a/src/pathops/SkDConicLineIntersection.cpp b/src/pathops/SkDConicLineIntersection.cpp
index c9d825d..e6d775f 100644
--- a/src/pathops/SkDConicLineIntersection.cpp
+++ b/src/pathops/SkDConicLineIntersection.cpp
@@ -25,8 +25,8 @@
 
     LineConicIntersections(const SkDConic& c)
         : fConic(c)
-        SkDEBUGPARAMS(fLine(NULL))
-        SkDEBUGPARAMS(fIntersections(NULL))
+        SkDEBUGPARAMS(fLine(nullptr))
+        SkDEBUGPARAMS(fIntersections(nullptr))
         SkDEBUGPARAMS(fAllowNear(false)) {
     }
 
@@ -39,7 +39,7 @@
         for (int index = 0; index < last; ) {
             double conicMidT = ((*fIntersections)[0][index] + (*fIntersections)[0][index + 1]) / 2;
             SkDPoint conicMidPt = fConic.ptAtT(conicMidT);
-            double t = fLine->nearPoint(conicMidPt, NULL);
+            double t = fLine->nearPoint(conicMidPt, nullptr);
             if (t < 0) {
                 ++index;
                 continue;
@@ -186,7 +186,7 @@
             if (fIntersections->hasT(conicT)) {
                 continue;
             }
-            double lineT = fLine->nearPoint(fConic[cIndex], NULL);
+            double lineT = fLine->nearPoint(fConic[cIndex], nullptr);
             if (lineT < 0) {
                 continue;
             }
diff --git a/src/pathops/SkDCubicLineIntersection.cpp b/src/pathops/SkDCubicLineIntersection.cpp
index ee1e3d3..cbdce77 100644
--- a/src/pathops/SkDCubicLineIntersection.cpp
+++ b/src/pathops/SkDCubicLineIntersection.cpp
@@ -98,7 +98,7 @@
         for (int index = 0; index < last; ) {
             double cubicMidT = ((*fIntersections)[0][index] + (*fIntersections)[0][index + 1]) / 2;
             SkDPoint cubicMidPt = fCubic.ptAtT(cubicMidT);
-            double t = fLine.nearPoint(cubicMidPt, NULL);
+            double t = fLine.nearPoint(cubicMidPt, nullptr);
             if (t < 0) {
                 ++index;
                 continue;
@@ -285,7 +285,7 @@
             if (fIntersections->hasT(cubicT)) {
                 continue;
             }
-            double lineT = fLine.nearPoint(fCubic[cIndex], NULL);
+            double lineT = fLine.nearPoint(fCubic[cIndex], nullptr);
             if (lineT < 0) {
                 continue;
             }
diff --git a/src/pathops/SkDLineIntersection.cpp b/src/pathops/SkDLineIntersection.cpp
index bfbbc7e..6fbac97 100644
--- a/src/pathops/SkDLineIntersection.cpp
+++ b/src/pathops/SkDLineIntersection.cpp
@@ -235,12 +235,12 @@
         }
     }
     if (fAllowNear || result == 2) {
-        if ((t = line.nearPoint(leftPt, NULL)) >= 0) {
+        if ((t = line.nearPoint(leftPt, nullptr)) >= 0) {
             insert(t, (double) flipped, leftPt);
         }
         if (left != right) {
             const SkDPoint rightPt = { right, y };
-            if ((t = line.nearPoint(rightPt, NULL)) >= 0) {
+            if ((t = line.nearPoint(rightPt, nullptr)) >= 0) {
                 insert(t, (double) !flipped, rightPt);
             }
             for (int index = 0; index < 2; ++index) {
@@ -311,12 +311,12 @@
         }
     }
     if (fAllowNear || result == 2) {
-        if ((t = line.nearPoint(topPt, NULL)) >= 0) {
+        if ((t = line.nearPoint(topPt, nullptr)) >= 0) {
             insert(t, (double) flipped, topPt);
         }
         if (top != bottom) {
             SkDPoint bottomPt = { x, bottom };
-            if ((t = line.nearPoint(bottomPt, NULL)) >= 0) {
+            if ((t = line.nearPoint(bottomPt, nullptr)) >= 0) {
                 insert(t, (double) !flipped, bottomPt);
             }
             for (int index = 0; index < 2; ++index) {
diff --git a/src/pathops/SkDQuadLineIntersection.cpp b/src/pathops/SkDQuadLineIntersection.cpp
index 5e3596e..64eb868 100644
--- a/src/pathops/SkDQuadLineIntersection.cpp
+++ b/src/pathops/SkDQuadLineIntersection.cpp
@@ -103,8 +103,8 @@
 
     LineQuadraticIntersections(const SkDQuad& q)
         : fQuad(q) 
-        SkDEBUGPARAMS(fLine(NULL))
-        SkDEBUGPARAMS(fIntersections(NULL))
+        SkDEBUGPARAMS(fLine(nullptr))
+        SkDEBUGPARAMS(fIntersections(nullptr))
         SkDEBUGPARAMS(fAllowNear(false)) {
     }
 
@@ -117,7 +117,7 @@
         for (int index = 0; index < last; ) {
             double quadMidT = ((*fIntersections)[0][index] + (*fIntersections)[0][index + 1]) / 2;
             SkDPoint quadMidPt = fQuad.ptAtT(quadMidT);
-            double t = fLine->nearPoint(quadMidPt, NULL);
+            double t = fLine->nearPoint(quadMidPt, nullptr);
             if (t < 0) {
                 ++index;
                 continue;
@@ -291,7 +291,7 @@
             if (fIntersections->hasT(quadT)) {
                 continue;
             }
-            double lineT = fLine->nearPoint(fQuad[qIndex], NULL);
+            double lineT = fLine->nearPoint(fQuad[qIndex], nullptr);
             if (lineT < 0) {
                 continue;
             }
diff --git a/src/pathops/SkIntersectionHelper.h b/src/pathops/SkIntersectionHelper.h
index 79de034..647b94b 100644
--- a/src/pathops/SkIntersectionHelper.h
+++ b/src/pathops/SkIntersectionHelper.h
@@ -25,7 +25,7 @@
 
     bool advance() {
         fSegment = fSegment->next();
-        return fSegment != NULL;
+        return fSegment != nullptr;
     }
 
     SkScalar bottom() const {
@@ -76,7 +76,7 @@
 
     bool startAfter(const SkIntersectionHelper& after) {
         fSegment = after.fSegment->next();
-        return fSegment != NULL;
+        return fSegment != nullptr;
     }
 
     SkScalar top() const {
diff --git a/src/pathops/SkOpAngle.cpp b/src/pathops/SkOpAngle.cpp
index ac596fd..bb10e53 100644
--- a/src/pathops/SkOpAngle.cpp
+++ b/src/pathops/SkOpAngle.cpp
@@ -349,7 +349,7 @@
             goto recomputeSector;
         } while (!oSpan->final() && (oSpan = oSpan->upCast()->next()));
         checkEnd = stepUp ? !checkEnd->final()
-                ? checkEnd->upCast()->next() : NULL
+                ? checkEnd->upCast()->next() : nullptr
                 : checkEnd->prev();
     } while (checkEnd);
 recomputeSector:
@@ -659,7 +659,7 @@
         }
         return;
     }
-    bool singleton = NULL == fNext;
+    bool singleton = nullptr == fNext;
     if (singleton) {
         fNext = this;
     }
@@ -703,7 +703,7 @@
 SkOpSpanBase* SkOpAngle::lastMarked() const {
     if (fLastMarked) {
         if (fLastMarked->chased()) {
-            return NULL;
+            return nullptr;
         }
         fLastMarked->setChased(true);
     }
@@ -759,7 +759,7 @@
     } while (working != angle);
     do {
         SkOpAngle* next = working->fNext;
-        working->fNext = NULL;
+        working->fNext = nullptr;
         insert(working);
         working = next;
     } while (working != angle);
@@ -877,7 +877,7 @@
     fStart = start;
     fComputedEnd = fEnd = end;
     SkASSERT(start != end);
-    fNext = NULL;
+    fNext = nullptr;
     fComputeSector = fComputedSector = fCheckCoincidence = false;
     setSpans();
     setSector();
@@ -929,7 +929,7 @@
 
 void SkOpAngle::setSpans() {
     fUnorderable = false;
-    fLastMarked = NULL;
+    fLastMarked = nullptr;
     if (!fStart) {
         fUnorderable = true;
         return;
diff --git a/src/pathops/SkOpBuilder.cpp b/src/pathops/SkOpBuilder.cpp
index 24a157a..4f53dee 100644
--- a/src/pathops/SkOpBuilder.cpp
+++ b/src/pathops/SkOpBuilder.cpp
@@ -44,7 +44,7 @@
     }
     SkChunkAlloc allocator(4096);
     SkOpContourHead contourHead;
-    SkOpGlobalState globalState(NULL, &contourHead  SkDEBUGPARAMS(NULL));
+    SkOpGlobalState globalState(nullptr, &contourHead  SkDEBUGPARAMS(nullptr));
     SkOpEdgeBuilder builder(*path, &contourHead, &allocator, &globalState);
     builder.finish(&allocator);
     SkASSERT(contourHead.next());
diff --git a/src/pathops/SkOpCoincidence.cpp b/src/pathops/SkOpCoincidence.cpp
index 46d06e9..fb2de5a 100755
--- a/src/pathops/SkOpCoincidence.cpp
+++ b/src/pathops/SkOpCoincidence.cpp
@@ -217,7 +217,7 @@
     }
     bool result;
     fTop = outer;
-    fHead = NULL;
+    fHead = nullptr;
     do {
     // addifmissing can modify the list that this is walking
     // maybe save head so that walker can iterate over old data unperturbed
@@ -467,7 +467,7 @@
 
 void SkOpCoincidence::detach(SkCoincidentSpans* remove) {
     SkCoincidentSpans* coin = fHead;
-    SkCoincidentSpans* prev = NULL;
+    SkCoincidentSpans* prev = nullptr;
     SkCoincidentSpans* next;
     do {
         next = coin->fNext;
@@ -505,7 +505,7 @@
                 expanded = true;
             }
         }
-        SkOpSpanBase* next = end->final() ? NULL : end->upCast()->next();
+        SkOpSpanBase* next = end->final() ? nullptr : end->upCast()->next();
         if (next && (oppPtT = next->contains(oppSegment))) {
             double midT = (end->t() + next->t()) / 2;
             if (segment->isClose(midT, oppSegment)) {
@@ -519,7 +519,7 @@
 }
 
 void SkOpCoincidence::findOverlaps(SkOpCoincidence* overlaps, SkChunkAlloc* allocator) const {
-    overlaps->fHead = overlaps->fTop = NULL;
+    overlaps->fHead = overlaps->fTop = nullptr;
     SkDEBUGCODE_(overlaps->debugSetGlobalState(fDebugState));
     SkCoincidentSpans* outer = fHead;
     while (outer) {
diff --git a/src/pathops/SkOpCoincidence.h b/src/pathops/SkOpCoincidence.h
index 83ba70a..86c6577 100644
--- a/src/pathops/SkOpCoincidence.h
+++ b/src/pathops/SkOpCoincidence.h
@@ -27,9 +27,9 @@
 class SkOpCoincidence {
 public:
     SkOpCoincidence()
-        : fHead(NULL)
-        , fTop(NULL)
-        SkDEBUGPARAMS(fDebugState(NULL))
+        : fHead(nullptr)
+        , fTop(nullptr)
+        SkDEBUGPARAMS(fDebugState(nullptr))
         {
     }
 
@@ -43,19 +43,19 @@
                   SkOpPtT* oppPtTEnd, bool flipped);
 
     const SkOpAngle* debugAngle(int id) const {
-        return SkDEBUGRELEASE(fDebugState->debugAngle(id), NULL);
+        return SkDEBUGRELEASE(fDebugState->debugAngle(id), nullptr);
     }
 
     SkOpContour* debugContour(int id) {
-        return SkDEBUGRELEASE(fDebugState->debugContour(id), NULL);
+        return SkDEBUGRELEASE(fDebugState->debugContour(id), nullptr);
     }
 
     const SkOpPtT* debugPtT(int id) const {
-        return SkDEBUGRELEASE(fDebugState->debugPtT(id), NULL);
+        return SkDEBUGRELEASE(fDebugState->debugPtT(id), nullptr);
     }
 
     const SkOpSegment* debugSegment(int id) const {
-        return SkDEBUGRELEASE(fDebugState->debugSegment(id), NULL);
+        return SkDEBUGRELEASE(fDebugState->debugSegment(id), nullptr);
     }
 
     void debugSetGlobalState(SkOpGlobalState* debugState) {
@@ -65,7 +65,7 @@
     void debugShowCoincidence() const;
 
     const SkOpSpanBase* debugSpan(int id) const {
-        return SkDEBUGRELEASE(fDebugState->debugSpan(id), NULL);
+        return SkDEBUGRELEASE(fDebugState->debugSpan(id), nullptr);
     }
 
     void detach(SkCoincidentSpans* );
diff --git a/src/pathops/SkOpContour.cpp b/src/pathops/SkOpContour.cpp
index 18b6328..2e4b2ca 100644
--- a/src/pathops/SkOpContour.cpp
+++ b/src/pathops/SkOpContour.cpp
@@ -34,7 +34,7 @@
         default:
             SkASSERT(0);
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkOpContour::toPath(SkPathWriter* path) const {
@@ -66,5 +66,5 @@
         segment->undoneSpan(startPtr, endPtr);
         return segment;
     } while ((segment = segment->next()));
-    return NULL;
+    return nullptr;
 }
diff --git a/src/pathops/SkOpContour.h b/src/pathops/SkOpContour.h
index 7ef68b0..b420008 100644
--- a/src/pathops/SkOpContour.h
+++ b/src/pathops/SkOpContour.h
@@ -81,7 +81,7 @@
 
     SkOpContour* appendContour(SkChunkAlloc* allocator) {
         SkOpContour* contour = SkOpTAllocator<SkOpContour>::New(allocator);
-        contour->setNext(NULL);
+        contour->setNext(nullptr);
         SkOpContour* prev = this;
         SkOpContour* next;
         while ((next = prev->next())) {
@@ -129,23 +129,23 @@
 #endif
 
     const SkOpAngle* debugAngle(int id) const {
-        return SkDEBUGRELEASE(this->globalState()->debugAngle(id), NULL);
+        return SkDEBUGRELEASE(this->globalState()->debugAngle(id), nullptr);
     }
 
     SkOpContour* debugContour(int id) {
-        return SkDEBUGRELEASE(this->globalState()->debugContour(id), NULL);
+        return SkDEBUGRELEASE(this->globalState()->debugContour(id), nullptr);
     }
 
     const SkOpPtT* debugPtT(int id) const {
-        return SkDEBUGRELEASE(this->globalState()->debugPtT(id), NULL);
+        return SkDEBUGRELEASE(this->globalState()->debugPtT(id), nullptr);
     }
 
     const SkOpSegment* debugSegment(int id) const {
-        return SkDEBUGRELEASE(this->globalState()->debugSegment(id), NULL);
+        return SkDEBUGRELEASE(this->globalState()->debugSegment(id), nullptr);
     }
 
     const SkOpSpanBase* debugSpan(int id) const {
-        return SkDEBUGRELEASE(this->globalState()->debugSpan(id), NULL);
+        return SkDEBUGRELEASE(this->globalState()->debugSpan(id), nullptr);
     }
 
     SkOpGlobalState* globalState() const {
@@ -155,7 +155,7 @@
     void debugValidate() const {
 #if DEBUG_VALIDATE
         const SkOpSegment* segment = &fHead;
-        const SkOpSegment* prior = NULL;
+        const SkOpSegment* prior = nullptr;
         do {
             segment->debugValidate();
             SkASSERT(segment->prev() == prior);
@@ -302,7 +302,7 @@
             SkASSERT(fCount == 0);
             return;
         }
-        SkASSERT(contour->fNext == NULL);
+        SkASSERT(contour->fNext == nullptr);
         SkOpContour* prev = this;
         SkOpContour* next;
         while ((next = prev->next()) != contour) {
@@ -310,12 +310,12 @@
             prev = next;
         }
         SkASSERT(prev);
-        prev->setNext(NULL);
+        prev->setNext(nullptr);
     }
 
     void reset() {
-        fTail = NULL;
-        fNext = NULL;
+        fTail = nullptr;
+        fNext = nullptr;
         fCount = 0;
         fDone = false;
         fTopsFound = false;
diff --git a/src/pathops/SkOpEdgeBuilder.h b/src/pathops/SkOpEdgeBuilder.h
index f81f727..f11e0e4 100644
--- a/src/pathops/SkOpEdgeBuilder.h
+++ b/src/pathops/SkOpEdgeBuilder.h
@@ -37,7 +37,7 @@
     void complete() {
         if (fCurrentContour && fCurrentContour->count()) {
             fCurrentContour->complete();
-            fCurrentContour = NULL;
+            fCurrentContour = nullptr;
         }
     }
 
diff --git a/src/pathops/SkOpSegment.cpp b/src/pathops/SkOpSegment.cpp
index a52ef4a..99af13a 100644
--- a/src/pathops/SkOpSegment.cpp
+++ b/src/pathops/SkOpSegment.cpp
@@ -50,7 +50,7 @@
     if (SkOpAngle* result = activeAngleOther(start, startPtr, endPtr, done)) {
         return result;
     }
-    return NULL;
+    return nullptr;
 }
 
 SkOpAngle* SkOpSegment::activeAngleInner(SkOpSpanBase* start, SkOpSpanBase** startPtr,
@@ -91,7 +91,7 @@
             SkASSERT(downSpan->done());
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 SkOpAngle* SkOpSegment::activeAngleOther(SkOpSpanBase* start, SkOpSpanBase** startPtr,
@@ -297,7 +297,7 @@
 }
 
 SkOpPtT* SkOpSegment::addMissing(double t, SkOpSegment* opp, SkChunkAlloc* allocator) {
-    SkOpSpanBase* existing = NULL;
+    SkOpSpanBase* existing = nullptr;
     SkOpSpanBase* test = &fHead;
     double testT;
     do {
@@ -373,7 +373,7 @@
         SkASSERT(span != &fTail);
     } while ((span = span->upCast()->next()));
     SkASSERT(0);
-    return NULL;
+    return nullptr;
 }
 
 // choose a solitary t and pt value; remove aliases; align the opposite ends
@@ -519,7 +519,7 @@
         SkOpAngle::IncludeType includeType) {
     SkASSERT(includeType != SkOpAngle::kUnaryXor);
     SkOpAngle* firstAngle = this->spanToAngle(end, start);
-    if (NULL == firstAngle || NULL == firstAngle->next()) {
+    if (nullptr == firstAngle || nullptr == firstAngle->next()) {
         return SK_NaN32;
     }
     // if all angles have a computed winding,
@@ -528,7 +528,7 @@
     //  there's nothing to do
     // if two orderable angles are adjacent, and both are next to orderable angles,
     //  and one has winding computed, transfer to the other
-    SkOpAngle* baseAngle = NULL;
+    SkOpAngle* baseAngle = nullptr;
     bool tryReverse = false;
     // look for counterclockwise transfers
     SkOpAngle* angle = firstAngle->previous();
@@ -541,7 +541,7 @@
         SkASSERT(prior->next() == angle);
         SkASSERT(angle->next() == next);
         if (prior->unorderable() || angle->unorderable() || next->unorderable()) {
-            baseAngle = NULL;
+            baseAngle = nullptr;
             continue;
         }
         int testWinding = angle->starter()->windSum();
@@ -552,7 +552,7 @@
         }
         if (baseAngle) {
             ComputeOneSum(baseAngle, angle, includeType);
-            baseAngle = SK_MinS32 != angle->starter()->windSum() ? angle : NULL;
+            baseAngle = SK_MinS32 != angle->starter()->windSum() ? angle : nullptr;
         }
     } while (next != firstAngle);
     if (baseAngle && SK_MinS32 == firstAngle->starter()->windSum()) {
@@ -560,7 +560,7 @@
         tryReverse = true;
     }
     if (tryReverse) {
-        baseAngle = NULL;
+        baseAngle = nullptr;
         SkOpAngle* prior = firstAngle;
         do {
             angle = prior;
@@ -568,7 +568,7 @@
             SkASSERT(prior->next() == angle);
             next = angle->next();
             if (prior->unorderable() || angle->unorderable() || next->unorderable()) {
-                baseAngle = NULL;
+                baseAngle = nullptr;
                 continue;
             }
             int testWinding = angle->starter()->windSum();
@@ -578,7 +578,7 @@
             }
             if (baseAngle) {
                 ComputeOneSumReverse(baseAngle, angle, includeType);
-                baseAngle = SK_MinS32 != angle->starter()->windSum() ? angle : NULL;
+                baseAngle = SK_MinS32 != angle->starter()->windSum() ? angle : nullptr;
             }
         } while (prior != firstAngle);
     }
@@ -646,7 +646,7 @@
 #endif
         SkOpSpan* startSpan = start->starter(end);
         if (startSpan->done()) {
-            return NULL;
+            return nullptr;
         }
         markDone(startSpan);
         *nextEnd = step > 0 ? (*nextStart)->upCast()->next() : (*nextStart)->prev();
@@ -663,13 +663,13 @@
     if (!sortable) {
         *unsortable = true;
         markDone(start->starter(end));
-        return NULL;
+        return nullptr;
     }
     SkOpAngle* angle = this->spanToAngle(end, start);
     if (angle->unorderable()) {
         *unsortable = true;
         markDone(start->starter(end));
-        return NULL;
+        return nullptr;
     }
 #if DEBUG_SORT
     SkDebugf("%s\n", __FUNCTION__);
@@ -679,14 +679,14 @@
     if (sumMiWinding == SK_MinS32) {
         *unsortable = true;
         markDone(start->starter(end));
-        return NULL;
+        return nullptr;
     }
     int sumSuWinding = updateOppWinding(end, start);
     if (operand()) {
         SkTSwap<int>(sumMiWinding, sumSuWinding);
     }
     SkOpAngle* nextAngle = angle->next();
-    const SkOpAngle* foundAngle = NULL;
+    const SkOpAngle* foundAngle = nullptr;
     bool foundDone = false;
     // iterate through the angle, and compute everyone's winding
     SkOpSegment* nextSegment;
@@ -724,7 +724,7 @@
     } while ((nextAngle = nextAngle->next()) != angle);
     start->segment()->markDone(start->starter(end));
     if (!foundAngle) {
-        return NULL;
+        return nullptr;
     }
     *nextStart = foundAngle->start();
     *nextEnd = foundAngle->end();
@@ -751,7 +751,7 @@
 #endif
         SkOpSpan* startSpan = start->starter(end);
         if (startSpan->done()) {
-            return NULL;
+            return nullptr;
         }
         markDone(startSpan);
         *nextEnd = step > 0 ? (*nextStart)->upCast()->next() : (*nextStart)->prev();
@@ -768,13 +768,13 @@
     if (!sortable) {
         *unsortable = true;
         markDone(start->starter(end));
-        return NULL;
+        return nullptr;
     }
     SkOpAngle* angle = this->spanToAngle(end, start);
     if (angle->unorderable()) {
         *unsortable = true;
         markDone(start->starter(end));
-        return NULL;
+        return nullptr;
     }
 #if DEBUG_SORT
     SkDebugf("%s\n", __FUNCTION__);
@@ -782,7 +782,7 @@
 #endif
     int sumWinding = updateWinding(end, start);
     SkOpAngle* nextAngle = angle->next();
-    const SkOpAngle* foundAngle = NULL;
+    const SkOpAngle* foundAngle = nullptr;
     bool foundDone = false;
     // iterate through the angle, and compute everyone's winding
     SkOpSegment* nextSegment;
@@ -820,7 +820,7 @@
     } while ((nextAngle = nextAngle->next()) != angle);
     start->segment()->markDone(start->starter(end));
     if (!foundAngle) {
-        return NULL;
+        return nullptr;
     }
     *nextStart = foundAngle->start();
     *nextEnd = foundAngle->end();
@@ -847,7 +847,7 @@
 #endif
         SkOpSpan* startSpan = start->starter(end);
         if (startSpan->done()) {
-            return NULL;
+            return nullptr;
         }
         markDone(startSpan);
         *nextEnd = step > 0 ? (*nextStart)->upCast()->next() : (*nextStart)->prev();
@@ -863,14 +863,14 @@
     if (!angle || angle->unorderable()) {
         *unsortable = true;
         markDone(start->starter(end));
-        return NULL;
+        return nullptr;
     }
 #if DEBUG_SORT
     SkDebugf("%s\n", __FUNCTION__);
     angle->debugLoop();
 #endif
     SkOpAngle* nextAngle = angle->next();
-    const SkOpAngle* foundAngle = NULL;
+    const SkOpAngle* foundAngle = nullptr;
     bool foundDone = false;
     // iterate through the angle, and compute everyone's winding
     SkOpSegment* nextSegment;
@@ -888,7 +888,7 @@
     } while (nextAngle != angle);
     start->segment()->markDone(start->starter(end));
     if (!foundAngle) {
-        return NULL;
+        return nullptr;
     }
     *nextStart = foundAngle->start();
     *nextEnd = foundAngle->end();
@@ -906,7 +906,7 @@
 
 void SkOpSegment::init(SkPoint pts[], SkScalar weight, SkOpContour* contour, SkPath::Verb verb) {
     fContour = contour;
-    fNext = NULL;
+    fNext = nullptr;
     fOriginal[0] = pts[0];
     fOriginal[1] = pts[SkPathOpsVerbToPoints(verb)];
     fPts = pts;
@@ -918,7 +918,7 @@
     fTopsFound = false;
     fVisited = false;
     SkOpSpan* zeroSpan = &fHead;
-    zeroSpan->init(this, NULL, 0, fPts[0]);
+    zeroSpan->init(this, nullptr, 0, fPts[0]);
     SkOpSpanBase* oneSpan = &fTail;
     zeroSpan->setNext(oneSpan);
     oneSpan->initBase(this, zeroSpan, 1, fPts[SkPathOpsVerbToPoints(fVerb)]);
@@ -955,7 +955,7 @@
     int step = start->step(end);
     SkOpSpan* minSpan = start->starter(end);
     markDone(minSpan);
-    SkOpSpanBase* last = NULL;
+    SkOpSpanBase* last = nullptr;
     SkOpSegment* other = this;
     while ((other = other->nextChase(&start, &step, &minSpan, &last))) {
         if (other->done()) {
@@ -972,7 +972,7 @@
     SkOpSpan* spanStart = start->starter(end);
     int step = start->step(end);
     bool success = markWinding(spanStart, winding);
-    SkOpSpanBase* last = NULL;
+    SkOpSpanBase* last = nullptr;
     SkOpSegment* other = this;
     while ((other = other->nextChase(&start, &step, &spanStart, &last))) {
         if (spanStart->windSum() != SK_MinS32) {
@@ -993,7 +993,7 @@
     SkOpSpan* spanStart = start->starter(end);
     int step = start->step(end);
     bool success = markWinding(spanStart, winding, oppWinding);
-    SkOpSpanBase* last = NULL;
+    SkOpSpanBase* last = nullptr;
     SkOpSegment* other = this;
     while ((other = other->nextChase(&start, &step, &spanStart, &last))) {
         if (spanStart->windSum() != SK_MinS32) {
@@ -1051,7 +1051,7 @@
     if (oppMaxWinding != oppSumWinding && UseInnerWinding(oppMaxWinding, oppSumWinding)) {
         oppMaxWinding = oppSumWinding;
     }
-    SkOpSpanBase* last = NULL;
+    SkOpSpanBase* last = nullptr;
     // caller doesn't require that this marks anything
     (void) markAndChaseWinding(angle->start(), angle->end(), maxWinding, oppMaxWinding, &last);
 #if DEBUG_WINDING
@@ -1126,7 +1126,7 @@
     if (last) {
         *last = endSpan;
     }
-    return NULL;
+    return nullptr;
 }
 
 SkOpSegment* SkOpSegment::nextChase(SkOpSpanBase** startPtr, int* stepPtr, SkOpSpan** minPtr,
@@ -1139,9 +1139,9 @@
     SkOpSpanBase* foundSpan;
     SkOpSpanBase* otherEnd;
     SkOpSegment* other;
-    if (angle == NULL) {
+    if (angle == nullptr) {
         if (endSpan->t() != 0 && endSpan->t() != 1) {
-            return NULL;
+            return nullptr;
         }
         SkOpPtT* otherPtT = endSpan->ptT()->next();
         other = otherPtT->segment();
@@ -1153,8 +1153,8 @@
             return set_last(last, endSpan);
         }
         const SkOpAngle* next = angle->next();
-        if (NULL == next) {
-            return NULL;
+        if (nullptr == next) {
+            return nullptr;
         }
 #if DEBUG_WINDING
         if (angle->debugSign() != next->debugSign() && !angle->segment()->contour()->isXor()
@@ -1172,7 +1172,7 @@
     }
     SkASSERT(*startPtr);
     if (!otherEnd) {
-        return NULL;
+        return nullptr;
     }
 //    SkASSERT(otherEnd >= 0);
     SkOpSpan* origMin = step < 0 ? origStart->prev() : origStart->upCast();
@@ -1212,7 +1212,7 @@
     if (this->done()) {
         return false;
     }
-    SkOpSpan* prior = NULL;
+    SkOpSpan* prior = nullptr;
     SkOpSpanBase* spanBase = &fHead;
     do {
         SkOpPtT* ptT = spanBase->ptT(), * spanStopPtT = ptT;
@@ -1244,9 +1244,9 @@
             if (spanBase->containsCoinEnd(opp)) {
                 continue;
             } 
-            SkOpPtT* priorPtT = NULL, * priorStopPtT;
+            SkOpPtT* priorPtT = nullptr, * priorStopPtT;
             // find prior span containing opp segment
-            SkOpSegment* priorOpp = NULL;
+            SkOpSegment* priorOpp = nullptr;
             SkOpSpan* priorTest = spanBase->prev();
             while (!priorOpp && priorTest) {
                 priorStopPtT = priorPtT = priorTest->ptT();
@@ -1293,7 +1293,7 @@
                 SkTSwap(priorPtT, ptT);
             }
         }
-    } while ((spanBase = spanBase->final() ? NULL : spanBase->upCast()->next()));
+    } while ((spanBase = spanBase->final() ? nullptr : spanBase->upCast()->next()));
     clear_visited(&fHead);
     return false;
 }
@@ -1339,7 +1339,7 @@
             }
             SkOpSpanBase* oppNext = oppSpan;
             SkOpSpanBase* oppLast = oppSpan;
-            while ((oppNext = oppNext->final() ? NULL : oppNext->upCast()->next())) {
+            while ((oppNext = oppNext->final() ? nullptr : oppNext->upCast()->next())) {
                 if (!roughly_equal(oppNext->t(), oppSpan->t())) {
                     break;
                 }
@@ -1393,7 +1393,7 @@
         } while ((testPtT = testPtT->next()) != startPtT);
 checkNextSpan: 
         ;
-    } while ((test = test->final() ? NULL : test->upCast()->next()));
+    } while ((test = test->final() ? nullptr : test->upCast()->next()));
     debugValidate();
 }
 
@@ -1416,7 +1416,7 @@
         }
         do {  // iterate through all spans associated with start
             SkOpPtT* startBase = spanS->ptT();
-            next = test->final() ? NULL : test->upCast()->next();
+            next = test->final() ? nullptr : test->upCast()->next();
             do {
                 SkOpPtT* testBase = test->ptT();
                 do {
@@ -1506,7 +1506,7 @@
     SkOpSpanBase* span = &this->fHead;
     do {
         SkOpAngle* fromAngle = span->fromAngle();
-        SkOpAngle* toAngle = span->final() ? NULL : span->upCast()->toAngle();
+        SkOpAngle* toAngle = span->final() ? nullptr : span->upCast()->toAngle();
         if (!fromAngle && !toAngle) {
             continue;
         }
@@ -1560,11 +1560,11 @@
             }
         } while ((ptT = ptT->next()) != stopPtT);
         if (baseAngle->loopCount() == 1) {
-            span->setFromAngle(NULL);
+            span->setFromAngle(nullptr);
             if (toAngle) {
-                span->upCast()->setToAngle(NULL);
+                span->upCast()->setToAngle(nullptr);
             }
-            baseAngle = NULL;
+            baseAngle = nullptr;
         }
 #if DEBUG_SORT
         SkASSERT(!baseAngle || baseAngle->loopCount() > 1);
diff --git a/src/pathops/SkOpSegment.h b/src/pathops/SkOpSegment.h
index a3f5989..d1cd29a 100644
--- a/src/pathops/SkOpSegment.h
+++ b/src/pathops/SkOpSegment.h
@@ -222,7 +222,7 @@
     }
 
     SkOpSegment* isSimple(SkOpSpanBase** end, int* step) {
-        return nextChase(end, step, NULL, NULL);
+        return nextChase(end, step, nullptr, nullptr);
     }
 
     bool isVertical() const {
diff --git a/src/pathops/SkOpSpan.cpp b/src/pathops/SkOpSpan.cpp
index df3ef3c..4d437f7 100755
--- a/src/pathops/SkOpSpan.cpp
+++ b/src/pathops/SkOpSpan.cpp
@@ -44,7 +44,7 @@
             return ptT;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 SkOpContour* SkOpPtT::contour() const {
@@ -65,7 +65,7 @@
         ptT = ptT->fNext;
     } while (stopPtT != ptT);
     SkASSERT(0);
-    return NULL;
+    return nullptr;
 }
 
 SkOpPtT* SkOpPtT::find(SkOpSegment* segment) {
@@ -78,7 +78,7 @@
         ptT = ptT->fNext;
     } while (stopPtT != ptT);
     SkASSERT(0);
-    return NULL;
+    return nullptr;
 }
 
 SkOpGlobalState* SkOpPtT::globalState() const {
@@ -127,7 +127,7 @@
         prev = next;
     } while (prev != this);
     SkASSERT(0);
-    return NULL;
+    return nullptr;
 }
 
 void SkOpPtT::removeNext(SkOpPtT* kept) {
@@ -252,7 +252,7 @@
             return walk;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 bool SkOpSpanBase::containsCoinEnd(const SkOpSegment* segment) const {
@@ -278,7 +278,7 @@
     fSegment = segment;
     fPtT.init(this, t, pt, false);
     fCoinEnd = this;
-    fFromAngle = NULL;
+    fFromAngle = nullptr;
     fPrev = prev;
     fSpanAdds = 0;
     fAligned = true;
@@ -354,7 +354,7 @@
     SkASSERT(t != 1);
     initBase(segment, prev, t, pt);
     fCoincident = this;
-    fToAngle = NULL;
+    fToAngle = nullptr;
     fWindSum = fOppSum = SK_MinS32;
     fWindValue = 1;
     fOppValue = 0;
diff --git a/src/pathops/SkOpSpan.h b/src/pathops/SkOpSpan.h
index 2a11c96..a2115df 100644
--- a/src/pathops/SkOpSpan.h
+++ b/src/pathops/SkOpSpan.h
@@ -105,11 +105,11 @@
         SkOpPtT* start1 = s1->fT < e1->fT ? s1 : e1;
         SkOpPtT* start2 = s2->fT < e2->fT ? s2 : e2;
         *sOut = between(s1->fT, start2->fT, e1->fT) ? start2
-                : between(s2->fT, start1->fT, e2->fT) ? start1 : NULL;
+                : between(s2->fT, start1->fT, e2->fT) ? start1 : nullptr;
         SkOpPtT* end1 = s1->fT < e1->fT ? e1 : s1;
         SkOpPtT* end2 = s2->fT < e2->fT ? e2 : s2;
         *eOut = between(s1->fT, end2->fT, e1->fT) ? end2
-                : between(s2->fT, end1->fT, e2->fT) ? end1 : NULL;
+                : between(s2->fT, end1->fT, e2->fT) ? end1 : nullptr;
         if (*sOut == *eOut) {
             SkASSERT(start1->fT >= end2->fT || start2->fT >= end1->fT);
             return false;
@@ -341,11 +341,11 @@
     }
 
     SkOpSpan* upCastable() {
-        return final() ? NULL : upCast();
+        return final() ? nullptr : upCast();
     }
 
     const SkOpSpan* upCastable() const {
-        return final() ? NULL : upCast();
+        return final() ? nullptr : upCast();
     }
 
 private:
diff --git a/src/pathops/SkPathOpsCommon.cpp b/src/pathops/SkPathOpsCommon.cpp
index c53f458..58bcacd 100644
--- a/src/pathops/SkPathOpsCommon.cpp
+++ b/src/pathops/SkPathOpsCommon.cpp
@@ -18,7 +18,7 @@
     const SkOpAngle* angle = segment->spanToAngle(start, end);
     if (!angle) {
         *windingPtr = SK_MinS32;
-        return NULL;
+        return nullptr;
     }
     bool computeWinding = false;
     const SkOpAngle* firstAngle = angle;
@@ -70,7 +70,7 @@
             return result;
         }
     } while ((contour = contour->next()));
-    return NULL;
+    return nullptr;
 }
 
 SkOpSegment* FindChase(SkTDArray<SkOpSpanBase*>* chase, SkOpSpanBase** startPtr,
@@ -81,7 +81,7 @@
         SkOpSegment* segment = span->segment();
         *startPtr = span->ptT()->next()->span();
         bool done = true;
-        *endPtr = NULL;
+        *endPtr = nullptr;
         if (SkOpAngle* last = segment->activeAngle(*startPtr, startPtr, endPtr, &done)) {
             *startPtr = last->start();
             *endPtr = last->end();
@@ -107,7 +107,7 @@
             segment = angle->segment();
             sumWinding = segment->updateWindingReverse(angle);
         }
-        SkOpSegment* first = NULL;
+        SkOpSegment* first = nullptr;
         const SkOpAngle* firstAngle = angle;
         while ((angle = angle->next()) != firstAngle) {
             segment = angle->segment();
@@ -138,7 +138,7 @@
             return first;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #if DEBUG_ACTIVE_SPANS
@@ -175,7 +175,7 @@
         contour->setNext(next);
         contour = next;
     }
-    contour->setNext(NULL);
+    contour->setNext(nullptr);
     return true;
 }
 
@@ -198,7 +198,7 @@
 void Assemble(const SkPathWriter& path, SkPathWriter* simple) {
     SkChunkAlloc allocator(4096);  // FIXME: constant-ize, tune
     SkOpContourHead contour;
-    SkOpGlobalState globalState(NULL, &contour  SkDEBUGPARAMS(NULL));
+    SkOpGlobalState globalState(nullptr, &contour  SkDEBUGPARAMS(nullptr));
 #if DEBUG_SHOW_TEST_NAME
     SkDebugf("</div>\n");
 #endif
diff --git a/src/pathops/SkPathOpsCurve.h b/src/pathops/SkPathOpsCurve.h
index c830e66..97e20be 100644
--- a/src/pathops/SkPathOpsCurve.h
+++ b/src/pathops/SkPathOpsCurve.h
@@ -108,7 +108,7 @@
 }
 
 static SkDPoint (* const CurveDPointAtT[])(const SkPoint[], SkScalar , double ) = {
-    NULL,
+    nullptr,
     dline_xy_at_t,
     dquad_xy_at_t,
     dconic_xy_at_t,
@@ -132,7 +132,7 @@
 }
 
 static SkPoint (* const CurvePointAtT[])(const SkPoint[], SkScalar , double ) = {
-    NULL,
+    nullptr,
     fline_xy_at_t,
     fquad_xy_at_t,
     fconic_xy_at_t,
@@ -164,7 +164,7 @@
 }
 
 static SkDVector (* const CurveDSlopeAtT[])(const SkPoint[], SkScalar , double ) = {
-    NULL,
+    nullptr,
     dline_dxdy_at_t,
     dquad_dxdy_at_t,
     dconic_dxdy_at_t,
@@ -188,7 +188,7 @@
 }
 
 static SkVector (* const CurveSlopeAtT[])(const SkPoint[], SkScalar , double ) = {
-    NULL,
+    nullptr,
     fline_dxdy_at_t,
     fquad_dxdy_at_t,
     fconic_dxdy_at_t,
@@ -225,7 +225,7 @@
 }
 
 static bool (* const CurveIsVertical[])(const SkPoint[], SkScalar , double , double) = {
-    NULL,
+    nullptr,
     line_is_vertical,
     quad_is_vertical,
     conic_is_vertical,
@@ -262,7 +262,7 @@
 
 static void (* const CurveIntersectRay[])(const SkPoint[] , SkScalar , const SkDLine& ,
         SkIntersections* ) = {
-    NULL,
+    nullptr,
     line_intersect_ray,
     quad_intersect_ray,
     conic_intersect_ray,
@@ -312,8 +312,8 @@
 }
 
 static int (* const CurveIntercept[])(const SkPoint[] , SkScalar , SkScalar , double* ) = {
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
     line_intercept_h,
     line_intercept_v,
     quad_intercept_h,
diff --git a/src/pathops/SkPathOpsDebug.cpp b/src/pathops/SkPathOpsDebug.cpp
index 813f237..141041a 100644
--- a/src/pathops/SkPathOpsDebug.cpp
+++ b/src/pathops/SkPathOpsDebug.cpp
@@ -163,7 +163,7 @@
 #include "SkOpSegment.h"
 
 SkOpAngle* SkOpSegment::debugLastAngle() {
-    SkOpAngle* result = NULL;
+    SkOpAngle* result = nullptr;
     SkOpSpan* span = this->head();
     do {
         if (span->toAngle()) {
@@ -414,7 +414,7 @@
 #if DEBUG_VALIDATE
     const SkOpSpanBase* span = &fHead;
     double lastT = -1;
-    const SkOpSpanBase* prev = NULL;
+    const SkOpSpanBase* prev = nullptr;
     int count = 0;
     int done = 0;
     do {
@@ -645,7 +645,7 @@
     SkPath::RawIter iter(path);
 #define SUPPORT_RECT_CONTOUR_DETECTION 0
 #if SUPPORT_RECT_CONTOUR_DETECTION
-    int rectCount = path.isRectContours() ? path.rectContours(NULL, NULL) : 0;
+    int rectCount = path.isRectContours() ? path.rectContours(nullptr, nullptr) : 0;
     if (rectCount > 0) {
         SkTDArray<SkRect> rects;
         SkTDArray<SkPath::Direction> directions;
diff --git a/src/pathops/SkPathOpsOp.cpp b/src/pathops/SkPathOpsOp.cpp
index 12a9578..be7fae7 100644
--- a/src/pathops/SkPathOpsOp.cpp
+++ b/src/pathops/SkPathOpsOp.cpp
@@ -19,7 +19,7 @@
         *startPtr = span->ptT()->prev()->span();
         SkOpSegment* segment = (*startPtr)->segment();
         bool done = true;
-        *endPtr = NULL;
+        *endPtr = nullptr;
         if (SkOpAngle* last = segment->activeAngle(*startPtr, startPtr, endPtr, &done)) {
             *startPtr = last->start();
             *endPtr = last->end();
@@ -48,7 +48,7 @@
                 SkTSwap<int>(sumMiWinding, sumSuWinding);
             }
         }
-        SkOpSegment* first = NULL;
+        SkOpSegment* first = nullptr;
         const SkOpAngle* firstAngle = angle;
         while ((angle = angle->next()) != firstAngle) {
             segment = angle->segment();
@@ -81,7 +81,7 @@
             return first;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 static bool bridgeOp(SkOpContourHead* contourList, const SkPathOp op,
@@ -304,5 +304,5 @@
 }
 
 bool Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result) {
-    return OpDebug(one, two, op, result, true  SkDEBUGPARAMS(NULL));
+    return OpDebug(one, two, op, result, true  SkDEBUGPARAMS(nullptr));
 }
diff --git a/src/pathops/SkPathOpsSimplify.cpp b/src/pathops/SkPathOpsSimplify.cpp
index 8c07653..14fde4f 100644
--- a/src/pathops/SkPathOpsSimplify.cpp
+++ b/src/pathops/SkPathOpsSimplify.cpp
@@ -167,7 +167,7 @@
     SkOpCoincidence coincidence;
     SkOpContour contour;
     SkOpContourHead* contourList = static_cast<SkOpContourHead*>(&contour);
-    SkOpGlobalState globalState(&coincidence, contourList  SkDEBUGPARAMS(NULL));
+    SkOpGlobalState globalState(&coincidence, contourList  SkDEBUGPARAMS(nullptr));
 #if DEBUG_SORT
     SkPathOpsDebug::gSortCount = SkPathOpsDebug::gSortCountDefault;
 #endif
diff --git a/src/pathops/SkPathOpsTSect.h b/src/pathops/SkPathOpsTSect.h
index 6ea01be..e8a0fd4 100644
--- a/src/pathops/SkPathOpsTSect.h
+++ b/src/pathops/SkPathOpsTSect.h
@@ -112,7 +112,7 @@
     void initBounds(const TCurve& );
 
     bool isBounded() const {
-        return fBounded != NULL;
+        return fBounded != nullptr;
     }
 
     bool linearsIntersect(SkTSpan<OppCurve, TCurve>* span);
@@ -138,7 +138,7 @@
     bool removeBounded(const SkTSpan<OppCurve, TCurve>* opp);
 
     void reset() {
-        fBounded = NULL;
+        fBounded = nullptr;
     }
 
     void resetBounds(const TCurve& curve) {
@@ -207,7 +207,7 @@
     bool debugHasBounded(const SkTSpan<OppCurve, TCurve>* ) const;
 
     const SkTSect<OppCurve, TCurve>* debugOpp() const {
-        return SkDEBUGRELEASE(fOppSect, NULL);
+        return SkDEBUGRELEASE(fOppSect, nullptr);
     }
 
     const SkTSpan<TCurve, OppCurve>* debugSpan(int id) const;
@@ -452,7 +452,7 @@
 
 template<typename TCurve, typename OppCurve>
 const SkTSect<OppCurve, TCurve>* SkTSpan<TCurve, OppCurve>::debugOpp() const {
-    return SkDEBUGRELEASE(fDebugSect->debugOpp(), NULL);
+    return SkDEBUGRELEASE(fDebugSect->debugOpp(), nullptr);
 }
 
 template<typename TCurve, typename OppCurve>
@@ -466,7 +466,7 @@
         }
         bounded = bounded->fNext;
     }
-    return NULL;
+    return nullptr;
 }
 
 // returns 0 if no hull intersection
@@ -520,10 +520,10 @@
 
 template<typename TCurve, typename OppCurve>
 void SkTSpan<TCurve, OppCurve>::init(const TCurve& c) {
-    fPrev = fNext = NULL;
+    fPrev = fNext = nullptr;
     fStartT = 0;
     fEndT = 1;
-    fBounded = NULL;
+    fBounded = nullptr;
     resetBounds(c);
 }
 
@@ -656,7 +656,7 @@
         }
         bounded = bounded->fNext;
     }
-    return NULL;
+    return nullptr;
 }
 
 template<typename TCurve, typename OppCurve>
@@ -692,7 +692,7 @@
         }
     }
     SkTSpanBounded<OppCurve, TCurve>* bounded = fBounded;
-    SkTSpanBounded<OppCurve, TCurve>* prev = NULL;
+    SkTSpanBounded<OppCurve, TCurve>* prev = nullptr;
     while (bounded) {
         SkTSpanBounded<OppCurve, TCurve>* boundedNext = bounded->fNext;
         if (opp == bounded->fBounded) {
@@ -701,7 +701,7 @@
                 return false;
             } else {
                 fBounded = boundedNext;
-                return fBounded == NULL;
+                return fBounded == nullptr;
             }
         }
         prev = bounded;
@@ -734,7 +734,7 @@
         fNext->fPrev = this;
     }
     SkTSpanBounded<OppCurve, TCurve>* bounded = work->fBounded;
-    fBounded = NULL;
+    fBounded = nullptr;
     while (bounded) {
         this->addBounded(bounded->fBounded, heap);
         bounded = bounded->fNext;
@@ -750,9 +750,9 @@
 template<typename TCurve, typename OppCurve>
 void SkTSpan<TCurve, OppCurve>::validate() const {
 #if DEBUG_T_SECT
-    SkASSERT(fNext == NULL || fNext != fPrev);
-    SkASSERT(fNext == NULL || this == fNext->fPrev);
-    SkASSERT(fPrev == NULL || this == fPrev->fNext);
+    SkASSERT(fNext == nullptr || fNext != fPrev);
+    SkASSERT(fNext == nullptr || this == fNext->fPrev);
+    SkASSERT(fPrev == nullptr || this == fPrev->fNext);
     SkASSERT(fBounds.width() || fBounds.height() || fCollapsed);
     SkASSERT(fBoundsMax == SkTMax(fBounds.width(), fBounds.height()));
     SkASSERT(0 <= fStartT);
@@ -810,8 +810,8 @@
 SkTSect<TCurve, OppCurve>::SkTSect(const TCurve& c PATH_OPS_DEBUG_T_SECT_PARAMS(int id))
     : fCurve(c)
     , fHeap(sizeof(SkTSpan<TCurve, OppCurve>) * 4)
-    , fCoincident(NULL)
-    , fDeleted(NULL)
+    , fCoincident(nullptr)
+    , fDeleted(nullptr)
     , fActiveCount(0)
     PATH_OPS_DEBUG_T_SECT_PARAMS(fID(id))
     PATH_OPS_DEBUG_T_SECT_PARAMS(fDebugCount(0))
@@ -831,7 +831,7 @@
     } else {
         result = new (fHeap.allocThrow(sizeof(SkTSpan<TCurve, OppCurve>)))(
                 SkTSpan<TCurve, OppCurve>);
-        result->fBounded = NULL;
+        result->fBounded = nullptr;
 #if DEBUG_T_SECT
         ++fDebugAllocatedCount;
 #endif
@@ -973,7 +973,7 @@
         SkTSpan<TCurve, OppCurve>* first, SkTSpan<TCurve, OppCurve>* last) {
     const OppCurve& opp = sect2->fCurve;
     SkTSpan<TCurve, OppCurve>* work = first;
-    SkTSpan<TCurve, OppCurve>* prior = NULL;
+    SkTSpan<TCurve, OppCurve>* prior = nullptr;
     do {
         if (!work->fHasPerp && !work->fCollapsed) {
             if (prior) {
@@ -1061,7 +1061,7 @@
         SkTSpan<TCurve, OppCurve>* first, SkTSpan<TCurve, OppCurve>* last) {
     first = findCoincidentRun(first, &last);
     if (!first) {
-        return NULL;
+        return nullptr;
     }
     // march outwards to find limit of coincidence from here to previous and next spans
     double startT = first->fStartT;
@@ -1146,15 +1146,15 @@
     }
     this->validate();
     sect2->validate();
-    return last && !last->fDeleted ? last : NULL;
+    return last && !last->fDeleted ? last : nullptr;
 }
 
 template<typename TCurve, typename OppCurve>
 SkTSpan<TCurve, OppCurve>* SkTSect<TCurve, OppCurve>::findCoincidentRun(
         SkTSpan<TCurve, OppCurve>* first, SkTSpan<TCurve, OppCurve>** lastPtr) {
     SkTSpan<TCurve, OppCurve>* work = first;
-    SkTSpan<TCurve, OppCurve>* lastCandidate = NULL;
-    first = NULL;
+    SkTSpan<TCurve, OppCurve>* lastCandidate = nullptr;
+    first = nullptr;
     // find the first fully coincident span
     do {
         if (work->fCoinStart.isCoincident()) {
@@ -1174,7 +1174,7 @@
             *lastPtr = lastCandidate;
             return first;
         } else {
-            lastCandidate = NULL;
+            lastCandidate = nullptr;
             SkASSERT(!first);
         }
         if (work == *lastPtr) {
@@ -1404,7 +1404,7 @@
     double smallLimit = 0;
     do {
         // find the smallest unprocessed span
-        SkTSpan<TCurve, OppCurve>* smaller = NULL;
+        SkTSpan<TCurve, OppCurve>* smaller = nullptr;
         SkTSpan<TCurve, OppCurve>* test = fCoincident;
         do {
             if (test->fStartT < smallLimit) {
@@ -1420,9 +1420,9 @@
         }
         smallLimit = smaller->fEndT;
         // find next larger span
-        SkTSpan<TCurve, OppCurve>* prior = NULL;
-        SkTSpan<TCurve, OppCurve>* larger = NULL;
-        SkTSpan<TCurve, OppCurve>* largerPrior = NULL;
+        SkTSpan<TCurve, OppCurve>* prior = nullptr;
+        SkTSpan<TCurve, OppCurve>* larger = nullptr;
+        SkTSpan<TCurve, OppCurve>* largerPrior = nullptr;
         test = fCoincident;
         do {
             if (test->fStartT < smaller->fEndT) {
@@ -1458,7 +1458,7 @@
 template<typename TCurve, typename OppCurve>
 SkTSpan<TCurve, OppCurve>* SkTSect<TCurve, OppCurve>::prev(
         SkTSpan<TCurve, OppCurve>* span) const {
-    SkTSpan<TCurve, OppCurve>* result = NULL;
+    SkTSpan<TCurve, OppCurve>* result = nullptr;
     SkTSpan<TCurve, OppCurve>* test = fHead;
     while (span != test) {
         result = test;
@@ -1588,13 +1588,13 @@
 SkTSpan<TCurve, OppCurve>* SkTSect<TCurve, OppCurve>::spanAtT(double t,
         SkTSpan<TCurve, OppCurve>** priorSpan) {
     SkTSpan<TCurve, OppCurve>* test = fHead;
-    SkTSpan<TCurve, OppCurve>* prev = NULL;
+    SkTSpan<TCurve, OppCurve>* prev = nullptr;
     while (test && test->fEndT < t) {
         prev = test;
         test = test->fNext;
     }
     *priorSpan = prev;
-    return test && test->fStartT <= t ? test : NULL;
+    return test && test->fStartT <= t ? test : nullptr;
 }
 
 template<typename TCurve, typename OppCurve>
@@ -1654,7 +1654,7 @@
     } else {
         fHead = next;
         if (next) {
-            next->fPrev = NULL;
+            next->fPrev = nullptr;
         }
     }
 }
@@ -1668,7 +1668,7 @@
     do {
         deleteSpan |= test->removeAllBounded();
     } while ((test = test->fNext) != final);
-    first->fBounded = NULL;
+    first->fBounded = nullptr;
     first->addBounded(oppFirst, &fHeap);
     // cannot call validate until remove span range is called
     return deleteSpan;
@@ -1688,7 +1688,7 @@
             SkASSERT(span->fStartT >= last);
             SkDEBUGCODE(last = span->fEndT);
             ++count;
-        } while ((span = span->fNext) != NULL);
+        } while ((span = span->fNext) != nullptr);
     }
     SkASSERT(count == fActiveCount);
     SkASSERT(fActiveCount <= fDebugAllocatedCount);
@@ -1716,7 +1716,7 @@
     const SkTSpan<TCurve, OppCurve>* span = fHead;
     do {
         span->validateBounded();
-    } while ((span = span->fNext) != NULL);
+    } while ((span = span->fNext) != nullptr);
 #endif
 }
 
@@ -1823,8 +1823,8 @@
     
     void reset() {
         fClosest = FLT_MAX;
-        SkDEBUGCODE(fC1Span = NULL);
-        SkDEBUGCODE(fC2Span = NULL);
+        SkDEBUGCODE(fC1Span = nullptr);
+        SkDEBUGCODE(fC2Span = nullptr);
         SkDEBUGCODE(fC1Index = fC2Index = -1);
     }
 
diff --git a/src/pathops/SkPathOpsTightBounds.cpp b/src/pathops/SkPathOpsTightBounds.cpp
index 7eb72a9..ac5d6aa 100644
--- a/src/pathops/SkPathOpsTightBounds.cpp
+++ b/src/pathops/SkPathOpsTightBounds.cpp
@@ -11,7 +11,7 @@
     SkChunkAlloc allocator(4096);  // FIXME: constant-ize, tune
     SkOpContour contour;
     SkOpContourHead* contourList = static_cast<SkOpContourHead*>(&contour);
-    SkOpGlobalState globalState(NULL, contourList  SkDEBUGPARAMS(NULL));
+    SkOpGlobalState globalState(nullptr, contourList  SkDEBUGPARAMS(nullptr));
     // turn path into list of segments
     SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState);
     if (!builder.finish(&allocator)) {
diff --git a/src/pathops/SkPathOpsWinding.cpp b/src/pathops/SkPathOpsWinding.cpp
index 03efdac..3061ea3 100644
--- a/src/pathops/SkPathOpsWinding.cpp
+++ b/src/pathops/SkPathOpsWinding.cpp
@@ -82,7 +82,7 @@
 
 struct SkOpRayHit {
     SkOpRayDir makeTestBase(SkOpSpan* span, double t) {
-        fNext = NULL;
+        fNext = nullptr;
         fSpan = span;
         fT = span->t() * (1 - t) + span->next()->t() * t;
         SkOpSegment* segment = span->segment();
@@ -191,13 +191,13 @@
     do {
         next = span->next();
         if (approximately_equal(tHit, next->t())) {
-            return NULL;
+            return nullptr;
         } 
         if (tHit < next->t()) {
             return span;
         }
     } while (!next->final() && (span = next->upCast()));
-    return NULL;
+    return nullptr;
 }
 
 static bool hit_compare_x(const SkOpRayHit* a, const SkOpRayHit* b) {
@@ -266,7 +266,7 @@
     for (int index = 0; index < count; ++index) {
         hit = sorted[index];
         SkOpSpan* span = hit->fSpan;
-        SkOpSegment* hitSegment = span ? span->segment() : NULL;
+        SkOpSegment* hitSegment = span ? span->segment() : nullptr;
         bool operand = span ? hitSegment->operand() : false;
         bool ccw = ccw_dxdy(hit->fSlope, dir);
         SkDebugf("%s [%d] valid=%d operand=%d span=%d ccw=%d ", __FUNCTION__, index,
@@ -278,7 +278,7 @@
                 hit->fPt.fX, hit->fPt.fY, hit->fSlope.fX, hit->fSlope.fY);
     }
 #endif
-    const SkPoint* last = NULL;
+    const SkPoint* last = nullptr;
     int wind = 0;
     int oppWind = 0;
     for (int index = 0; index < count; ++index) {
@@ -345,8 +345,8 @@
             if (this->globalState()->phase() == SkOpGlobalState::kFixWinding) {
                 hitSegment->contour()->setCcw(ccw);
             } else {
-                (void) hitSegment->markAndChaseWinding(span, span->next(), windSum, oppSum, NULL);
-                (void) hitSegment->markAndChaseWinding(span->next(), span, windSum, oppSum, NULL);
+                (void) hitSegment->markAndChaseWinding(span, span->next(), windSum, oppSum, nullptr);
+                (void) hitSegment->markAndChaseWinding(span->next(), span, windSum, oppSum, nullptr);
             }
         }
         if (operand) {
@@ -373,7 +373,7 @@
             return span;
         }
     } while (!next->final() && (span = next->upCast()));
-    return NULL;
+    return nullptr;
 }
 
 SkOpSpan* SkOpContour::findSortableTop(SkOpContour* contourHead) {
@@ -387,7 +387,7 @@
             return result;
         }
     } while ((testSegment = testSegment->next()));
-    return NULL;
+    return nullptr;
 }
 
 SkOpSpan* FindSortableTop(SkOpContourHead* contourHead) {
@@ -403,5 +403,5 @@
             }
         } while ((contour = contour->next()));
     }
-    return NULL;
+    return nullptr;
 }
diff --git a/src/pdf/SkDeflate.cpp b/src/pdf/SkDeflate.cpp
index bef8d97..c52a460 100644
--- a/src/pdf/SkDeflate.cpp
+++ b/src/pdf/SkDeflate.cpp
@@ -73,7 +73,7 @@
     }
     fImpl->fZStream.zalloc = &skia_alloc_func;
     fImpl->fZStream.zfree = &skia_free_func;
-    fImpl->fZStream.opaque = NULL;
+    fImpl->fZStream.opaque = nullptr;
     SkDEBUGCODE(int r =) deflateInit(&fImpl->fZStream, Z_DEFAULT_COMPRESSION);
     SkASSERT(Z_OK == r);
 }
@@ -87,7 +87,7 @@
     do_deflate(Z_FINISH, &fImpl->fZStream, fImpl->fOut, fImpl->fInBuffer,
                fImpl->fInBufferIndex);
     (void)deflateEnd(&fImpl->fZStream);
-    fImpl->fOut = NULL;
+    fImpl->fOut = nullptr;
 }
 
 bool SkDeflateWStream::write(const void* void_buffer, size_t len) {
diff --git a/src/pdf/SkJpegInfo.cpp b/src/pdf/SkJpegInfo.cpp
index 85cd325..455b4aa 100644
--- a/src/pdf/SkJpegInfo.cpp
+++ b/src/pdf/SkJpegInfo.cpp
@@ -22,7 +22,7 @@
         }
         if (JpegSegment::StandAloneMarker(fMarker)) {
             fLength = 0;
-            fBuffer = NULL;
+            fBuffer = nullptr;
             return true;
         }
         if (!this->readBigendianUint16(&fLength) || fLength < 2) {
diff --git a/src/pdf/SkJpegInfo.h b/src/pdf/SkJpegInfo.h
index 1be4c0f..178d648 100644
--- a/src/pdf/SkJpegInfo.h
+++ b/src/pdf/SkJpegInfo.h
@@ -19,7 +19,7 @@
 };
 
 /** Returns true iff the data seems to be a valid JFIF JPEG image.  
-    If so and if info is not NULL, populate info.
+    If so and if info is not nullptr, populate info.
 
     JPEG/JFIF References:
         http://www.w3.org/Graphics/JPEG/itu-t81.pdf
diff --git a/src/pdf/SkPDFBitmap.cpp b/src/pdf/SkPDFBitmap.cpp
index 3505233..de43221 100644
--- a/src/pdf/SkPDFBitmap.cpp
+++ b/src/pdf/SkPDFBitmap.cpp
@@ -439,12 +439,12 @@
     SkASSERT(canon);
     if (!SkColorTypeIsValid(bitmap.colorType()) ||
         kUnknown_SkColorType == bitmap.colorType()) {
-        return NULL;
+        return nullptr;
     }
     SkBitmap copy;
     const SkBitmap& bm = immutable_bitmap(bitmap, &copy);
     if (bm.drawsNothing()) {
-        return NULL;
+        return nullptr;
     }
     if (SkPDFBitmap* canonBitmap = canon->findBitmap(bm)) {
         return SkRef(canonBitmap);
@@ -463,7 +463,7 @@
         }
     }
 
-    SkPDFObject* smask = NULL;
+    SkPDFObject* smask = nullptr;
     if (!bm.isOpaque() && !SkBitmap::ComputeIsOpaque(bm)) {
         smask = new PDFAlphaBitmap(bm);
     }
diff --git a/src/pdf/SkPDFBitmap.h b/src/pdf/SkPDFBitmap.h
index 2c8653f..58d91be 100644
--- a/src/pdf/SkPDFBitmap.h
+++ b/src/pdf/SkPDFBitmap.h
@@ -24,7 +24,7 @@
  */
 class SkPDFBitmap : public SkPDFObject {
 public:
-    // Returns NULL on unsupported bitmap;
+    // Returns nullptr on unsupported bitmap;
     static SkPDFBitmap* Create(SkPDFCanon*, const SkBitmap&);
     bool equals(const SkBitmap& other) const {
         return fBitmap.getGenerationID() == other.getGenerationID() &&
diff --git a/src/pdf/SkPDFCanon.cpp b/src/pdf/SkPDFCanon.cpp
index b6187cb..6cc3995 100644
--- a/src/pdf/SkPDFCanon.cpp
+++ b/src/pdf/SkPDFCanon.cpp
@@ -41,7 +41,7 @@
             return ptrArray[i];
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -51,7 +51,7 @@
                                 SkPDFFont** relatedFontPtr) const {
     SkASSERT(relatedFontPtr);
 
-    SkPDFFont* relatedFont = NULL;
+    SkPDFFont* relatedFont = nullptr;
     for (int i = 0; i < fFontRecords.count(); ++i) {
         SkPDFFont::Match match = SkPDFFont::IsMatch(
                 fFontRecords[i].fFont, fFontRecords[i].fFontID,
@@ -62,8 +62,8 @@
             relatedFont = fFontRecords[i].fFont;
         }
     }
-    *relatedFontPtr = relatedFont;  // May still be NULL.
-    return NULL;
+    *relatedFontPtr = relatedFont;  // May still be nullptr.
+    return nullptr;
 }
 
 void SkPDFCanon::addFont(SkPDFFont* font, uint32_t fontID, uint16_t fGlyphID) {
@@ -109,7 +109,7 @@
 const SkPDFGraphicState* SkPDFCanon::findGraphicState(
         const SkPDFGraphicState& key) const {
     const WrapGS* ptr = fGraphicStateRecords.find(WrapGS(&key));
-    return ptr ? ptr->fPtr : NULL;
+    return ptr ? ptr->fPtr : nullptr;
 }
 
 void SkPDFCanon::addGraphicState(const SkPDFGraphicState* state) {
diff --git a/src/pdf/SkPDFCanon.h b/src/pdf/SkPDFCanon.h
index 5198e7b..2ad5a22 100644
--- a/src/pdf/SkPDFCanon.h
+++ b/src/pdf/SkPDFCanon.h
@@ -40,9 +40,9 @@
     // reset to original setting, unrefs all objects.
     void reset();
 
-    // Returns exact match if there is one.  If not, it returns NULL.
+    // Returns exact match if there is one.  If not, it returns nullptr.
     // If there is no exact match, but there is a related font, we
-    // still return NULL, but also set *relatedFont.
+    // still return nullptr, but also set *relatedFont.
     SkPDFFont* findFont(uint32_t fontID,
                         uint16_t glyphID,
                         SkPDFFont** relatedFont) const;
@@ -78,7 +78,7 @@
     SkTDArray<SkPDFImageShader*> fImageShaderRecords;
 
     struct WrapGS {
-        explicit WrapGS(const SkPDFGraphicState* ptr = NULL) : fPtr(ptr) {}
+        explicit WrapGS(const SkPDFGraphicState* ptr = nullptr) : fPtr(ptr) {}
         const SkPDFGraphicState* fPtr;
         bool operator==(const WrapGS& rhs) const {
             SkASSERT(fPtr);
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 678e6c0..a5c9557 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -43,7 +43,7 @@
 static void replace_srcmode_on_opaque_paint(SkPaint* paint) {
     if (kSrcOver_SkXfermodeInterpretation
         == SkInterpretXfermode(*paint, false)) {
-        paint->setXfermode(NULL);
+        paint->setXfermode(nullptr);
     }
 }
 
@@ -86,7 +86,7 @@
 
     SkMatrix ident;
     ident.reset();
-    SkAutoGlyphCache autoCache(paint, NULL, &ident);
+    SkAutoGlyphCache autoCache(paint, nullptr, &ident);
     SkGlyphCache* cache = autoCache.getCache();
 
     const char* start = reinterpret_cast<const char*>(glyphs);
@@ -126,7 +126,7 @@
                                 const uint16_t** glyphIDs) {
     // Make sure we have a glyph id encoding.
     if (paint.getTextEncoding() != SkPaint::kGlyphID_TextEncoding) {
-        int numGlyphs = paint.textToGlyphs(text, len, NULL);
+        int numGlyphs = paint.textToGlyphs(text, len, nullptr);
         storage->reset(numGlyphs);
         paint.textToGlyphs(text, len, storage->get());
         *glyphIDs = storage->get();
@@ -204,10 +204,10 @@
     int fGraphicStateIndex;
 
     // We may change the font (i.e. for Type1 support) within a
-    // ContentEntry.  This is the one currently in effect, or NULL if none.
+    // ContentEntry.  This is the one currently in effect, or nullptr if none.
     SkPDFFont* fFont;
     // In PDF, text size has no default value. It is only valid if fFont is
-    // not NULL.
+    // not nullptr.
     SkScalar fTextSize;
 };
 
@@ -216,7 +216,7 @@
                                          fTextFill(SkPaint::kFill_Style),
                                          fShaderIndex(-1),
                                          fGraphicStateIndex(-1),
-                                         fFont(NULL),
+                                         fFont(nullptr),
                                          fTextSize(SK_ScalarNaN) {
     fMatrix.reset();
 }
@@ -309,7 +309,7 @@
         }
     }
 
-    SkASSERT(prefixEntry == NULL);
+    SkASSERT(prefixEntry == nullptr);
 }
 
 static void emit_clip(SkPath* clipPath, SkRect* clipRect,
@@ -444,7 +444,7 @@
 #ifdef SK_PDF_USE_PATHOPS_CLIPPING
     SkPath clipPath;
     if (get_clip_stack_path(transform, clipStack, clipRegion, &clipPath)) {
-        emit_clip(&clipPath, NULL, fContentStream);
+        emit_clip(&clipPath, nullptr, fContentStream);
         return;
     }
 #endif
@@ -474,7 +474,7 @@
     if (needRegion) {
         SkPath clipPath;
         SkAssertResult(clipRegion.getBoundaryPath(&clipPath));
-        emit_clip(&clipPath, NULL, fContentStream);
+        emit_clip(&clipPath, nullptr, fContentStream);
     } else {
         skip_clip_stack_prefix(fEntries[0].fClipStack, clipStack, &iter);
         const SkClipStack::Element* clipEntry;
@@ -484,14 +484,14 @@
                 case SkClipStack::Element::kRect_Type: {
                     SkRect translatedClip;
                     transform.mapRect(&translatedClip, clipEntry->getRect());
-                    emit_clip(NULL, &translatedClip, fContentStream);
+                    emit_clip(nullptr, &translatedClip, fContentStream);
                     break;
                 }
                 default: {
                     SkPath translatedPath;
                     clipEntry->asPath(&translatedPath);
                     translatedPath.transform(transform, &translatedPath);
-                    emit_clip(&translatedPath, NULL, fContentStream);
+                    emit_clip(&translatedPath, nullptr, fContentStream);
                     break;
                 }
             }
@@ -572,13 +572,13 @@
     // to improve quality and file size (http://skbug.com/3043)
 
     // TODO: should we return true if there is a colorfilter?
-    return layerPaint.getImageFilter() != NULL;
+    return layerPaint.getImageFilter() != nullptr;
 }
 
 SkBaseDevice* SkPDFDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint* layerPaint) {
     if (cinfo.fForImageFilter ||
         (layerPaint && not_supported_for_layers(*layerPaint))) {
-        return NULL;
+        return nullptr;
     }
     SkISize size = SkISize::Make(cinfo.fInfo.width(), cinfo.fInfo.height());
     return SkPDFDevice::Create(size, fRasterDpi, fCanon);
@@ -594,9 +594,9 @@
     // So we manually destruct the object.
     ~ContentEntry() {
         ContentEntry* val = fNext.detach();
-        while (val != NULL) {
+        while (val != nullptr) {
             ContentEntry* valNext = val->fNext.detach();
-            // When the destructor is called, fNext is NULL and exits.
+            // When the destructor is called, fNext is nullptr and exits.
             delete val;
             val = valNext;
         }
@@ -610,18 +610,18 @@
     ScopedContentEntry(SkPDFDevice* device, const SkDraw& draw,
                        const SkPaint& paint, bool hasText = false)
         : fDevice(device),
-          fContentEntry(NULL),
+          fContentEntry(nullptr),
           fXfermode(SkXfermode::kSrcOver_Mode),
-          fDstFormXObject(NULL) {
+          fDstFormXObject(nullptr) {
         init(draw.fClipStack, *draw.fClip, *draw.fMatrix, paint, hasText);
     }
     ScopedContentEntry(SkPDFDevice* device, const SkClipStack* clipStack,
                        const SkRegion& clipRegion, const SkMatrix& matrix,
                        const SkPaint& paint, bool hasText = false)
         : fDevice(device),
-          fContentEntry(NULL),
+          fContentEntry(nullptr),
           fXfermode(SkXfermode::kSrcOver_Mode),
-          fDstFormXObject(NULL) {
+          fDstFormXObject(nullptr) {
         init(clipStack, clipRegion, matrix, paint, hasText);
     }
 
@@ -629,7 +629,7 @@
         if (fContentEntry) {
             SkPath* shape = &fShape;
             if (shape->isEmpty()) {
-                shape = NULL;
+                shape = nullptr;
             }
             fDevice->finishContentEntry(fXfermode, fDstFormXObject, shape);
         }
@@ -702,11 +702,11 @@
     , fPageSize(pageSize)
     , fContentSize(pageSize)
     , fExistingClipRegion(SkIRect::MakeSize(pageSize))
-    , fAnnotations(NULL)
-    , fLastContentEntry(NULL)
-    , fLastMarginContentEntry(NULL)
+    , fAnnotations(nullptr)
+    , fLastContentEntry(nullptr)
+    , fLastMarginContentEntry(nullptr)
     , fDrawingArea(kContent_DrawingArea)
-    , fClipStack(NULL)
+    , fClipStack(nullptr)
     , fFontGlyphUsage(new SkPDFGlyphSetMap)
     , fRasterDpi(rasterDpi)
     , fCanon(canon) {
@@ -731,13 +731,13 @@
 }
 
 void SkPDFDevice::init() {
-    fAnnotations = NULL;
+    fAnnotations = nullptr;
     fContentEntries.free();
-    fLastContentEntry = NULL;
+    fLastContentEntry = nullptr;
     fMarginContentEntries.free();
-    fLastMarginContentEntry = NULL;
+    fLastMarginContentEntry = nullptr;
     fDrawingArea = kContent_DrawingArea;
-    if (fFontGlyphUsage.get() == NULL) {
+    if (fFontGlyphUsage.get() == nullptr) {
         fFontGlyphUsage.reset(new SkPDFGlyphSetMap);
     }
 }
@@ -946,7 +946,7 @@
     if (linkToName) {
         return create_link_named_dest(linkToName, r);
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkPDFDevice::drawRect(const SkDraw& d,
@@ -963,7 +963,7 @@
         }
         SkPath path;
         path.addRect(r);
-        drawPath(d, path, paint, NULL, true);
+        drawPath(d, path, paint, nullptr, true);
         return;
     }
 
@@ -996,7 +996,7 @@
     replace_srcmode_on_opaque_paint(&paint);
     SkPath  path;
     path.addRRect(rrect);
-    this->drawPath(draw, path, paint, NULL, true);
+    this->drawPath(draw, path, paint, nullptr, true);
 }
 
 void SkPDFDevice::drawOval(const SkDraw& draw,
@@ -1006,7 +1006,7 @@
     replace_srcmode_on_opaque_paint(&paint);
     SkPath  path;
     path.addOval(oval);
-    this->drawPath(draw, path, paint, NULL, true);
+    this->drawPath(draw, path, paint, nullptr, true);
 }
 
 void SkPDFDevice::drawPath(const SkDraw& d,
@@ -1043,14 +1043,14 @@
         bool fill = paint.getFillPath(origPath, pathPtr);
 
         SkPaint noEffectPaint(paint);
-        noEffectPaint.setPathEffect(NULL);
+        noEffectPaint.setPathEffect(nullptr);
         if (fill) {
             noEffectPaint.setStyle(SkPaint::kFill_Style);
         } else {
             noEffectPaint.setStyle(SkPaint::kStroke_Style);
             noEffectPaint.setStrokeWidth(0);
         }
-        drawPath(d, *pathPtr, noEffectPaint, NULL, true);
+        drawPath(d, *pathPtr, noEffectPaint, nullptr, true);
         return;
     }
 
@@ -1154,7 +1154,7 @@
 
     SkMatrix transform = matrix;
     transform.postConcat(*d.fMatrix);
-    this->internalDrawBitmap(transform, d.fClipStack, *d.fClip, bitmap, NULL,
+    this->internalDrawBitmap(transform, d.fClipStack, *d.fClip, bitmap, nullptr,
                              paint);
 }
 
@@ -1171,7 +1171,7 @@
 
     SkMatrix matrix;
     matrix.setTranslate(SkIntToScalar(x), SkIntToScalar(y));
-    this->internalDrawBitmap(matrix, d.fClipStack, *d.fClip, bitmap, NULL,
+    this->internalDrawBitmap(matrix, d.fClipStack, *d.fClip, bitmap, nullptr,
                              paint);
 }
 
@@ -1215,8 +1215,8 @@
     SkPaint paint = srcPaint;
     replace_srcmode_on_opaque_paint(&paint);
 
-    NOT_IMPLEMENTED(paint.getMaskFilter() != NULL, false);
-    if (paint.getMaskFilter() != NULL) {
+    NOT_IMPLEMENTED(paint.getMaskFilter() != nullptr, false);
+    if (paint.getMaskFilter() != nullptr) {
         // Don't pretend we support drawing MaskFilters, it makes for artifacts
         // making text unreadable (e.g. same text twice when using CSS shadows).
         return;
@@ -1228,7 +1228,7 @@
     }
 
     SkGlyphStorage storage(0);
-    const uint16_t* glyphIDs = NULL;
+    const uint16_t* glyphIDs = nullptr;
     int numGlyphs = force_glyph_encoding(paint, text, len, &storage, &glyphIDs);
     textPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
 
@@ -1267,8 +1267,8 @@
     SkPaint paint = srcPaint;
     replace_srcmode_on_opaque_paint(&paint);
 
-    NOT_IMPLEMENTED(paint.getMaskFilter() != NULL, false);
-    if (paint.getMaskFilter() != NULL) {
+    NOT_IMPLEMENTED(paint.getMaskFilter() != nullptr, false);
+    if (paint.getMaskFilter() != nullptr) {
         // Don't pretend we support drawing MaskFilters, it makes for artifacts
         // making text unreadable (e.g. same text twice when using CSS shadows).
         return;
@@ -1281,7 +1281,7 @@
     }
 
     SkGlyphStorage storage(0);
-    const uint16_t* glyphIDs = NULL;
+    const uint16_t* glyphIDs = nullptr;
     size_t numGlyphs = force_glyph_encoding(paint, text, len, &storage, &glyphIDs);
     textPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
 
@@ -1374,7 +1374,7 @@
 void SkPDFDevice::onDetachFromCanvas() {
     INHERITED::onDetachFromCanvas();
 
-    fClipStack = NULL;
+    fClipStack = nullptr;
 }
 
 SkSurface* SkPDFDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps& props) {
@@ -1451,7 +1451,7 @@
     // TODO(ctguil): For margins, I'm not sure fExistingClipStack/Region is the
     // right thing to pass here.
     GraphicStackState gsState(fExistingClipStack, fExistingClipRegion, data);
-    while (entry != NULL) {
+    while (entry != nullptr) {
         SkPoint translation;
         translation.iset(this->getOrigin());
         translation.negate();
@@ -1485,7 +1485,7 @@
     if (fPageSize != fContentSize) {
         SkRect r = SkRect::MakeWH(SkIntToScalar(this->width()),
                                   SkIntToScalar(this->height()));
-        emit_clip(NULL, &r, out);
+        emit_clip(nullptr, &r, out);
     }
 
     SkPDFDevice::copyContentEntriesToData(fContentEntries.get(), out);
@@ -1525,7 +1525,7 @@
             // To be consistent with the raster output, hairline strokes
             // are rendered as non-inverted.
             modifiedPath.toggleInverseFillType();
-            drawPath(d, modifiedPath, paint, NULL, true);
+            drawPath(d, modifiedPath, paint, nullptr, true);
             return true;
         }
     }
@@ -1584,7 +1584,7 @@
 }
 
 void SkPDFDevice::addAnnotation(SkPDFDict* annotation) {
-    if (NULL == fAnnotations) {
+    if (nullptr == fAnnotations) {
         fAnnotations = new SkPDFArray;
     }
     fAnnotations->appendObject(annotation);
@@ -1653,14 +1653,14 @@
                                              const SkPaint& paint,
                                              bool hasText,
                                              SkPDFFormXObject** dst) {
-    *dst = NULL;
+    *dst = nullptr;
     if (clipRegion.isEmpty()) {
-        return NULL;
+        return nullptr;
     }
 
     // The clip stack can come from an SkDraw where it is technically optional.
     SkClipStack synthesizedClipStack;
-    if (clipStack == NULL) {
+    if (clipStack == nullptr) {
         if (clipRegion == fExistingClipRegion) {
             clipStack = &fExistingClipStack;
         } else {
@@ -1699,7 +1699,7 @@
                    xfermode != SkXfermode::kSrcOut_Mode) {
             // Except for Src and SrcOut, if there isn't anything already there,
             // then we're done.
-            return NULL;
+            return nullptr;
         }
     }
     // TODO(vandebo): Figure out how/if we can handle the following modes:
@@ -1707,7 +1707,7 @@
 
     // Dst xfer mode doesn't draw source at all.
     if (xfermode == SkXfermode::kDst_Mode) {
-        return NULL;
+        return nullptr;
     }
 
     ContentEntry* entry;
@@ -1798,7 +1798,7 @@
         // If there is shape, then an empty source with Src, SrcIn, SrcOut,
         // DstIn, DstAtop or Modulate reduces to Clear and DstOut or SrcAtop
         // reduces to Dst.
-        if (shape == NULL || xfermode == SkXfermode::kDstOut_Mode ||
+        if (shape == nullptr || xfermode == SkXfermode::kDstOut_Mode ||
                 xfermode == SkXfermode::kSrcATop_Mode) {
             ScopedContentEntry content(this, &fExistingClipStack,
                                        fExistingClipRegion, identity,
@@ -1827,7 +1827,7 @@
     } else {
         SkAutoTUnref<SkPDFFormXObject> dstMaskStorage;
         SkPDFFormXObject* dstMask = srcFormXObject.get();
-        if (shape != NULL) {
+        if (shape != nullptr) {
             // Draw shape into a form-xobject.
             SkDraw d;
             d.fMatrix = &identity;
@@ -1836,7 +1836,7 @@
             SkPaint filledPaint;
             filledPaint.setColor(SK_ColorBLACK);
             filledPaint.setStyle(SkPaint::kFill_Style);
-            this->drawPath(d, *shape, filledPaint, NULL, true);
+            this->drawPath(d, *shape, filledPaint, nullptr, true);
 
             dstMaskStorage.reset(createFormXObjectFromDevice());
             dstMask = dstMaskStorage.get();
@@ -1915,9 +1915,9 @@
         const SkPaint& paint,
         bool hasText,
         GraphicStateEntry* entry) {
-    NOT_IMPLEMENTED(paint.getPathEffect() != NULL, false);
-    NOT_IMPLEMENTED(paint.getMaskFilter() != NULL, false);
-    NOT_IMPLEMENTED(paint.getColorFilter() != NULL, false);
+    NOT_IMPLEMENTED(paint.getPathEffect() != nullptr, false);
+    NOT_IMPLEMENTED(paint.getMaskFilter() != nullptr, false);
+    NOT_IMPLEMENTED(paint.getColorFilter() != nullptr, false);
 
     entry->fMatrix = matrix;
     entry->fClipStack = clipStack;
@@ -1967,7 +1967,7 @@
             SkShader::GradientInfo gradientInfo;
             SkColor gradientColor;
             gradientInfo.fColors = &gradientColor;
-            gradientInfo.fColorOffsets = NULL;
+            gradientInfo.fColorOffsets = nullptr;
             gradientInfo.fColorCount = 1;
             if (shader->asAGradient(&gradientInfo) ==
                     SkShader::kColor_GradientType) {
@@ -2025,7 +2025,7 @@
 void SkPDFDevice::updateFont(const SkPaint& paint, uint16_t glyphID,
                              ContentEntry* contentEntry) {
     SkTypeface* typeface = paint.getTypeface();
-    if (contentEntry->fState.fFont == NULL ||
+    if (contentEntry->fState.fFont == nullptr ||
             contentEntry->fState.fTextSize != paint.getTextSize() ||
             !contentEntry->fState.fFont->hasGlyph(glyphID)) {
         int fontIndex = getFontResourceIndex(typeface, glyphID);
@@ -2080,7 +2080,7 @@
             subsetBitmap = &tmpSubsetBitmap;
             *subsetBitmap = origBitmap;
         }
-        srcRect = NULL;
+        srcRect = nullptr;
 
         // Transform the bitmap in the new space, without taking into
         // account the initial transform.
@@ -2156,7 +2156,7 @@
                                   SkScalarCeilToInt(bounds.width()),
                                   SkScalarCeilToInt(bounds.height())));
         clipRegion = &perspectiveBounds;
-        srcRect = NULL;
+        srcRect = nullptr;
         bitmap = &perspectiveBitmap;
     }
 
diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h
index 06d3e10..fbd5fb3 100644
--- a/src/pdf/SkPDFDevice.h
+++ b/src/pdf/SkPDFDevice.h
@@ -152,7 +152,7 @@
      */
     SkPDFArray* copyMediaBox() const;
 
-    /** Get the annotations from this page, or NULL if there are none.
+    /** Get the annotations from this page, or nullptr if there are none.
      */
     SkPDFArray* getAnnotations() const { return fAnnotations; }
 
@@ -247,7 +247,7 @@
                                  bool invertClip);
 
     // If the paint or clip is such that we shouldn't draw anything, this
-    // returns NULL and does not create a content entry.
+    // returns nullptr and does not create a content entry.
     // setUpContentEntry and finishContentEntry can be used directly, but
     // the preferred method is to use the ScopedContentEntry helper class.
     ContentEntry* setUpContentEntry(const SkClipStack* clipStack,
@@ -288,7 +288,7 @@
 
     bool handleInversePath(const SkDraw& d, const SkPath& origPath,
                            const SkPaint& paint, bool pathIsMutable,
-                           const SkMatrix* prePathMatrix = NULL);
+                           const SkMatrix* prePathMatrix = nullptr);
     bool handlePointAnnotation(const SkPoint* points, size_t count,
                                const SkMatrix& matrix, SkAnnotation* annot);
     void addAnnotation(SkPDFDict*);
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index 25ffc0b..8df59b7 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -77,7 +77,7 @@
     return parsePFBSection(&srcPtr, &remaining, 1, headerLen) &&
            parsePFBSection(&srcPtr, &remaining, 2, dataLen) &&
            parsePFBSection(&srcPtr, &remaining, 1, trailerLen) &&
-           parsePFBSection(&srcPtr, &remaining, 3, NULL);
+           parsePFBSection(&srcPtr, &remaining, 3, nullptr);
 }
 
 /* The sections of a PFA file are implicitly defined.  The body starts
@@ -162,13 +162,13 @@
     // Make as few copies as possible given these constraints.
     SkDynamicMemoryWStream dynamicStream;
     SkAutoTDelete<SkMemoryStream> staticStream;
-    SkData* data = NULL;
+    SkData* data = nullptr;
     const uint8_t* src;
     size_t srcLen;
     if ((srcLen = srcStream->getLength()) > 0) {
         staticStream.reset(new SkMemoryStream(srcLen + 1));
         src = (const uint8_t*)staticStream->getMemoryBase();
-        if (srcStream->getMemoryBase() != NULL) {
+        if (srcStream->getMemoryBase() != nullptr) {
             memcpy((void *)src, srcStream->getMemoryBase(), srcLen);
         } else {
             size_t read = 0;
@@ -176,7 +176,7 @@
                 size_t got = srcStream->read((void *)staticStream->getAtPos(),
                                              srcLen - read);
                 if (got == 0) {
-                    return NULL;
+                    return nullptr;
                 }
                 read += got;
                 staticStream->seek(read);
@@ -191,7 +191,7 @@
             dynamicStream.write(buf, amount);
         }
         amount = 0;
-        dynamicStream.write(&amount, 1);  // NULL terminator.
+        dynamicStream.write(&amount, 1);  // nullptr terminator.
         data = dynamicStream.copyToData();
         src = data->bytes();
         srcLen = data->size() - 1;
@@ -268,7 +268,7 @@
 
         return SkData::NewFromMalloc(buffer.detach(), length);
     }
-    return NULL;
+    return nullptr;
 }
 
 // scale from em-units to base-1000, returning as a SkScalar
@@ -329,7 +329,7 @@
                                      SkPDFArray* array),
         Data* defaultAdvance) {
     SkPDFArray* result = new SkPDFArray();
-    for (; advanceInfo != NULL; advanceInfo = advanceInfo->fNext.get()) {
+    for (; advanceInfo != nullptr; advanceInfo = advanceInfo->fNext.get()) {
         switch (advanceInfo->fType) {
             case SkAdvancedTypefaceMetrics::WidthRange::kDefault: {
                 SkASSERT(advanceInfo->fAdvance.count() == 1);
@@ -520,7 +520,7 @@
 
     for (int i = firstGlyphID - glyphOffset; i < limit + 1; ++i) {
         bool inSubset = i < limit &&
-                        (subset == NULL || subset->has(i + glyphOffset));
+                        (subset == nullptr || subset->has(i + glyphOffset));
         if (!rangeEmpty) {
             // PDF spec requires bfrange not changing the higher byte,
             // e.g. <1035> <10FF> <2222> is ok, but
@@ -596,11 +596,11 @@
     size_t fontSize = fontData->getLength();
 
     // Read font into buffer.
-    SkPDFStream* subsetFontStream = NULL;
+    SkPDFStream* subsetFontStream = nullptr;
     SkTDArray<unsigned char> originalFont;
     originalFont.setCount(SkToInt(fontSize));
     if (fontData->read(originalFont.begin(), fontSize) == fontSize) {
-        unsigned char* subsetFont = NULL;
+        unsigned char* subsetFont = nullptr;
         // sfntly requires unsigned int* to be passed in, as far as we know,
         // unsigned int is equivalent to uint32_t on all platforms.
         static_assert(sizeof(unsigned int) == sizeof(uint32_t), "unsigned_int_not_32_bits");
@@ -610,11 +610,11 @@
                                                        subset.begin(),
                                                        subset.count(),
                                                        &subsetFont);
-        if (subsetFontSize > 0 && subsetFont != NULL) {
+        if (subsetFontSize > 0 && subsetFont != nullptr) {
             SkAutoDataUnref data(SkData::NewWithProc(subsetFont,
                                                      subsetFontSize,
                                                      sk_delete_array,
-                                                     NULL));
+                                                     nullptr));
             subsetFontStream = new SkPDFStream(data.get());
             fontSize = subsetFontSize;
         }
@@ -671,7 +671,7 @@
 
 const SkPDFGlyphSetMap::FontGlyphSetPair* SkPDFGlyphSetMap::F2BIter::next() const {
     if (fIndex >= fMap->count()) {
-        return NULL;
+        return nullptr;
     }
     return &((*fMap)[fIndex++]);
 }
@@ -697,7 +697,7 @@
 
 void SkPDFGlyphSetMap::reset() {
     for (int i = 0; i < fMap.count(); ++i) {
-        delete fMap[i].fGlyphSet;  // Should not be NULL.
+        delete fMap[i].fGlyphSet;  // Should not be nullptr.
     }
     fMap.reset();
 }
@@ -806,7 +806,7 @@
     }
 
     SkAutoTUnref<const SkAdvancedTypefaceMetrics> fontMetrics;
-    SkPDFDict* relatedFontDescriptor = NULL;
+    SkPDFDict* relatedFontDescriptor = nullptr;
     if (relatedFont) {
         fontMetrics.reset(SkSafeRef(relatedFont->fontInfo()));
         relatedFontDescriptor = relatedFont->getFontDescriptor();
@@ -832,7 +832,7 @@
                   info, SkTypeface::kHAdvance_PerGlyphInfo);
 #endif
         fontMetrics.reset(
-            typeface->getAdvancedTypefaceMetrics(info, NULL, 0));
+            typeface->getAdvancedTypefaceMetrics(info, nullptr, 0));
 #if defined (SK_SFNTLY_SUBSETTER)
         if (fontMetrics.get() &&
             fontMetrics->fType != SkAdvancedTypefaceMetrics::kTrueType_Font) {
@@ -840,7 +840,7 @@
             info = SkTBitOr<SkTypeface::PerGlyphInfo>(
                       info, SkTypeface::kHAdvance_PerGlyphInfo);
             fontMetrics.reset(
-                typeface->getAdvancedTypefaceMetrics(info, NULL, 0));
+                typeface->getAdvancedTypefaceMetrics(info, nullptr, 0));
         }
 #endif
     }
@@ -852,7 +852,7 @@
 }
 
 SkPDFFont* SkPDFFont::getFontSubset(const SkPDFGlyphSet*) {
-    return NULL;  // Default: no support.
+    return nullptr;  // Default: no support.
 }
 
 SkPDFFont::SkPDFFont(const SkAdvancedTypefaceMetrics* info,
@@ -864,7 +864,7 @@
     , fLastGlyphID(info ? info->fLastGlyphID : 0)
     , fFontInfo(SkSafeRef(info))
     , fDescriptor(SkSafeRef(relatedFontDescriptor)) {
-    if (info == NULL ||
+    if (info == nullptr ||
             info->fFlags & SkAdvancedTypefaceMetrics::kMultiMaster_FontFlag) {
         fFontType = SkAdvancedTypefaceMetrics::kOther_Font;
     } else {
@@ -886,7 +886,7 @@
     }
     if (type == SkAdvancedTypefaceMetrics::kType1CID_Font ||
         type == SkAdvancedTypefaceMetrics::kTrueType_Font) {
-        SkASSERT(relatedFontDescriptor == NULL);
+        SkASSERT(relatedFontDescriptor == nullptr);
         return new SkPDFType0Font(info, typeface);
     }
     if (type == SkAdvancedTypefaceMetrics::kType1_Font) {
@@ -904,7 +904,7 @@
 }
 
 void SkPDFFont::setFontInfo(const SkAdvancedTypefaceMetrics* info) {
-    if (info == NULL || info == fFontInfo.get()) {
+    if (info == nullptr || info == fFontInfo.get()) {
         return;
     }
     fFontInfo.reset(info);
@@ -933,7 +933,7 @@
 }
 
 bool SkPDFFont::addCommonFontDescriptorEntries(int16_t defaultWidth) {
-    if (fDescriptor.get() == NULL) {
+    if (fDescriptor.get() == nullptr) {
         return false;
     }
 
@@ -970,7 +970,7 @@
 }
 
 void SkPDFFont::populateToUnicodeTable(const SkPDFGlyphSet* subset) {
-    if (fFontInfo == NULL || fFontInfo->fGlyphToUnicode.begin() == NULL) {
+    if (fFontInfo == nullptr || fFontInfo->fGlyphToUnicode.begin() == nullptr) {
         return;
     }
     this->insertObjRef("ToUnicode",
@@ -986,10 +986,10 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SkPDFType0Font::SkPDFType0Font(const SkAdvancedTypefaceMetrics* info, SkTypeface* typeface)
-    : SkPDFFont(info, typeface, NULL) {
+    : SkPDFFont(info, typeface, nullptr) {
     SkDEBUGCODE(fPopulated = false);
     if (!canSubset()) {
-        this->populate(NULL);
+        this->populate(nullptr);
     }
 }
 
@@ -997,7 +997,7 @@
 
 SkPDFFont* SkPDFType0Font::getFontSubset(const SkPDFGlyphSet* subset) {
     if (!canSubset()) {
-        return NULL;
+        return nullptr;
     }
     SkPDFType0Font* newSubset = new SkPDFType0Font(fontInfo(), typeface());
     newSubset->populate(subset);
@@ -1037,7 +1037,7 @@
 SkPDFCIDFont::SkPDFCIDFont(const SkAdvancedTypefaceMetrics* info,
                            SkTypeface* typeface,
                            const SkPDFGlyphSet* subset)
-    : SkPDFFont(info, typeface, NULL) {
+    : SkPDFFont(info, typeface, nullptr) {
     this->populate(subset);
 }
 
@@ -1062,7 +1062,7 @@
 #if defined(SK_SFNTLY_SUBSETTER)
             if (this->canSubset()) {
                 SkAutoTUnref<SkPDFStream> fontStream;
-                SkPDFStream* rawStream = NULL;
+                SkPDFStream* rawStream = nullptr;
                 fontSize = get_subset_font_stream(fontInfo()->fFontName.c_str(),
                                                   typeface(),
                                                   *subset,
@@ -1077,7 +1077,7 @@
 #endif
             SkAutoTUnref<SkPDFSharedStream> fontStream;
             SkAutoTDelete<SkStreamAsset> fontData(
-                    this->typeface()->openStream(NULL));
+                    this->typeface()->openStream(nullptr));
             SkASSERT(fontData);
             fontSize = fontData->getLength();
             SkASSERT(fontSize > 0);
@@ -1089,7 +1089,7 @@
         case SkAdvancedTypefaceMetrics::kCFF_Font:
         case SkAdvancedTypefaceMetrics::kType1CID_Font: {
             SkAutoTUnref<SkPDFSharedStream> fontStream(
-                    new SkPDFSharedStream(this->typeface()->openStream(NULL)));
+                    new SkPDFSharedStream(this->typeface()->openStream(nullptr)));
 
             if (getType() == SkAdvancedTypefaceMetrics::kCFF_Font) {
                 fontStream->dict()->insertName("Subtype", "Type1C");
@@ -1123,7 +1123,7 @@
         info = SkTypeface::kGlyphNames_PerGlyphInfo;
         info = SkTBitOr<SkTypeface::PerGlyphInfo>(
                   info, SkTypeface::kHAdvance_PerGlyphInfo);
-        uint32_t* glyphs = (glyphIDs.count() == 0) ? NULL : glyphIDs.begin();
+        uint32_t* glyphs = (glyphIDs.count() == 0) ? nullptr : glyphIDs.begin();
         uint32_t glyphsCount = glyphs ? glyphIDs.count() : 0;
         SkAutoTUnref<const SkAdvancedTypefaceMetrics> fontMetrics(
             typeface()->getAdvancedTypefaceMetrics(info, glyphs, glyphsCount));
@@ -1131,7 +1131,7 @@
         addFontDescriptor(0, &glyphIDs);
     } else {
         // Other CID fonts
-        addFontDescriptor(0, NULL);
+        addFontDescriptor(0, nullptr);
     }
 
     insertName("BaseFont", fontInfo()->fFontName);
@@ -1219,7 +1219,7 @@
     SkAutoTDelete<SkStream> rawFontData(typeface()->openStream(&ttcIndex));
     SkAutoTUnref<SkData> fontData(handle_type1_stream(rawFontData.get(), &header,
                                                       &data, &trailer));
-    if (fontData.get() == NULL) {
+    if (fontData.get() == nullptr) {
         return false;
     }
     if (canEmbed()) {
@@ -1242,10 +1242,10 @@
     adjustGlyphRangeForSingleByteEncoding(glyphID);
 
     int16_t defaultWidth = 0;
-    const SkAdvancedTypefaceMetrics::WidthRange* widthRangeEntry = NULL;
+    const SkAdvancedTypefaceMetrics::WidthRange* widthRangeEntry = nullptr;
     const SkAdvancedTypefaceMetrics::WidthRange* widthEntry;
     for (widthEntry = fontInfo()->fGlyphWidths.get();
-            widthEntry != NULL;
+            widthEntry != nullptr;
             widthEntry = widthEntry->fNext.get()) {
         switch (widthEntry->fType) {
             case SkAdvancedTypefaceMetrics::WidthRange::kDefault:
@@ -1255,7 +1255,7 @@
                 SkASSERT(false);
                 break;
             case SkAdvancedTypefaceMetrics::WidthRange::kRange:
-                SkASSERT(widthRangeEntry == NULL);
+                SkASSERT(widthRangeEntry == nullptr);
                 widthRangeEntry = widthEntry;
                 break;
         }
@@ -1320,7 +1320,7 @@
 SkPDFType3Font::SkPDFType3Font(const SkAdvancedTypefaceMetrics* info,
                                SkTypeface* typeface,
                                uint16_t glyphID)
-    : SkPDFFont(info, typeface, NULL) {
+    : SkPDFFont(info, typeface, nullptr) {
     this->populate(glyphID);
 }
 
@@ -1331,7 +1331,7 @@
     paint.setTypeface(typeface());
     paint.setTextSize(1000);
     const SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
-    SkAutoGlyphCache autoCache(paint, &props, NULL);
+    SkAutoGlyphCache autoCache(paint, &props, nullptr);
     SkGlyphCache* cache = autoCache.getCache();
     // If fLastGlyphID isn't set (because there is not fFontInfo), look it up.
     if (lastGlyphID() == 0) {
@@ -1394,7 +1394,7 @@
     this->insertObject("Widths", widthArray.detach());
     this->insertName("CIDToGIDMap", "Identity");
 
-    this->populateToUnicodeTable(NULL);
+    this->populateToUnicodeTable(nullptr);
     return true;
 }
 
@@ -1409,7 +1409,7 @@
     if (existingGlyphID == 0 || searchGlyphID == 0) {
         return SkPDFFont::kExact_Match;
     }
-    if (existingFont != NULL) {
+    if (existingFont != nullptr) {
         return (existingFont->fFirstGlyphID <= searchGlyphID &&
                 searchGlyphID <= existingFont->fLastGlyphID)
                        ? SkPDFFont::kExact_Match
diff --git a/src/pdf/SkPDFFont.h b/src/pdf/SkPDFFont.h
index d85c582..404e8b7 100644
--- a/src/pdf/SkPDFFont.h
+++ b/src/pdf/SkPDFFont.h
@@ -82,7 +82,7 @@
 public:
     virtual ~SkPDFFont();
 
-    /** Returns the typeface represented by this class. Returns NULL for the
+    /** Returns the typeface represented by this class. Returns nullptr for the
      *  default typeface.
      */
     SkTypeface* typeface();
@@ -133,7 +133,7 @@
     /** Subset the font based on usage set. Returns a SkPDFFont instance with
      *  subset.
      *  @param usage  Glyph subset requested.
-     *  @return       NULL if font does not support subsetting, a new instance
+     *  @return       nullptr if font does not support subsetting, a new instance
      *                of SkPDFFont otherwise.
      */
     virtual SkPDFFont* getFontSubset(const SkPDFGlyphSet* usage);
@@ -175,7 +175,7 @@
     void adjustGlyphRangeForSingleByteEncoding(uint16_t glyphID);
 
     // Generate ToUnicode table according to glyph usage subset.
-    // If subset is NULL, all available glyph ids will be used.
+    // If subset is nullptr, all available glyph ids will be used.
     void populateToUnicodeTable(const SkPDFGlyphSet* subset);
 
     // Create instances of derived types based on fontInfo.
diff --git a/src/pdf/SkPDFFormXObject.cpp b/src/pdf/SkPDFFormXObject.cpp
index 07f42fa..09db140 100644
--- a/src/pdf/SkPDFFormXObject.cpp
+++ b/src/pdf/SkPDFFormXObject.cpp
@@ -25,7 +25,7 @@
     this->setData(content.get());
 
     SkAutoTUnref<SkPDFArray> bboxArray(device->copyMediaBox());
-    this->init(NULL, resourceDict.get(), bboxArray);
+    this->init(nullptr, resourceDict.get(), bboxArray);
 
     // We invert the initial transform and apply that to the xobject so that
     // it doesn't get applied twice. We can't just undo it because it's
@@ -68,7 +68,7 @@
     SkAutoTUnref<SkPDFDict> group(new SkPDFDict("Group"));
     group->insertName("S", "Transparency");
 
-    if (colorSpace != NULL) {
+    if (colorSpace != nullptr) {
         group->insertName("CS", colorSpace);
     }
     group->insertBool("I", true);  // Isolated.
diff --git a/src/pdf/SkPDFGraphicState.cpp b/src/pdf/SkPDFGraphicState.cpp
index bff32ae..162ddc8 100644
--- a/src/pdf/SkPDFGraphicState.cpp
+++ b/src/pdf/SkPDFGraphicState.cpp
@@ -65,9 +65,9 @@
         // TODO(vandebo): Figure out if we can support more of these modes.
         case SkXfermode::kXor_Mode:
         case SkXfermode::kPlus_Mode:
-            return NULL;
+            return nullptr;
     }
-    return NULL;
+    return nullptr;
 }
 
 // If a SkXfermode is unsupported in PDF, this function returns
diff --git a/src/pdf/SkPDFResourceDict.h b/src/pdf/SkPDFResourceDict.h
index 2913779..698823b 100644
--- a/src/pdf/SkPDFResourceDict.h
+++ b/src/pdf/SkPDFResourceDict.h
@@ -34,7 +34,7 @@
      *  The full set of ProcSet entries is automatically created for backwards
      *  compatibility, as recommended by the PDF spec.
      *
-     *  Any arguments can be NULL.
+     *  Any arguments can be nullptr.
      */
     static SkPDFDict* Create(
         const SkTDArray<SkPDFObject*>* gStateResources,
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index 6b4e758..645091d 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -495,7 +495,7 @@
         // handle compose shader by pulling things up to a layer, drawing with
         // the first shader, applying the xfer mode and drawing again with the
         // second shader, then applying the layer to the original drawing.
-        return NULL;
+        return nullptr;
     } else if (state.fType == SkShader::kNone_GradientType) {
         SkPDFObject* shader = canon->findImageShader(state);
         return shader ? SkRef(shader)
@@ -533,7 +533,7 @@
     if (gState) {
         graphicStates.push(gState);
     }
-    return SkPDFResourceDict::Create(&graphicStates, &patterns, NULL, NULL);
+    return SkPDFResourceDict::Create(&graphicStates, &patterns, nullptr, nullptr);
 }
 
 static void populate_tiling_pattern_dict(SkPDFDict* pattern,
@@ -592,7 +592,7 @@
     SkAutoTDelete<SkStream> alphaStream(create_pattern_fill_content(-1, bbox));
 
     SkAutoTUnref<SkPDFDict>
-        resources(get_gradient_resource_dict(luminosityShader, NULL));
+        resources(get_gradient_resource_dict(luminosityShader, nullptr));
 
     SkAutoTUnref<SkPDFFormXObject> alphaMask(
             new SkPDFFormXObject(alphaStream.get(), bbox, resources.get()));
@@ -615,7 +615,7 @@
     SkAutoTUnref<SkPDFObject> colorShader(
             get_pdf_shader_by_state(canon, dpi, &opaqueState));
     if (!colorShader) {
-        return NULL;
+        return nullptr;
     }
 
     // Create resource dict with alpha graphics state as G0 and
@@ -712,7 +712,7 @@
     const SkPDFShader::State& state = **autoState;
 
     SkString (*codeFunction)(const SkShader::GradientInfo& info,
-                             const SkMatrix& perspectiveRemover) = NULL;
+                             const SkMatrix& perspectiveRemover) = nullptr;
     SkPoint transformPoints[2];
 
     // Depending on the type of the gradient, we want to transform the
@@ -743,7 +743,7 @@
         case SkShader::kColor_GradientType:
         case SkShader::kNone_GradientType:
         default:
-            return NULL;
+            return nullptr;
     }
 
     // Move any scaling (assuming a unit gradient) or translation
@@ -766,14 +766,14 @@
     if (finalMatrix.hasPerspective()) {
         if (!split_perspective(finalMatrix,
                                &finalMatrix, &perspectiveInverseOnly)) {
-            return NULL;
+            return nullptr;
         }
     }
 
     SkRect bbox;
     bbox.set(state.fBBox);
     if (!inverse_transform_bbox(finalMatrix, &bbox)) {
-        return NULL;
+        return nullptr;
     }
 
     SkAutoTUnref<SkPDFArray> domain(new SkPDFArray);
@@ -792,7 +792,7 @@
         SkShader::GradientInfo twoPointRadialInfo = *info;
         SkMatrix inverseMapperMatrix;
         if (!mapperMatrix.invert(&inverseMapperMatrix)) {
-            return NULL;
+            return nullptr;
         }
         inverseMapperMatrix.mapPoints(twoPointRadialInfo.fPoint, 2);
         twoPointRadialInfo.fRadius[0] =
@@ -843,7 +843,7 @@
     SkRect deviceBounds;
     deviceBounds.set(state.fBBox);
     if (!inverse_transform_bbox(finalMatrix, &deviceBounds)) {
-        return NULL;
+        return nullptr;
     }
 
     const SkBitmap* image = &state.fImage;
@@ -1099,8 +1099,8 @@
           fBBox(bbox),
           fPixelGeneration(0) {
     fInfo.fColorCount = 0;
-    fInfo.fColors = NULL;
-    fInfo.fColorOffsets = NULL;
+    fInfo.fColors = nullptr;
+    fInfo.fColorOffsets = nullptr;
     fShaderTransform = shader.getLocalMatrix();
     fImageTileModes[0] = fImageTileModes[1] = SkShader::kClamp_TileMode;
 
diff --git a/src/pdf/SkPDFShader.h b/src/pdf/SkPDFShader.h
index 1cc36ce..9380b57 100644
--- a/src/pdf/SkPDFShader.h
+++ b/src/pdf/SkPDFShader.h
@@ -29,7 +29,7 @@
     class State;
 
     /** Get the PDF shader for the passed SkShader. If the SkShader is
-     *  invalid in some way, returns NULL. The reference count of
+     *  invalid in some way, returns nullptr. The reference count of
      *  the object is incremented and it is the caller's responsibility to
      *  unreference it when done.  This is needed to accommodate the weak
      *  reference pattern used when the returned object is new and has no
diff --git a/src/pipe/SkGPipePriv.h b/src/pipe/SkGPipePriv.h
index 07c62f5..c4217f3 100644
--- a/src/pipe/SkGPipePriv.h
+++ b/src/pipe/SkGPipePriv.h
@@ -172,8 +172,8 @@
         : fBitmap(bitmap)
         , fGenID(genID)
         , fBytesAllocated(0)
-        , fMoreRecentlyUsed(NULL)
-        , fLessRecentlyUsed(NULL)
+        , fMoreRecentlyUsed(nullptr)
+        , fLessRecentlyUsed(nullptr)
         , fToBeDrawnCount(toBeDrawnCount)
     {}
 
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index 97cae90..4d57a6c 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -118,7 +118,7 @@
 
     SkFlattenable* getFlat(unsigned index) const {
         if (0 == index) {
-            return NULL;
+            return nullptr;
         }
         return fFlatArray[index - 1];
     }
@@ -174,7 +174,7 @@
     void releaseRef(int32_t) override {}
 
     void setSharedHeap(SkBitmapHeap* heap) {
-        SkASSERT(!shouldFlattenBitmaps(fFlags) || NULL == heap);
+        SkASSERT(!shouldFlattenBitmaps(fFlags) || nullptr == heap);
         SkRefCnt_SafeAssign(fSharedHeap, heap);
         this->updateReader();
     }
@@ -200,7 +200,7 @@
     }
 
     SkTypeface* getTypeface(unsigned id) const {
-        return id ? fTypefaces[id - 1] : NULL;
+        return id ? fTypefaces[id - 1] : nullptr;
     }
 
     const SkImage* getImage(int32_t slot) const {
@@ -209,7 +209,7 @@
 
 private:
     void updateReader() {
-        if (NULL == fReader) {
+        if (nullptr == fReader) {
             return;
         }
         bool crossProcess = SkToBool(fFlags & SkGPipeWriter::kCrossProcess_Flag);
@@ -218,7 +218,7 @@
         if (crossProcess) {
             fReader->setFactoryArray(&fFactoryArray);
         } else {
-            fReader->setFactoryArray(NULL);
+            fReader->setFactoryArray(nullptr);
         }
 
         if (shouldFlattenBitmaps(fFlags)) {
@@ -337,11 +337,11 @@
     unsigned flags = DrawOp_unpackFlags(op32);
     SkCanvas::SaveFlags saveFlags = (SkCanvas::SaveFlags)DrawOp_unpackData(op32);
 
-    const SkRect* bounds = NULL;
+    const SkRect* bounds = nullptr;
     if (flags & kSaveLayer_HasBounds_DrawOpFlag) {
         bounds = skip<SkRect>(reader);
     }
-    const SkPaint* paint = NULL;
+    const SkPaint* paint = nullptr;
     if (flags & kSaveLayer_HasPaint_DrawOpFlag) {
         paint = &state->paint();
     }
@@ -414,11 +414,11 @@
     
     const SkPoint* cubics = skip<SkPoint>(reader, SkPatchUtils::kNumCtrlPts);
     
-    const SkColor* colors = NULL;
+    const SkColor* colors = nullptr;
     if (flags & kDrawVertices_HasColors_DrawOpFlag) {
         colors = skip<SkColor>(reader, SkPatchUtils::kNumCorners);
     }
-    const SkPoint* texCoords = NULL;
+    const SkPoint* texCoords = nullptr;
     if (flags & kDrawVertices_HasTexs_DrawOpFlag) {
         texCoords = skip<SkPoint>(reader, SkPatchUtils::kNumCorners);
     }
@@ -452,12 +452,12 @@
     int vertexCount = reader->readU32();
     const SkPoint* verts = skip<SkPoint>(reader, vertexCount);
 
-    const SkPoint* texs = NULL;
+    const SkPoint* texs = nullptr;
     if (flags & kDrawVertices_HasTexs_DrawOpFlag) {
         texs = skip<SkPoint>(reader, vertexCount);
     }
 
-    const SkColor* colors = NULL;
+    const SkColor* colors = nullptr;
     if (flags & kDrawVertices_HasColors_DrawOpFlag) {
         colors = skip<SkColor>(reader, vertexCount);
     }
@@ -469,7 +469,7 @@
     }
 
     int indexCount = 0;
-    const uint16_t* indices = NULL;
+    const uint16_t* indices = nullptr;
     if (flags & kDrawVertices_HasIndices_DrawOpFlag) {
         indexCount = reader->readU32();
         indices = skipAlign<uint16_t>(reader, indexCount);
@@ -483,7 +483,7 @@
 static void drawAtlas_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, SkGPipeState* state) {
     unsigned flags = DrawOp_unpackFlags(op32);
 
-    const SkPaint* paint = NULL;
+    const SkPaint* paint = nullptr;
     if (flags & kDrawAtlas_HasPaint_DrawOpFlag) {
         paint = &state->paint();
     }
@@ -493,11 +493,11 @@
     SkXfermode::Mode mode = (SkXfermode::Mode)reader->readU32();
     const SkRSXform* xform = skip<SkRSXform>(reader, count);
     const SkRect* tex = skip<SkRect>(reader, count);
-    const SkColor* colors = NULL;
+    const SkColor* colors = nullptr;
     if (flags & kDrawAtlas_HasColors_DrawOpFlag) {
         colors = skip<SkColor>(reader, count);
     }
-    const SkRect* cull = NULL;
+    const SkRect* cull = nullptr;
     if (flags & kDrawAtlas_HasCull_DrawOpFlag) {
         cull = skip<SkRect>(reader, 1);
     }
@@ -551,7 +551,7 @@
     reader->readPath(&path);
 
     SkMatrix matrixStorage;
-    const SkMatrix* matrix = NULL;
+    const SkMatrix* matrix = nullptr;
     if (DrawOp_unpackFlags(op32) & kDrawTextOnPath_HasMatrix_DrawOpFlag) {
         reader->readMatrix(&matrixStorage);
         matrix = &matrixStorage;
@@ -567,7 +567,7 @@
 public:
     BitmapHolder(SkReader32* reader, uint32_t op32, SkGPipeState* state);
     ~BitmapHolder() {
-        if (fHeapEntry != NULL) {
+        if (fHeapEntry != nullptr) {
             fHeapEntry->releaseRef();
         }
     }
@@ -585,7 +585,7 @@
     const unsigned flags = state->getFlags();
     const unsigned index = DrawOp_unpackData(op32);
     if (shouldFlattenBitmaps(flags)) {
-        fHeapEntry = NULL;
+        fHeapEntry = nullptr;
         fBitmap = state->getBitmap(index);
     } else {
         SkBitmapHeapEntry* entry = state->getSharedHeap()->getEntry(index);
@@ -596,7 +596,7 @@
             fBitmap = &fBitmapStorage;
             // Release the ref on the bitmap now, since we made our own copy.
             entry->releaseRef();
-            fHeapEntry = NULL;
+            fHeapEntry = nullptr;
         } else {
             SkASSERT(!shouldFlattenBitmaps(flags));
             SkASSERT(!SkToBool(flags & SkGPipeWriter::kSimultaneousReaders_Flag));
@@ -614,7 +614,7 @@
     SkScalar top = reader->readScalar();
     const SkBitmap* bitmap = holder.getBitmap();
     if (state->shouldDraw()) {
-        canvas->drawBitmap(*bitmap, left, top, hasPaint ? &state->paint() : NULL);
+        canvas->drawBitmap(*bitmap, left, top, hasPaint ? &state->paint() : nullptr);
     }
 }
 
@@ -627,7 +627,7 @@
     const SkBitmap* bitmap = holder.getBitmap();
     if (state->shouldDraw()) {
         canvas->drawBitmapNine(*bitmap, *center, *dst,
-                               hasPaint ? &state->paint() : NULL);
+                               hasPaint ? &state->paint() : nullptr);
     }
 }
 
@@ -641,7 +641,7 @@
     if (hasSrc) {
         src = skip<SkRect>(reader);
     } else {
-        src = NULL;
+        src = nullptr;
     }
     SkCanvas::SrcRectConstraint constraint = SkCanvas::kStrict_SrcRectConstraint;
     if (flags & kDrawBitmap_Bleed_DrawOpFlag) {
@@ -650,7 +650,7 @@
     const SkRect* dst = skip<SkRect>(reader);
     const SkBitmap* bitmap = holder.getBitmap();
     if (state->shouldDraw()) {
-        canvas->legacy_drawBitmapRect(*bitmap, src, *dst, hasPaint ? &state->paint() : NULL, constraint);
+        canvas->legacy_drawBitmapRect(*bitmap, src, *dst, hasPaint ? &state->paint() : nullptr, constraint);
     }
 }
 
@@ -661,7 +661,7 @@
     const SkIPoint* point = skip<SkIPoint>(reader);
     const SkBitmap* bitmap = holder.getBitmap();
     if (state->shouldDraw()) {
-        canvas->drawSprite(*bitmap, point->fX, point->fY, hasPaint ? &state->paint() : NULL);
+        canvas->drawSprite(*bitmap, point->fX, point->fY, hasPaint ? &state->paint() : nullptr);
     }
 }
 
@@ -673,7 +673,7 @@
     SkScalar y = reader->readScalar();
     const SkImage* image = state->getImage(slot);
     if (state->shouldDraw()) {
-        canvas->drawImage(image, x, y, hasPaint ? &state->paint() : NULL);
+        canvas->drawImage(image, x, y, hasPaint ? &state->paint() : nullptr);
     }
 }
 
@@ -683,7 +683,7 @@
     unsigned flags = DrawOp_unpackFlags(op32);
     bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag);
     bool hasSrc = SkToBool(flags & kDrawBitmap_HasSrcRect_DrawOpFlag);
-    const SkRect* src = NULL;
+    const SkRect* src = nullptr;
     if (hasSrc) {
         src = skip<SkRect>(reader);
     }
@@ -692,7 +692,7 @@
 
     const SkImage* image = state->getImage(slot);
     if (state->shouldDraw()) {
-        canvas->legacy_drawImageRect(image, src, *dst, hasPaint ? &state->paint() : NULL, constraint);
+        canvas->legacy_drawImageRect(image, src, *dst, hasPaint ? &state->paint() : nullptr, constraint);
     }
 }
 
@@ -705,7 +705,7 @@
     const SkRect* dst = skip<SkRect>(reader);
     const SkImage* image = state->getImage(slot);
     if (state->shouldDraw()) {
-        canvas->drawImageNine(image, *center, *dst, hasPaint ? &state->paint() : NULL);
+        canvas->drawImageNine(image, *center, *dst, hasPaint ? &state->paint() : nullptr);
     }
 }
 
@@ -812,7 +812,7 @@
         p->setAnnotation(SkAnnotation::Create(buffer))->unref();
         SkASSERT(buffer.offset() == size);
     } else {
-        p->setAnnotation(NULL);
+        p->setAnnotation(nullptr);
     }
 }
 
@@ -925,7 +925,7 @@
 SkGPipeState::SkGPipeState()
     : fReader(0)
     , fSilent(false)
-    , fSharedHeap(NULL)
+    , fSharedHeap(nullptr)
     , fFlags(0) {
 
 }
@@ -942,16 +942,16 @@
 #include "SkGPipe.h"
 
 SkGPipeReader::SkGPipeReader() {
-    fCanvas = NULL;
-    fState = NULL;
-    fProc = NULL;
+    fCanvas = nullptr;
+    fState = nullptr;
+    fProc = nullptr;
 }
 
 SkGPipeReader::SkGPipeReader(SkCanvas* target) {
-    fCanvas = NULL;
+    fCanvas = nullptr;
     this->setCanvas(target);
-    fState = NULL;
-    fProc = NULL;
+    fState = nullptr;
+    fProc = nullptr;
 }
 
 void SkGPipeReader::setCanvas(SkCanvas *target) {
@@ -965,11 +965,11 @@
 
 SkGPipeReader::Status SkGPipeReader::playback(const void* data, size_t length,
                                               uint32_t playbackFlags, size_t* bytesRead) {
-    if (NULL == fCanvas) {
+    if (nullptr == fCanvas) {
         return kError_Status;
     }
 
-    if (NULL == fState) {
+    if (nullptr == fState) {
         fState = new SkGPipeState;
     }
 
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index b74b36d..0fccb80 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -53,7 +53,7 @@
         case kXfermode_PaintFlat:       return paint.getXfermode();
     }
     SkDEBUGFAIL("never gets here");
-    return NULL;
+    return nullptr;
 }
 
 static size_t writeTypeface(SkWriter32* writer, SkTypeface* typeface) {
@@ -76,7 +76,7 @@
     FlattenableHeap(int numFlatsToKeep, SkNamedFactorySet* fset, bool isCrossProcess)
     : INHERITED(isCrossProcess ? SkWriteBuffer::kCrossProcess_Flag : 0)
     , fNumFlatsToKeep(numFlatsToKeep) {
-        SkASSERT((isCrossProcess && fset != NULL) || (!isCrossProcess && NULL == fset));
+        SkASSERT((isCrossProcess && fset != nullptr) || (!isCrossProcess && nullptr == fset));
         if (isCrossProcess) {
             this->setNamedFactorySet(fset);
         }
@@ -150,7 +150,7 @@
             }
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -229,10 +229,10 @@
 
     size_t storageAllocatedForRecording() {
         size_t bytesAllocated = 0;
-        if (NULL != fBitmapHeap) {
+        if (nullptr != fBitmapHeap) {
             bytesAllocated += fBitmapHeap->bytesAllocated();
         }
-        if (NULL != fImageHeap) {
+        if (nullptr != fImageHeap) {
             bytesAllocated += fImageHeap->bytesInCache();
         }
         return bytesAllocated;
@@ -375,7 +375,7 @@
 
 void SkGPipeCanvas::flattenFactoryNames() {
     const char* name;
-    while ((name = fFactorySet->getNextAddedFactoryName()) != NULL) {
+    while ((name = fFactorySet->getNextAddedFactoryName()) != nullptr) {
         size_t len = strlen(name);
         if (this->needOpBytes(SkWriter32::WriteStringSize(name, len))) {
             this->writeOp(kDef_Factory_DrawOp);
@@ -400,11 +400,11 @@
     return false;
 }
 
-// return 0 for NULL (or unflattenable obj), or index-base-1
+// return 0 for nullptr (or unflattenable obj), or index-base-1
 // return ~(index-base-1) if an old flattenable was replaced
 int SkGPipeCanvas::flattenToIndex(SkFlattenable* obj, PaintFlats paintflat) {
-    SkASSERT(!fDone && fBitmapHeap != NULL);
-    if (NULL == obj) {
+    SkASSERT(!fDone && fBitmapHeap != nullptr);
+    if (nullptr == obj) {
         return 0;
     }
 
@@ -442,7 +442,7 @@
                              uint32_t width,
                              uint32_t height)
     : SkCanvas(width, height)
-    , fFactorySet(is_cross_process(flags) ? new SkNamedFactorySet : NULL)
+    , fFactorySet(is_cross_process(flags) ? new SkNamedFactorySet : nullptr)
     , fWriter(*writer)
     , fFlags(flags)
     , fFlattenableHeap(FLATTENABLES_TO_KEEP, fFactorySet, is_cross_process(flags))
@@ -501,7 +501,7 @@
         needed = SkTMax<size_t>(MIN_BLOCK_SIZE, needed);
 
         void* block = fController->requestBlock(needed, &fBlockSize);
-        if (NULL == block) {
+        if (nullptr == block) {
             // Do not notify the readers, which would call this function again.
             this->finish(false);
             return false;
@@ -519,7 +519,7 @@
         id = fTypefaceSet.find(face);
         if (0 == id) {
             id = fTypefaceSet.add(face);
-            size_t size = writeTypeface(NULL, face);
+            size_t size = writeTypeface(nullptr, face);
             if (this->needOpBytes(size)) {
                 this->writeOp(kDef_Typeface_DrawOp);
                 writeTypeface(&fWriter, face);
@@ -596,7 +596,7 @@
 }
 
 void SkGPipeCanvas::recordConcat(const SkMatrix& m) {
-    if (this->needOpBytes(m.writeToMemory(NULL))) {
+    if (this->needOpBytes(m.writeToMemory(nullptr))) {
         this->writeOp(kConcat_DrawOp);
         fWriter.writeMatrix(m);
     }
@@ -623,7 +623,7 @@
 
 void SkGPipeCanvas::didSetMatrix(const SkMatrix& matrix) {
     NOTIFY_SETUP(this);
-    if (this->needOpBytes(matrix.writeToMemory(NULL))) {
+    if (this->needOpBytes(matrix.writeToMemory(nullptr))) {
         this->writeOp(kSetMatrix_DrawOp);
         fWriter.writeMatrix(matrix);
     }
@@ -661,7 +661,7 @@
 void SkGPipeCanvas::onClipPath(const SkPath& path, SkRegion::Op rgnOp,
                                ClipEdgeStyle edgeStyle) {
     NOTIFY_SETUP(this);
-    if (this->needOpBytes(path.writeToMemory(NULL))) {
+    if (this->needOpBytes(path.writeToMemory(nullptr))) {
         unsigned flags = 0;
         if (kSoft_ClipEdgeStyle == edgeStyle) {
             flags = kClip_HasAntiAlias_DrawOpFlag;
@@ -675,7 +675,7 @@
 
 void SkGPipeCanvas::onClipRegion(const SkRegion& region, SkRegion::Op rgnOp) {
     NOTIFY_SETUP(this);
-    if (this->needOpBytes(region.writeToMemory(NULL))) {
+    if (this->needOpBytes(region.writeToMemory(nullptr))) {
         this->writeOp(kClipRegion_DrawOp, 0, rgnOp);
         fWriter.writeRegion(region);
     }
@@ -746,7 +746,7 @@
 void SkGPipeCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
     NOTIFY_SETUP(this);
     this->writePaint(paint);
-    if (this->needOpBytes(path.writeToMemory(NULL))) {
+    if (this->needOpBytes(path.writeToMemory(nullptr))) {
         this->writeOp(kDrawPath_DrawOp);
         fWriter.writePath(path);
     }
@@ -760,13 +760,13 @@
         return false;
     }
 
-    if (paint != NULL) {
+    if (paint != nullptr) {
         flags |= kDrawBitmap_HasPaint_DrawOpFlag;
         this->writePaint(*paint);
     }
     // This needs to run first so its calls to needOpBytes() and its writes
     // don't interlace with the needOpBytes() and write below.
-    SkASSERT(fBitmapHeap != NULL);
+    SkASSERT(fBitmapHeap != nullptr);
     int32_t bitmapIndex = fBitmapHeap->insert(bm);
     if (SkBitmapHeap::INVALID_SLOT == bitmapIndex) {
         return false;
@@ -794,7 +794,7 @@
                                      const SkPaint* paint, SrcRectConstraint constraint) {
     NOTIFY_SETUP(this);
     size_t opBytesNeeded = sizeof(SkRect);
-    bool hasSrc = src != NULL;
+    bool hasSrc = src != nullptr;
     unsigned flags;
     if (hasSrc) {
         flags = kDrawBitmap_HasSrcRect_DrawOpFlag;
@@ -844,7 +844,7 @@
         return false;
     }
     
-    if (paint != NULL) {
+    if (paint != nullptr) {
         flags |= kDrawBitmap_HasPaint_DrawOpFlag;
         this->writePaint(*paint);
     }
@@ -916,7 +916,7 @@
     if (byteLength) {
         NOTIFY_SETUP(this);
         this->writePaint(paint);
-        int count = paint.textToGlyphs(text, byteLength, NULL);
+        int count = paint.textToGlyphs(text, byteLength, nullptr);
         if (this->needOpBytes(4 + SkAlign4(byteLength) + 4 + count * sizeof(SkPoint))) {
             this->writeOp(kDrawPosText_DrawOp);
             fWriter.write32(SkToU32(byteLength));
@@ -932,7 +932,7 @@
     if (byteLength) {
         NOTIFY_SETUP(this);
         this->writePaint(paint);
-        int count = paint.textToGlyphs(text, byteLength, NULL);
+        int count = paint.textToGlyphs(text, byteLength, nullptr);
         if (this->needOpBytes(4 + SkAlign4(byteLength) + 4 + count * sizeof(SkScalar) + 4)) {
             this->writeOp(kDrawPosTextH_DrawOp);
             fWriter.write32(SkToU32(byteLength));
@@ -949,10 +949,10 @@
     if (byteLength) {
         NOTIFY_SETUP(this);
         unsigned flags = 0;
-        size_t size = 4 + SkAlign4(byteLength) + path.writeToMemory(NULL);
+        size_t size = 4 + SkAlign4(byteLength) + path.writeToMemory(nullptr);
         if (matrix) {
             flags |= kDrawTextOnPath_HasMatrix_DrawOpFlag;
-            size += matrix->writeToMemory(NULL);
+            size += matrix->writeToMemory(nullptr);
         }
         this->writePaint(paint);
         if (this->needOpBytes(size)) {
@@ -1214,7 +1214,7 @@
 }
 
 size_t SkGPipeCanvas::freeMemoryIfPossible(size_t bytesToFree) {
-    return (NULL == fBitmapHeap) ? 0 : fBitmapHeap->freeMemoryIfPossible(bytesToFree);
+    return (nullptr == fBitmapHeap) ? 0 : fBitmapHeap->freeMemoryIfPossible(bytesToFree);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1347,7 +1347,7 @@
     //  Do these after we've written kPaintOp_DrawOp
 
     if (base.getAnnotation() != paint.getAnnotation()) {
-        if (NULL == paint.getAnnotation()) {
+        if (nullptr == paint.getAnnotation()) {
             if (this->needOpBytes()) {
                 this->writeOp(kSetAnnotation_DrawOp, 0, 0);
             }
@@ -1388,7 +1388,7 @@
 
 SkGPipeWriter::SkGPipeWriter()
 : fWriter(0) {
-    fCanvas = NULL;
+    fCanvas = nullptr;
 }
 
 SkGPipeWriter::~SkGPipeWriter() {
@@ -1397,8 +1397,8 @@
 
 SkCanvas* SkGPipeWriter::startRecording(SkGPipeController* controller, uint32_t flags,
                                         uint32_t width, uint32_t height) {
-    if (NULL == fCanvas) {
-        fWriter.reset(NULL, 0);
+    if (nullptr == fCanvas) {
+        fWriter.reset(nullptr, 0);
         fCanvas = new SkGPipeCanvas(controller, &fWriter, flags, width, height);
     }
     controller->setCanvas(fCanvas);
@@ -1409,7 +1409,7 @@
     if (fCanvas) {
         fCanvas->finish(true);
         fCanvas->unref();
-        fCanvas = NULL;
+        fCanvas = nullptr;
     }
 }
 
@@ -1427,13 +1427,13 @@
 }
 
 size_t SkGPipeWriter::storageAllocatedForRecording() const {
-    return NULL == fCanvas ? 0 : fCanvas->storageAllocatedForRecording();
+    return nullptr == fCanvas ? 0 : fCanvas->storageAllocatedForRecording();
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 
 BitmapShuttle::BitmapShuttle(SkGPipeCanvas* canvas) {
-    SkASSERT(canvas != NULL);
+    SkASSERT(canvas != nullptr);
     fCanvas = canvas;
     fCanvas->ref();
 }
@@ -1443,16 +1443,16 @@
 }
 
 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) {
-    SkASSERT(fCanvas != NULL);
+    SkASSERT(fCanvas != nullptr);
     return fCanvas->shuttleBitmap(bitmap, slot);
 }
 
 void BitmapShuttle::removeCanvas() {
-    if (NULL == fCanvas) {
+    if (nullptr == fCanvas) {
         return;
     }
     fCanvas->unref();
-    fCanvas = NULL;
+    fCanvas = nullptr;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/pipe/utils/SamplePipeControllers.cpp b/src/pipe/utils/SamplePipeControllers.cpp
index b85ceb6..fea9d68 100644
--- a/src/pipe/utils/SamplePipeControllers.cpp
+++ b/src/pipe/utils/SamplePipeControllers.cpp
@@ -13,7 +13,7 @@
 
 PipeController::PipeController(SkCanvas* target, SkPicture::InstallPixelRefProc proc)
 :fReader(target) {
-    fBlock = NULL;
+    fBlock = nullptr;
     fBlockSize = fBytesWritten = 0;
     fReader.setBitmapDecoder(proc);
 }
@@ -42,7 +42,7 @@
 TiledPipeController::TiledPipeController(const SkBitmap& bitmap,
                                          SkPicture::InstallPixelRefProc proc,
                                          const SkMatrix* initial)
-: INHERITED(NULL, proc) {
+: INHERITED(nullptr, proc) {
     int32_t top = 0;
     int32_t bottom;
     int32_t height = bitmap.height() / NumberOfTiles;
@@ -55,7 +55,7 @@
         SkDEBUGCODE(bool extracted = )bitmap.extractSubset(&fBitmaps[i], rect);
         SkASSERT(extracted);
         SkCanvas* canvas = new SkCanvas(fBitmaps[i]);
-        if (initial != NULL) {
+        if (initial != nullptr) {
             canvas->setMatrix(*initial);
         }
         canvas->translate(SkIntToScalar(-rect.left()),
@@ -82,7 +82,7 @@
 ThreadSafePipeController::ThreadSafePipeController(int numberOfReaders)
 : fAllocator(kMinBlockSize)
 , fNumberOfReaders(numberOfReaders) {
-    fBlock = NULL;
+    fBlock = nullptr;
     fBytesWritten = 0;
 }
 
diff --git a/src/pipe/utils/SamplePipeControllers.h b/src/pipe/utils/SamplePipeControllers.h
index 5e074c5..b3f057f 100644
--- a/src/pipe/utils/SamplePipeControllers.h
+++ b/src/pipe/utils/SamplePipeControllers.h
@@ -16,7 +16,7 @@
 
 class PipeController : public SkGPipeController {
 public:
-    PipeController(SkCanvas* target, SkPicture::InstallPixelRefProc proc = NULL);
+    PipeController(SkCanvas* target, SkPicture::InstallPixelRefProc proc = nullptr);
     virtual ~PipeController();
     void* requestBlock(size_t minRequest, size_t* actual) override;
     void notifyWritten(size_t bytes) override;
@@ -34,8 +34,8 @@
 
 class TiledPipeController : public PipeController {
 public:
-    TiledPipeController(const SkBitmap&, SkPicture::InstallPixelRefProc proc = NULL,
-                        const SkMatrix* initialMatrix = NULL);
+    TiledPipeController(const SkBitmap&, SkPicture::InstallPixelRefProc proc = nullptr,
+                        const SkMatrix* initialMatrix = nullptr);
     virtual ~TiledPipeController() {};
     void notifyWritten(size_t bytes) override;
     int numberOfReaders() const override { return NumberOfTiles; }
diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp
index 3400aa9..8a8e4a1 100644
--- a/src/ports/SkFontConfigInterface_direct.cpp
+++ b/src/ports/SkFontConfigInterface_direct.cpp
@@ -77,7 +77,7 @@
                                int initValue) {
     SkFontConfigInterface::FontIdentity iden1;
 
-    size_t size0 = iden0.writeToMemory(NULL);
+    size_t size0 = iden0.writeToMemory(nullptr);
 
     SkAutoMalloc storage(size0);
     memset(storage.get(), initValue, size0);
@@ -131,8 +131,8 @@
 
 SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBaseMutex* mutex) {
     SkAutoMutexAcquire ac(mutex);
-    static SkFontConfigInterfaceDirect* singleton = NULL;
-    if (singleton == NULL) {
+    static SkFontConfigInterfaceDirect* singleton = nullptr;
+    if (singleton == nullptr) {
         singleton = new SkFontConfigInterfaceDirect;
     }
     return singleton;
@@ -140,13 +140,13 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-// Returns the string from the pattern, or NULL
+// Returns the string from the pattern, or nullptr
 static const char* get_name(FcPattern* pattern, const char field[],
                             int index = 0) {
     const char* name;
     if (FcPatternGetString(pattern, field, index,
                            (FcChar8**)&name) != FcResultMatch) {
-        name = NULL;
+        name = nullptr;
     }
     return name;
 }
@@ -360,7 +360,7 @@
                      const SkString& family) {
   // Older versions of fontconfig have a bug where they cannot select
   // only scalable fonts so we have to manually filter the results.
-  FcPattern* match = NULL;
+  FcPattern* match = nullptr;
   for (int i = 0; i < font_set->nfont; ++i) {
     FcPattern* current = font_set->fonts[i];
     if (valid_pattern(current)) {
@@ -388,7 +388,7 @@
         break;
     }
     if (!acceptable_substitute)
-      return NULL;
+      return nullptr;
   }
 
   return match;
@@ -469,7 +469,7 @@
                                                       : FC_SLANT_ROMAN);
     FcPatternAddBool(pattern, FC_SCALABLE, FcTrue);
 
-    FcConfigSubstitute(NULL, pattern, FcMatchPattern);
+    FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
     FcDefaultSubstitute(pattern);
 
     // Font matching:
@@ -477,7 +477,7 @@
     //    font-family: a, b, c, serif;
     // However, fontconfig will always do its best to find *a* font when asked
     // for something so we need a way to tell if the match which it has found is
-    // "good enough" for us. Otherwise, we can return NULL which gets piped up
+    // "good enough" for us. Otherwise, we can return nullptr which gets piped up
     // and lets WebKit know to try the next CSS family name. However, fontconfig
     // configs allow substitutions (mapping "Arial -> Helvetica" etc) and we
     // wish to support that.
@@ -579,20 +579,20 @@
 
     FcPattern* pat = FcPatternCreate();
     SkAutoTCallVProc<FcPattern, FcPatternDestroy> autoDestroyPat(pat);
-    if (NULL == pat) {
-        return NULL;
+    if (nullptr == pat) {
+        return nullptr;
     }
 
     FcObjectSet* os = FcObjectSetBuild(FC_FAMILY, (char *)0);
     SkAutoTCallVProc<FcObjectSet, FcObjectSetDestroy> autoDestroyOs(os);
-    if (NULL == os) {
-        return NULL;
+    if (nullptr == os) {
+        return nullptr;
     }
 
-    FcFontSet* fs = FcFontList(NULL, pat, os);
+    FcFontSet* fs = FcFontList(nullptr, pat, os);
     SkAutoTCallVProc<FcFontSet, FcFontSetDestroy> autoDestroyFs(fs);
-    if (NULL == fs) {
-        return NULL;
+    if (nullptr == fs) {
+        return nullptr;
     }
 
     SkTDArray<const char*> names;
@@ -630,7 +630,7 @@
     }
     FcPatternAddBool(pattern, FC_SCALABLE, FcTrue);
 
-    FcConfigSubstitute(NULL, pattern, FcMatchPattern);
+    FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
     FcDefaultSubstitute(pattern);
 
     // Font matching:
@@ -638,7 +638,7 @@
     //    font-family: a, b, c, serif;
     // However, fontconfig will always do its best to find *a* font when asked
     // for something so we need a way to tell if the match which it has found is
-    // "good enough" for us. Otherwise, we can return NULL which gets piped up
+    // "good enough" for us. Otherwise, we can return nullptr which gets piped up
     // and lets WebKit know to try the next CSS family name. However, fontconfig
     // configs allow substitutions (mapping "Arial -> Helvetica" etc) and we
     // wish to support that.
@@ -720,7 +720,7 @@
         if (!match) {
             FcPatternDestroy(pattern);
             FcFontSetDestroy(font_set);
-            return NULL;
+            return nullptr;
         }
 
         FcPatternDestroy(pattern);
diff --git a/src/ports/SkFontConfigTypeface.h b/src/ports/SkFontConfigTypeface.h
index d207f08..a6dc6ca 100644
--- a/src/ports/SkFontConfigTypeface.h
+++ b/src/ports/SkFontConfigTypeface.h
@@ -48,7 +48,7 @@
             : INHERITED(style, SkTypefaceCache::NewFontID(), false)
             , fIdentity(fi)
             , fFamilyName(familyName)
-            , fLocalStream(NULL) {}
+            , fLocalStream(nullptr) {}
 
     FontConfigTypeface(const SkFontStyle& style, bool fixedWidth, SkStreamAsset* localStream)
             : INHERITED(style, SkTypefaceCache::NewFontID(), fixedWidth)
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index 860f320..32eafad 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -76,11 +76,11 @@
         return sk_realloc_throw(block, new_size);
     }
 };
-FT_MemoryRec_ gFTMemory = { NULL, sk_ft_alloc, sk_ft_free, sk_ft_realloc };
+FT_MemoryRec_ gFTMemory = { nullptr, sk_ft_alloc, sk_ft_free, sk_ft_realloc };
 
 class FreeTypeLibrary : SkNoncopyable {
 public:
-    FreeTypeLibrary() : fLibrary(NULL), fIsLCDSupported(false), fLCDExtra(0) {
+    FreeTypeLibrary() : fLibrary(nullptr), fIsLCDSupported(false), fLCDExtra(0) {
         if (FT_New_Library(&gFTMemory, &fLibrary)) {
             return;
         }
@@ -101,7 +101,7 @@
             FT_Library_SetLcdFilterWeights(fLibrary, gGaussianLikeHeavyWeights);
 #    elif SK_CAN_USE_DLOPEN == 1
             //The FreeType library is already loaded, so symbols are available in process.
-            void* self = dlopen(NULL, RTLD_LAZY);
+            void* self = dlopen(nullptr, RTLD_LAZY);
             if (self) {
                 FT_Library_SetLcdFilterWeightsProc setLcdFilterWeights;
                 //The following cast is non-standard, but safe for POSIX.
@@ -157,7 +157,7 @@
     SkASSERT(gFTCount >= 0);
 
     if (0 == gFTCount) {
-        SkASSERT(NULL == gFTLibrary);
+        SkASSERT(nullptr == gFTLibrary);
         gFTLibrary = new FreeTypeLibrary;
     }
     ++gFTCount;
@@ -171,9 +171,9 @@
 
     --gFTCount;
     if (0 == gFTCount) {
-        SkASSERT(NULL != gFTLibrary);
+        SkASSERT(nullptr != gFTLibrary);
         delete gFTLibrary;
-        SkDEBUGCODE(gFTLibrary = NULL;)
+        SkDEBUGCODE(gFTLibrary = nullptr;)
     }
 }
 
@@ -183,7 +183,7 @@
     virtual ~SkScalerContext_FreeType();
 
     bool success() const {
-        return fFTSize != NULL && fFace != NULL;
+        return fFTSize != nullptr && fFace != nullptr;
     }
 
 protected:
@@ -257,7 +257,7 @@
 }
 
 SkFaceRec::SkFaceRec(SkStreamAsset* stream, uint32_t fontID)
-        : fNext(NULL), fSkStream(stream), fRefCnt(1), fFontID(fontID)
+        : fNext(nullptr), fSkStream(stream), fRefCnt(1), fFontID(fontID)
 {
     sk_bzero(&fFTStream, sizeof(fFTStream));
     fFTStream.size = fSkStream->getLength();
@@ -272,7 +272,7 @@
     }
 
     SkDEBUGCODE(
-        FT_MM_Var* variations = NULL;
+        FT_MM_Var* variations = nullptr;
         if (FT_Get_MM_Var(face, &variations)) {
             SkDEBUGF(("INFO: font %s claims variations, but none found.\n", face->family_name));
             return;
@@ -314,8 +314,8 @@
     }
 
     SkAutoTDelete<SkFontData> data(typeface->createFontData());
-    if (NULL == data || !data->hasStream()) {
-        return NULL;
+    if (nullptr == data || !data->hasStream()) {
+        return nullptr;
     }
 
     // this passes ownership of stream to the rec
@@ -337,14 +337,14 @@
     if (err) {
         SkDEBUGF(("ERROR: unable to open font '%x'\n", fontID));
         delete rec;
-        return NULL;
+        return nullptr;
     }
     SkASSERT(rec->fFace);
 
     ft_face_setup_axes(rec->fFace, *data);
 
     // FreeType will set the charmap to the "most unicode" cmap if it exists.
-    // If there are no unicode cmaps, the charmap is set to NULL.
+    // If there are no unicode cmaps, the charmap is set to nullptr.
     // However, "symbol" cmaps should also be considered "fallback unicode" cmaps
     // because they are effectively private use area only (even if they aren't).
     // This is the last on the fallback list at
@@ -363,7 +363,7 @@
     gFTMutex.assertHeld();
 
     SkFaceRec*  rec = gFaceRecHead;
-    SkFaceRec*  prev = NULL;
+    SkFaceRec*  prev = nullptr;
     while (rec) {
         SkFaceRec* next = rec->fNext;
         if (rec->fFace == face) {
@@ -386,7 +386,7 @@
 
 class AutoFTAccess {
 public:
-    AutoFTAccess(const SkTypeface* tf) : fFace(NULL) {
+    AutoFTAccess(const SkTypeface* tf) : fFace(nullptr) {
         gFTMutex.acquire();
         if (!ref_ft_library()) {
             sk_throw();
@@ -458,12 +458,12 @@
         const uint32_t* glyphIDs,
         uint32_t glyphIDsCount) const {
 #if defined(SK_BUILD_FOR_MAC)
-    return NULL;
+    return nullptr;
 #else
     AutoFTAccess fta(this);
     FT_Face face = fta.face();
     if (!face) {
-        return NULL;
+        return nullptr;
     }
 
     SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics;
@@ -500,7 +500,7 @@
         cid = true;
         TT_Header* ttHeader;
         if ((ttHeader = (TT_Header*)FT_Get_Sfnt_Table(face,
-                                                      ft_sfnt_head)) != NULL) {
+                                                      ft_sfnt_head)) != nullptr) {
             info->fEmSize = ttHeader->Units_Per_EM;
         }
     } else {
@@ -519,7 +519,7 @@
         info->fItalicAngle = ps_info.italic_angle;
     } else if ((tt_info =
                 (TT_Postscript*)FT_Get_Sfnt_Table(face,
-                                                  ft_sfnt_post)) != NULL) {
+                                                  ft_sfnt_post)) != nullptr) {
         info->fItalicAngle = SkFixedToScalar(tt_info->italicAngle);
     } else {
         info->fItalicAngle = 0;
@@ -546,14 +546,14 @@
 
     TT_PCLT* pclt_info;
     TT_OS2* os2_table;
-    if ((pclt_info = (TT_PCLT*)FT_Get_Sfnt_Table(face, ft_sfnt_pclt)) != NULL) {
+    if ((pclt_info = (TT_PCLT*)FT_Get_Sfnt_Table(face, ft_sfnt_pclt)) != nullptr) {
         info->fCapHeight = pclt_info->CapHeight;
         uint8_t serif_style = pclt_info->SerifStyle & 0x3F;
         if (serif_style >= 2 && serif_style <= 6)
             info->fStyle |= SkAdvancedTypefaceMetrics::kSerif_Style;
         else if (serif_style >= 9 && serif_style <= 12)
             info->fStyle |= SkAdvancedTypefaceMetrics::kScript_Style;
-    } else if (((os2_table = (TT_OS2*)FT_Get_Sfnt_Table(face, ft_sfnt_os2)) != NULL) &&
+    } else if (((os2_table = (TT_OS2*)FT_Get_Sfnt_Table(face, ft_sfnt_os2)) != nullptr) &&
                // sCapHeight is available only when version 2 or later.
                os2_table->version != 0xFFFF &&
                os2_table->version >= 2) {
@@ -666,7 +666,7 @@
             new SkScalerContext_FreeType(const_cast<SkTypeface_FreeType*>(this), desc);
     if (!c->success()) {
         delete c;
-        c = NULL;
+        c = nullptr;
     }
     return c;
 }
@@ -742,8 +742,8 @@
 
 static FT_Int chooseBitmapStrike(FT_Face face, SkFixed scaleY) {
     // early out if face is bad
-    if (face == NULL) {
-        SkDEBUGF(("chooseBitmapStrike aborted due to NULL face\n"));
+    if (face == nullptr) {
+        SkDEBUGF(("chooseBitmapStrike aborted due to nullptr face\n"));
         return -1;
     }
     // determine target ppem
@@ -795,9 +795,9 @@
 
     // load the font file
     fStrikeIndex = -1;
-    fFTSize = NULL;
+    fFTSize = nullptr;
     fFace = ref_ft_face(typeface);
-    if (NULL == fFace) {
+    if (nullptr == fFace) {
         return;
     }
 
@@ -886,14 +886,14 @@
     FT_Error err = FT_New_Size(fFace, &fFTSize);
     if (err != 0) {
         SkDEBUGF(("FT_New_Size returned %x for face %s\n", err, fFace->family_name));
-        fFace = NULL;
+        fFace = nullptr;
         return;
     }
     err = FT_Activate_Size(fFTSize);
     if (err != 0) {
         SkDEBUGF(("FT_Activate_Size(%08x, 0x%x, 0x%x) returned 0x%x\n", fFace, fScaleX, fScaleY,
                   err));
-        fFTSize = NULL;
+        fFTSize = nullptr;
         return;
     }
 
@@ -902,10 +902,10 @@
         if (err != 0) {
             SkDEBUGF(("FT_Set_CharSize(%08x, 0x%x, 0x%x) returned 0x%x\n",
                                     fFace, fScaleX, fScaleY,      err));
-            fFace = NULL;
+            fFace = nullptr;
             return;
         }
-        FT_Set_Transform(fFace, &fMatrix22, NULL);
+        FT_Set_Transform(fFace, &fMatrix22, nullptr);
     } else if (FT_HAS_FIXED_SIZES(fFace)) {
         fStrikeIndex = chooseBitmapStrike(fFace, fScaleY);
         if (fStrikeIndex == -1) {
@@ -934,11 +934,11 @@
 SkScalerContext_FreeType::~SkScalerContext_FreeType() {
     SkAutoMutexAcquire  ac(gFTMutex);
 
-    if (fFTSize != NULL) {
+    if (fFTSize != nullptr) {
         FT_Done_Size(fFTSize);
     }
 
-    if (fFace != NULL) {
+    if (fFace != nullptr) {
         unref_ft_face(fFace);
     }
 
@@ -953,13 +953,13 @@
     if (err != 0) {
         SkDEBUGF(("SkScalerContext_FreeType::FT_Activate_Size(%s %s, 0x%x, 0x%x) returned 0x%x\n",
                   fFace->family_name, fFace->style_name, fScaleX, fScaleY, err));
-        fFTSize = NULL;
+        fFTSize = nullptr;
         return err;
     }
 
     // seems we need to reset this every time (not sure why, but without it
     // I get random italics from some other fFTSize)
-    FT_Set_Transform(fFace, &fMatrix22, NULL);
+    FT_Set_Transform(fFace, &fMatrix22, nullptr);
     return 0;
 }
 
@@ -1258,7 +1258,7 @@
 }
 
 void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* metrics) {
-    if (NULL == metrics) {
+    if (nullptr == metrics) {
         return;
     }
 
@@ -1473,7 +1473,7 @@
 
     EncodingProc next_uni_proc = find_encoding_proc(encoding);
 
-    if (NULL == glyphs) {
+    if (nullptr == glyphs) {
         for (int i = 0; i < glyphCount; ++i) {
             if (0 == FT_Get_Char_Index(face, next_uni_proc(&chars))) {
                 return i;
@@ -1507,7 +1507,7 @@
 SkTypeface::LocalizedStrings* SkTypeface_FreeType::onCreateFamilyNameIterator() const {
     SkTypeface::LocalizedStrings* nameIter =
         SkOTUtils::LocalizedStrings_NameTable::CreateForFamilyNames(*this);
-    if (NULL == nameIter) {
+    if (nullptr == nameIter) {
         SkString familyName;
         this->getFamilyName(&familyName);
         SkString language("und"); //undetermined
@@ -1523,8 +1523,8 @@
     FT_ULong tableCount = 0;
     FT_Error error;
 
-    // When 'tag' is NULL, returns number of tables in 'length'.
-    error = FT_Sfnt_Table_Info(face, 0, NULL, &tableCount);
+    // When 'tag' is nullptr, returns number of tables in 'length'.
+    error = FT_Sfnt_Table_Info(face, 0, nullptr, &tableCount);
     if (error) {
         return 0;
     }
@@ -1553,7 +1553,7 @@
     FT_Error error;
 
     // When 'length' is 0 it is overwritten with the full table length; 'offset' is ignored.
-    error = FT_Load_Sfnt_Table(face, tag, 0, NULL, &tableLength);
+    error = FT_Load_Sfnt_Table(face, tag, 0, nullptr, &tableLength);
     if (error) {
         return 0;
     }
@@ -1575,7 +1575,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
 
-SkTypeface_FreeType::Scanner::Scanner() : fLibrary(NULL) {
+SkTypeface_FreeType::Scanner::Scanner() : fLibrary(nullptr) {
     if (FT_New_Library(&gFTMemory, &fLibrary)) {
         return;
     }
@@ -1590,8 +1590,8 @@
 FT_Face SkTypeface_FreeType::Scanner::openFace(SkStream* stream, int ttcIndex,
                                                FT_Stream ftStream) const
 {
-    if (fLibrary == NULL) {
-        return NULL;
+    if (fLibrary == nullptr) {
+        return nullptr;
     }
 
     FT_Open_Args args;
@@ -1616,7 +1616,7 @@
 
     FT_Face face;
     if (FT_Open_Face(fLibrary, &args, ttcIndex, &face)) {
-        return NULL;
+        return nullptr;
     }
     return face;
 }
@@ -1626,7 +1626,7 @@
 
     FT_StreamRec streamRec;
     FT_Face face = this->openFace(stream, -1, &streamRec);
-    if (NULL == face) {
+    if (nullptr == face) {
         return false;
     }
 
@@ -1645,7 +1645,7 @@
 
     FT_StreamRec streamRec;
     FT_Face face = this->openFace(stream, ttcIndex, &streamRec);
-    if (NULL == face) {
+    if (nullptr == face) {
         return false;
     }
 
@@ -1716,7 +1716,7 @@
     }
 
     if (axes && face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS) {
-        FT_MM_Var* variations = NULL;
+        FT_MM_Var* variations = nullptr;
         FT_Error err = FT_Get_MM_Var(face, &variations);
         if (err) {
             SkDEBUGF(("INFO: font %s claims to have variations, but none found.\n",
diff --git a/src/ports/SkFontHost_FreeType_common.cpp b/src/ports/SkFontHost_FreeType_common.cpp
index 5afe70a..245ded1 100644
--- a/src/ports/SkFontHost_FreeType_common.cpp
+++ b/src/ports/SkFontHost_FreeType_common.cpp
@@ -194,7 +194,7 @@
     const size_t height = srcFTBitmap.rows;
 
     if (SkMask::kLCD16_Format == dstFormat) {
-        copyFT2LCD16<false>(srcFTBitmap, dstMask, false, NULL, NULL, NULL);
+        copyFT2LCD16<false>(srcFTBitmap, dstMask, false, nullptr, nullptr, nullptr);
         return;
     }
 
diff --git a/src/ports/SkFontHost_fontconfig.cpp b/src/ports/SkFontHost_fontconfig.cpp
index 540d805..5c9e896 100644
--- a/src/ports/SkFontHost_fontconfig.cpp
+++ b/src/ports/SkFontHost_fontconfig.cpp
@@ -88,8 +88,8 @@
                                                      SkTypeface::Style style)
 {
     SkAutoTUnref<SkFontConfigInterface> fci(RefFCI());
-    if (NULL == fci.get()) {
-        return NULL;
+    if (nullptr == fci.get()) {
+        return nullptr;
     }
 
     // Check if requested NameStyle is in the NameStyle cache.
@@ -107,7 +107,7 @@
     SkString outFamilyName;
     SkTypeface::Style outStyle;
     if (!fci->matchFamilyName(familyName, style, &indentity, &outFamilyName, &outStyle)) {
-        return NULL;
+        return nullptr;
     }
 
     // Check if a typeface with this FontIdentity is already in the FontIdentity cache.
@@ -136,8 +136,8 @@
     }
 
     SkAutoTUnref<SkFontConfigInterface> fci(RefFCI());
-    if (NULL == fci.get()) {
-        return NULL;
+    if (nullptr == fci.get()) {
+        return nullptr;
     }
 
     *ttcIndex = this->getIdentity().fTTCIndex;
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index b144aee..343936c 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -68,7 +68,7 @@
 // provide a wrapper here that will return an empty array if need be.
 static CFArrayRef SkCTFontManagerCopyAvailableFontFamilyNames() {
 #ifdef SK_BUILD_FOR_IOS
-    return CFArrayCreate(NULL, NULL, 0, NULL);
+    return CFArrayCreate(nullptr, nullptr, 0, nullptr);
 #else
     return CTFontManagerCopyAvailableFontFamilyNames();
 #endif
@@ -94,10 +94,10 @@
 /** Acts like a CFRef, but calls CFSafeRelease when it goes out of scope. */
 template<typename CFRef> class AutoCFRelease : private SkNoncopyable {
 public:
-    explicit AutoCFRelease(CFRef cfRef = NULL) : fCFRef(cfRef) { }
+    explicit AutoCFRelease(CFRef cfRef = nullptr) : fCFRef(cfRef) { }
     ~AutoCFRelease() { CFSafeRelease(fCFRef); }
 
-    void reset(CFRef that = NULL) {
+    void reset(CFRef that = nullptr) {
         if (that != fCFRef) {
             CFSafeRelease(fCFRef);
             fCFRef = that;
@@ -106,20 +106,20 @@
 
     CFRef detach() {
         CFRef self = fCFRef;
-        fCFRef = NULL;
+        fCFRef = nullptr;
         return self;
     }
 
     operator CFRef() const { return fCFRef; }
     CFRef get() const { return fCFRef; }
 
-    CFRef* operator&() { SkASSERT(fCFRef == NULL); return &fCFRef; }
+    CFRef* operator&() { SkASSERT(fCFRef == nullptr); return &fCFRef; }
 private:
     CFRef fCFRef;
 };
 
 static CFStringRef make_CFString(const char str[]) {
-    return CFStringCreateWithCString(NULL, str, kCFStringEncodingUTF8);
+    return CFStringCreateWithCString(nullptr, str, kCFStringEncodingUTF8);
 }
 
 template<typename T> class AutoCGTable : SkNoncopyable {
@@ -127,7 +127,7 @@
     AutoCGTable(CGFontRef font)
     //Undocumented: the tag parameter in this call is expected in machine order and not BE order.
     : fCFData(CGFontCopyTableForTag(font, SkSetFourByteTag(T::TAG0, T::TAG1, T::TAG2, T::TAG3)))
-    , fData(fCFData ? reinterpret_cast<const T*>(CFDataGetBytePtr(fCFData)) : NULL)
+    , fData(fCFData ? reinterpret_cast<const T*>(CFDataGetBytePtr(fCFData)) : nullptr)
     { }
 
     const T* operator->() const { return fData; }
@@ -327,8 +327,8 @@
 class Offscreen {
 public:
     Offscreen()
-        : fRGBSpace(NULL)
-        , fCG(NULL)
+        : fRGBSpace(nullptr)
+        , fCG(nullptr)
         , fDoAA(false)
         , fDoLCD(false)
     {
@@ -389,7 +389,7 @@
 static SkFontStyle fontstyle_from_descriptor(CTFontDescriptorRef desc) {
     AutoCFRelease<CFDictionaryRef> dict(
             (CFDictionaryRef)CTFontDescriptorCopyAttribute(desc, kCTFontTraitsAttribute));
-    if (NULL == dict.get()) {
+    if (nullptr == dict.get()) {
         return SkFontStyle();
     }
 
@@ -528,7 +528,7 @@
                                       &kCFTypeDictionaryValueCallBacks));
 
     if (!cfFontName || !cfFontTraits || !cfAttributes || !cfTraits) {
-        return NULL;
+        return nullptr;
     }
 
     CFDictionaryAddValue(cfTraits, kCTFontSymbolicTrait, cfFontTraits);
@@ -539,17 +539,17 @@
     AutoCFRelease<CTFontDescriptorRef> ctFontDesc(
             CTFontDescriptorCreateWithAttributes(cfAttributes));
     if (!ctFontDesc) {
-        return NULL;
+        return nullptr;
     }
 
-    AutoCFRelease<CTFontRef> ctFont(CTFontCreateWithFontDescriptor(ctFontDesc, 0, NULL));
+    AutoCFRelease<CTFontRef> ctFont(CTFontCreateWithFontDescriptor(ctFontDesc, 0, nullptr));
     if (!ctFont) {
-        return NULL;
+        return nullptr;
     }
 
     SkTypeface* face = SkTypefaceCache::FindByProcAndRef(find_by_CTFontRef, (void*)ctFont.get());
     if (!face) {
-        face = NewFromFontRef(ctFont.detach(), NULL, NULL, false);
+        face = NewFromFontRef(ctFont.detach(), nullptr, nullptr, false);
         SkTypefaceCache::Add(face, face->fontStyle());
     }
     return face;
@@ -561,7 +561,7 @@
 
     static SkTypeface* gDefaultFace;
 
-    if (NULL == gDefaultFace) {
+    if (nullptr == gDefaultFace) {
         gDefaultFace = NewFromName(FONT_DEFAULT_NAME, SkFontStyle());
         SkTypefaceCache::Add(gDefaultFace, SkFontStyle());
     }
@@ -573,7 +573,7 @@
 extern CTFontRef SkTypeface_GetCTFontRef(const SkTypeface* face);
 CTFontRef SkTypeface_GetCTFontRef(const SkTypeface* face) {
     const SkTypeface_Mac* macface = (const SkTypeface_Mac*)face;
-    return macface ? macface->fFontRef.get() : NULL;
+    return macface ? macface->fFontRef.get() : nullptr;
 }
 
 /*  This function is visible on the outside. It first searches the cache, and if
@@ -586,7 +586,7 @@
         if (resourceRef) {
             CFRetain(resourceRef);
         }
-        face = NewFromFontRef(fontRef, resourceRef, NULL, false);
+        face = NewFromFontRef(fontRef, resourceRef, nullptr, false);
         SkTypefaceCache::Add(face, face->fontStyle());
     }
     return face;
@@ -736,7 +736,7 @@
     SkVector scale;
     SkMatrix skTransform;
     fRec.computeMatrices(SkScalerContextRec::kVertical_PreMatrixScale, &scale, &skTransform,
-                         NULL, NULL, &fFUnitMatrix);
+                         nullptr, nullptr, &fFUnitMatrix);
     fTransform = MatrixToCGAffineTransform(skTransform);
     fInvTransform = CGAffineTransformInvert(fTransform);
 
@@ -761,9 +761,9 @@
     CGFloat textSize = ScalarToCG(scale.y());
 
     fCTFont.reset(CTFontCreateCopyWithAttributes(ctFont, textSize, &fTransform, ctFontDesc));
-    fCGFont.reset(CTFontCopyGraphicsFont(fCTFont, NULL));
+    fCGFont.reset(CTFontCopyGraphicsFont(fCTFont, nullptr));
     fCTUnrotatedFont.reset(CTFontCreateCopyWithAttributes(ctFont, textSize,
-                                                          &CGAffineTransformIdentity, NULL));
+                                                          &CGAffineTransformIdentity, nullptr));
 
     // The fUnitMatrix includes the text size (and em) as it is used to scale the raw font data.
     SkScalar emPerFUnit = SkScalarInvert(SkIntToScalar(CGFontGetUnitsPerEm(fCGFont)));
@@ -1088,8 +1088,8 @@
         // empty path or not, and if so, we jam the bounds to 0. Hopefully a zero-advance
         // is rare, so we won't incur a big performance cost for this extra check.
         if (0 == cgAdvance.width && 0 == cgAdvance.height) {
-            AutoCFRelease<CGPathRef> path(CTFontCreatePathForGlyph(fCTFont, cgGlyph, NULL));
-            if (NULL == path || CGPathIsEmpty(path)) {
+            AutoCFRelease<CGPathRef> path(CTFontCreatePathForGlyph(fCTFont, cgGlyph, nullptr));
+            if (nullptr == path || CGPathIsEmpty(path)) {
                 return;
             }
         }
@@ -1253,7 +1253,7 @@
     // Draw the glyph
     size_t cgRowBytes;
     CGRGBPixel* cgPixels = fOffscreen.getCG(*this, glyph, cgGlyph, &cgRowBytes, generateA8FromLCD);
-    if (cgPixels == NULL) {
+    if (cgPixels == nullptr) {
         return;
     }
 
@@ -1372,14 +1372,14 @@
 
         CGAffineTransform xform = MatrixToCGAffineTransform(m, scaleX, scaleY);
         // need to release font when we're done
-        font = CTFontCreateCopyWithAttributes(fCTFont, 1, &xform, NULL);
+        font = CTFontCreateCopyWithAttributes(fCTFont, 1, &xform, nullptr);
     }
 
     CGGlyph cgGlyph = (CGGlyph)glyph.getGlyphID();
-    AutoCFRelease<CGPathRef> cgPath(CTFontCreatePathForGlyph(font, cgGlyph, NULL));
+    AutoCFRelease<CGPathRef> cgPath(CTFontCreatePathForGlyph(font, cgGlyph, nullptr));
 
     path->reset();
-    if (cgPath != NULL) {
+    if (cgPath != nullptr) {
         CGPathApply(cgPath, path, SkScalerContext_Mac::CTPathElement);
     }
 
@@ -1398,7 +1398,7 @@
 }
 
 void SkScalerContext_Mac::generateFontMetrics(SkPaint::FontMetrics* metrics) {
-    if (NULL == metrics) {
+    if (nullptr == metrics) {
         return;
     }
 
@@ -1461,15 +1461,15 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-// Returns NULL on failure
+// Returns nullptr on failure
 // Call must still manage its ownership of provider
 static SkTypeface* create_from_dataProvider(CGDataProviderRef provider) {
     AutoCFRelease<CGFontRef> cg(CGFontCreateWithDataProvider(provider));
-    if (NULL == cg) {
-        return NULL;
+    if (nullptr == cg) {
+        return nullptr;
     }
-    CTFontRef ct = CTFontCreateWithGraphicsFont(cg, 0, NULL, NULL);
-    return ct ? NewFromFontRef(ct, NULL, NULL, true) : NULL;
+    CTFontRef ct = CTFontCreateWithGraphicsFont(cg, 0, nullptr, nullptr);
+    return ct ? NewFromFontRef(ct, nullptr, nullptr, true) : nullptr;
 }
 
 // Web fonts added to the the CTFont registry do not return their character set.
@@ -1548,7 +1548,7 @@
     return true;
 }
 
-/** Assumes src and dst are not NULL. */
+/** Assumes src and dst are not nullptr. */
 static void CFStringToSkString(CFStringRef src, SkString* dst) {
     // Reserve enough room for the worst-case string,
     // plus 1 byte for the trailing null.
@@ -1569,7 +1569,7 @@
 
     CTFontRef originalCTFont = fFontRef.get();
     AutoCFRelease<CTFontRef> ctFont(CTFontCreateCopyWithAttributes(
-            originalCTFont, CTFontGetUnitsPerEm(originalCTFont), NULL, NULL));
+            originalCTFont, CTFontGetUnitsPerEm(originalCTFont), nullptr, nullptr));
     SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics;
 
     {
@@ -1699,7 +1699,7 @@
 SkStreamAsset* SkTypeface_Mac::onOpenStream(int* ttcIndex) const {
     SK_SFNT_ULONG fontType = get_font_type_tag(this);
     if (0 == fontType) {
-        return NULL;
+        return nullptr;
     }
 
     // get table tags
@@ -1811,12 +1811,12 @@
                            SkAutoSTMalloc<4, SkFixed>* axisValues)
 {
     // CTFontCopyVariationAxes and CTFontCopyVariation do not work when applied to fonts which
-    // started life with CGFontCreateWithDataProvider (they simply always return NULL).
+    // started life with CGFontCreateWithDataProvider (they simply always return nullptr).
     // As a result, we are limited to CGFontCopyVariationAxes and CGFontCopyVariations.
-    AutoCFRelease<CGFontRef> cgFont(CTFontCopyGraphicsFont(fFontRef, NULL));
+    AutoCFRelease<CGFontRef> cgFont(CTFontCopyGraphicsFont(fFontRef, nullptr));
 
     AutoCFRelease<CFDictionaryRef> cgVariations(CGFontCopyVariations(cgFont));
-    // If a font has no variations CGFontCopyVariations returns NULL (instead of an empty dict).
+    // If a font has no variations CGFontCopyVariations returns nullptr (instead of an empty dict).
     if (!cgVariations.get()) {
         return false;
     }
@@ -1868,21 +1868,21 @@
     if (get_variations(fFontRef, &cgAxisCount, &axisValues)) {
         return new SkFontData(stream.detach(), index, axisValues.get(), cgAxisCount);
     }
-    return new SkFontData(stream.detach(), index, NULL, 0);
+    return new SkFontData(stream.detach(), index, nullptr, 0);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
 
 int SkTypeface_Mac::onGetUPEM() const {
-    AutoCFRelease<CGFontRef> cgFont(CTFontCopyGraphicsFont(fFontRef, NULL));
+    AutoCFRelease<CGFontRef> cgFont(CTFontCopyGraphicsFont(fFontRef, nullptr));
     return CGFontGetUnitsPerEm(cgFont);
 }
 
 SkTypeface::LocalizedStrings* SkTypeface_Mac::onCreateFamilyNameIterator() const {
     SkTypeface::LocalizedStrings* nameIter =
         SkOTUtils::LocalizedStrings_NameTable::CreateForFamilyNames(*this);
-    if (NULL == nameIter) {
+    if (nullptr == nameIter) {
         AutoCFRelease<CFStringRef> cfLanguage;
         AutoCFRelease<CFStringRef> cfFamilyName(
             CTFontCopyLocalizedName(fFontRef, kCTFontFamilyNameKey, &cfLanguage));
@@ -1909,8 +1909,8 @@
 static CFDataRef copyTableFromFont(CTFontRef ctFont, SkFontTableTag tag) {
     CFDataRef data = CTFontCopyTable(ctFont, (CTFontTableTag) tag,
                                      kCTFontTableOptionNoOptions);
-    if (NULL == data) {
-        AutoCFRelease<CGFontRef> cgFont(CTFontCopyGraphicsFont(ctFont, NULL));
+    if (nullptr == data) {
+        AutoCFRelease<CGFontRef> cgFont(CTFontCopyGraphicsFont(ctFont, nullptr));
         data = CGFontCopyTableForTag(cgFont, tag);
     }
     return data;
@@ -1919,7 +1919,7 @@
 int SkTypeface_Mac::onGetTableTags(SkFontTableTag tags[]) const {
     AutoCFRelease<CFArrayRef> cfArray(CTFontCopyAvailableTables(fFontRef,
                                                 kCTFontTableOptionNoOptions));
-    if (NULL == cfArray) {
+    if (nullptr == cfArray) {
         return 0;
     }
     int count = SkToInt(CFArrayGetCount(cfArray));
@@ -1935,7 +1935,7 @@
 size_t SkTypeface_Mac::onGetTableData(SkFontTableTag tag, size_t offset,
                                       size_t length, void* dstData) const {
     AutoCFRelease<CFDataRef> srcData(copyTableFromFont(fFontRef, tag));
-    if (NULL == srcData) {
+    if (nullptr == srcData) {
         return 0;
     }
 
@@ -2039,8 +2039,8 @@
 
 // we take ownership of the ref
 static const char* get_str(CFStringRef ref, SkString* str) {
-    if (NULL == ref) {
-        return NULL;
+    if (nullptr == ref) {
+        return nullptr;
     }
     CFStringToSkString(ref, str);
     CFSafeRelease(ref);
@@ -2106,22 +2106,22 @@
         }
     }
 
-    // If glyphs is NULL, CT still needs glyph storage for finding the first failure.
+    // If glyphs is nullptr, CT still needs glyph storage for finding the first failure.
     // Also, if there are any non-bmp code points, the provided 'glyphs' storage will be inadequate.
     SkAutoSTMalloc<1024, uint16_t> glyphStorage;
     uint16_t* macGlyphs = glyphs;
-    if (NULL == macGlyphs || srcCount > glyphCount) {
+    if (nullptr == macGlyphs || srcCount > glyphCount) {
         macGlyphs = glyphStorage.reset(srcCount);
     }
 
     bool allEncoded = CTFontGetGlyphsForCharacters(fFontRef, src, macGlyphs, srcCount);
 
     // If there were any non-bmp, then copy and compact.
-    // If 'glyphs' is NULL, then compact glyphStorage in-place.
-    // If all are bmp and 'glyphs' is non-NULL, 'glyphs' already contains the compact glyphs.
-    // If some are non-bmp and 'glyphs' is non-NULL, copy and compact into 'glyphs'.
+    // If 'glyphs' is nullptr, then compact glyphStorage in-place.
+    // If all are bmp and 'glyphs' is non-nullptr, 'glyphs' already contains the compact glyphs.
+    // If some are non-bmp and 'glyphs' is non-nullptr, copy and compact into 'glyphs'.
     uint16_t* compactedGlyphs = glyphs;
-    if (NULL == compactedGlyphs) {
+    if (nullptr == compactedGlyphs) {
         compactedGlyphs = macGlyphs;
     }
     if (srcCount > glyphCount) {
@@ -2157,7 +2157,7 @@
 
 static bool find_desc_str(CTFontDescriptorRef desc, CFStringRef name, SkString* value) {
     AutoCFRelease<CFStringRef> ref((CFStringRef)CTFontDescriptorCopyAttribute(desc, name));
-    if (NULL == ref.get()) {
+    if (nullptr == ref.get()) {
         return false;
     }
     CFStringToSkString(ref, value);
@@ -2190,15 +2190,15 @@
         return face;
     }
 
-    AutoCFRelease<CTFontRef> ctFont(CTFontCreateWithFontDescriptor(desc, 0, NULL));
+    AutoCFRelease<CTFontRef> ctFont(CTFontCreateWithFontDescriptor(desc, 0, nullptr));
     if (!ctFont) {
-        return NULL;
+        return nullptr;
     }
 
     bool isFixedPitch;
     (void)computeStyleBits(ctFont, &isFixedPitch);
 
-    face = new SkTypeface_Mac(ctFont.detach(), NULL, cacheRequest.fStyle, isFixedPitch,
+    face = new SkTypeface_Mac(ctFont.detach(), nullptr, cacheRequest.fStyle, isFixedPitch,
                               skFamilyName.c_str(), false);
     SkTypefaceCache::Add(face, face->fontStyle());
     return face;
@@ -2207,12 +2207,12 @@
 class SkFontStyleSet_Mac : public SkFontStyleSet {
 public:
     SkFontStyleSet_Mac(CFStringRef familyName, CTFontDescriptorRef desc)
-        : fArray(CTFontDescriptorCreateMatchingFontDescriptors(desc, NULL))
+        : fArray(CTFontDescriptorCreateMatchingFontDescriptors(desc, nullptr))
         , fFamilyName(familyName)
         , fCount(0) {
         CFRetain(familyName);
-        if (NULL == fArray) {
-            fArray = CFArrayCreate(NULL, NULL, 0, NULL);
+        if (nullptr == fArray) {
+            fArray = CFArrayCreate(nullptr, nullptr, 0, nullptr);
         }
         fCount = SkToInt(CFArrayGetCount(fArray));
     }
@@ -2248,7 +2248,7 @@
 
     SkTypeface* matchStyle(const SkFontStyle& pattern) override {
         if (0 == fCount) {
-            return NULL;
+            return nullptr;
         }
         return createFromDesc(fFamilyName, findMatchingDesc(pattern));
     }
@@ -2260,7 +2260,7 @@
 
     CTFontDescriptorRef findMatchingDesc(const SkFontStyle& pattern) const {
         int bestMetric = SK_MaxS32;
-        CTFontDescriptorRef bestDesc = NULL;
+        CTFontDescriptorRef bestDesc = nullptr;
 
         for (int i = 0; i < fCount; ++i) {
             CTFontDescriptorRef desc = (CTFontDescriptorRef)CFArrayGetValueAtIndex(fArray, i);
@@ -2324,7 +2324,7 @@
 
     SkFontStyleSet* onCreateStyleSet(int index) const override {
         if ((unsigned)index >= (unsigned)fCount) {
-            return NULL;
+            return nullptr;
         }
         return CreateSet(this->stringAt(index));
     }
@@ -2336,32 +2336,32 @@
 
     virtual SkTypeface* onMatchFamilyStyle(const char familyName[],
                                            const SkFontStyle&) const override {
-        return NULL;
+        return nullptr;
     }
 
     virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], const SkFontStyle&,
                                                     const char* bcp47[], int bcp47Count,
                                                     SkUnichar character) const override {
-        return NULL;
+        return nullptr;
     }
 
     virtual SkTypeface* onMatchFaceStyle(const SkTypeface* familyMember,
                                          const SkFontStyle&) const override {
-        return NULL;
+        return nullptr;
     }
 
     SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override {
         AutoCFRelease<CGDataProviderRef> pr(SkCreateDataProviderFromData(data));
-        if (NULL == pr) {
-            return NULL;
+        if (nullptr == pr) {
+            return nullptr;
         }
         return create_from_dataProvider(pr);
     }
 
     SkTypeface* onCreateFromStream(SkStreamAsset* stream, int ttcIndex) const override {
         AutoCFRelease<CGDataProviderRef> pr(SkCreateDataProviderFromStream(stream));
-        if (NULL == pr) {
-            return NULL;
+        if (nullptr == pr) {
+            return nullptr;
         }
         return create_from_dataProvider(pr);
     }
@@ -2369,12 +2369,12 @@
     static CFDictionaryRef get_axes(CGFontRef cg, SkFontData* fontData) {
         AutoCFRelease<CFArrayRef> cgAxes(CGFontCopyVariationAxes(cg));
         if (!cgAxes) {
-            return NULL;
+            return nullptr;
         }
 
         CFIndex axisCount = CFArrayGetCount(cgAxes);
         if (0 == axisCount || axisCount != fontData->getAxisCount()) {
-            return NULL;
+            return nullptr;
         }
 
         CFMutableDictionaryRef dict = CFDictionaryCreateMutable(kCFAllocatorDefault, axisCount,
@@ -2383,13 +2383,13 @@
         for (int i = 0; i < fontData->getAxisCount(); ++i) {
             CFTypeRef axisInfo = CFArrayGetValueAtIndex(cgAxes, i);
             if (CFDictionaryGetTypeID() != CFGetTypeID(axisInfo)) {
-                return NULL;
+                return nullptr;
             }
             CFDictionaryRef axisInfoDict = static_cast<CFDictionaryRef>(axisInfo);
 
             CFTypeRef axisName = CFDictionaryGetValue(axisInfoDict, kCGFontVariationAxisName);
             if (!axisName || CFGetTypeID(axisName) != CFStringGetTypeID()) {
-                return NULL;
+                return nullptr;
             }
 
             // The variation axes can be set to any value, but cg will effectively pin them.
@@ -2399,7 +2399,7 @@
             if (!min || CFGetTypeID(min) != CFNumberGetTypeID() ||
                 !max || CFGetTypeID(max) != CFNumberGetTypeID())
             {
-                return NULL;
+                return nullptr;
             }
             CFNumberRef minNumber = static_cast<CFNumberRef>(min);
             CFNumberRef maxNumber = static_cast<CFNumberRef>(max);
@@ -2408,7 +2408,7 @@
             if (!CFNumberGetValue(minNumber, kCFNumberDoubleType, &minDouble) ||
                 !CFNumberGetValue(maxNumber, kCFNumberDoubleType, &maxDouble))
             {
-                return NULL;
+                return nullptr;
             }
             double value = SkTPin(SkFixedToDouble(fontData->getAxis()[i]), minDouble, maxDouble);
             CFNumberRef valueNumber = CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType,
@@ -2423,12 +2423,12 @@
         SkAutoTDelete<SkFontData> fontData(data);
         SkStreamAsset* stream = fontData->detachStream();
         AutoCFRelease<CGDataProviderRef> provider(SkCreateDataProviderFromStream(stream));
-        if (NULL == provider) {
-            return NULL;
+        if (nullptr == provider) {
+            return nullptr;
         }
         AutoCFRelease<CGFontRef> cg(CGFontCreateWithDataProvider(provider));
-        if (NULL == cg) {
-            return NULL;
+        if (nullptr == cg) {
+            return nullptr;
         }
 
         AutoCFRelease<CFDictionaryRef> cgVariations(get_axes(cg, fontData));
@@ -2442,17 +2442,17 @@
             cgVariant.reset(cg.detach());
         }
 
-        CTFontRef ct = CTFontCreateWithGraphicsFont(cgVariant, 0, NULL, NULL);
+        CTFontRef ct = CTFontCreateWithGraphicsFont(cgVariant, 0, nullptr, nullptr);
         if (!ct) {
-            return NULL;
+            return nullptr;
         }
-        return NewFromFontRef(ct, cg.detach(), NULL, true);
+        return NewFromFontRef(ct, cg.detach(), nullptr, true);
     }
 
     SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override {
         AutoCFRelease<CGDataProviderRef> pr(CGDataProviderCreateWithFilename(path));
-        if (NULL == pr) {
-            return NULL;
+        if (nullptr == pr) {
+            return nullptr;
         }
         return create_from_dataProvider(pr);
     }
@@ -2472,7 +2472,7 @@
         NameStyle cacheRequest = { familyName, style };
         SkTypeface* face = SkTypefaceCache::FindByProcAndRef(find_by_NameStyle, &cacheRequest);
 
-        if (NULL == face) {
+        if (nullptr == face) {
             face = NewFromName(familyName, style);
             if (face) {
                 SkTypefaceCache::Add(face, style);
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index 97e659e..e263cc2 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -87,9 +87,9 @@
 
 static void tchar_to_skstring(const TCHAR t[], SkString* s) {
 #ifdef UNICODE
-    size_t sSize = WideCharToMultiByte(CP_UTF8, 0, t, -1, NULL, 0, NULL, NULL);
+    size_t sSize = WideCharToMultiByte(CP_UTF8, 0, t, -1, nullptr, 0, nullptr, nullptr);
     s->resize(sSize);
-    WideCharToMultiByte(CP_UTF8, 0, t, -1, s->writable_str(), sSize, NULL, NULL);
+    WideCharToMultiByte(CP_UTF8, 0, t, -1, s->writable_str(), sSize, nullptr, nullptr);
 #else
     s->set(t);
 #endif
@@ -97,9 +97,9 @@
 
 static void dcfontname_to_skstring(HDC deviceContext, const LOGFONT& lf, SkString* familyName) {
     int fontNameLen; //length of fontName in TCHARS.
-    if (0 == (fontNameLen = GetTextFace(deviceContext, 0, NULL))) {
+    if (0 == (fontNameLen = GetTextFace(deviceContext, 0, nullptr))) {
         call_ensure_accessible(lf);
-        if (0 == (fontNameLen = GetTextFace(deviceContext, 0, NULL))) {
+        if (0 == (fontNameLen = GetTextFace(deviceContext, 0, nullptr))) {
             fontNameLen = 0;
         }
     }
@@ -169,7 +169,7 @@
     while (min < max) {
         int32_t mid = min + ((max - min) / 2);
         if (GetGlyphOutlineW(hdc, mid, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0,
-                             NULL, &mat2) == GDI_ERROR) {
+                             nullptr, &mat2) == GDI_ERROR) {
             max = mid;
         } else {
             min = mid + 1;
@@ -212,7 +212,7 @@
         // If the font has cubic outlines, it will not be rendered with ClearType.
         HFONT font = CreateFontIndirect(&lf);
 
-        HDC deviceContext = ::CreateCompatibleDC(NULL);
+        HDC deviceContext = ::CreateCompatibleDC(nullptr);
         HFONT savefont = (HFONT)SelectObject(deviceContext, font);
 
         TEXTMETRIC textMetric;
@@ -320,7 +320,7 @@
     LOGFONT lf = origLF;
     make_canonical(&lf);
     SkTypeface* face = SkTypefaceCache::FindByProcAndRef(FindByLogFont, &lf);
-    if (NULL == face) {
+    if (nullptr == face) {
         face = LogFontTypeface::Create(lf);
         SkTypefaceCache::Add(face, get_style(lf));
     }
@@ -341,7 +341,7 @@
  *  This guy is public
  */
 void SkLOGFONTFromTypeface(const SkTypeface* face, LOGFONT* lf) {
-    if (NULL == face) {
+    if (nullptr == face) {
         *lf = get_default_font();
     } else {
         *lf = static_cast<const LogFontTypeface*>(face)->fLogFont;
@@ -356,7 +356,7 @@
 // of calling GetFontUnicodeRange().
 static void populate_glyph_to_unicode(HDC fontHdc, const unsigned glyphCount,
                                       SkTDArray<SkUnichar>* glyphToUnicode) {
-    DWORD glyphSetBufferSize = GetFontUnicodeRanges(fontHdc, NULL);
+    DWORD glyphSetBufferSize = GetFontUnicodeRanges(fontHdc, nullptr);
     if (!glyphSetBufferSize) {
         return;
     }
@@ -416,7 +416,7 @@
         fFont = 0;
         fDC = 0;
         fBM = 0;
-        fBits = NULL;
+        fBits = nullptr;
         fWidth = fHeight = 0;
         fIsBW = false;
     }
@@ -455,7 +455,7 @@
     if (0 == fDC) {
         fDC = CreateCompatibleDC(0);
         if (0 == fDC) {
-            return NULL;
+            return nullptr;
         }
         SetGraphicsMode(fDC, GM_ADVANCED);
         SetBkMode(fDC, TRANSPARENT);
@@ -498,7 +498,7 @@
         }
         fBM = CreateDIBSection(fDC, &info, DIB_RGB_COLORS, &fBits, 0, 0);
         if (0 == fBM) {
-            return NULL;
+            return nullptr;
         }
         SelectObject(fDC, fBM);
     }
@@ -514,10 +514,10 @@
     SetWorldTransform(fDC, &xform);
 
     uint16_t glyphID = glyph.getGlyphID();
-    BOOL ret = ExtTextOutW(fDC, 0, 0, ETO_GLYPH_INDEX, NULL, reinterpret_cast<LPCWSTR>(&glyphID), 1, NULL);
+    BOOL ret = ExtTextOutW(fDC, 0, 0, ETO_GLYPH_INDEX, nullptr, reinterpret_cast<LPCWSTR>(&glyphID), 1, nullptr);
     GdiFlush();
     if (0 == ret) {
-        return NULL;
+        return nullptr;
     }
     *srcRBPtr = srcRB;
     // offset to the start of the image
@@ -606,7 +606,7 @@
 {
     LogFontTypeface* typeface = reinterpret_cast<LogFontTypeface*>(rawTypeface);
 
-    fDDC = ::CreateCompatibleDC(NULL);
+    fDDC = ::CreateCompatibleDC(nullptr);
     if (!fDDC) {
         return;
     }
@@ -806,13 +806,13 @@
         // Use uniscribe to detemine glyph index for non-BMP characters.
         static const int numWCHAR = 2;
         static const int maxItems = 2;
-        // MSDN states that this can be NULL, but some things don't work then.
+        // MSDN states that this can be nullptr, but some things don't work then.
         SCRIPT_CONTROL sc = { 0 };
         // Add extra item to SCRIPT_ITEM to work around a bug (now documented).
         // https://bugzilla.mozilla.org/show_bug.cgi?id=366643
         SCRIPT_ITEM si[maxItems + 1];
         int numItems;
-        HRZM(ScriptItemize(utf16, numWCHAR, maxItems, &sc, NULL, si, &numItems),
+        HRZM(ScriptItemize(utf16, numWCHAR, maxItems, &sc, nullptr, si, &numItems),
              "Could not itemize character.");
 
         // Sometimes ScriptShape cannot find a glyph for a non-BMP and returns 2 space glyphs.
@@ -883,10 +883,10 @@
     GLYPHMETRICS gm;
     sk_bzero(&gm, sizeof(gm));
 
-    DWORD status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, &fMat22);
+    DWORD status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, nullptr, &fMat22);
     if (GDI_ERROR == status) {
         LogFontTypeface::EnsureAccessible(this->getTypeface());
-        status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, &fMat22);
+        status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, nullptr, &fMat22);
         if (GDI_ERROR == status) {
             glyph->zeroMetrics();
             return;
@@ -899,7 +899,7 @@
     // is to be drawn, like a '.'. We need to outset '.' but do not wish to outset ' '.
     if (1 == gm.gmBlackBoxX && 1 == gm.gmBlackBoxY) {
         // If GetGlyphOutline with GGO_NATIVE returns 0, we know there was no outline.
-        DWORD bufferSize = GetGlyphOutlineW(fDDC, glyphId, GGO_NATIVE | GGO_GLYPH_INDEX, &gm, 0, NULL, &fMat22);
+        DWORD bufferSize = GetGlyphOutlineW(fDDC, glyphId, GGO_NATIVE | GGO_GLYPH_INDEX, &gm, 0, nullptr, &fMat22);
         empty = (0 == bufferSize);
     }
 
@@ -925,7 +925,7 @@
 
     if (this->isSubpixel()) {
         sk_bzero(&gm, sizeof(gm));
-        status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, &fHighResMat22);
+        status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, nullptr, &fHighResMat22);
         if (GDI_ERROR != status) {
             SkPoint advance;
             fHiResMatrix.mapXY(SkIntToScalar(gm.gmCellIncX), SkIntToScalar(gm.gmCellIncY), &advance);
@@ -933,7 +933,7 @@
             glyph->fAdvanceY = SkScalarToFixed(advance.fY);
         }
     } else if (!isAxisAligned(this->fRec)) {
-        status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, &fGsA);
+        status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, nullptr, &fGsA);
         if (GDI_ERROR != status) {
             SkPoint advance;
             fG_inv.mapXY(SkIntToScalar(gm.gmCellIncX), SkIntToScalar(gm.gmCellIncY), &advance);
@@ -945,7 +945,7 @@
 
 static const MAT2 gMat2Identity = {{0, 1}, {0, 0}, {0, 0}, {0, 1}};
 void SkScalerContext_GDI::generateFontMetrics(SkPaint::FontMetrics* metrics) {
-    if (NULL == metrics) {
+    if (nullptr == metrics) {
         return;
     }
     sk_bzero(metrics, sizeof(*metrics));
@@ -1231,10 +1231,10 @@
 
     size_t srcRB;
     const void* bits = fOffscreen.draw(glyph, isBW, &srcRB);
-    if (NULL == bits) {
+    if (nullptr == bits) {
         LogFontTypeface::EnsureAccessible(this->getTypeface());
         bits = fOffscreen.draw(glyph, isBW, &srcRB);
-        if (NULL == bits) {
+        if (nullptr == bits) {
             sk_bzero(glyph.fImage, glyph.computeImageSize());
             return;
         }
@@ -1322,22 +1322,22 @@
 nextHeader:
         if (!fCurveIter.isSet()) {
             const TTPOLYGONHEADER* header = fHeaderIter.next();
-            if (NULL == header) {
-                return NULL;
+            if (nullptr == header) {
+                return nullptr;
             }
             fCurveIter.set(header);
             const TTPOLYCURVE* curve = fCurveIter.next();
-            if (NULL == curve) {
-                return NULL;
+            if (nullptr == curve) {
+                return nullptr;
             }
             fPointIter.set(curve);
             return &header->pfxStart;
         }
 
         const POINTFX* nextPoint = fPointIter.next();
-        if (NULL == nextPoint) {
+        if (nullptr == nextPoint) {
             const TTPOLYCURVE* curve = fCurveIter.next();
-            if (NULL == curve) {
+            if (nullptr == curve) {
                 fCurveIter.set();
                 goto nextHeader;
             } else {
@@ -1363,7 +1363,7 @@
 
         const TTPOLYGONHEADER* next() {
             if (fCurPolygon >= fEndPolygon) {
-                return NULL;
+                return nullptr;
             }
             const TTPOLYGONHEADER* thisPolygon = fCurPolygon;
             fCurPolygon = SkTAddOffset<const TTPOLYGONHEADER>(fCurPolygon, fCurPolygon->cb);
@@ -1377,27 +1377,27 @@
     /** Iterates over all of the polygon curves in a polygon header. */
     class GDIPolygonCurveIter {
     public:
-        GDIPolygonCurveIter() : fCurCurve(NULL), fEndCurve(NULL) { }
+        GDIPolygonCurveIter() : fCurCurve(nullptr), fEndCurve(nullptr) { }
 
         GDIPolygonCurveIter(const TTPOLYGONHEADER* curPolygon)
             : fCurCurve(SkTAddOffset<const TTPOLYCURVE>(curPolygon, sizeof(TTPOLYGONHEADER)))
             , fEndCurve(SkTAddOffset<const TTPOLYCURVE>(curPolygon, curPolygon->cb))
         { }
 
-        bool isSet() { return fCurCurve != NULL; }
+        bool isSet() { return fCurCurve != nullptr; }
 
         void set(const TTPOLYGONHEADER* curPolygon) {
             fCurCurve = SkTAddOffset<const TTPOLYCURVE>(curPolygon, sizeof(TTPOLYGONHEADER));
             fEndCurve = SkTAddOffset<const TTPOLYCURVE>(curPolygon, curPolygon->cb);
         }
         void set() {
-            fCurCurve = NULL;
-            fEndCurve = NULL;
+            fCurCurve = nullptr;
+            fEndCurve = nullptr;
         }
 
         const TTPOLYCURVE* next() {
             if (fCurCurve >= fEndCurve) {
-                return NULL;
+                return nullptr;
             }
             const TTPOLYCURVE* thisCurve = fCurCurve;
             fCurCurve = SkTAddOffset<const TTPOLYCURVE>(fCurCurve, size_of_TTPOLYCURVE(*fCurCurve));
@@ -1414,7 +1414,7 @@
     /** Iterates over all of the polygon points in a polygon curve. */
     class GDIPolygonCurvePointIter {
     public:
-        GDIPolygonCurvePointIter() : fCurveType(0), fCurPoint(NULL), fEndPoint(NULL) { }
+        GDIPolygonCurvePointIter() : fCurveType(0), fCurPoint(nullptr), fEndPoint(nullptr) { }
 
         GDIPolygonCurvePointIter(const TTPOLYCURVE* curPolygon)
             : fCurveType(curPolygon->wType)
@@ -1422,7 +1422,7 @@
             , fEndPoint(&curPolygon->apfx[curPolygon->cpfx])
         { }
 
-        bool isSet() { return fCurPoint != NULL; }
+        bool isSet() { return fCurPoint != nullptr; }
 
         void set(const TTPOLYCURVE* curPolygon) {
             fCurveType = curPolygon->wType;
@@ -1430,13 +1430,13 @@
             fEndPoint = &curPolygon->apfx[curPolygon->cpfx];
         }
         void set() {
-            fCurPoint = NULL;
-            fEndPoint = NULL;
+            fCurPoint = nullptr;
+            fEndPoint = nullptr;
         }
 
         const POINTFX* next() {
             if (fCurPoint >= fEndPoint) {
-                return NULL;
+                return nullptr;
             }
             const POINTFX* thisPoint = fCurPoint;
             ++fCurPoint;
@@ -1505,7 +1505,7 @@
 
 #define move_next_expected_hinted_point(iter, pElem) do {\
     pElem = iter.next(); \
-    if (NULL == pElem) return false; \
+    if (nullptr == pElem) return false; \
 } while(0)
 
 // It is possible for the hinted and unhinted versions of the same path to have
@@ -1591,10 +1591,10 @@
         // GDI_ERROR because the BUFFERSIZE was too small, or because the data was not accessible.
         // When the data is not accessable GetGlyphOutlineW fails rather quickly,
         // so just try to get the size. If that fails then ensure the data is accessible.
-        total_size = GetGlyphOutlineW(fDDC, glyph.getGlyphID(), flags, &gm, 0, NULL, &fMat22);
+        total_size = GetGlyphOutlineW(fDDC, glyph.getGlyphID(), flags, &gm, 0, nullptr, &fMat22);
         if (GDI_ERROR == total_size) {
             LogFontTypeface::EnsureAccessible(this->getTypeface());
-            total_size = GetGlyphOutlineW(fDDC, glyph.getGlyphID(), flags, &gm, 0, NULL, &fMat22);
+            total_size = GetGlyphOutlineW(fDDC, glyph.getGlyphID(), flags, &gm, 0, nullptr, &fMat22);
             if (GDI_ERROR == total_size) {
                 // GetGlyphOutlineW is known to fail for some characters, such as spaces.
                 // In these cases, just return that the glyph does not have a shape.
@@ -1668,7 +1668,7 @@
 #ifdef UNICODE
     // Get the buffer size needed first.
     size_t str_len = ::MultiByteToWideChar(CP_UTF8, 0, familyName,
-                                            -1, NULL, 0);
+                                            -1, nullptr, 0);
     // Allocate a buffer (str_len already has terminating null
     // accounted for).
     wchar_t *wideFamilyName = new wchar_t[str_len];
@@ -1688,7 +1688,7 @@
     // Get the actual name of the typeface. The logfont may not know this.
     HFONT font = CreateFontIndirect(&fLogFont);
 
-    HDC deviceContext = ::CreateCompatibleDC(NULL);
+    HDC deviceContext = ::CreateCompatibleDC(nullptr);
     HFONT savefont = (HFONT)SelectObject(deviceContext, font);
 
     dcfontname_to_skstring(deviceContext, fLogFont, familyName);
@@ -1716,7 +1716,7 @@
                         SkScalarToFIXED(0), SkScalarToFIXED(1)};
     int flags = GGO_METRICS | GGO_GLYPH_INDEX;
     GLYPHMETRICS gm;
-    if (GDI_ERROR == GetGlyphOutline(hdc, gId, flags, &gm, 0, NULL, &mat2)) {
+    if (GDI_ERROR == GetGlyphOutline(hdc, gId, flags, &gm, 0, nullptr, &mat2)) {
         return false;
     }
     SkASSERT(advance);
@@ -1729,12 +1729,12 @@
         const uint32_t* glyphIDs,
         uint32_t glyphIDsCount) const {
     LOGFONT lf = fLogFont;
-    SkAdvancedTypefaceMetrics* info = NULL;
+    SkAdvancedTypefaceMetrics* info = nullptr;
 
-    HDC hdc = CreateCompatibleDC(NULL);
+    HDC hdc = CreateCompatibleDC(nullptr);
     HFONT font = CreateFontIndirect(&lf);
     HFONT savefont = (HFONT)SelectObject(hdc, font);
-    HFONT designFont = NULL;
+    HFONT designFont = nullptr;
 
     const char stem_chars[] = {'i', 'I', '!', '1'};
     int16_t min_width;
@@ -1852,7 +1852,7 @@
 
 //Dummy representation of a Base64 encoded GUID from create_unique_font_name.
 #define BASE64_GUID_ID "XXXXXXXXXXXXXXXXXXXXXXXX"
-//Length of GUID representation from create_id, including NULL terminator.
+//Length of GUID representation from create_id, including nullptr terminator.
 #define BASE64_GUID_ID_LEN SK_ARRAY_COUNT(BASE64_GUID_ID)
 
 static_assert(BASE64_GUID_ID_LEN < LF_FACESIZE, "GUID_longer_than_facesize");
@@ -1899,7 +1899,7 @@
 }
 
 /**
-   Introduces a font to GDI. On failure will return NULL. The returned handle
+   Introduces a font to GDI. On failure will return nullptr. The returned handle
    should eventually be passed to RemoveFontMemResourceEx.
 */
 static HANDLE activate_font(SkData* fontData) {
@@ -1910,9 +1910,9 @@
                                              0,
                                              &numFonts);
 
-    if (fontHandle != NULL && numFonts < 1) {
+    if (fontHandle != nullptr && numFonts < 1) {
         RemoveFontMemResourceEx(fontHandle);
-        return NULL;
+        return nullptr;
     }
 
     return fontHandle;
@@ -1925,19 +1925,19 @@
     char familyName[BASE64_GUID_ID_LEN];
     const int familyNameSize = SK_ARRAY_COUNT(familyName);
     if (FAILED(create_unique_font_name(familyName, familyNameSize))) {
-        return NULL;
+        return nullptr;
     }
 
     // Change the name of the font.
     SkAutoTUnref<SkData> rewrittenFontData(SkOTUtils::RenameFont(stream, familyName, familyNameSize-1));
-    if (NULL == rewrittenFontData.get()) {
-        return NULL;
+    if (nullptr == rewrittenFontData.get()) {
+        return nullptr;
     }
 
     // Register the font with GDI.
     HANDLE fontReference = activate_font(rewrittenFontData.get());
-    if (NULL == fontReference) {
-        return NULL;
+    if (nullptr == fontReference) {
+        return nullptr;
     }
 
     // Create the typeface.
@@ -1954,17 +1954,17 @@
         SkEndian_SwapBE32(SkSetFourByteTag('t', 't', 'c', 'f'));
     LOGFONT lf = fLogFont;
 
-    HDC hdc = ::CreateCompatibleDC(NULL);
+    HDC hdc = ::CreateCompatibleDC(nullptr);
     HFONT font = CreateFontIndirect(&lf);
     HFONT savefont = (HFONT)SelectObject(hdc, font);
 
-    SkMemoryStream* stream = NULL;
+    SkMemoryStream* stream = nullptr;
     DWORD tables[2] = {kTTCTag, 0};
     for (int i = 0; i < SK_ARRAY_COUNT(tables); i++) {
-        DWORD bufferSize = GetFontData(hdc, tables[i], 0, NULL, 0);
+        DWORD bufferSize = GetFontData(hdc, tables[i], 0, nullptr, 0);
         if (bufferSize == GDI_ERROR) {
             call_ensure_accessible(lf);
-            bufferSize = GetFontData(hdc, tables[i], 0, NULL, 0);
+            bufferSize = GetFontData(hdc, tables[i], 0, nullptr, 0);
         }
         if (bufferSize != GDI_ERROR) {
             stream = new SkMemoryStream(bufferSize);
@@ -1972,7 +1972,7 @@
                 break;
             } else {
                 delete stream;
-                stream = NULL;
+                stream = nullptr;
             }
         }
     }
@@ -2015,13 +2015,13 @@
     // Use uniscribe to detemine glyph index for non-BMP characters.
     static const int numWCHAR = 2;
     static const int maxItems = 2;
-    // MSDN states that this can be NULL, but some things don't work then.
+    // MSDN states that this can be nullptr, but some things don't work then.
     SCRIPT_CONTROL scriptControl = { 0 };
     // Add extra item to SCRIPT_ITEM to work around a bug (now documented).
     // https://bugzilla.mozilla.org/show_bug.cgi?id=366643
     SCRIPT_ITEM si[maxItems + 1];
     int numItems;
-    HRZM(ScriptItemize(utf16, numWCHAR, maxItems, &scriptControl, NULL, si, &numItems),
+    HRZM(ScriptItemize(utf16, numWCHAR, maxItems, &scriptControl, nullptr, si, &numItems),
          "Could not itemize character.");
 
     // Sometimes ScriptShape cannot find a glyph for a non-BMP and returns 2 space glyphs.
@@ -2042,7 +2042,7 @@
 class SkAutoHDC {
 public:
     SkAutoHDC(const LOGFONT& lf)
-        : fHdc(::CreateCompatibleDC(NULL))
+        : fHdc(::CreateCompatibleDC(nullptr))
         , fFont(::CreateFontIndirect(&lf))
         , fSavefont((HFONT)SelectObject(fHdc, fFont))
     { }
@@ -2075,7 +2075,7 @@
 
     SkAutoSTMalloc<256, uint16_t> scratchGlyphs;
     uint16_t* glyphs;
-    if (userGlyphs != NULL) {
+    if (userGlyphs != nullptr) {
         glyphs = userGlyphs;
     } else {
         glyphs = scratchGlyphs.reset(glyphCount);
@@ -2189,7 +2189,7 @@
 }
 
 int LogFontTypeface::onCountGlyphs() const {
-    HDC hdc = ::CreateCompatibleDC(NULL);
+    HDC hdc = ::CreateCompatibleDC(nullptr);
     HFONT font = CreateFontIndirect(&fLogFont);
     HFONT savefont = (HFONT)SelectObject(hdc, font);
 
@@ -2203,7 +2203,7 @@
 }
 
 int LogFontTypeface::onGetUPEM() const {
-    HDC hdc = ::CreateCompatibleDC(NULL);
+    HDC hdc = ::CreateCompatibleDC(nullptr);
     HFONT font = CreateFontIndirect(&fLogFont);
     HFONT savefont = (HFONT)SelectObject(hdc, font);
 
@@ -2219,7 +2219,7 @@
 SkTypeface::LocalizedStrings* LogFontTypeface::onCreateFamilyNameIterator() const {
     SkTypeface::LocalizedStrings* nameIter =
         SkOTUtils::LocalizedStrings_NameTable::CreateForFamilyNames(*this);
-    if (NULL == nameIter) {
+    if (nullptr == nameIter) {
         SkString familyName;
         this->getFamilyName(&familyName);
         SkString language("und"); //undetermined
@@ -2255,12 +2255,12 @@
 {
     LOGFONT lf = fLogFont;
 
-    HDC hdc = ::CreateCompatibleDC(NULL);
+    HDC hdc = ::CreateCompatibleDC(nullptr);
     HFONT font = CreateFontIndirect(&lf);
     HFONT savefont = (HFONT)SelectObject(hdc, font);
 
     tag = SkEndian_SwapBE32(tag);
-    if (NULL == data) {
+    if (nullptr == data) {
         length = 0;
     }
     DWORD bufferSize = GetFontData(hdc, tag, (DWORD) offset, data, (DWORD) length);
@@ -2280,7 +2280,7 @@
     SkScalerContext_GDI* ctx = new SkScalerContext_GDI(const_cast<LogFontTypeface*>(this), desc);
     if (!ctx->isValid()) {
         delete ctx;
-        ctx = NULL;
+        ctx = nullptr;
     }
     return ctx;
 }
@@ -2378,7 +2378,7 @@
         lf.lfCharSet = DEFAULT_CHARSET;
         _tcscpy_s(lf.lfFaceName, familyName);
 
-        HDC hdc = ::CreateCompatibleDC(NULL);
+        HDC hdc = ::CreateCompatibleDC(nullptr);
         ::EnumFontFamiliesEx(hdc, &lf, enum_family_proc, (LPARAM)&fArray, 0);
         ::DeleteDC(hdc);
     }
@@ -2424,7 +2424,7 @@
         sk_bzero(&lf, sizeof(lf));
         lf.lfCharSet = DEFAULT_CHARSET;
 
-        HDC hdc = ::CreateCompatibleDC(NULL);
+        HDC hdc = ::CreateCompatibleDC(nullptr);
         ::EnumFontFamiliesEx(hdc, &lf, enum_family_proc, (LPARAM)&fLogFontArray, 0);
         ::DeleteDC(hdc);
     }
@@ -2445,7 +2445,7 @@
     }
 
     SkFontStyleSet* onMatchFamily(const char familyName[]) const override {
-        if (NULL == familyName) {
+        if (nullptr == familyName) {
             familyName = "";    // do we need this check???
         }
         LOGFONT lf;
@@ -2463,7 +2463,7 @@
     virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], const SkFontStyle&,
                                                     const char* bcp47[], int bcp47Count,
                                                     SkUnichar character) const override {
-        return NULL;
+        return nullptr;
     }
 
     virtual SkTypeface* onMatchFaceStyle(const SkTypeface* familyMember,
@@ -2492,7 +2492,7 @@
     virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
                                                unsigned styleBits) const override {
         LOGFONT lf;
-        if (NULL == familyName) {
+        if (nullptr == familyName) {
             lf = get_default_font();
         } else {
             logfont_for_name(familyName, &lf);
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index dc89d91..0fd121e 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -124,7 +124,7 @@
 
 public:
     explicit SkFontStyleSet_Android(const FontFamily& family, const Scanner& scanner) {
-        const SkString* cannonicalFamilyName = NULL;
+        const SkString* cannonicalFamilyName = nullptr;
         if (family.fNames.count() > 0) {
             cannonicalFamilyName = &family.fNames[0];
         }
@@ -174,7 +174,7 @@
             // The first specified family name overrides the family name found in the font.
             // TODO: SkTypeface_AndroidSystem::onCreateFamilyNameIterator should return
             // all of the specified family names in addition to the names found in the font.
-            if (cannonicalFamilyName != NULL) {
+            if (cannonicalFamilyName != nullptr) {
                 familyName = *cannonicalFamilyName;
             }
 
@@ -244,7 +244,7 @@
     }
     SkTypeface_AndroidSystem* createTypeface(int index) override {
         if (index < 0 || fStyles.count() <= index) {
-            return NULL;
+            return nullptr;
         }
         return SkRef(fStyles[index].get());
     }
@@ -255,7 +255,7 @@
      */
     SkTypeface_AndroidSystem* matchStyle(const SkFontStyle& pattern) override {
         if (0 == fStyles.count()) {
-            return NULL;
+            return nullptr;
         }
         SkTypeface_AndroidSystem* closest = fStyles[0];
         int minScore = std::numeric_limits<int>::max();
@@ -342,14 +342,14 @@
 
     SkFontStyleSet* onCreateStyleSet(int index) const override {
         if (index < 0 || fNameToFamilyMap.count() <= index) {
-            return NULL;
+            return nullptr;
         }
         return SkRef(fNameToFamilyMap[index].styleSet);
     }
 
     SkFontStyleSet* onMatchFamily(const char familyName[]) const override {
         if (!familyName) {
-            return NULL;
+            return nullptr;
         }
         SkAutoAsciiToLC tolc(familyName);
         for (int i = 0; i < fNameToFamilyMap.count(); ++i) {
@@ -363,7 +363,7 @@
                 return SkRef(fFallbackNameToFamilyMap[i].styleSet);
             }
         }
-        return NULL;
+        return nullptr;
     }
 
     virtual SkTypeface* onMatchFamilyStyle(const char familyName[],
@@ -381,7 +381,7 @@
                 }
             }
         }
-        return NULL;
+        return nullptr;
     }
 
     static SkTypeface_AndroidSystem* find_family_style_character(
@@ -411,7 +411,7 @@
                 return face.detach();
             }
         }
-        return NULL;
+        return nullptr;
     }
 
     virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[],
@@ -449,7 +449,7 @@
                 return matchingTypeface;
             }
         }
-        return NULL;
+        return nullptr;
     }
 
     SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override {
@@ -458,7 +458,7 @@
 
     SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override {
         SkAutoTDelete<SkStreamAsset> stream(SkStream::NewFromFile(path));
-        return stream.get() ? this->createFromStream(stream.detach(), ttcIndex) : NULL;
+        return stream.get() ? this->createFromStream(stream.detach(), ttcIndex) : nullptr;
     }
 
     SkTypeface* onCreateFromStream(SkStreamAsset* bareStream, int ttcIndex) const override {
@@ -466,10 +466,10 @@
         bool isFixedPitch;
         SkFontStyle style;
         SkString name;
-        if (!fScanner.scanFont(stream, ttcIndex, &name, &style, &isFixedPitch, NULL)) {
-            return NULL;
+        if (!fScanner.scanFont(stream, ttcIndex, &name, &style, &isFixedPitch, nullptr)) {
+            return nullptr;
         }
-        SkFontData* data(new SkFontData(stream.detach(), ttcIndex, NULL, 0));
+        SkFontData* data(new SkFontData(stream.detach(), ttcIndex, nullptr, 0));
         return new SkTypeface_AndroidStream(data, style, isFixedPitch, name);
     }
 
@@ -478,8 +478,8 @@
         bool isFixedPitch;
         SkFontStyle style;
         SkString name;
-        if (!fScanner.scanFont(stream, data->getIndex(), &name, &style, &isFixedPitch, NULL)) {
-            return NULL;
+        if (!fScanner.scanFont(stream, data->getIndex(), &name, &style, &isFixedPitch, nullptr)) {
+            return nullptr;
         }
         return new SkTypeface_AndroidStream(data, style, isFixedPitch, name);
     }
@@ -490,7 +490,7 @@
         SkFontStyle style = SkFontStyle(styleBits);
 
         if (familyName) {
-            // On Android, we must return NULL when we can't find the requested
+            // On Android, we must return nullptr when we can't find the requested
             // named typeface so that the system/app can provide their own recovery
             // mechanism. On other platforms we'd provide a typeface from the
             // default family instead.
@@ -546,18 +546,18 @@
         static const char* gDefaultNames[] = { "sans-serif" };
         for (size_t i = 0; i < SK_ARRAY_COUNT(gDefaultNames); ++i) {
             SkFontStyleSet* set = this->onMatchFamily(gDefaultNames[i]);
-            if (NULL == set) {
+            if (nullptr == set) {
                 continue;
             }
             SkTypeface* tf = set->matchStyle(SkFontStyle());
-            if (NULL == tf) {
+            if (nullptr == tf) {
                 continue;
             }
             fDefaultFamily = set;
             fDefaultTypeface = tf;
             break;
         }
-        if (NULL == fDefaultTypeface) {
+        if (nullptr == fDefaultTypeface) {
             fDefaultFamily = fFontStyleSets[0];
             fDefaultTypeface = fDefaultFamily->createTypeface(0);
         }
diff --git a/src/ports/SkFontMgr_android_factory.cpp b/src/ports/SkFontMgr_android_factory.cpp
index 7f48561..96d8931 100644
--- a/src/ports/SkFontMgr_android_factory.cpp
+++ b/src/ports/SkFontMgr_android_factory.cpp
@@ -9,9 +9,9 @@
 #include "SkFontMgr_android.h"
 
 // For test only.
-static const char* gTestFontsXml = NULL;
-static const char* gTestFallbackFontsXml = NULL;
-static const char* gTestBasePath = NULL;
+static const char* gTestFontsXml = nullptr;
+static const char* gTestFallbackFontsXml = nullptr;
+static const char* gTestBasePath = nullptr;
 
 void SkUseTestFontConfigFile(const char* fontsXml, const char* fallbackFontsXml,
                              const char* basePath)
@@ -39,5 +39,5 @@
         return SkFontMgr_New_Android(&custom);
     }
 
-    return SkFontMgr_New_Android(NULL);
+    return SkFontMgr_New_Android(nullptr);
 }
diff --git a/src/ports/SkFontMgr_android_parser.cpp b/src/ports/SkFontMgr_android_parser.cpp
index 53decf3..83b1c4a 100644
--- a/src/ports/SkFontMgr_android_parser.cpp
+++ b/src/ports/SkFontMgr_android_parser.cpp
@@ -51,28 +51,28 @@
     /** Called at the start tag.
      *  Called immediately after the parent tag retuns this handler from a call to 'tag'.
      *  Allows setting up for handling the tag content and processing attributes.
-     *  If NULL, will not be called.
+     *  If nullptr, will not be called.
      */
     void (*start)(FamilyData* data, const char* tag, const char** attributes);
 
     /** Called at the end tag.
      *  Allows post-processing of any accumulated information.
      *  This will be the last call made in relation to the current tag.
-     *  If NULL, will not be called.
+     *  If nullptr, will not be called.
      */
     void (*end)(FamilyData* data, const char* tag);
 
     /** Called when a nested tag is encountered.
      *  This is responsible for determining how to handle the tag.
-     *  If the tag is not recognized, return NULL to skip the tag.
-     *  If NULL, all nested tags will be skipped.
+     *  If the tag is not recognized, return nullptr to skip the tag.
+     *  If nullptr, all nested tags will be skipped.
      */
     const TagHandler* (*tag)(FamilyData* data, const char* tag, const char** attributes);
 
     /** The character handler for this tag.
      *  This is only active for character data contained directly in this tag (not sub-tags).
      *  The first parameter will be castable to a FamilyData*.
-     *  If NULL, any character data in this tag will be ignored.
+     *  If nullptr, any character data in this tag will be ignored.
      */
     XML_CharacterDataHandler chars;
 };
@@ -84,8 +84,8 @@
                const TagHandler* topLevelHandler)
         : fParser(parser)
         , fFamilies(families)
-        , fCurrentFamily(NULL)
-        , fCurrentFontInfo(NULL)
+        , fCurrentFamily(nullptr)
+        , fCurrentFontInfo(nullptr)
         , fVersion(0)
         , fBasePath(basePath)
         , fIsFallback(isFallback)
@@ -114,7 +114,7 @@
 }
 #define MEMEQ(c, s, n) memeq(c, s, sizeof(c) - 1, n)
 
-#define ATTS_NON_NULL(a, i) (a[i] != NULL && a[i+1] != NULL)
+#define ATTS_NON_NULL(a, i) (a[i] != nullptr && a[i+1] != nullptr)
 
 #define SK_FONTMGR_ANDROID_PARSER_PREFIX "[SkFontMgr Android Parser] "
 
@@ -178,9 +178,9 @@
             }
         }
     },
-    /*end*/NULL,
-    /*tag*/NULL,
-    /*chars*/NULL,
+    /*end*/nullptr,
+    /*tag*/nullptr,
+    /*chars*/nullptr,
 };
 
 static const TagHandler fontHandler = {
@@ -221,7 +221,7 @@
         if (MEMEQ("axis", tag, len)) {
             return &axisHandler;
         }
-        return NULL;
+        return nullptr;
     },
     /*chars*/[](void* data, const char* s, int len) {
         FamilyData* self = static_cast<FamilyData*>(data);
@@ -265,9 +265,9 @@
         if (MEMEQ("font", tag, len)) {
             return &fontHandler;
         }
-        return NULL;
+        return nullptr;
     },
-    /*chars*/NULL,
+    /*chars*/nullptr,
 };
 
 static FontFamily* find_family(FamilyData* self, const SkString& familyName) {
@@ -279,7 +279,7 @@
             }
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 static const TagHandler aliasHandler = {
@@ -331,14 +331,14 @@
             targetFamily->fNames.push_back().set(aliasName);
         }
     },
-    /*end*/NULL,
-    /*tag*/NULL,
-    /*chars*/NULL,
+    /*end*/nullptr,
+    /*tag*/nullptr,
+    /*chars*/nullptr,
 };
 
 static const TagHandler familySetHandler = {
     /*start*/[](FamilyData* self, const char* tag, const char** attributes) { },
-    /*end*/NULL,
+    /*end*/nullptr,
     /*tag*/[](FamilyData* self, const char* tag, const char** attributes) -> const TagHandler* {
         size_t len = strlen(tag);
         if (MEMEQ("family", tag, len)) {
@@ -346,9 +346,9 @@
         } else if (MEMEQ("alias", tag, len)) {
             return &aliasHandler;
         }
-        return NULL;
+        return nullptr;
     },
-    /*chars*/NULL,
+    /*chars*/nullptr,
 };
 
 } // lmpParser
@@ -400,8 +400,8 @@
         }
         self->fCurrentFontInfo = &newFileInfo;
     },
-    /*end*/NULL,
-    /*tag*/NULL,
+    /*end*/nullptr,
+    /*tag*/nullptr,
     /*chars*/[](void* data, const char* s, int len) {
         FamilyData* self = static_cast<FamilyData*>(data);
         self->fCurrentFontInfo->fFileName.append(s, len);
@@ -409,16 +409,16 @@
 };
 
 static const TagHandler fileSetHandler = {
-    /*start*/NULL,
-    /*end*/NULL,
+    /*start*/nullptr,
+    /*end*/nullptr,
     /*tag*/[](FamilyData* self, const char* tag, const char** attributes) -> const TagHandler* {
         size_t len = strlen(tag);
         if (MEMEQ("file", tag, len)) {
             return &fileHandler;
         }
-        return NULL;
+        return nullptr;
     },
-    /*chars*/NULL,
+    /*chars*/nullptr,
 };
 
 static const TagHandler nameHandler = {
@@ -426,8 +426,8 @@
         // The character data should be a name for the font.
         self->fCurrentFamily->fNames.push_back();
     },
-    /*end*/NULL,
-    /*tag*/NULL,
+    /*end*/nullptr,
+    /*tag*/nullptr,
     /*chars*/[](void* data, const char* s, int len) {
         FamilyData* self = static_cast<FamilyData*>(data);
         SkAutoAsciiToLC tolc(s, len);
@@ -436,16 +436,16 @@
 };
 
 static const TagHandler nameSetHandler = {
-    /*start*/NULL,
-    /*end*/NULL,
+    /*start*/nullptr,
+    /*end*/nullptr,
     /*tag*/[](FamilyData* self, const char* tag, const char** attributes) -> const TagHandler* {
         size_t len = strlen(tag);
         if (MEMEQ("name", tag, len)) {
             return &nameHandler;
         }
-        return NULL;
+        return nullptr;
     },
-    /*chars*/NULL,
+    /*chars*/nullptr,
 };
 
 static const TagHandler familyHandler = {
@@ -467,29 +467,29 @@
         } else if (MEMEQ("fileset", tag, len)) {
             return &fileSetHandler;
         }
-        return NULL;
+        return nullptr;
     },
-    /*chars*/NULL,
+    /*chars*/nullptr,
 };
 
 static const TagHandler familySetHandler = {
-    /*start*/NULL,
-    /*end*/NULL,
+    /*start*/nullptr,
+    /*end*/nullptr,
     /*tag*/[](FamilyData* self, const char* tag, const char** attributes) -> const TagHandler* {
         size_t len = strlen(tag);
         if (MEMEQ("family", tag, len)) {
             return &familyHandler;
         }
-        return NULL;
+        return nullptr;
     },
-    /*chars*/NULL,
+    /*chars*/nullptr,
 };
 
 } // namespace jbParser
 
 static const TagHandler topLevelHandler = {
-    /*start*/NULL,
-    /*end*/NULL,
+    /*start*/nullptr,
+    /*end*/nullptr,
     /*tag*/[](FamilyData* self, const char* tag, const char** attributes) -> const TagHandler* {
         size_t len = strlen(tag);
         if (MEMEQ("familyset", tag, len)) {
@@ -508,9 +508,9 @@
             }
             return &jbParser::familySetHandler;
         }
-        return NULL;
+        return nullptr;
     },
-    /*chars*/NULL,
+    /*chars*/nullptr,
 };
 
 static void XMLCALL start_element_handler(void *data, const char *tag, const char **attributes) {
@@ -518,7 +518,7 @@
 
     if (!self->fSkip) {
         const TagHandler* parent = self->fHandler.top();
-        const TagHandler* child = parent->tag ? parent->tag(self, tag, attributes) : NULL;
+        const TagHandler* child = parent->tag ? parent->tag(self, tag, attributes) : nullptr;
         if (child) {
             if (child->start) {
                 child->start(self, tag, attributes);
@@ -527,7 +527,7 @@
             XML_SetCharacterDataHandler(self->fParser, child->chars);
         } else {
             SK_FONTCONFIGPARSER_WARNING("'%s' tag not recognized, skipping", tag);
-            XML_SetCharacterDataHandler(self->fParser, NULL);
+            XML_SetCharacterDataHandler(self->fParser, nullptr);
             self->fSkip = self->fDepth;
         }
     }
@@ -597,7 +597,7 @@
     }
 
     SkAutoTCallVProc<remove_ptr<XML_Parser>::type, XML_ParserFree> parser(
-        XML_ParserCreate_MM(NULL, &sk_XML_alloc, NULL));
+        XML_ParserCreate_MM(nullptr, &sk_XML_alloc, nullptr));
     if (!parser) {
         SkDebugf(SK_FONTMGR_ANDROID_PARSER_PREFIX "could not create XML parser\n");
         return -1;
@@ -669,7 +669,7 @@
 #endif
 
     SkAutoTCallIProc<DIR, closedir> fontDirectory(opendir(dir));
-    if (NULL == fontDirectory) {
+    if (nullptr == fontDirectory) {
         return;
     }
 
@@ -789,7 +789,7 @@
 
     // strip off the rightmost "-.*"
     const char* parentTagEnd = strrchr(tag, '-');
-    if (parentTagEnd == NULL) {
+    if (parentTagEnd == nullptr) {
         return SkLanguage();
     }
     size_t parentTagLen = parentTagEnd - tag;
diff --git a/src/ports/SkFontMgr_android_parser.h b/src/ports/SkFontMgr_android_parser.h
index ca66c43..aca1573 100644
--- a/src/ports/SkFontMgr_android_parser.h
+++ b/src/ports/SkFontMgr_android_parser.h
@@ -115,7 +115,7 @@
                            const SkString& basePath,
                            const char* fontsXml,
                            const char* fallbackFontsXml,
-                           const char* langFallbackFontsDir = NULL);
+                           const char* langFallbackFontsDir = nullptr);
 
 } // SkFontMgr_Android_Parser namespace
 
diff --git a/src/ports/SkFontMgr_custom.cpp b/src/ports/SkFontMgr_custom.cpp
index 496a54c..7f3ce6b 100644
--- a/src/ports/SkFontMgr_custom.cpp
+++ b/src/ports/SkFontMgr_custom.cpp
@@ -63,7 +63,7 @@
     SkTypeface_Empty() : INHERITED(SkFontStyle(), false, true, SkString(), 0) {}
 
 protected:
-    SkStreamAsset* onOpenStream(int*) const override { return NULL; }
+    SkStreamAsset* onOpenStream(int*) const override { return nullptr; }
 
 private:
     typedef SkTypeface_Custom INHERITED;
@@ -156,7 +156,7 @@
 
     SkTypeface* matchStyle(const SkFontStyle& pattern) override {
         if (0 == fStyles.count()) {
-            return NULL;
+            return nullptr;
         }
 
         SkTypeface_Custom* closest = fStyles[0];
@@ -203,30 +203,30 @@
         virtual ~SystemFontLoader() { }
         virtual void loadSystemFonts(const SkTypeface_FreeType::Scanner&, Families*) const = 0;
     };
-    explicit SkFontMgr_Custom(const SystemFontLoader& loader) : fDefaultFamily(NULL) {
+    explicit SkFontMgr_Custom(const SystemFontLoader& loader) : fDefaultFamily(nullptr) {
         loader.loadSystemFonts(fScanner, &fFamilies);
 
         // Try to pick a default font.
         static const char* defaultNames[] = {
-            "Arial", "Verdana", "Times New Roman", "Droid Sans", NULL
+            "Arial", "Verdana", "Times New Roman", "Droid Sans", nullptr
         };
         for (size_t i = 0; i < SK_ARRAY_COUNT(defaultNames); ++i) {
             SkFontStyleSet_Custom* set = this->onMatchFamily(defaultNames[i]);
-            if (NULL == set) {
+            if (nullptr == set) {
                 continue;
             }
 
             SkTypeface* tf = set->matchStyle(SkFontStyle(SkFontStyle::kNormal_Weight,
                                                          SkFontStyle::kNormal_Width,
                                                          SkFontStyle::kUpright_Slant));
-            if (NULL == tf) {
+            if (nullptr == tf) {
                 continue;
             }
 
             fDefaultFamily = set;
             break;
         }
-        if (NULL == fDefaultFamily) {
+        if (nullptr == fDefaultFamily) {
             fDefaultFamily = fFamilies[0];
         }
     }
@@ -252,7 +252,7 @@
                 return SkRef(fFamilies[i].get());
             }
         }
-        return NULL;
+        return nullptr;
     }
 
     SkTypeface* onMatchFamilyStyle(const char familyName[],
@@ -266,7 +266,7 @@
                                             const char* bcp47[], int bcp47Count,
                                             SkUnichar character) const override
     {
-        return NULL;
+        return nullptr;
     }
 
     SkTypeface* onMatchFaceStyle(const SkTypeface* familyMember,
@@ -279,7 +279,7 @@
                 }
             }
         }
-        return NULL;
+        return nullptr;
     }
 
     SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override {
@@ -288,24 +288,24 @@
 
     SkTypeface* onCreateFromStream(SkStreamAsset* bareStream, int ttcIndex) const override {
         SkAutoTDelete<SkStreamAsset> stream(bareStream);
-        if (NULL == stream || stream->getLength() <= 0) {
-            return NULL;
+        if (nullptr == stream || stream->getLength() <= 0) {
+            return nullptr;
         }
 
         bool isFixedPitch;
         SkFontStyle style;
         SkString name;
-        if (fScanner.scanFont(stream, ttcIndex, &name, &style, &isFixedPitch, NULL)) {
+        if (fScanner.scanFont(stream, ttcIndex, &name, &style, &isFixedPitch, nullptr)) {
             return new SkTypeface_Stream(style, isFixedPitch, false, name, stream.detach(),
                                          ttcIndex);
         } else {
-            return NULL;
+            return nullptr;
         }
     }
 
     SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override {
         SkAutoTDelete<SkStreamAsset> stream(SkStream::NewFromFile(path));
-        return stream.get() ? this->createFromStream(stream.detach(), ttcIndex) : NULL;
+        return stream.get() ? this->createFromStream(stream.detach(), ttcIndex) : nullptr;
     }
 
     SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override {
@@ -317,13 +317,13 @@
                                         oldStyle & SkTypeface::kItalic
                                                  ? SkFontStyle::kItalic_Slant
                                                  : SkFontStyle::kUpright_Slant);
-        SkTypeface* tf = NULL;
+        SkTypeface* tf = nullptr;
 
         if (familyName) {
             tf = this->onMatchFamilyStyle(familyName, style);
         }
 
-        if (NULL == tf) {
+        if (nullptr == tf) {
             tf = fDefaultFamily->matchStyle(style);
         }
 
@@ -366,7 +366,7 @@
                 return families[i].get();
             }
         }
-        return NULL;
+        return nullptr;
     }
 
     static void load_directory_fonts(const SkTypeface_FreeType::Scanner& scanner,
@@ -394,7 +394,7 @@
                 bool isFixedPitch;
                 SkString realname;
                 SkFontStyle style = SkFontStyle(); // avoid uninitialized warning
-                if (!scanner.scanFont(stream, faceIndex, &realname, &style, &isFixedPitch, NULL)) {
+                if (!scanner.scanFont(stream, faceIndex, &realname, &style, &isFixedPitch, nullptr)) {
                     SkDebugf("---- failed to open <%s> <%d> as a font\n",
                              filename.c_str(), faceIndex);
                     continue;
@@ -405,7 +405,7 @@
                                                             realname, filename.c_str(), faceIndex);
 
                 SkFontStyleSet_Custom* addTo = find_family(*families, realname.c_str());
-                if (NULL == addTo) {
+                if (nullptr == addTo) {
                     addTo = new SkFontStyleSet_Custom(realname);
                     families->push_back().reset(addTo);
                 }
@@ -463,7 +463,7 @@
                 return families[i].get();
             }
         }
-        return NULL;
+        return nullptr;
     }
 
     static void load_embedded_font(const SkTypeface_FreeType::Scanner& scanner,
@@ -482,7 +482,7 @@
             bool isFixedPitch;
             SkString realname;
             SkFontStyle style = SkFontStyle(); // avoid uninitialized warning
-            if (!scanner.scanFont(stream, faceIndex, &realname, &style, &isFixedPitch, NULL)) {
+            if (!scanner.scanFont(stream, faceIndex, &realname, &style, &isFixedPitch, nullptr)) {
                 SkDebugf("---- failed to open <%d> <%d> as a font\n", index, faceIndex);
                 return;
             }
@@ -492,7 +492,7 @@
                                           realname, stream.detach(), faceIndex);
 
             SkFontStyleSet_Custom* addTo = find_family(*families, realname.c_str());
-            if (NULL == addTo) {
+            if (nullptr == addTo) {
                 addTo = new SkFontStyleSet_Custom(realname);
                 families->push_back().reset(addTo);
             }
diff --git a/src/ports/SkFontMgr_empty_factory.cpp b/src/ports/SkFontMgr_empty_factory.cpp
index ceed8f3..b4232cd 100644
--- a/src/ports/SkFontMgr_empty_factory.cpp
+++ b/src/ports/SkFontMgr_empty_factory.cpp
@@ -8,6 +8,6 @@
 #include "SkFontMgr.h"
 
 SkFontMgr* SkFontMgr::Factory() {
-    // Always return NULL, an empty SkFontMgr will be used.
-    return NULL;
+    // Always return nullptr, an empty SkFontMgr will be used.
+    return nullptr;
 }
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index 3dc1ea0..7682523 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -113,7 +113,7 @@
 public:
     SkAutoFc() : SkAutoTCallVProc<T, FcTDestroy<T, D> >(C()) {
         T* obj = this->operator T*();
-        SK_ALWAYSBREAK(NULL != obj);
+        SK_ALWAYSBREAK(nullptr != obj);
     }
     explicit SkAutoFc(T* obj) : SkAutoTCallVProc<T, FcTDestroy<T, D> >(obj) {}
 };
@@ -162,7 +162,7 @@
 
     // Create a copy of the pattern with only the value 'pattern'['object'['id']] in it.
     // Internally, FontConfig pattern objects are linked lists, so faster to remove from head.
-    SkAutoFcObjectSet requestedObjectOnly(FcObjectSetBuild(object, NULL));
+    SkAutoFcObjectSet requestedObjectOnly(FcObjectSetBuild(object, nullptr));
     SkAutoFcPattern minimal(FcPatternFilter(pattern, requestedObjectOnly));
     FcBool hasId = true;
     for (int i = 0; hasId && i < id; ++i) {
@@ -226,7 +226,7 @@
 static void remove_weak(FcPattern* pattern, const char object[]) {
     FCLocker::AssertHeld();
 
-    SkAutoFcObjectSet requestedObjectOnly(FcObjectSetBuild(object, NULL));
+    SkAutoFcObjectSet requestedObjectOnly(FcObjectSetBuild(object, nullptr));
     SkAutoFcPattern minimal(FcPatternFilter(pattern, requestedObjectOnly));
 
     int lastStrongId = -1;
@@ -512,8 +512,8 @@
             SkAutoFcPattern match(FcFontSetMatch(fFontMgr->fFC,
                                                  fontSets, SK_ARRAY_COUNT(fontSets),
                                                  pattern, &result));
-            if (NULL == match) {
-                return NULL;
+            if (nullptr == match) {
+                return nullptr;
             }
 
             return fFontMgr->createTypefaceFromFcPattern(match);
@@ -544,7 +544,7 @@
         for (int setIndex = 0; setIndex < (int)SK_ARRAY_COUNT(fcNameSet); ++setIndex) {
             // Return value of FcConfigGetFonts must not be destroyed.
             FcFontSet* allFonts(FcConfigGetFonts(fcconfig, fcNameSet[setIndex]));
-            if (NULL == allFonts) {
+            if (nullptr == allFonts) {
                 continue;
             }
 
@@ -587,7 +587,7 @@
         FCLocker::AssertHeld();
         SkAutoMutexAcquire ama(fTFCacheMutex);
         SkTypeface* face = fTFCache.findByProcAndRef(FindByFcPattern, pattern);
-        if (NULL == face) {
+        if (nullptr == face) {
             FcPatternReference(pattern);
             face = SkTypeface_fontconfig::Create(pattern);
             if (face) {
@@ -658,8 +658,8 @@
 
     static bool FontAccessible(FcPattern* font) {
         // FontConfig can return fonts which are unreadable.
-        const char* filename = get_string(font, FC_FILE, NULL);
-        if (NULL == filename) {
+        const char* filename = get_string(font, FC_FILE, nullptr);
+        if (nullptr == filename) {
             return false;
         }
         return sk_exists(filename, kRead_SkFILE_Flag);
@@ -696,7 +696,7 @@
         FcDefaultSubstitute(pattern);
 
         FcPattern* matchPattern;
-        SkAutoFcPattern strongPattern(NULL);
+        SkAutoFcPattern strongPattern(nullptr);
         if (familyName) {
             strongPattern.reset(FcPatternDuplicate(pattern));
             remove_weak(strongPattern, FC_FAMILY);
@@ -713,7 +713,7 @@
         for (int setIndex = 0; setIndex < (int)SK_ARRAY_COUNT(fcNameSet); ++setIndex) {
             // Return value of FcConfigGetFonts must not be destroyed.
             FcFontSet* allFonts(FcConfigGetFonts(fFC, fcNameSet[setIndex]));
-            if (NULL == allFonts) {
+            if (nullptr == allFonts) {
                 continue;
             }
 
@@ -748,7 +748,7 @@
         // In aliases, bindings are weak by default, so this is easy and common.
         // If no family name was specified, we'll probably only get weak matches, but that's ok.
         FcPattern* matchPattern;
-        SkAutoFcPattern strongPattern(NULL);
+        SkAutoFcPattern strongPattern(nullptr);
         if (familyName) {
             strongPattern.reset(FcPatternDuplicate(pattern));
             remove_weak(strongPattern, FC_FAMILY);
@@ -759,8 +759,8 @@
 
         FcResult result;
         SkAutoFcPattern font(FcFontMatch(fFC, pattern, &result));
-        if (NULL == font || !FontAccessible(font) || !FontFamilyNameMatches(font, matchPattern)) {
-            return NULL;
+        if (nullptr == font || !FontAccessible(font) || !FontFamilyNameMatches(font, matchPattern)) {
+            return nullptr;
         }
 
         return createTypefaceFromFcPattern(font);
@@ -801,8 +801,8 @@
 
         FcResult result;
         SkAutoFcPattern font(FcFontMatch(fFC, pattern, &result));
-        if (NULL == font || !FontAccessible(font) || !FontContainsCharacter(font, character)) {
-            return NULL;
+        if (nullptr == font || !FontAccessible(font) || !FontContainsCharacter(font, character)) {
+            return nullptr;
         }
 
         return createTypefaceFromFcPattern(font);
@@ -821,16 +821,16 @@
         SkAutoTDelete<SkStreamAsset> stream(bareStream);
         const size_t length = stream->getLength();
         if (length <= 0 || (1u << 30) < length) {
-            return NULL;
+            return nullptr;
         }
 
         SkFontStyle style;
         bool isFixedWidth = false;
-        if (!fScanner.scanFont(stream, ttcIndex, NULL, &style, &isFixedWidth, NULL)) {
-            return NULL;
+        if (!fScanner.scanFont(stream, ttcIndex, nullptr, &style, &isFixedWidth, nullptr)) {
+            return nullptr;
         }
 
-        return new SkTypeface_stream(new SkFontData(stream.detach(), ttcIndex, NULL, 0), style,
+        return new SkTypeface_stream(new SkFontData(stream.detach(), ttcIndex, nullptr, 0), style,
                                      isFixedWidth);
     }
 
@@ -846,14 +846,14 @@
         SkStreamAsset* stream(fontData->getStream());
         const size_t length = stream->getLength();
         if (length <= 0 || (1u << 30) < length) {
-            return NULL;
+            return nullptr;
         }
 
         const int ttcIndex = fontData->getIndex();
         SkFontStyle style;
         bool isFixedWidth = false;
-        if (!fScanner.scanFont(stream, ttcIndex, NULL, &style, &isFixedWidth, NULL)) {
-            return NULL;
+        if (!fScanner.scanFont(stream, ttcIndex, nullptr, &style, &isFixedWidth, nullptr)) {
+            return nullptr;
         }
 
         return new SkTypeface_stream(fontData, style, isFixedWidth);
@@ -873,7 +873,7 @@
             return typeface.detach();
         }
 
-        return this->matchFamilyStyle(NULL, style);
+        return this->matchFamilyStyle(nullptr, style);
     }
 };
 
diff --git a/src/ports/SkFontMgr_fontconfig_factory.cpp b/src/ports/SkFontMgr_fontconfig_factory.cpp
index 78792fa..cdf0556 100644
--- a/src/ports/SkFontMgr_fontconfig_factory.cpp
+++ b/src/ports/SkFontMgr_fontconfig_factory.cpp
@@ -10,5 +10,5 @@
 #include "SkTypes.h"
 
 SkFontMgr* SkFontMgr::Factory() {
-    return SkFontMgr_New_FontConfig(NULL);
+    return SkFontMgr_New_FontConfig(nullptr);
 }
diff --git a/src/ports/SkFontMgr_win_dw.cpp b/src/ports/SkFontMgr_win_dw.cpp
index df51764..e40c5e4 100644
--- a/src/ports/SkFontMgr_win_dw.cpp
+++ b/src/ports/SkFontMgr_win_dw.cpp
@@ -42,7 +42,7 @@
     // Takes ownership of stream.
     static HRESULT Create(SkStreamAsset* stream, StreamFontFileLoader** streamFontFileLoader) {
         *streamFontFileLoader = new StreamFontFileLoader(stream);
-        if (NULL == streamFontFileLoader) {
+        if (nullptr == streamFontFileLoader) {
             return E_OUTOFMEMORY;
         }
         return S_OK;
@@ -63,7 +63,7 @@
         AddRef();
         return S_OK;
     } else {
-        *ppvObject = NULL;
+        *ppvObject = nullptr;
         return E_NOINTERFACE;
     }
 }
@@ -107,7 +107,7 @@
     static HRESULT Create(IDWriteFactory* factory, IDWriteFontFileLoader* fontFileLoader,
                           StreamFontFileEnumerator** streamFontFileEnumerator) {
         *streamFontFileEnumerator = new StreamFontFileEnumerator(factory, fontFileLoader);
-        if (NULL == streamFontFileEnumerator) {
+        if (nullptr == streamFontFileEnumerator) {
             return E_OUTOFMEMORY;
         }
         return S_OK;
@@ -139,7 +139,7 @@
         AddRef();
         return S_OK;
     } else {
-        *ppvObject = NULL;
+        *ppvObject = nullptr;
         return E_NOINTERFACE;
     }
 }
@@ -166,7 +166,7 @@
 
     UINT32 dummy = 0;
     HR(fFactory->CreateCustomFontFileReference(
-            &dummy, //cannot be NULL
+            &dummy, //cannot be nullptr
             sizeof(dummy), //even if this is 0
             fFontFileLoader.get(),
             &fCurrentFile));
@@ -176,8 +176,8 @@
 }
 
 HRESULT StreamFontFileEnumerator::GetCurrentFontFile(IDWriteFontFile** fontFile) {
-    if (fCurrentFile.get() == NULL) {
-        *fontFile = NULL;
+    if (fCurrentFile.get() == nullptr) {
+        *fontFile = nullptr;
         return E_FAIL;
     }
 
@@ -204,7 +204,7 @@
     static HRESULT Create(IDWriteFontFileLoader* fontFileLoader,
                           StreamFontCollectionLoader** streamFontCollectionLoader) {
         *streamFontCollectionLoader = new StreamFontCollectionLoader(fontFileLoader);
-        if (NULL == streamFontCollectionLoader) {
+        if (nullptr == streamFontCollectionLoader) {
             return E_OUTOFMEMORY;
         }
         return S_OK;
@@ -226,7 +226,7 @@
         AddRef();
         return S_OK;
     } else {
-        *ppvObject = NULL;
+        *ppvObject = nullptr;
         return E_NOINTERFACE;
     }
 }
@@ -268,9 +268,9 @@
     {
 #if SK_HAS_DWRITE_2_H
         if (!SUCCEEDED(fFactory->QueryInterface(&fFactory2))) {
-            // IUnknown::QueryInterface states that if it fails, punk will be set to NULL.
+            // IUnknown::QueryInterface states that if it fails, punk will be set to nullptr.
             // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/26/96777.aspx
-            SK_ALWAYSBREAK(NULL == fFactory2.get());
+            SK_ALWAYSBREAK(nullptr == fFactory2.get());
         }
 #endif
         memcpy(fLocaleName.get(), localeName, localeNameLength * sizeof(WCHAR));
@@ -370,8 +370,8 @@
     //Check if the two fonts share the same loader and have the same key.
     UINT32 cshNumFiles;
     UINT32 ctxNumFiles;
-    HRB(cshFace->fDWriteFontFace->GetFiles(&cshNumFiles, NULL));
-    HRB(ctxFace->fDWriteFontFace->GetFiles(&ctxNumFiles, NULL));
+    HRB(cshFace->fDWriteFontFace->GetFiles(&cshNumFiles, nullptr));
+    HRB(ctxFace->fDWriteFontFace->GetFiles(&ctxNumFiles, nullptr));
     if (cshNumFiles != ctxNumFiles) {
         return false;
     }
@@ -452,7 +452,7 @@
     SkAutoMutexAcquire ama(fTFCacheMutex);
     ProtoDWriteTypeface spec = { fontFace, font, fontFamily };
     SkTypeface* face = fTFCache.findByProcAndRef(FindByDWriteFont, &spec);
-    if (NULL == face) {
+    if (nullptr == face) {
         face = DWriteFontTypeface::Create(fFactory.get(), fontFace, font, fontFamily);
         if (face) {
             fTFCache.add(face, get_style(font));
@@ -491,7 +491,7 @@
     HRNM(fFontCollection->FindFamilyName(dwFamilyName.get(), &index, &exists),
             "Failed while finding family by name.");
     if (!exists) {
-        return NULL;
+        return nullptr;
     }
 
     return this->onCreateStyleSet(index);
@@ -506,7 +506,7 @@
 class FontFallbackRenderer : public IDWriteTextRenderer {
 public:
     FontFallbackRenderer(const SkFontMgr_DirectWrite* outer, UINT32 character)
-        : fRefCount(1), fOuter(SkSafeRef(outer)), fCharacter(character), fResolvedTypeface(NULL) {
+        : fRefCount(1), fOuter(SkSafeRef(outer)), fCharacter(character), fResolvedTypeface(nullptr) {
     }
 
     virtual ~FontFallbackRenderer() { }
@@ -616,7 +616,7 @@
             this->AddRef();
             return S_OK;
         }
-        *ppvObject = NULL;
+        *ppvObject = nullptr;
         return E_FAIL;
     }
 
@@ -648,7 +648,7 @@
         UINT32* textLength) override
     {
         if (fLength <= textPosition) {
-            *textString = NULL;
+            *textString = nullptr;
             *textLength = 0;
             return S_OK;
         }
@@ -663,7 +663,7 @@
         UINT32* textLength) override
     {
         if (textPosition < 1 || fLength <= textPosition) {
-            *textString = NULL;
+            *textString = nullptr;
             *textLength = 0;
             return S_OK;
         }
@@ -716,7 +716,7 @@
             this->AddRef();
             return S_OK;
         }
-        *ppvObject = NULL;
+        *ppvObject = nullptr;
         return E_FAIL;
     }
 
@@ -735,7 +735,7 @@
 {
     const DWriteStyle dwStyle(style);
 
-    const WCHAR* dwFamilyName = NULL;
+    const WCHAR* dwFamilyName = nullptr;
     SkSMallocWCHAR dwFamilyNameLocal;
     if (familyName) {
         HRN(sk_cstring_to_wchar(familyName, &dwFamilyNameLocal));
@@ -764,7 +764,7 @@
         HRNM(fFactory2->GetSystemFontFallback(&fontFallback), "Could not get system fallback.");
 
         SkTScopedComPtr<IDWriteNumberSubstitution> numberSubstitution;
-        HRNM(fFactory2->CreateNumberSubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, NULL, TRUE,
+        HRNM(fFactory2->CreateNumberSubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, nullptr, TRUE,
                                                  &numberSubstitution),
              "Could not create number substitution.");
         SkTScopedComPtr<FontFallbackSource> fontFallbackSource(
@@ -786,7 +786,7 @@
                                          &scale),
              "Could not map characters");
         if (!font.get()) {
-            return NULL;
+            return nullptr;
         }
 
         SkTScopedComPtr<IDWriteFontFace> fontFace;
@@ -820,7 +820,7 @@
     SkTScopedComPtr<FontFallbackRenderer> fontFallbackRenderer(
         new FontFallbackRenderer(this, character));
 
-    HRNM(fallbackLayout->Draw(NULL, fontFallbackRenderer.get(), 50.0f, 50.0f),
+    HRNM(fallbackLayout->Draw(nullptr, fontFallbackRenderer.get(), 50.0f, 50.0f),
          "Could not draw layout with renderer.");
 
     return fontFallbackRenderer->FallbackTypeface();
@@ -849,7 +849,7 @@
 
     T* detatch() {
         T* old = fUnregister;
-        fUnregister = NULL;
+        fUnregister = nullptr;
         return old;
     }
 
@@ -881,7 +881,7 @@
         fFactory.get(), fontCollectionLoader.get());
 
     SkTScopedComPtr<IDWriteFontCollection> fontCollection;
-    HRN(fFactory->CreateCustomFontCollection(fontCollectionLoader.get(), NULL, 0, &fontCollection));
+    HRN(fFactory->CreateCustomFontCollection(fontCollectionLoader.get(), nullptr, 0, &fontCollection));
 
     // Find the first non-simulated font which has the given ttc index.
     UINT32 familyCount = fontCollection->GetFontFamilyCount();
@@ -910,7 +910,7 @@
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 SkTypeface* SkFontMgr_DirectWrite::onCreateFromData(SkData* data, int ttcIndex) const {
@@ -957,12 +957,12 @@
         }
     }
 
-    if (NULL == fontFamily.get()) {
+    if (nullptr == fontFamily.get()) {
         // No family with given name, try default.
         HRNM(this->getDefaultFontFamily(&fontFamily), "Could not get default font family.");
     }
 
-    if (NULL == fontFamily.get()) {
+    if (nullptr == fontFamily.get()) {
         // Could not obtain the default font.
         HRNM(fFontCollection->GetFontFamily(0, &fontFamily),
              "Could not get default-default font family.");
@@ -1065,10 +1065,10 @@
 #include "SkTypeface_win.h"
 
 SK_API SkFontMgr* SkFontMgr_New_DirectWrite(IDWriteFactory* factory) {
-    if (NULL == factory) {
+    if (nullptr == factory) {
         factory = sk_get_dwrite_factory();
-        if (NULL == factory) {
-            return NULL;
+        if (nullptr == factory) {
+            return nullptr;
         }
     }
 
@@ -1077,13 +1077,13 @@
          "Could not get system font collection.");
 
     WCHAR localeNameStorage[LOCALE_NAME_MAX_LENGTH];
-    WCHAR* localeName = NULL;
+    WCHAR* localeName = nullptr;
     int localeNameLen = 0;
 
     // Dynamically load GetUserDefaultLocaleName function, as it is not available on XP.
-    SkGetUserDefaultLocaleNameProc getUserDefaultLocaleNameProc = NULL;
+    SkGetUserDefaultLocaleNameProc getUserDefaultLocaleNameProc = nullptr;
     HRESULT hr = SkGetGetUserDefaultLocaleNameProc(&getUserDefaultLocaleNameProc);
-    if (NULL == getUserDefaultLocaleNameProc) {
+    if (nullptr == getUserDefaultLocaleNameProc) {
         SK_TRACEHR(hr, "Could not get GetUserDefaultLocaleName.");
     } else {
         localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_NAME_MAX_LENGTH);
@@ -1098,8 +1098,8 @@
 #include "SkFontMgr_indirect.h"
 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) {
     SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite());
-    if (impl.get() == NULL) {
-        return NULL;
+    if (impl.get() == nullptr) {
+        return nullptr;
     }
     return new SkFontMgr_Indirect(impl.get(), proxy);
 }
diff --git a/src/ports/SkImageDecoder_CG.cpp b/src/ports/SkImageDecoder_CG.cpp
index e1e6dc1..bd94764 100644
--- a/src/ports/SkImageDecoder_CG.cpp
+++ b/src/ports/SkImageDecoder_CG.cpp
@@ -41,7 +41,7 @@
 static CGImageSourceRef SkStreamToCGImageSource(SkStream* stream) {
     CGDataProviderRef data = SkStreamToDataProvider(stream);
     if (!data) {
-        return NULL;
+        return nullptr;
     }
     CGImageSourceRef imageSrc = CGImageSourceCreateWithDataProvider(data, 0);
     CGDataProviderRelease(data);
@@ -134,13 +134,13 @@
 SkImageDecoder::Result SkImageDecoder_CG::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
     CGImageSourceRef imageSrc = SkStreamToCGImageSource(stream);
 
-    if (NULL == imageSrc) {
+    if (nullptr == imageSrc) {
         return kFailure;
     }
     SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc);
 
-    CGImageRef image = CGImageSourceCreateImageAtIndex(imageSrc, 0, NULL);
-    if (NULL == image) {
+    CGImageRef image = CGImageSourceCreateImageAtIndex(imageSrc, 0, nullptr);
+    if (nullptr == image) {
         return kFailure;
     }
     SkAutoTCallVProc<CGImage, CGImageRelease> arimage(image);
@@ -173,7 +173,7 @@
         return kSuccess;
     }
 
-    if (!this->allocPixelRef(bm, NULL)) {
+    if (!this->allocPixelRef(bm, nullptr)) {
         return kFailure;
     }
 
@@ -219,7 +219,7 @@
 
 SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable* stream) {
     SkImageDecoder* decoder = image_decoder_from_stream(stream);
-    if (NULL == decoder) {
+    if (nullptr == decoder) {
         // If no image decoder specific to the stream exists, use SkImageDecoder_CG.
         return new SkImageDecoder_CG;
     } else {
@@ -230,7 +230,7 @@
 /////////////////////////////////////////////////////////////////////////
 
 SkMovie* SkMovie::DecodeStream(SkStreamRewindable* stream) {
-    return NULL;
+    return nullptr;
 }
 
 /////////////////////////////////////////////////////////////////////////
@@ -256,12 +256,12 @@
 static CGImageDestinationRef SkStreamToImageDestination(SkWStream* stream,
                                                         CFStringRef type) {
     CGDataConsumerRef consumer = SkStreamToCGDataConsumer(stream);
-    if (NULL == consumer) {
-        return NULL;
+    if (nullptr == consumer) {
+        return nullptr;
     }
     SkAutoTCallVProc<const void, CFRelease> arconsumer(consumer);
 
-    return CGImageDestinationCreateWithDataConsumer(consumer, type, 1, NULL);
+    return CGImageDestinationCreateWithDataConsumer(consumer, type, 1, nullptr);
 }
 
 class SkImageEncoder_CG : public SkImageEncoder {
@@ -316,18 +316,18 @@
     }
 
     CGImageDestinationRef dst = SkStreamToImageDestination(stream, type);
-    if (NULL == dst) {
+    if (nullptr == dst) {
         return false;
     }
     SkAutoTCallVProc<const void, CFRelease> ardst(dst);
 
     CGImageRef image = SkCreateCGImageRef(*bmPtr);
-    if (NULL == image) {
+    if (nullptr == image) {
         return false;
     }
     SkAutoTCallVProc<CGImage, CGImageRelease> agimage(image);
 
-    CGImageDestinationAddImage(dst, image, NULL);
+    CGImageDestinationAddImage(dst, image, nullptr);
     return CGImageDestinationFinalize(dst);
 }
 
@@ -342,7 +342,7 @@
         case SkImageEncoder::kPNG_Type:
             break;
         default:
-            return NULL;
+            return nullptr;
     }
     return new SkImageEncoder_CG(t);
 }
@@ -388,13 +388,13 @@
 static SkImageDecoder::Format get_format_cg(SkStreamRewindable* stream) {
     CGImageSourceRef imageSrc = SkStreamToCGImageSource(stream);
 
-    if (NULL == imageSrc) {
+    if (nullptr == imageSrc) {
         return SkImageDecoder::kUnknown_Format;
     }
 
     SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc);
     const CFStringRef name = CGImageSourceGetType(imageSrc);
-    if (NULL == name) {
+    if (nullptr == name) {
         return SkImageDecoder::kUnknown_Format;
     }
     return UTType_to_Format(name);
diff --git a/src/ports/SkImageDecoder_WIC.cpp b/src/ports/SkImageDecoder_WIC.cpp
index 9194831..3cc9a32 100644
--- a/src/ports/SkImageDecoder_WIC.cpp
+++ b/src/ports/SkImageDecoder_WIC.cpp
@@ -60,7 +60,7 @@
      *  Helper function to decode an SkStream.
      *  @param stream SkStream to decode. Must be at the beginning.
      *  @param bm   SkBitmap to decode into. Only used if wicMode is kDecodeBounds_WICMode or
-     *      kDecodePixels_WICMode, in which case it must not be NULL.
+     *      kDecodePixels_WICMode, in which case it must not be nullptr.
      *  @param format Out parameter for the SkImageDecoder::Format of the SkStream. Only used if
      *      wicMode is kDecodeFormat_WICMode.
      */
@@ -102,7 +102,7 @@
             wicMode = kDecodePixels_WICMode;
             break;
     }
-    return this->decodeStream(stream, bm, wicMode, NULL) ? kSuccess : kFailure;
+    return this->decodeStream(stream, bm, wicMode, nullptr) ? kSuccess : kFailure;
 }
 
 bool SkImageDecoder_WIC::decodeStream(SkStream* stream, SkBitmap* bm, WICModes wicMode,
@@ -120,7 +120,7 @@
     if (SUCCEEDED(hr)) {
         hr = CoCreateInstance(
             CLSID_WICImagingFactory
-            , NULL
+            , nullptr
             , CLSCTX_INPROC_SERVER
             , IID_PPV_ARGS(&piImagingFactory)
         );
@@ -135,7 +135,7 @@
     //Make sure we're at the beginning of the stream.
     if (SUCCEEDED(hr)) {
         LARGE_INTEGER liBeginning = { 0 };
-        hr = piStream->Seek(liBeginning, STREAM_SEEK_SET, NULL);
+        hr = piStream->Seek(liBeginning, STREAM_SEEK_SET, nullptr);
     }
 
     //Create the decoder from the stream content.
@@ -143,14 +143,14 @@
     if (SUCCEEDED(hr)) {
         hr = piImagingFactory->CreateDecoderFromStream(
             piStream.get()                    //Image to be decoded
-            , NULL                            //No particular vendor
+            , nullptr                            //No particular vendor
             , WICDecodeMetadataCacheOnDemand  //Cache metadata when needed
             , &piBitmapDecoder                //Pointer to the decoder
         );
     }
 
     if (kDecodeFormat_WICMode == wicMode) {
-        SkASSERT(format != NULL);
+        SkASSERT(format != nullptr);
         //Get the format
         if (SUCCEEDED(hr)) {
             GUID guidFormat;
@@ -190,7 +190,7 @@
         if (kDecodeBounds_WICMode == wicMode) {
             return true;
         }
-        if (!this->allocPixelRef(bm, NULL)) {
+        if (!this->allocPixelRef(bm, nullptr)) {
             return false;
         }
     }
@@ -213,7 +213,7 @@
             piBitmapSourceOriginal.get()      //Input bitmap to convert
             , destinationPixelFormat          //Destination pixel format
             , WICBitmapDitherTypeNone         //Specified dither patterm
-            , NULL                            //Specify a particular palette
+            , nullptr                            //Specify a particular palette
             , 0.f                             //Alpha threshold
             , WICBitmapPaletteTypeCustom      //Palette translation type
         );
@@ -233,7 +233,7 @@
         bm->eraseColor(SK_ColorTRANSPARENT);
         const UINT stride = (UINT) bm->rowBytes();
         hr = piBitmapSourceConverted->CopyPixels(
-            NULL,                             //Get all the pixels
+            nullptr,                             //Get all the pixels
             stride,
             stride * height,
             reinterpret_cast<BYTE *>(bm->getPixels())
@@ -254,7 +254,7 @@
 
 SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable* stream) {
     SkImageDecoder* decoder = image_decoder_from_stream(stream);
-    if (NULL == decoder) {
+    if (nullptr == decoder) {
         // If no image decoder specific to the stream exists, use SkImageDecoder_WIC.
         return new SkImageDecoder_WIC;
     } else {
@@ -265,7 +265,7 @@
 /////////////////////////////////////////////////////////////////////////
 
 SkMovie* SkMovie::DecodeStream(SkStreamRewindable* stream) {
-    return NULL;
+    return nullptr;
 }
 
 /////////////////////////////////////////////////////////////////////////
@@ -345,7 +345,7 @@
     if (SUCCEEDED(hr)) {
         hr = CoCreateInstance(
             CLSID_WICImagingFactory
-            , NULL
+            , nullptr
             , CLSCTX_INPROC_SERVER
             , IID_PPV_ARGS(&piImagingFactory)
         );
@@ -360,7 +360,7 @@
     //Create an encode of the appropriate type.
     SkTScopedComPtr<IWICBitmapEncoder> piEncoder;
     if (SUCCEEDED(hr)) {
-        hr = piImagingFactory->CreateEncoder(type, NULL, &piEncoder);
+        hr = piImagingFactory->CreateEncoder(type, nullptr, &piEncoder);
     }
 
     if (SUCCEEDED(hr)) {
@@ -445,7 +445,7 @@
         case SkImageEncoder::kPNG_Type:
             break;
         default:
-            return NULL;
+            return nullptr;
     }
     return new SkImageEncoder_WIC(t);
 }
@@ -455,7 +455,7 @@
 static SkImageDecoder::Format get_format_wic(SkStreamRewindable* stream) {
     SkImageDecoder::Format format;
     SkImageDecoder_WIC codec;
-    if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICMode, &format)) {
+    if (!codec.decodeStream(stream, nullptr, SkImageDecoder_WIC::kDecodeFormat_WICMode, &format)) {
         format = SkImageDecoder::kUnknown_Format;
     }
     return format;
diff --git a/src/ports/SkImageDecoder_empty.cpp b/src/ports/SkImageDecoder_empty.cpp
index e6cca08..d248f14 100644
--- a/src/ports/SkImageDecoder_empty.cpp
+++ b/src/ports/SkImageDecoder_empty.cpp
@@ -22,7 +22,7 @@
 SkImageDecoder::~SkImageDecoder() {}
 
 SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable*) {
-    return NULL;
+    return nullptr;
 }
 
 void SkImageDecoder::copyFieldsToOther(SkImageDecoder* ) {}
@@ -67,15 +67,15 @@
 }
 
 const char* SkImageDecoder::GetFormatName(Format) {
-    return NULL;
+    return nullptr;
 }
 
 SkImageDecoder::Peeker* SkImageDecoder::setPeeker(Peeker*) {
-    return NULL;
+    return nullptr;
 }
 
 SkBitmap::Allocator* SkImageDecoder::setAllocator(SkBitmap::Allocator*) {
-    return NULL;
+    return nullptr;
 }
 
 void SkImageDecoder::setSampleSize(int) {}
@@ -94,7 +94,7 @@
 // Empty implementation for SkMovie.
 
 SkMovie* SkMovie::DecodeStream(SkStreamRewindable* stream) {
-    return NULL;
+    return nullptr;
 }
 
 /////////////////////////////////////////////////////////////////////////
@@ -102,7 +102,7 @@
 // Empty implementations for SkImageEncoder.
 
 SkImageEncoder* SkImageEncoder::Create(Type t) {
-    return NULL;
+    return nullptr;
 }
 
 bool SkImageEncoder::EncodeFile(const char file[], const SkBitmap&, Type, int quality) {
@@ -114,7 +114,7 @@
 }
 
 SkData* SkImageEncoder::EncodeData(const SkBitmap&, Type, int quality) {
-    return NULL;
+    return nullptr;
 }
 
 bool SkImageEncoder::encodeStream(SkWStream*, const SkBitmap&, int) {
@@ -122,7 +122,7 @@
 }
 
 SkData* SkImageEncoder::encodeData(const SkBitmap&, int) {
-    return NULL;
+    return nullptr;
 }
 
 bool SkImageEncoder::encodeFile(const char file[], const SkBitmap& bm, int quality) {
diff --git a/src/ports/SkImageGenerator_none.cpp b/src/ports/SkImageGenerator_none.cpp
index c0126ca..2dce1c2 100644
--- a/src/ports/SkImageGenerator_none.cpp
+++ b/src/ports/SkImageGenerator_none.cpp
@@ -8,5 +8,5 @@
 #include "SkImageGenerator.h"
 
 SkImageGenerator* SkImageGenerator::NewFromEncodedImpl(SkData*) {
-    return NULL;
+    return nullptr;
 }
diff --git a/src/ports/SkImageGenerator_skia.cpp b/src/ports/SkImageGenerator_skia.cpp
index 2b11651..afcd4b4 100644
--- a/src/ports/SkImageGenerator_skia.cpp
+++ b/src/ports/SkImageGenerator_skia.cpp
@@ -28,7 +28,7 @@
         {
             return false;
         }
-        return bm->installPixels(bmi, fMemory, fRowBytes, ctable, NULL, NULL);
+        return bm->installPixels(bmi, fMemory, fRowBytes, ctable, nullptr, nullptr);
     }
 };
 
@@ -67,7 +67,7 @@
             SkASSERT(ctableEntries);
 
             SkColorTable* ctable = bm.getColorTable();
-            if (NULL == ctable) {
+            if (nullptr == ctable) {
                 return false;
             }
             const int count = ctable->count();
@@ -90,15 +90,15 @@
 SkImageGenerator* SkImageGenerator::NewFromEncodedImpl(SkData* data) {
     SkMemoryStream stream(data->data(), data->size(), false);
     SkImageDecoder* decoder = SkImageDecoder::Factory(&stream);
-    if (NULL == decoder) {
-        return NULL;
+    if (nullptr == decoder) {
+        return nullptr;
     }
 
     SkBitmap bm;
     stream.rewind();
     if (!decoder->decode(&stream, &bm, kUnknown_SkColorType, SkImageDecoder::kDecodeBounds_Mode)) {
         delete decoder;
-        return NULL;
+        return nullptr;
     }
 
     return new SkImageDecoderGenerator(bm.info(), decoder, data);
diff --git a/src/ports/SkMemory_malloc.cpp b/src/ports/SkMemory_malloc.cpp
index f9836c0..6ad01da 100644
--- a/src/ports/SkMemory_malloc.cpp
+++ b/src/ports/SkMemory_malloc.cpp
@@ -19,8 +19,8 @@
 }
 
 static inline void* throw_on_failure(size_t size, void* p) {
-    if (size > 0 && p == NULL) {
-        // If we've got a NULL here, the only reason we should have failed is running out of RAM.
+    if (size > 0 && p == nullptr) {
+        // If we've got a nullptr here, the only reason we should have failed is running out of RAM.
         sk_out_of_memory(size);
     }
     return p;
diff --git a/src/ports/SkOSFile_posix.cpp b/src/ports/SkOSFile_posix.cpp
index b604c21..58662f3 100644
--- a/src/ports/SkOSFile_posix.cpp
+++ b/src/ports/SkOSFile_posix.cpp
@@ -63,19 +63,19 @@
 void* sk_fdmmap(int fd, size_t* size) {
     struct stat status;
     if (0 != fstat(fd, &status)) {
-        return NULL;
+        return nullptr;
     }
     if (!S_ISREG(status.st_mode)) {
-        return NULL;
+        return nullptr;
     }
     if (!SkTFitsIn<size_t>(status.st_size)) {
-        return NULL;
+        return nullptr;
     }
     size_t fileSize = static_cast<size_t>(status.st_size);
 
-    void* addr = mmap(NULL, fileSize, PROT_READ, MAP_PRIVATE, fd, 0);
+    void* addr = mmap(nullptr, fileSize, PROT_READ, MAP_PRIVATE, fd, 0);
     if (MAP_FAILED == addr) {
-        return NULL;
+        return nullptr;
     }
 
     *size = fileSize;
@@ -89,7 +89,7 @@
 void* sk_fmmap(SkFILE* f, size_t* size) {
     int fd = sk_fileno(f);
     if (fd < 0) {
-        return NULL;
+        return nullptr;
     }
 
     return sk_fdmmap(fd, size);
@@ -149,7 +149,7 @@
     if (self.fDIR) {
         dirent* entry;
 
-        while ((entry = ::readdir(self.fDIR)) != NULL) {
+        while ((entry = ::readdir(self.fDIR)) != nullptr) {
             struct stat s;
             SkString str(self.fPath);
 
diff --git a/src/ports/SkOSFile_stdio.cpp b/src/ports/SkOSFile_stdio.cpp
index a7d776a..5b497d4 100644
--- a/src/ports/SkOSFile_stdio.cpp
+++ b/src/ports/SkOSFile_stdio.cpp
@@ -70,7 +70,7 @@
 
 size_t sk_fread(void* buffer, size_t byteCount, SkFILE* f) {
     SkASSERT(f);
-    if (buffer == NULL) {
+    if (buffer == nullptr) {
         size_t curr = ::ftell((FILE*)f);
         if ((long)curr == -1) {
             SkDEBUGF(("sk_fread: ftell(%p) returned -1 feof:%d ferror:%d\n", f, feof((FILE*)f), ferror((FILE*)f)));
diff --git a/src/ports/SkOSFile_win.cpp b/src/ports/SkOSFile_win.cpp
index 64bd516..14af458 100644
--- a/src/ports/SkOSFile_win.cpp
+++ b/src/ports/SkOSFile_win.cpp
@@ -79,29 +79,29 @@
 void* sk_fdmmap(int fileno, size_t* length) {
     HANDLE file = (HANDLE)_get_osfhandle(fileno);
     if (INVALID_HANDLE_VALUE == file) {
-        return NULL;
+        return nullptr;
     }
 
     LARGE_INTEGER fileSize;
     if (0 == GetFileSizeEx(file, &fileSize)) {
         //TODO: use SK_TRACEHR(GetLastError(), "Could not get file size.") to report.
-        return NULL;
+        return nullptr;
     }
     if (!SkTFitsIn<size_t>(fileSize.QuadPart)) {
-        return NULL;
+        return nullptr;
     }
 
-    SkAutoWinMMap mmap(CreateFileMapping(file, NULL, PAGE_READONLY, 0, 0, NULL));
+    SkAutoWinMMap mmap(CreateFileMapping(file, nullptr, PAGE_READONLY, 0, 0, nullptr));
     if (!mmap.isValid()) {
         //TODO: use SK_TRACEHR(GetLastError(), "Could not create file mapping.") to report.
-        return NULL;
+        return nullptr;
     }
 
     // Eventually call UnmapViewOfFile
     void* addr = MapViewOfFile(mmap, FILE_MAP_READ, 0, 0, 0);
-    if (NULL == addr) {
+    if (nullptr == addr) {
         //TODO: use SK_TRACEHR(GetLastError(), "Could not map view of file.") to report.
-        return NULL;
+        return nullptr;
     }
 
     *length = static_cast<size_t>(fileSize.QuadPart);
@@ -115,7 +115,7 @@
 void* sk_fmmap(SkFILE* f, size_t* length) {
     int fileno = sk_fileno(f);
     if (fileno < 0) {
-        return NULL;
+        return nullptr;
     }
 
     return sk_fdmmap(fileno, length);
@@ -124,7 +124,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 struct SkOSFileIterData {
-    SkOSFileIterData() : fHandle(0), fPath16(NULL) { }
+    SkOSFileIterData() : fHandle(0), fPath16(nullptr) { }
     HANDLE fHandle;
     uint16_t* fPath16;
 };
@@ -177,7 +177,7 @@
         ::FindClose(self.fHandle);
         self.fHandle = 0;
     }
-    if (NULL == path) {
+    if (nullptr == path) {
         path = "";
     }
 
@@ -193,7 +193,7 @@
 static bool get_the_file(HANDLE handle, SkString* name, WIN32_FIND_DATAW* dataPtr, bool getDir) {
     WIN32_FIND_DATAW    data;
 
-    if (NULL == dataPtr) {
+    if (nullptr == dataPtr) {
         if (::FindNextFileW(handle, &data))
             dataPtr = &data;
         else
@@ -226,10 +226,10 @@
 bool SkOSFile::Iter::next(SkString* name, bool getDir) {
     SkOSFileIterData& self = *static_cast<SkOSFileIterData*>(fSelf.get());
     WIN32_FIND_DATAW    data;
-    WIN32_FIND_DATAW*   dataPtr = NULL;
+    WIN32_FIND_DATAW*   dataPtr = nullptr;
 
     if (self.fHandle == 0) {  // our first time
-        if (self.fPath16 == NULL || *self.fPath16 == 0) {  // check for no path
+        if (self.fPath16 == nullptr || *self.fPath16 == 0) {  // check for no path
             return false;
         }
 
diff --git a/src/ports/SkRemotableFontMgr_win_dw.cpp b/src/ports/SkRemotableFontMgr_win_dw.cpp
index 2d06255..aaef3a4 100644
--- a/src/ports/SkRemotableFontMgr_win_dw.cpp
+++ b/src/ports/SkRemotableFontMgr_win_dw.cpp
@@ -34,8 +34,8 @@
         explicit DataId(DataId& that)
             : fLoader(that.fLoader), fKey(that.fKey), fKeySize(that.fKeySize)
         {
-            that.fLoader = NULL;
-            that.fKey = NULL;
+            that.fLoader = nullptr;
+            that.fKey = nullptr;
             SkDEBUGCODE(that.fKeySize = 0xFFFFFFFF;)
         }
 
@@ -116,7 +116,7 @@
         HRM(font->CreateFontFace(&fontFace), "Could not create font face.");
 
         UINT32 numFiles;
-        HR(fontFace->GetFiles(&numFiles, NULL));
+        HR(fontFace->GetFiles(&numFiles, nullptr));
         if (numFiles > 1) {
             return E_FAIL;
         }
@@ -193,7 +193,7 @@
                    "Could not match font in family.",
                    identity);
 
-        HR_GENERAL(FontToIdentity(font.get(), &identity), NULL, identity);
+        HR_GENERAL(FontToIdentity(font.get(), &identity), nullptr, identity);
 
         return identity;
     }
@@ -218,12 +218,12 @@
 
     SkRemotableFontIdentitySet* matchName(const char familyName[]) const override {
         SkSMallocWCHAR dwFamilyName;
-        if (NULL == familyName) {
+        if (nullptr == familyName) {
             HR_GENERAL(getDefaultFontFamilyName(&dwFamilyName),
-                       NULL, SkRemotableFontIdentitySet::NewEmpty());
+                       nullptr, SkRemotableFontIdentitySet::NewEmpty());
         } else {
             HR_GENERAL(sk_cstring_to_wchar(familyName, &dwFamilyName),
-                       NULL, SkRemotableFontIdentitySet::NewEmpty());
+                       nullptr, SkRemotableFontIdentitySet::NewEmpty());
         }
 
         UINT32 index;
@@ -244,10 +244,10 @@
         SkFontIdentity identity = { SkFontIdentity::kInvalidDataId };
 
         SkSMallocWCHAR dwFamilyName;
-        if (NULL == familyName) {
-            HR_GENERAL(getDefaultFontFamilyName(&dwFamilyName), NULL, identity);
+        if (nullptr == familyName) {
+            HR_GENERAL(getDefaultFontFamilyName(&dwFamilyName), nullptr, identity);
         } else {
-            HR_GENERAL(sk_cstring_to_wchar(familyName, &dwFamilyName), NULL, identity);
+            HR_GENERAL(sk_cstring_to_wchar(familyName, &dwFamilyName), nullptr, identity);
         }
 
         UINT32 index;
@@ -374,7 +374,7 @@
                 this->AddRef();
                 return S_OK;
             }
-            *ppvObject = NULL;
+            *ppvObject = nullptr;
             return E_FAIL;
         }
 
@@ -395,7 +395,7 @@
         SkFontIdentity identity = { SkFontIdentity::kInvalidDataId };
 
         IDWriteFactory* dwFactory = sk_get_dwrite_factory();
-        if (NULL == dwFactory) {
+        if (nullptr == dwFactory) {
             return identity;
         }
 
@@ -404,10 +404,10 @@
         const DWriteStyle dwStyle(pattern);
 
         SkSMallocWCHAR dwFamilyName;
-        if (NULL == familyName) {
-            HR_GENERAL(getDefaultFontFamilyName(&dwFamilyName), NULL, identity);
+        if (nullptr == familyName) {
+            HR_GENERAL(getDefaultFontFamilyName(&dwFamilyName), nullptr, identity);
         } else {
-            HR_GENERAL(sk_cstring_to_wchar(familyName, &dwFamilyName), NULL, identity);
+            HR_GENERAL(sk_cstring_to_wchar(familyName, &dwFamilyName), nullptr, identity);
         }
 
         const SkSMallocWCHAR* dwBcp47;
@@ -416,7 +416,7 @@
             dwBcp47 = &fLocaleName;
         } else {
             //TODO: support fallback stack.
-            HR_GENERAL(sk_cstring_to_wchar(bcp47[bcp47Count-1], &dwBcp47Local), NULL, identity);
+            HR_GENERAL(sk_cstring_to_wchar(bcp47[bcp47Count-1], &dwBcp47Local), nullptr, identity);
             dwBcp47 = &dwBcp47Local;
         }
 
@@ -445,7 +445,7 @@
         SkTScopedComPtr<FontFallbackRenderer> fontFallbackRenderer(
             new FontFallbackRenderer(this, character));
 
-        HR_GENERAL(fallbackLayout->Draw(NULL, fontFallbackRenderer.get(), 50.0f, 50.0f),
+        HR_GENERAL(fallbackLayout->Draw(nullptr, fontFallbackRenderer.get(), 50.0f, 50.0f),
                    "Could not draw layout with renderer.",
                    identity);
 
@@ -455,7 +455,7 @@
     SkStreamAsset* getData(int dataId) const override {
         SkAutoMutexAcquire ama(fDataIdCacheMutex);
         if (dataId >= fDataIdCache.count()) {
-            return NULL;
+            return nullptr;
         }
         const DataId& id = fDataIdCache[dataId];
 
@@ -478,8 +478,8 @@
 
 SkRemotableFontMgr* SkRemotableFontMgr_New_DirectWrite() {
     IDWriteFactory* factory = sk_get_dwrite_factory();
-    if (NULL == factory) {
-        return NULL;
+    if (nullptr == factory) {
+        return nullptr;
     }
 
     SkTScopedComPtr<IDWriteFontCollection> sysFontCollection;
@@ -487,13 +487,13 @@
          "Could not get system font collection.");
 
     WCHAR localeNameStorage[LOCALE_NAME_MAX_LENGTH];
-    WCHAR* localeName = NULL;
+    WCHAR* localeName = nullptr;
     int localeNameLen = 0;
 
     // Dynamically load GetUserDefaultLocaleName function, as it is not available on XP.
-    SkGetUserDefaultLocaleNameProc getUserDefaultLocaleNameProc = NULL;
+    SkGetUserDefaultLocaleNameProc getUserDefaultLocaleNameProc = nullptr;
     HRESULT hr = SkGetGetUserDefaultLocaleNameProc(&getUserDefaultLocaleNameProc);
-    if (NULL == getUserDefaultLocaleNameProc) {
+    if (nullptr == getUserDefaultLocaleNameProc) {
         SK_TRACEHR(hr, "Could not get GetUserDefaultLocaleName.");
     } else {
         localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_NAME_MAX_LENGTH);
diff --git a/src/ports/SkScalerContext_win_dw.cpp b/src/ports/SkScalerContext_win_dw.cpp
index 7bfa1d4..e259479 100644
--- a/src/ports/SkScalerContext_win_dw.cpp
+++ b/src/ports/SkScalerContext_win_dw.cpp
@@ -467,7 +467,7 @@
 }
 
 void SkScalerContext_DW::generateFontMetrics(SkPaint::FontMetrics* metrics) {
-    if (NULL == metrics) {
+    if (nullptr == metrics) {
         return;
     }
 
@@ -734,8 +734,8 @@
     //It may not be needed, it appears that DirectWrite only hints at em size.
     HRVM(fTypeface->fDWriteFontFace->GetGlyphRunOutline(SkScalarToFloat(fTextSizeRender),
                                        &glyphId,
-                                       NULL, //advances
-                                       NULL, //offsets
+                                       nullptr, //advances
+                                       nullptr, //offsets
                                        1, //num glyphs
                                        FALSE, //sideways
                                        FALSE, //rtl
diff --git a/src/ports/SkTLS_none.cpp b/src/ports/SkTLS_none.cpp
index 95f6e37..d655560 100644
--- a/src/ports/SkTLS_none.cpp
+++ b/src/ports/SkTLS_none.cpp
@@ -7,7 +7,7 @@
 
 #include "SkTLS.h"
 
-static void* gSpecific = NULL;
+static void* gSpecific = nullptr;
 
 void* SkTLS::PlatformGetSpecific(bool) {
     return gSpecific;
diff --git a/src/ports/SkTLS_pthread.cpp b/src/ports/SkTLS_pthread.cpp
index 4264890..ac558a8 100644
--- a/src/ports/SkTLS_pthread.cpp
+++ b/src/ports/SkTLS_pthread.cpp
@@ -18,7 +18,7 @@
 
 void* SkTLS::PlatformGetSpecific(bool forceCreateTheSlot) {
     // should we use forceCreateTheSlot to potentially skip calling pthread_once
-    // and just return NULL if we've never been called with
+    // and just return nullptr if we've never been called with
     // forceCreateTheSlot==true ?
 
     (void)pthread_once(&gSkTLSKey_Once, sk_tls_make_key);
diff --git a/src/ports/SkTLS_win.cpp b/src/ports/SkTLS_win.cpp
index c6f3dfc..cdfb465 100644
--- a/src/ports/SkTLS_win.cpp
+++ b/src/ports/SkTLS_win.cpp
@@ -14,7 +14,7 @@
 
 void* SkTLS::PlatformGetSpecific(bool forceCreateTheSlot) {
     if (!forceCreateTheSlot && !gOnce) {
-        return NULL;
+        return nullptr;
     }
 
     if (!gOnce) {
@@ -49,9 +49,9 @@
 void NTAPI onTLSCallback(PVOID unused, DWORD reason, PVOID unused2) {
     if ((DLL_THREAD_DETACH == reason || DLL_PROCESS_DETACH == reason) && gOnce) {
         void* ptr = TlsGetValue(gTlsIndex);
-        if (ptr != NULL) {
+        if (ptr != nullptr) {
             SkTLS::Destructor(ptr);
-            TlsSetValue(gTlsIndex, NULL);
+            TlsSetValue(gTlsIndex, nullptr);
         }
     }
 }
diff --git a/src/ports/SkTime_Unix.cpp b/src/ports/SkTime_Unix.cpp
index 84f1a4e..ec96bb8 100644
--- a/src/ports/SkTime_Unix.cpp
+++ b/src/ports/SkTime_Unix.cpp
@@ -38,6 +38,6 @@
 SkMSec SkTime::GetMSecs()
 {
     struct timeval tv;
-    gettimeofday(&tv, NULL);
+    gettimeofday(&tv, nullptr);
     return (SkMSec) (tv.tv_sec * 1000 + tv.tv_usec / 1000 ); // microseconds to milliseconds
 }
diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp
index 3af4cca..144d4c7 100644
--- a/src/ports/SkTypeface_win_dw.cpp
+++ b/src/ports/SkTypeface_win_dw.cpp
@@ -30,7 +30,7 @@
     SkTScopedComPtr<IDWriteLocalizedStrings> familyNames;
     HRV(fDWriteFontFamily->GetFamilyNames(&familyNames));
 
-    sk_get_locale_string(familyNames.get(), NULL/*fMgr->fLocaleName.get()*/, familyName);
+    sk_get_locale_string(familyNames.get(), nullptr/*fMgr->fLocaleName.get()*/, familyName);
 }
 
 void DWriteFontTypeface::onGetFontDescriptor(SkFontDescriptor* desc,
@@ -40,7 +40,7 @@
     HRV(fDWriteFontFamily->GetFamilyNames(&familyNames));
 
     SkString utf8FamilyName;
-    sk_get_locale_string(familyNames.get(), NULL/*fMgr->fLocaleName.get()*/, &utf8FamilyName);
+    sk_get_locale_string(familyNames.get(), nullptr/*fMgr->fLocaleName.get()*/, &utf8FamilyName);
 
     desc->setFamilyName(utf8FamilyName.c_str());
     *isLocalStream = SkToBool(fDWriteFontFileLoader.get());
@@ -74,7 +74,7 @@
 int DWriteFontTypeface::onCharsToGlyphs(const void* chars, Encoding encoding,
                                         uint16_t glyphs[], int glyphCount) const
 {
-    if (NULL == glyphs) {
+    if (nullptr == glyphs) {
         EncodingProc next_ucs4_proc = find_encoding_proc(encoding);
         for (int i = 0; i < glyphCount; ++i) {
             const SkUnichar c = next_ucs4_proc(&chars);
@@ -172,7 +172,7 @@
 SkTypeface::LocalizedStrings* DWriteFontTypeface::onCreateFamilyNameIterator() const {
     SkTypeface::LocalizedStrings* nameIter =
         SkOTUtils::LocalizedStrings_NameTable::CreateForFamilyNames(*this);
-    if (NULL == nameIter) {
+    if (nullptr == nameIter) {
         SkTScopedComPtr<IDWriteLocalizedStrings> familyNames;
         HRNM(fDWriteFontFamily->GetFamilyNames(&familyNames), "Could not obtain family names.");
         nameIter = new LocalizedStrings_IDWriteLocalizedStrings(familyNames.release());
@@ -217,10 +217,10 @@
     *ttcIndex = fDWriteFontFace->GetIndex();
 
     UINT32 numFiles;
-    HRNM(fDWriteFontFace->GetFiles(&numFiles, NULL),
+    HRNM(fDWriteFontFace->GetFiles(&numFiles, nullptr),
          "Could not get number of font files.");
     if (numFiles != 1) {
-        return NULL;
+        return nullptr;
     }
 
     SkTScopedComPtr<IDWriteFontFile> fontFile;
@@ -265,7 +265,7 @@
 
 #if SK_FONT_HOST_USE_SYSTEM_SETTINGS
     IDWriteFactory* factory = get_dwrite_factory();
-    if (factory != NULL) {
+    if (factory != nullptr) {
         SkTScopedComPtr<IDWriteRenderingParams> defaultRenderingParams;
         if (SUCCEEDED(factory->CreateRenderingParams(&defaultRenderingParams))) {
             float gamma = defaultRenderingParams->GetGamma();
@@ -332,7 +332,7 @@
         const uint32_t* glyphIDs,
         uint32_t glyphIDsCount) const {
 
-    SkAdvancedTypefaceMetrics* info = NULL;
+    SkAdvancedTypefaceMetrics* info = nullptr;
 
     HRESULT hr = S_OK;
 
diff --git a/src/ports/SkTypeface_win_dw.h b/src/ports/SkTypeface_win_dw.h
index 866e634..3d6fce0 100644
--- a/src/ports/SkTypeface_win_dw.h
+++ b/src/ports/SkTypeface_win_dw.h
@@ -41,8 +41,8 @@
                        IDWriteFontFace* fontFace,
                        IDWriteFont* font,
                        IDWriteFontFamily* fontFamily,
-                       IDWriteFontFileLoader* fontFileLoader = NULL,
-                       IDWriteFontCollectionLoader* fontCollectionLoader = NULL)
+                       IDWriteFontFileLoader* fontFileLoader = nullptr,
+                       IDWriteFontCollectionLoader* fontCollectionLoader = nullptr)
         : SkTypeface(style, fontID, false)
         , fFactory(SkRefComPtr(factory))
         , fDWriteFontCollectionLoader(SkSafeRefComPtr(fontCollectionLoader))
@@ -53,9 +53,9 @@
     {
 #if SK_HAS_DWRITE_1_H
         if (!SUCCEEDED(fDWriteFontFace->QueryInterface(&fDWriteFontFace1))) {
-            // IUnknown::QueryInterface states that if it fails, punk will be set to NULL.
+            // IUnknown::QueryInterface states that if it fails, punk will be set to nullptr.
             // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/26/96777.aspx
-            SK_ALWAYSBREAK(NULL == fDWriteFontFace1.get());
+            SK_ALWAYSBREAK(nullptr == fDWriteFontFace1.get());
         }
 #endif
     }
@@ -75,8 +75,8 @@
                                       IDWriteFontFace* fontFace,
                                       IDWriteFont* font,
                                       IDWriteFontFamily* fontFamily,
-                                      IDWriteFontFileLoader* fontFileLoader = NULL,
-                                      IDWriteFontCollectionLoader* fontCollectionLoader = NULL) {
+                                      IDWriteFontFileLoader* fontFileLoader = nullptr,
+                                      IDWriteFontCollectionLoader* fontCollectionLoader = nullptr) {
         SkFontID fontID = SkTypefaceCache::NewFontID();
         return new DWriteFontTypeface(get_style(font), fontID, factory, fontFace, font, fontFamily,
                                       fontFileLoader, fontCollectionLoader);
diff --git a/src/sfnt/SkOTTable_name.cpp b/src/sfnt/SkOTTable_name.cpp
index 897b235..4e26759 100644
--- a/src/sfnt/SkOTTable_name.cpp
+++ b/src/sfnt/SkOTTable_name.cpp
@@ -31,7 +31,7 @@
 }
 
 static void SkStringFromUTF16BE(const uint16_t* utf16be, size_t length, SkString& utf8) {
-    SkASSERT(utf16be != NULL);
+    SkASSERT(utf16be != nullptr);
 
     utf8.reset();
     size_t numberOf16BitValues = length / 2;
diff --git a/src/sfnt/SkOTUtils.cpp b/src/sfnt/SkOTUtils.cpp
index fb82182..52d996f 100644
--- a/src/sfnt/SkOTUtils.cpp
+++ b/src/sfnt/SkOTUtils.cpp
@@ -38,7 +38,7 @@
     // Get the sfnt header.
     SkSFNTHeader sfntHeader;
     if (fontData->read(&sfntHeader, sizeof(sfntHeader)) < sizeof(sfntHeader)) {
-        return NULL;
+        return nullptr;
     }
 
     // Find the existing 'name' table.
@@ -47,18 +47,18 @@
     int numTables = SkEndian_SwapBE16(sfntHeader.numTables);
     for (tableIndex = 0; tableIndex < numTables; ++tableIndex) {
         if (fontData->read(&tableEntry, sizeof(tableEntry)) < sizeof(tableEntry)) {
-            return NULL;
+            return nullptr;
         }
         if (SkOTTableName::TAG == tableEntry.tag) {
             break;
         }
     }
     if (tableIndex == numTables) {
-        return NULL;
+        return nullptr;
     }
 
     if (!fontData->rewind()) {
-        return NULL;
+        return nullptr;
     }
 
     // The required 'name' record types: Family, Style, Unique, Full and PostScript.
@@ -87,19 +87,19 @@
     SK_OT_BYTE* data = static_cast<SK_OT_BYTE*>(rewrittenFontData->writable_data());
 
     if (fontData->read(data, oldNameTableOffset) < oldNameTableOffset) {
-        return NULL;
+        return nullptr;
     }
     if (fontData->skip(oldNameTablePhysicalSize) < oldNameTablePhysicalSize) {
-        return NULL;
+        return nullptr;
     }
     if (fontData->read(data + oldNameTableOffset, originalDataSize - oldNameTableOffset) < originalDataSize - oldNameTableOffset) {
-        return NULL;
+        return nullptr;
     }
 
     //Fix up the offsets of the directory entries after the old 'name' table entry.
     SkSFNTHeader::TableDirectoryEntry* currentEntry = reinterpret_cast<SkSFNTHeader::TableDirectoryEntry*>(data + sizeof(SkSFNTHeader));
     SkSFNTHeader::TableDirectoryEntry* endEntry = currentEntry + numTables;
-    SkSFNTHeader::TableDirectoryEntry* headTableEntry = NULL;
+    SkSFNTHeader::TableDirectoryEntry* headTableEntry = nullptr;
     for (; currentEntry < endEntry; ++currentEntry) {
         uint32_t oldOffset = SkEndian_SwapBE32(currentEntry->offset);
         if (oldOffset > oldNameTableOffset) {
@@ -166,12 +166,12 @@
     static const SkFontTableTag nameTag = SkSetFourByteTag('n','a','m','e');
     size_t nameTableSize = typeface.getTableSize(nameTag);
     if (0 == nameTableSize) {
-        return NULL;
+        return nullptr;
     }
     SkAutoTDeleteArray<uint8_t> nameTableData(new uint8_t[nameTableSize]);
     size_t copied = typeface.getTableData(nameTag, 0, nameTableSize, nameTableData.get());
     if (copied != nameTableSize) {
-        return NULL;
+        return nullptr;
     }
 
     return new SkOTUtils::LocalizedStrings_NameTable((SkOTTableName*)nameTableData.detach(),
diff --git a/src/sfnt/SkOTUtils.h b/src/sfnt/SkOTUtils.h
index e1db048..1773e69 100644
--- a/src/sfnt/SkOTUtils.h
+++ b/src/sfnt/SkOTUtils.h
@@ -23,7 +23,7 @@
 
     /**
       *  Renames an sfnt font. On failure (invalid data or not an sfnt font)
-      *  returns NULL.
+      *  returns nullptr.
       *
       *  Essentially, this removes any existing 'name' table and replaces it
       *  with a new one in which FontFamilyName, FontSubfamilyName,
@@ -50,7 +50,7 @@
         { }
 
         /** Creates an iterator over all the family names in the 'name' table of a typeface.
-         *  If no valid 'name' table can be found, returns NULL.
+         *  If no valid 'name' table can be found, returns nullptr.
          */
         static LocalizedStrings_NameTable* CreateForFamilyNames(const SkTypeface& typeface);
 
diff --git a/src/svg/SkSVGDevice.cpp b/src/svg/SkSVGDevice.cpp
index a3f8af7..4c679df 100644
--- a/src/svg/SkSVGDevice.cpp
+++ b/src/svg/SkSVGDevice.cpp
@@ -38,7 +38,7 @@
 
 // Keep in sync with SkPaint::Cap
 static const char* cap_map[]  = {
-    NULL,    // kButt_Cap (default)
+    nullptr,    // kButt_Cap (default)
     "round", // kRound_Cap
     "square" // kSquare_Cap
 };
@@ -51,7 +51,7 @@
 
 // Keep in sync with SkPaint::Join
 static const char* join_map[] = {
-    NULL,    // kMiter_Join (default)
+    nullptr,    // kMiter_Join (default)
     "round", // kRound_Join
     "bevel"  // kBevel_Join
 };
@@ -64,7 +64,7 @@
 
 // Keep in sync with SkPaint::Align
 static const char* text_align_map[] = {
-    NULL,     // kLeft_Align (default)
+    nullptr,     // kLeft_Align (default)
     "middle", // kCenter_Align
     "end"     // kRight_Align
 };
@@ -115,7 +115,7 @@
 class SVGTextBuilder : SkNoncopyable {
 public:
     SVGTextBuilder(const void* text, size_t byteLen, const SkPaint& paint, const SkPoint& offset,
-                   unsigned scalarsPerPos, const SkScalar pos[] = NULL)
+                   unsigned scalarsPerPos, const SkScalar pos[] = nullptr)
         : fOffset(offset)
         , fScalarsPerPos(scalarsPerPos)
         , fPos(pos)
@@ -277,7 +277,7 @@
 public:
     AutoElement(const char name[], SkXMLWriter* writer)
         : fWriter(writer)
-        , fResourceBucket(NULL) {
+        , fResourceBucket(nullptr) {
         fWriter->startElement(name);
     }
 
@@ -563,7 +563,7 @@
 
 SkBaseDevice* SkSVGDevice::Create(const SkISize& size, SkXMLWriter* writer) {
     if (!writer) {
-        return NULL;
+        return nullptr;
     }
 
     return new SkSVGDevice(size, writer);
@@ -670,7 +670,7 @@
         return;
     }
 
-    size_t b64Size = SkBase64::Encode(pngData->data(), pngData->size(), NULL);
+    size_t b64Size = SkBase64::Encode(pngData->data(), pngData->size(), nullptr);
     SkAutoTMalloc<char> b64Data(b64Size);
     SkBase64::Encode(pngData->data(), pngData->size(), b64Data.get());
 
diff --git a/src/svg/SkSVGDevice.h b/src/svg/SkSVGDevice.h
index 31e231d..8426ad5 100644
--- a/src/svg/SkSVGDevice.h
+++ b/src/svg/SkSVGDevice.h
@@ -27,7 +27,7 @@
     void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& paint) override;
     void drawPath(const SkDraw&, const SkPath& path,
                   const SkPaint& paint,
-                  const SkMatrix* prePathMatrix = NULL,
+                  const SkMatrix* prePathMatrix = nullptr,
                   bool pathIsMutable = false) override;
 
     void drawBitmap(const SkDraw&, const SkBitmap& bitmap,
diff --git a/src/svg/parser/SkSVGClipPath.cpp b/src/svg/parser/SkSVGClipPath.cpp
index fa3a799..86dc2df 100644
--- a/src/svg/parser/SkSVGClipPath.cpp
+++ b/src/svg/parser/SkSVGClipPath.cpp
@@ -28,7 +28,7 @@
     SkSVGElement* child = *fChildren.begin();
     SkASSERT(child->getType() == SkSVGType_Use);
     SkSVGUse* use = (SkSVGUse*) child;
-    SkSVGElement* ref = NULL;
+    SkSVGElement* ref = nullptr;
     const char* refStr = &use->f_xlink_href.c_str()[1];
     SkASSERT(parser.getIDs().find(refStr, &ref));
     SkASSERT(ref);
diff --git a/src/svg/parser/SkSVGElements.cpp b/src/svg/parser/SkSVGElements.cpp
index a1bd100..dc8ec94 100644
--- a/src/svg/parser/SkSVGElements.cpp
+++ b/src/svg/parser/SkSVGElements.cpp
@@ -21,14 +21,14 @@
 }
 
 
-SkSVGElement::SkSVGElement() : fParent(NULL), fIsDef(false), fIsNotDef(true) {
+SkSVGElement::SkSVGElement() : fParent(nullptr), fIsDef(false), fIsNotDef(true) {
 }
 
 SkSVGElement::~SkSVGElement() {
 }
 
 SkSVGElement* SkSVGElement::getGradient() {
-    return NULL;
+    return nullptr;
 }
 
 bool SkSVGElement::isGroupParent() {
diff --git a/src/svg/parser/SkSVGGradient.cpp b/src/svg/parser/SkSVGGradient.cpp
index bbcca18..0f7c6ba 100644
--- a/src/svg/parser/SkSVGGradient.cpp
+++ b/src/svg/parser/SkSVGGradient.cpp
@@ -33,7 +33,7 @@
     bool addedFirst = false;
     bool addedLast = false;
     SkString offsets("[");
-    SkString* lastOffset = NULL;
+    SkString* lastOffset = nullptr;
     for (SkSVGElement** ptr = fChildren.begin(); ptr < fChildren.end(); ptr++) {
         SkASSERT((*ptr)->getType() == SkSVGType_Stop);
         SkSVGStop* stop = (SkSVGStop*) *ptr;
diff --git a/src/svg/parser/SkSVGGroup.cpp b/src/svg/parser/SkSVGGroup.cpp
index 420179d..cbd8c4e 100644
--- a/src/svg/parser/SkSVGGroup.cpp
+++ b/src/svg/parser/SkSVGGroup.cpp
@@ -17,10 +17,10 @@
 SkSVGElement* SkSVGGroup::getGradient() {
     for (SkSVGElement** ptr = fChildren.begin(); ptr < fChildren.end(); ptr++) {
         SkSVGElement* result = (*ptr)->getGradient();
-        if (result != NULL)
+        if (result != nullptr)
             return result;
     }
-    return NULL;
+    return nullptr;
 }
 
 bool SkSVGGroup::isDef() {
diff --git a/src/svg/parser/SkSVGPaintState.cpp b/src/svg/parser/SkSVGPaintState.cpp
index 5db624d..df8ba28 100644
--- a/src/svg/parser/SkSVGPaintState.cpp
+++ b/src/svg/parser/SkSVGPaintState.cpp
@@ -38,7 +38,7 @@
 
 const int SkSVGPaint::kAttributesSize = SK_ARRAY_COUNT(SkSVGPaint::gAttributes);
 
-SkSVGPaint::SkSVGPaint() : fNext(NULL) {
+SkSVGPaint::SkSVGPaint() : fNext(nullptr) {
 }
 
 SkString* SkSVGPaint::operator[](int index) {
@@ -81,7 +81,7 @@
             const char* attrEnd = attrValue + attrLength;
             do {
                 const char* end = strchr(attrValue, ';');
-                if (end == NULL)
+                if (end == nullptr)
                     end = attrEnd;
                 const char* delimiter = strchr(attrValue, ':');
                 SkASSERT(delimiter != 0 && delimiter < end);
@@ -102,7 +102,7 @@
     SkSVGPaint current;
     SkSVGPaint* walking = parser.fHead;
     int index;
-    while (walking != NULL) {
+    while (walking != nullptr) {
         for (index = kInitial + 1; index < kTerminal; index++) {
             SkString* lastAttr = (*walking)[index];
             if (lastAttr->size() == 0)
@@ -195,7 +195,7 @@
     int index;
     SkMatrix sum;
     sum.reset();
-    while (walking != NULL) {
+    while (walking != nullptr) {
         for (index = kInitial + 1; index < kTerminal; index++) {
             SkString* lastAttr = (*walking)[index];
             if (lastAttr->size() == 0)
@@ -205,7 +205,7 @@
                 SkASSERT(strncmp(str, "matrix(", 7) == 0);
                 str += 6;
                 const char* strEnd = strrchr(str, ')');
-                SkASSERT(strEnd != NULL);
+                SkASSERT(strEnd != nullptr);
                 SkString mat(str, strEnd - str);
                 SkSVGParser::ConvertToArray(mat);
                 SkScalar values[6];
diff --git a/src/svg/parser/SkSVGParser.cpp b/src/svg/parser/SkSVGParser.cpp
index 74ea023..854716b 100644
--- a/src/svg/parser/SkSVGParser.cpp
+++ b/src/svg/parser/SkSVGParser.cpp
@@ -38,14 +38,14 @@
 SkSVGParser::SkSVGParser(SkXMLParserError* errHandler) :
     SkXMLParser(errHandler),
     fHead(&fEmptyPaint), fIDs(256),
-        fXMLWriter(&fStream), fCurrElement(NULL), fInSVG(false), fSuppressPaint(false) {
+        fXMLWriter(&fStream), fCurrElement(nullptr), fInSVG(false), fSuppressPaint(false) {
     fLastTransform.reset();
     fEmptyPaint.f_fill.set("black");
     fEmptyPaint.f_stroke.set("none");
     fEmptyPaint.f_strokeMiterlimit.set("4");
     fEmptyPaint.f_fillRule.set("winding");
     fEmptyPaint.f_opacity.set("1");
-    fEmptyPaint.fNext = NULL;
+    fEmptyPaint.fNext = nullptr;
     for (int index = SkSVGPaint::kInitial + 1; index < SkSVGPaint::kTerminal; index++) {
         SkString* initial = fEmptyPaint[index];
         if (initial->size() == 0)
@@ -129,7 +129,7 @@
     bool fill = false;
     bool strokeSet = false;
     bool fillSet = false;
-    while (walking != NULL) {
+    while (walking != nullptr) {
         if (strokeSet == false && walking->f_stroke.size() > 0) {
             stroke = walking->f_stroke.equals("none") == false;
             *strokeState = walking;
@@ -150,7 +150,7 @@
 }
 
 bool SkSVGParser::onAddAttributeLen(const char name[], const char value[], size_t len) {
-    if (fCurrElement == NULL)    // this signals we should ignore attributes for this element
+    if (fCurrElement == nullptr)    // this signals we should ignore attributes for this element
         return true;
     if (fCurrElement->fIsDef == false && fCurrElement->fIsNotDef == false)
         return false; // also an ignored element
@@ -202,7 +202,7 @@
         type = SkSVGType_G;
 //        return true;
     }
-    SkSVGElement* parent = fParents.count() > 0 ? fParents.top() : NULL;
+    SkSVGElement* parent = fParents.count() > 0 ? fParents.top() : nullptr;
     SkSVGElement* element = CreateElement(type, parent);
     bool result = false;
     if (parent) {
@@ -237,7 +237,7 @@
         (element->fIsDef == false && isDef && element->fIsNotDef)) {
         isFlushable = false;
     }
-    SkSVGPaint* strokeState = NULL, * fillState = NULL;
+    SkSVGPaint* strokeState = nullptr, * fillState = nullptr;
     if (isFlushable)
         element->fPaintState.setSave(*this);
     if (isFlushable && isStrokeAndFill(&strokeState, &fillState)) {
@@ -288,7 +288,7 @@
     SkASSERT(strncmp(str, "matrix(", 7) == 0);
     str += 6;
     const char* strEnd = strrchr(str, ')');
-    SkASSERT(strEnd != NULL);
+    SkASSERT(strEnd != nullptr);
     SkString mat(str, strEnd - str);
     ConvertToArray(mat);
     const char* elems[6];
@@ -305,7 +305,7 @@
     string.reset();
     for (int index = 0; index < 6; index++) {
         const char* end = strchr(elems[index], ',');
-        if (end == NULL)
+        if (end == nullptr)
             end= strchr(elems[index], ']');
         string.append(elems[index], end - elems[index] + 1);
     }
@@ -356,7 +356,7 @@
 #define CASE_NEW(type) case SkSVGType_##type : created = new SkSVG##type(); break
 
 SkSVGElement* SkSVGParser::CreateElement(SkSVGTypes type, SkSVGElement* parent) {
-    SkSVGElement* created = NULL;
+    SkSVGElement* created = nullptr;
     switch (type) {
         CASE_NEW(Circle);
         CASE_NEW(ClipPath);
@@ -383,7 +383,7 @@
         CASE_NEW(Use);
         default:
             SkASSERT(0);
-            return NULL;
+            return nullptr;
     }
     created->fParent = parent;
     bool isDef = created->fIsDef = created->isDef();
diff --git a/src/svg/parser/SkSVGPath.cpp b/src/svg/parser/SkSVGPath.cpp
index ab18a65..c9917c7 100644
--- a/src/svg/parser/SkSVGPath.cpp
+++ b/src/svg/parser/SkSVGPath.cpp
@@ -21,7 +21,7 @@
     INHERITED::translate(parser, defState);
     bool hasMultiplePaths = false;
     const char* firstZ = strchr(f_d.c_str(), 'z');
-    if (firstZ != NULL) {
+    if (firstZ != nullptr) {
         firstZ++; // skip over 'z'
         while (*firstZ == ' ')
             firstZ++;
diff --git a/src/utils/SkBase64.cpp b/src/utils/SkBase64.cpp
index 545a8eb..4c3078f 100644
--- a/src/utils/SkBase64.cpp
+++ b/src/utils/SkBase64.cpp
@@ -26,7 +26,7 @@
     41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
 };
 
-SkBase64::SkBase64() : fLength((size_t) -1), fData(NULL) {
+SkBase64::SkBase64() : fLength((size_t) -1), fData(nullptr) {
 }
 
 #if defined _WIN32 && _MSC_VER >= 1300  // disable 'two', etc. may be used without having been initialized
@@ -111,7 +111,7 @@
 
 size_t SkBase64::Encode(const void* srcPtr, size_t length, void* dstPtr, const char* encodeMap) {
     const char* encode;
-    if (NULL == encodeMap) {
+    if (nullptr == encodeMap) {
         encode = default_encode;
     } else {
         encode = encodeMap;
diff --git a/src/utils/SkBase64.h b/src/utils/SkBase64.h
index ba66dd2..13350b7 100644
--- a/src/utils/SkBase64.h
+++ b/src/utils/SkBase64.h
@@ -26,7 +26,7 @@
        encode[64] will be used as the pad character. Encodings other than the
        default encoding cannot be decoded.
     */
-    static size_t Encode(const void* src, size_t length, void* dest, const char* encode = NULL);
+    static size_t Encode(const void* src, size_t length, void* dest, const char* encode = nullptr);
 
 private:
     Error decode(const void* srcPtr, size_t length, bool writeDestination);
diff --git a/src/utils/SkBitSet.cpp b/src/utils/SkBitSet.cpp
index 63d18ff..3ace15d 100755
--- a/src/utils/SkBitSet.cpp
+++ b/src/utils/SkBitSet.cpp
@@ -10,7 +10,7 @@
 #include "SkBitSet.h"
 
 SkBitSet::SkBitSet(int numberOfBits)
-    : fBitData(NULL), fDwordCount(0), fBitCount(numberOfBits) {
+    : fBitData(nullptr), fDwordCount(0), fBitCount(numberOfBits) {
     SkASSERT(numberOfBits > 0);
     // Round up size to 32-bit boundary.
     fDwordCount = (numberOfBits + 31) / 32;
@@ -18,7 +18,7 @@
 }
 
 SkBitSet::SkBitSet(const SkBitSet& source)
-    : fBitData(NULL), fDwordCount(0), fBitCount(0) {
+    : fBitData(nullptr), fDwordCount(0), fBitCount(0) {
     *this = source;
 }
 
@@ -36,7 +36,7 @@
 
 bool SkBitSet::operator==(const SkBitSet& rhs) {
     if (fBitCount == rhs.fBitCount) {
-        if (fBitData.get() != NULL) {
+        if (fBitData.get() != nullptr) {
             return (memcmp(fBitData.get(), rhs.fBitData.get(),
                            fDwordCount * sizeof(uint32_t)) == 0);
         }
@@ -50,7 +50,7 @@
 }
 
 void SkBitSet::clearAll() {
-    if (fBitData.get() != NULL) {
+    if (fBitData.get() != nullptr) {
         sk_bzero(fBitData.get(), fDwordCount * sizeof(uint32_t));
     }
 }
diff --git a/src/utils/SkBoundaryPatch.cpp b/src/utils/SkBoundaryPatch.cpp
index e5fcc40..7ef11ee 100644
--- a/src/utils/SkBoundaryPatch.cpp
+++ b/src/utils/SkBoundaryPatch.cpp
@@ -7,7 +7,7 @@
  */
 #include "SkBoundaryPatch.h"
 
-SkBoundaryPatch::SkBoundaryPatch() : fBoundary(NULL) {}
+SkBoundaryPatch::SkBoundaryPatch() : fBoundary(nullptr) {}
 
 SkBoundaryPatch::~SkBoundaryPatch() {
     SkSafeUnref(fBoundary);
@@ -74,6 +74,6 @@
     fPts[12] = fPts[0];
 
     SkPoint loc;
-    SkEvalCubicAt(&fPts[e * 3], t, &loc, NULL, NULL);
+    SkEvalCubicAt(&fPts[e * 3], t, &loc, nullptr, nullptr);
     return loc;
 }
diff --git a/src/utils/SkCamera.cpp b/src/utils/SkCamera.cpp
index c7389ce..c8c462a 100644
--- a/src/utils/SkCamera.cpp
+++ b/src/utils/SkCamera.cpp
@@ -74,7 +74,7 @@
 }
 
 void SkPatch3D::transform(const SkMatrix3D& m, SkPatch3D* dst) const {
-    if (dst == NULL) {
+    if (dst == nullptr) {
         dst = (SkPatch3D*)this;
     }
     m.mapVector(fU, &dst->fU);
@@ -356,7 +356,7 @@
 }
 
 void Sk3DView::getMatrix(SkMatrix* matrix) const {
-    if (matrix != NULL) {
+    if (matrix != nullptr) {
         SkPatch3D   patch;
         patch.transform(fRec->fMatrix);
         fCamera.patchToMatrix(patch, matrix);
diff --git a/src/utils/SkCanvasStateUtils.cpp b/src/utils/SkCanvasStateUtils.cpp
index 8ab853d..8b7a10a 100644
--- a/src/utils/SkCanvasStateUtils.cpp
+++ b/src/utils/SkCanvasStateUtils.cpp
@@ -104,9 +104,9 @@
     : INHERITED(kVersion, canvas)
     {
         layerCount = 0;
-        layers = NULL;
+        layers = nullptr;
         mcState.clipRectCount = 0;
-        mcState.clipRects = NULL;
+        mcState.clipRects = nullptr;
         originalCanvas = SkRef(canvas);
     }
 
@@ -203,7 +203,7 @@
     if (validator.failed()) {
         SkErrorInternals::SetError(kInvalidOperation_SkError,
                 "CaptureCanvasState does not support canvases with antialiased clips.\n");
-        return NULL;
+        return nullptr;
     }
 
     SkAutoTDelete<SkCanvasState_v1> canvasState(new SkCanvasState_v1(canvas));
@@ -226,7 +226,7 @@
         // we currently only work for bitmap backed devices
         SkPixmap pmap;
         if (!layer.device()->accessPixels(&pmap) || 0 == pmap.width() || 0 == pmap.height()) {
-            return NULL;
+            return nullptr;
         }
 
         SkCanvasLayerState* layerState =
@@ -245,7 +245,7 @@
                 layerState->raster.config = kRGB_565_RasterConfig;
                 break;
             default:
-                return NULL;
+                return nullptr;
         }
         layerState->raster.rowBytes = pmap.rowBytes();
         layerState->raster.pixels = pmap.writable_addr();
@@ -301,7 +301,7 @@
         kUnknown_SkColorType;
 
     if (colorType == kUnknown_SkColorType) {
-        return NULL;
+        return nullptr;
     }
 
     bitmap.installPixels(SkImageInfo::Make(layerState.width, layerState.height,
@@ -327,7 +327,7 @@
     const SkCanvasState_v1* state_v1 = static_cast<const SkCanvasState_v1*>(state);
 
     if (state_v1->layerCount < 1) {
-        return NULL;
+        return nullptr;
     }
 
     SkAutoTUnref<SkCanvasStack> canvas(new SkCanvasStack(state->width, state->height));
@@ -339,7 +339,7 @@
     for (int i = state_v1->layerCount - 1; i >= 0; --i) {
         SkAutoTUnref<SkCanvas> canvasLayer(create_canvas_from_canvas_layer(state_v1->layers[i]));
         if (!canvasLayer.get()) {
-            return NULL;
+            return nullptr;
         }
         canvas->pushCanvas(canvasLayer.get(), SkIPoint::Make(state_v1->layers[i].x,
                                                              state_v1->layers[i].y));
diff --git a/src/utils/SkCullPoints.cpp b/src/utils/SkCullPoints.cpp
index 76e63c7..f77acf1 100644
--- a/src/utils/SkCullPoints.cpp
+++ b/src/utils/SkCullPoints.cpp
@@ -76,7 +76,7 @@
 }
 
 SkCullPoints::LineToResult SkCullPoints::lineTo(int x, int y, SkIPoint line[]) {
-    SkASSERT(line != NULL);
+    SkASSERT(line != nullptr);
 
     LineToResult result = kNo_Result;
     int x0 = fPrevPt.fX;
@@ -107,7 +107,7 @@
 #include "SkPath.h"
 
 SkCullPointsPath::SkCullPointsPath()
-    : fCP(), fPath(NULL) {
+    : fCP(), fPath(nullptr) {
 }
 
 SkCullPointsPath::SkCullPointsPath(const SkIRect& r, SkPath* dst)
diff --git a/src/utils/SkDashPath.cpp b/src/utils/SkDashPath.cpp
index de249f6..c177295 100644
--- a/src/utils/SkDashPath.cpp
+++ b/src/utils/SkDashPath.cpp
@@ -92,7 +92,7 @@
 static bool cull_path(const SkPath& srcPath, const SkStrokeRec& rec,
                       const SkRect* cullRect, SkScalar intervalLength,
                       SkPath* dstPath) {
-    if (NULL == cullRect) {
+    if (nullptr == cullRect) {
         return false;
     }
 
diff --git a/src/utils/SkDashPathPriv.h b/src/utils/SkDashPathPriv.h
index 94222a2..7453dce 100644
--- a/src/utils/SkDashPathPriv.h
+++ b/src/utils/SkDashPathPriv.h
@@ -15,11 +15,11 @@
      * Calculates the initialDashLength, initialDashIndex, and intervalLength based on the
      * inputed phase and intervals. If adjustedPhase is passed in, then the phase will be
      * adjusted to be between 0 and intervalLength. The result will be stored in adjustedPhase.
-     * If adjustedPhase is NULL then it is assumed phase is already between 0 and intervalLength
+     * If adjustedPhase is nullptr then it is assumed phase is already between 0 and intervalLength
      */
     void CalcDashParameters(SkScalar phase, const SkScalar intervals[], int32_t count,
                             SkScalar* initialDashLength, int32_t* initialDashIndex,
-                            SkScalar* intervalLength, SkScalar* adjustedPhase = NULL);
+                            SkScalar* intervalLength, SkScalar* adjustedPhase = nullptr);
 
     bool FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*,
                         const SkScalar aIntervals[], int32_t count, SkScalar initialDashLength,
diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp
index e8997ab..8d0209d 100644
--- a/src/utils/SkDumpCanvas.cpp
+++ b/src/utils/SkDumpCanvas.cpp
@@ -195,7 +195,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 void SkDumpCanvas::willSave() {
-    this->dump(kSave_Verb, NULL, "save()");
+    this->dump(kSave_Verb, nullptr, "save()");
     this->INHERITED::willSave();
 }
 
@@ -220,7 +220,7 @@
 }
 
 void SkDumpCanvas::willRestore() {
-    this->dump(kRestore_Verb, NULL, "restore");
+    this->dump(kRestore_Verb, nullptr, "restore");
     this->INHERITED::willRestore();
 }
 
@@ -229,18 +229,18 @@
 
     switch (matrix.getType()) {
         case SkMatrix::kTranslate_Mask:
-            this->dump(kMatrix_Verb, NULL, "translate(%g %g)",
+            this->dump(kMatrix_Verb, nullptr, "translate(%g %g)",
                        SkScalarToFloat(matrix.getTranslateX()),
                        SkScalarToFloat(matrix.getTranslateY()));
             break;
         case SkMatrix::kScale_Mask:
-            this->dump(kMatrix_Verb, NULL, "scale(%g %g)",
+            this->dump(kMatrix_Verb, nullptr, "scale(%g %g)",
                        SkScalarToFloat(matrix.getScaleX()),
                        SkScalarToFloat(matrix.getScaleY()));
             break;
         default:
             matrix.toString(&str);
-            this->dump(kMatrix_Verb, NULL, "concat(%s)", str.c_str());
+            this->dump(kMatrix_Verb, nullptr, "concat(%s)", str.c_str());
             break;
     }
 
@@ -250,7 +250,7 @@
 void SkDumpCanvas::didSetMatrix(const SkMatrix& matrix) {
     SkString str;
     matrix.toString(&str);
-    this->dump(kMatrix_Verb, NULL, "setMatrix(%s)", str.c_str());
+    this->dump(kMatrix_Verb, nullptr, "setMatrix(%s)", str.c_str());
     this->INHERITED::didSetMatrix(matrix);
 }
 
@@ -263,7 +263,7 @@
 void SkDumpCanvas::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
     SkString str;
     toString(rect, &str);
-    this->dump(kClip_Verb, NULL, "clipRect(%s %s %s)", str.c_str(), toString(op),
+    this->dump(kClip_Verb, nullptr, "clipRect(%s %s %s)", str.c_str(), toString(op),
                EdgeStyleToAAString(edgeStyle));
     this->INHERITED::onClipRect(rect, op, edgeStyle);
 }
@@ -271,7 +271,7 @@
 void SkDumpCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
     SkString str;
     toString(rrect, &str);
-    this->dump(kClip_Verb, NULL, "clipRRect(%s %s %s)", str.c_str(), toString(op),
+    this->dump(kClip_Verb, nullptr, "clipRRect(%s %s %s)", str.c_str(), toString(op),
                EdgeStyleToAAString(edgeStyle));
     this->INHERITED::onClipRRect(rrect, op, edgeStyle);
 }
@@ -279,7 +279,7 @@
 void SkDumpCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
     SkString str;
     toString(path, &str);
-    this->dump(kClip_Verb, NULL, "clipPath(%s %s %s)", str.c_str(), toString(op),
+    this->dump(kClip_Verb, nullptr, "clipPath(%s %s %s)", str.c_str(), toString(op),
                EdgeStyleToAAString(edgeStyle));
     this->INHERITED::onClipPath(path, op, edgeStyle);
 }
@@ -287,7 +287,7 @@
 void SkDumpCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
     SkString str;
     toString(deviceRgn, &str);
-    this->dump(kClip_Verb, NULL, "clipRegion(%s %s)", str.c_str(),
+    this->dump(kClip_Verb, nullptr, "clipRegion(%s %s)", str.c_str(),
                toString(op));
     this->INHERITED::onClipRegion(deviceRgn, op);
 }
@@ -448,13 +448,13 @@
 
 void SkDumpCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix,
                                  const SkPaint* paint) {
-    this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %f:%f:%f:%f", picture,
+    this->dump(kDrawPicture_Verb, nullptr, "drawPicture(%p) %f:%f:%f:%f", picture,
                picture->cullRect().fLeft, picture->cullRect().fTop,
                picture->cullRect().fRight, picture->cullRect().fBottom);
     fNestLevel += 1;
     this->INHERITED::onDrawPicture(picture, matrix, paint);
     fNestLevel -= 1;
-    this->dump(kDrawPicture_Verb, NULL, "endPicture(%p) %f:%f:%f:%f", &picture,
+    this->dump(kDrawPicture_Verb, nullptr, "endPicture(%p) %f:%f:%f:%f", &picture,
                picture->cullRect().fLeft, picture->cullRect().fTop,
                picture->cullRect().fRight, picture->cullRect().fBottom);
 }
@@ -552,6 +552,6 @@
     SkDebugf("%s\n", text);
 }
 
-SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {}
+SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {}
 
 #endif
diff --git a/src/utils/SkFrontBufferedStream.cpp b/src/utils/SkFrontBufferedStream.cpp
index 08364d1..0955cfa 100644
--- a/src/utils/SkFrontBufferedStream.cpp
+++ b/src/utils/SkFrontBufferedStream.cpp
@@ -30,7 +30,7 @@
 
     size_t getLength() const override { return fLength; }
 
-    SkStreamRewindable* duplicate() const override { return NULL; }
+    SkStreamRewindable* duplicate() const override { return nullptr; }
 
 private:
     SkAutoTDelete<SkStream> fStream;
@@ -44,21 +44,21 @@
     // Total size of the buffer.
     const size_t            fBufferSize;
     // FIXME: SkAutoTMalloc throws on failure. Instead, Create should return a
-    // NULL stream.
+    // nullptr stream.
     SkAutoTMalloc<char>     fBuffer;
 
     // Read up to size bytes from already buffered data, and copy to
-    // dst, if non-NULL. Updates fOffset. Assumes that fOffset is less
+    // dst, if non-nullptr. Updates fOffset. Assumes that fOffset is less
     // than fBufferedSoFar.
     size_t readFromBuffer(char* dst, size_t size);
 
     // Buffer up to size bytes from the stream, and copy to dst if non-
-    // NULL. Updates fOffset and fBufferedSoFar. Assumes that fOffset is
+    // nullptr. Updates fOffset and fBufferedSoFar. Assumes that fOffset is
     // less than fBufferedSoFar, and size is greater than 0.
     size_t bufferAndWriteTo(char* dst, size_t size);
 
     // Read up to size bytes directly from the stream and into dst if non-
-    // NULL. Updates fOffset. Assumes fOffset is at or beyond the buffered
+    // nullptr. Updates fOffset. Assumes fOffset is at or beyond the buffered
     // data, and size is greater than 0.
     size_t readDirectlyFromStream(char* dst, size_t size);
 
@@ -66,8 +66,8 @@
 };
 
 SkStreamRewindable* SkFrontBufferedStream::Create(SkStream* stream, size_t bufferSize) {
-    if (NULL == stream) {
-        return NULL;
+    if (nullptr == stream) {
+        return nullptr;
     }
     return new FrontBufferedStream(stream, bufferSize);
 }
@@ -106,7 +106,7 @@
     // lesser of the size requested and the remainder of the buffered
     // data.
     const size_t bytesToCopy = SkTMin(size, fBufferedSoFar - fOffset);
-    if (dst != NULL) {
+    if (dst != nullptr) {
         memcpy(dst, fBuffer + fOffset, bytesToCopy);
     }
 
@@ -133,7 +133,7 @@
     SkASSERT(fBufferedSoFar <= fBufferSize);
 
     // Copy the buffer to the destination buffer and update the amount read.
-    if (dst != NULL) {
+    if (dst != nullptr) {
         memcpy(dst, buffer, buffered);
     }
 
@@ -185,7 +185,7 @@
         // and the destination buffer.
         size -= bytesCopied;
         SkASSERT(size + (fOffset - start) == totalSize);
-        if (dst != NULL) {
+        if (dst != nullptr) {
             dst += bytesCopied;
         }
     }
@@ -199,7 +199,7 @@
         // and the destination buffer.
         size -= buffered;
         SkASSERT(size + (fOffset - start) == totalSize);
-        if (dst != NULL) {
+        if (dst != nullptr) {
             dst += buffered;
         }
     }
diff --git a/src/utils/SkInterpolator.cpp b/src/utils/SkInterpolator.cpp
index 03e7e4a..cd9ad3a 100644
--- a/src/utils/SkInterpolator.cpp
+++ b/src/utils/SkInterpolator.cpp
@@ -12,9 +12,9 @@
 #include "SkTSearch.h"
 
 SkInterpolatorBase::SkInterpolatorBase() {
-    fStorage    = NULL;
-    fTimes      = NULL;
-    SkDEBUGCODE(fTimesArray = NULL;)
+    fStorage    = nullptr;
+    fTimes      = nullptr;
+    SkDEBUGCODE(fTimesArray = nullptr;)
 }
 
 SkInterpolatorBase::~SkInterpolatorBase() {
@@ -30,9 +30,9 @@
     fRepeat = SK_Scalar1;
     if (fStorage) {
         sk_free(fStorage);
-        fStorage = NULL;
-        fTimes = NULL;
-        SkDEBUGCODE(fTimesArray = NULL);
+        fStorage = nullptr;
+        fTimes = nullptr;
+        SkDEBUGCODE(fTimesArray = nullptr);
     }
 }
 
@@ -129,8 +129,8 @@
 
 SkInterpolator::SkInterpolator() {
     INHERITED::reset(0, 0);
-    fValues = NULL;
-    SkDEBUGCODE(fScalarsArray = NULL;)
+    fValues = nullptr;
+    SkDEBUGCODE(fScalarsArray = nullptr;)
 }
 
 SkInterpolator::SkInterpolator(int elemCount, int frameCount) {
@@ -159,9 +159,9 @@
 
 bool SkInterpolator::setKeyFrame(int index, SkMSec time,
                             const SkScalar values[], const SkScalar blend[4]) {
-    SkASSERT(values != NULL);
+    SkASSERT(values != nullptr);
 
-    if (blend == NULL) {
+    if (blend == nullptr) {
         blend = gIdentityBlend;
     }
 
diff --git a/src/utils/SkLayer.cpp b/src/utils/SkLayer.cpp
index 525917f..39032b6 100644
--- a/src/utils/SkLayer.cpp
+++ b/src/utils/SkLayer.cpp
@@ -18,7 +18,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SkLayer::SkLayer() {
-    fParent = NULL;
+    fParent = nullptr;
     m_opacity = SK_Scalar1;
     m_size.set(0, 0);
     m_position.set(0, 0);
@@ -35,7 +35,7 @@
 }
 
 SkLayer::SkLayer(const SkLayer& src) : INHERITED() {
-    fParent = NULL;
+    fParent = nullptr;
     m_opacity = src.m_opacity;
     m_size = src.m_size;
     m_position = src.m_position;
@@ -93,14 +93,14 @@
         SkASSERT(m_children[index]->fParent == this);
         return m_children[index];
     }
-    return NULL;
+    return nullptr;
 }
 
 SkLayer* SkLayer::addChild(SkLayer* child) {
     SkASSERT(this != child);
     child->ref();
     child->detachFromParent();
-    SkASSERT(child->fParent == NULL);
+    SkASSERT(child->fParent == nullptr);
     child->fParent = this;
 
     *m_children.append() = child;
@@ -112,7 +112,7 @@
         int index = fParent->m_children.find(this);
         SkASSERT(index >= 0);
         fParent->m_children.remove(index);
-        fParent = NULL;
+        fParent = nullptr;
         this->unref();  // this call might delete us
     }
 }
@@ -122,7 +122,7 @@
     for (int i = 0; i < count; i++) {
         SkLayer* child = m_children[i];
         SkASSERT(child->fParent == this);
-        child->fParent = NULL;  // in case it has more than one owner
+        child->fParent = nullptr;  // in case it has more than one owner
         child->unref();
     }
     m_children.reset();
@@ -130,7 +130,7 @@
 
 SkLayer* SkLayer::getRootLayer() const {
     const SkLayer* root = this;
-    while (root->fParent != NULL) {
+    while (root->fParent != nullptr) {
         root = root->fParent;
     }
     return const_cast<SkLayer*>(root);
@@ -157,7 +157,7 @@
     }
 
     const SkLayer* layer = this;
-    while (layer->fParent != NULL) {
+    while (layer->fParent != nullptr) {
         layer = layer->fParent;
 
         SkMatrix tmp;
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index e5d4c2b..307e5f6 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -502,13 +502,13 @@
             return paint;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 static int lcanvas_drawImage(lua_State* L) {
     SkCanvas* canvas = get_ref<SkCanvas>(L, 1);
     SkImage* image = get_ref<SkImage>(L, 2);
-    if (NULL == image) {
+    if (nullptr == image) {
         return 0;
     }
     SkScalar x = lua2scalar(L, 3);
@@ -522,12 +522,12 @@
 static int lcanvas_drawImageRect(lua_State* L) {
     SkCanvas* canvas = get_ref<SkCanvas>(L, 1);
     SkImage* image = get_ref<SkImage>(L, 2);
-    if (NULL == image) {
+    if (nullptr == image) {
         return 0;
     }
 
     SkRect srcR, dstR;
-    SkRect* srcRPtr = NULL;
+    SkRect* srcRPtr = nullptr;
     if (!lua_isnil(L, 3)) {
         srcRPtr = lua2rect(L, 3, &srcR);
     }
@@ -543,8 +543,8 @@
     SkColor colorStorage[4];
     SkPoint texStorage[4];
 
-    const SkColor* colors = NULL;
-    const SkPoint* texs = NULL;
+    const SkColor* colors = nullptr;
+    const SkPoint* texs = nullptr;
 
     getarray_points(L, 2, cubics, 12);
 
@@ -560,7 +560,7 @@
         texs = texStorage;
     }
 
-    get_ref<SkCanvas>(L, 1)->drawPatch(cubics, colors, texs, NULL, *get_obj<SkPaint>(L, 5));
+    get_ref<SkCanvas>(L, 1)->drawPatch(cubics, colors, texs, nullptr, *get_obj<SkPaint>(L, 5));
     return 0;
 }
 
@@ -576,7 +576,7 @@
     SkPicture* picture = get_ref<SkPicture>(L, 2);
     SkScalar x = lua2scalar_def(L, 3, 0);
     SkScalar y = lua2scalar_def(L, 4, 0);
-    SkMatrix matrix, *matrixPtr = NULL;
+    SkMatrix matrix, *matrixPtr = nullptr;
     if (x || y) {
         matrix.setTranslate(x, y);
         matrixPtr = &matrix;
@@ -646,7 +646,7 @@
                                    &genID,
                                    &initialState,
                                    &resultBounds,
-                                   NULL);
+                                   nullptr);
 
     GrReducedClip::ElementList::Iter iter(elements);
     int i = 0;
@@ -671,7 +671,7 @@
 
 static int lcanvas_saveLayer(lua_State* L) {
     SkPaint paint;
-    lua_pushinteger(L, get_ref<SkCanvas>(L, 1)->saveLayer(NULL, lua2OptionalPaint(L, 2, &paint)));
+    lua_pushinteger(L, get_ref<SkCanvas>(L, 1)->saveLayer(nullptr, lua2OptionalPaint(L, 2, &paint)));
     return 1;
 }
 
@@ -710,7 +710,7 @@
     int height = lua2int_def(L, 3, 0);
     SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
     SkSurface* surface = get_ref<SkCanvas>(L, 1)->newSurface(info);
-    if (NULL == surface) {
+    if (nullptr == surface) {
         lua_pushnil(L);
     } else {
         push_ref(L, surface)->unref();
@@ -754,13 +754,13 @@
     { "newSurface", lcanvas_newSurface },
 
     { "__gc", lcanvas_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
 
 static int ldocument_beginPage(lua_State* L) {
-    const SkRect* contentPtr = NULL;
+    const SkRect* contentPtr = nullptr;
     push_ref(L, get_ref<SkDocument>(L, 1)->beginPage(lua2scalar(L, 2),
                                                      lua2scalar(L, 3),
                                                      contentPtr));
@@ -787,7 +787,7 @@
     { "endPage", ldocument_endPage },
     { "close", ldocument_close },
     { "__gc", ldocument_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1176,7 +1176,7 @@
     { "setShader", lpaint_setShader },
     { "getPathEffect", lpaint_getPathEffect },
     { "__gc", lpaint_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1260,7 +1260,7 @@
     { "isABitmap",      lshader_isABitmap },
     { "asAGradient",    lshader_asAGradient },
     { "__gc",           lshader_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1289,7 +1289,7 @@
 static const struct luaL_Reg gSkPathEffect_Methods[] = {
     { "asADash",        lpatheffect_asADash },
     { "__gc",           lpatheffect_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1301,7 +1301,7 @@
 
 static const struct luaL_Reg gSkImageFilter_Methods[] = {
     { "__gc",       lpimagefilter_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1390,7 +1390,7 @@
     { "setRectToRect", lmatrix_setRectToRect },
     { "invert", lmatrix_invert },
     { "mapXY", lmatrix_mapXY },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1568,7 +1568,7 @@
     { "cubicTo", lpath_cubicTo },
     { "close", lpath_close },
     { "__gc", lpath_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1620,7 +1620,7 @@
     { "type", lrrect_type },
     { "radii", lrrect_radii },
     { "__gc", lrrect_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1637,7 +1637,7 @@
 
 static int limage_newShader(lua_State* L) {
     SkShader::TileMode tmode = SkShader::kClamp_TileMode;
-    const SkMatrix* localM = NULL;
+    const SkMatrix* localM = nullptr;
     SkAutoTUnref<SkShader> shader(get_ref<SkImage>(L, 1)->newShader(tmode, tmode, localM));
     push_ref(L, shader.get());
     return 1;
@@ -1653,7 +1653,7 @@
     { "height", limage_height },
     { "newShader", limage_newShader },
     { "__gc", limage_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1670,7 +1670,7 @@
 
 static int lsurface_getCanvas(lua_State* L) {
     SkCanvas* canvas = get_ref<SkSurface>(L, 1)->getCanvas();
-    if (NULL == canvas) {
+    if (nullptr == canvas) {
         lua_pushnil(L);
     } else {
         push_ref(L, canvas);
@@ -1685,7 +1685,7 @@
 
 static int lsurface_newImageSnapshot(lua_State* L) {
     SkImage* image = get_ref<SkSurface>(L, 1)->newImageSnapshot();
-    if (NULL == image) {
+    if (nullptr == image) {
         lua_pushnil(L);
     } else {
         push_ref(L, image)->unref();
@@ -1698,7 +1698,7 @@
     int height = lua2int_def(L, 3, 0);
     SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
     SkSurface* surface = get_ref<SkSurface>(L, 1)->newSurface(info);
-    if (NULL == surface) {
+    if (nullptr == surface) {
         lua_pushnil(L);
     } else {
         push_ref(L, surface)->unref();
@@ -1718,7 +1718,7 @@
     { "newImageSnapshot", lsurface_newImageSnapshot },
     { "newSurface", lsurface_newSurface },
     { "__gc", lsurface_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1732,7 +1732,7 @@
     }
 
     SkCanvas* canvas = get_obj<SkPictureRecorder>(L, 1)->beginRecording(w, h);
-    if (NULL == canvas) {
+    if (nullptr == canvas) {
         lua_pushnil(L);
         return 1;
     }
@@ -1743,7 +1743,7 @@
 
 static int lpicturerecorder_getCanvas(lua_State* L) {
     SkCanvas* canvas = get_obj<SkPictureRecorder>(L, 1)->getRecordingCanvas();
-    if (NULL == canvas) {
+    if (nullptr == canvas) {
         lua_pushnil(L);
         return 1;
     }
@@ -1753,7 +1753,7 @@
 
 static int lpicturerecorder_endRecording(lua_State* L) {
     SkPicture* pic = get_obj<SkPictureRecorder>(L, 1)->endRecording();
-    if (NULL == pic) {
+    if (nullptr == pic) {
         lua_pushnil(L);
         return 1;
     }
@@ -1771,7 +1771,7 @@
     { "getCanvas", lpicturerecorder_getCanvas },
     { "endRecording", lpicturerecorder_endRecording },
     { "__gc", lpicturerecorder_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1795,7 +1795,7 @@
     { "width", lpicture_width },
     { "height", lpicture_height },
     { "__gc", lpicture_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1813,7 +1813,7 @@
 static const struct luaL_Reg gSkTextBlob_Methods[] = {
     { "bounds", ltextblob_bounds },
     { "__gc", ltextblob_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1839,7 +1839,7 @@
     { "getFamilyName", ltypeface_getFamilyName },
     { "getStyle", ltypeface_getStyle },
     { "__gc", ltypeface_gc },
-    { NULL, NULL }
+    { nullptr, nullptr }
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1873,13 +1873,13 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 static int lsk_newDocumentPDF(lua_State* L) {
-    const char* file = NULL;
+    const char* file = nullptr;
     if (lua_gettop(L) > 0 && lua_isstring(L, 1)) {
-        file = lua_tolstring(L, 1, NULL);
+        file = lua_tolstring(L, 1, nullptr);
     }
 
     SkDocument* doc = SkDocument::CreatePDF(file);
-    if (NULL == doc) {
+    if (nullptr == doc) {
         // do I need to push a nil on the stack and return 1?
         return 0;
     } else {
@@ -1892,7 +1892,7 @@
     SkScalar sigmaX = lua2scalar_def(L, 1, 0);
     SkScalar sigmaY = lua2scalar_def(L, 2, 0);
     SkImageFilter* imf = SkBlurImageFilter::Create(sigmaX, sigmaY);
-    if (NULL == imf) {
+    if (nullptr == imf) {
         lua_pushnil(L);
     } else {
         push_ref(L, imf)->unref();
@@ -1910,8 +1910,8 @@
 
     SkPoint pts[] = { { x0, y0 }, { x1, y1 } };
     SkColor colors[] = { c0, c1 };
-    SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode);
-    if (NULL == s) {
+    SkShader* s = SkGradientShader::CreateLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode);
+    if (nullptr == s) {
         lua_pushnil(L);
     } else {
         push_ref(L, s)->unref();
@@ -1947,7 +1947,7 @@
 #include "SkTextBox.h"
 // Sk.newTextBlob(text, rect, paint)
 static int lsk_newTextBlob(lua_State* L) {
-    const char* text = lua_tolstring(L, 1, NULL);
+    const char* text = lua_tolstring(L, 1, nullptr);
     SkRect bounds;
     lua2rect(L, 2, &bounds);
     const SkPaint& paint = *get_obj<SkPaint>(L, 3);
@@ -1965,21 +1965,21 @@
 }
 
 static int lsk_newTypeface(lua_State* L) {
-    const char* name = NULL;
+    const char* name = nullptr;
     int style = SkTypeface::kNormal;
 
     int count = lua_gettop(L);
     if (count > 0 && lua_isstring(L, 1)) {
-        name = lua_tolstring(L, 1, NULL);
+        name = lua_tolstring(L, 1, nullptr);
         if (count > 1 && lua_isnumber(L, 2)) {
-            style = lua_tointegerx(L, 2, NULL) & SkTypeface::kBoldItalic;
+            style = lua_tointegerx(L, 2, nullptr) & SkTypeface::kBoldItalic;
         }
     }
 
     SkTypeface* face = SkTypeface::CreateFromName(name,
                                                   (SkTypeface::Style)style);
 //    SkDebugf("---- name <%s> style=%d, face=%p ref=%d\n", name, style, face, face->getRefCnt());
-    if (NULL == face) {
+    if (nullptr == face) {
         face = SkTypeface::RefDefault();
     }
     push_ref(L, face)->unref();
@@ -1992,7 +1992,7 @@
     SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
     SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
     SkSurface* surface = SkSurface::NewRaster(info, &props);
-    if (NULL == surface) {
+    if (nullptr == surface) {
         lua_pushnil(L);
     } else {
         push_ref(L, surface)->unref();
@@ -2002,7 +2002,7 @@
 
 static int lsk_loadImage(lua_State* L) {
     if (lua_gettop(L) > 0 && lua_isstring(L, 1)) {
-        const char* name = lua_tolstring(L, 1, NULL);
+        const char* name = lua_tolstring(L, 1, nullptr);
         SkAutoDataUnref data(SkData::NewFromFileName(name));
         if (data.get()) {
             SkImage* image = SkImage::NewFromEncoded(data);
diff --git a/src/utils/SkMeshUtils.cpp b/src/utils/SkMeshUtils.cpp
index 3857dc9..cf4e509 100644
--- a/src/utils/SkMeshUtils.cpp
+++ b/src/utils/SkMeshUtils.cpp
@@ -21,15 +21,15 @@
                          int texW, int texH, int rows, int cols) {
     if (rows < 2 || cols < 2) {
         sk_free(fStorage);
-        fStorage = NULL;
-        fTex = NULL;
-        fIndices = NULL;
+        fStorage = nullptr;
+        fTex = nullptr;
+        fIndices = nullptr;
         fTexCount = fIndexCount = 0;
         return false;
     }
 
     sk_free(fStorage);
-    fStorage = NULL;
+    fStorage = nullptr;
 
     fTexCount = rows * cols;
     rows -= 1;
@@ -96,7 +96,7 @@
                                          SkShader::kClamp_TileMode,
                                          SkShader::kClamp_TileMode))->unref();
         canvas->drawVertices(SkCanvas::kTriangles_VertexMode,
-                             rows * cols, verts, idx.tex(), colors, NULL,
+                             rows * cols, verts, idx.tex(), colors, nullptr,
                              idx.indices(), idx.indexCount(), p);
     }
 }
diff --git a/src/utils/SkNinePatch.cpp b/src/utils/SkNinePatch.cpp
index 4a5308b..5ee488e 100644
--- a/src/utils/SkNinePatch.cpp
+++ b/src/utils/SkNinePatch.cpp
@@ -196,8 +196,8 @@
 
     mesh.fVerts = verts;
     mesh.fTexs = texs;
-    mesh.fColors = NULL;
-    mesh.fIndices = NULL;
+    mesh.fColors = nullptr;
+    mesh.fIndices = nullptr;
 
     // we use <= for YDivs, since the prebuild indices work for 3x2 and 3x1 too
     if (numXDivs == 2 && numYDivs <= 2) {
@@ -245,7 +245,7 @@
     }
     p.setShader(shader)->unref();
     canvas->drawVertices(SkCanvas::kTriangles_VertexMode, vCount,
-                         mesh.fVerts, mesh.fTexs, mesh.fColors, NULL,
+                         mesh.fVerts, mesh.fTexs, mesh.fColors, nullptr,
                          mesh.fIndices, indexCount, p);
 }
 
diff --git a/src/utils/SkOSFile.cpp b/src/utils/SkOSFile.cpp
index cb12c2b..a0c003b 100644
--- a/src/utils/SkOSFile.cpp
+++ b/src/utils/SkOSFile.cpp
@@ -20,7 +20,7 @@
         return SkString();
     }
     const char* filename = strrchr(fullPath, SkPATH_SEPARATOR);
-    if (NULL == filename) {
+    if (nullptr == filename) {
         filename = fullPath;
     } else {
         ++filename;
@@ -33,7 +33,7 @@
         return SkString();
     }
     const char* end = strrchr(fullPath, SkPATH_SEPARATOR);
-    if (NULL == end) {
+    if (nullptr == end) {
         return SkString();
     }
     if (end == fullPath) {
diff --git a/src/utils/SkParse.cpp b/src/utils/SkParse.cpp
index 446f9d4..b5a108e 100644
--- a/src/utils/SkParse.cpp
+++ b/src/utils/SkParse.cpp
@@ -112,7 +112,7 @@
     str = skip_ws(str);
 
     if (!is_hex(*str))
-        return NULL;
+        return nullptr;
 
     uint32_t n = 0;
     int max_digits = 8;
@@ -121,7 +121,7 @@
     while ((digit = to_hex(*str)) >= 0)
     {
         if (--max_digits < 0)
-            return NULL;
+            return nullptr;
         n = (n << 4) | digit;
         str += 1;
     }
@@ -132,7 +132,7 @@
             *value = n;
         return str;
     }
-    return NULL;
+    return nullptr;
 }
 
 const char* SkParse::FindS32(const char str[], int32_t* value)
@@ -148,7 +148,7 @@
     }
 
     if (!is_digit(*str))
-        return NULL;
+        return nullptr;
 
     int n = 0;
     while (is_digit(*str))
@@ -174,7 +174,7 @@
     }
 
     if (!is_digit(*str))
-        return NULL;
+        return nullptr;
 
     int n = 0;
     while (is_digit(*str))
@@ -207,7 +207,7 @@
     char* stop;
     float v = (float)strtod(str, &stop);
     if (str == stop) {
-        return NULL;
+        return nullptr;
     }
     if (value) {
         *value = v;
@@ -224,7 +224,7 @@
         for (;;)
         {
             str = SkParse::FindScalar(str, value);
-            if (--count == 0 || str == NULL)
+            if (--count == 0 || str == nullptr)
                 break;
 
             // keep going
@@ -272,14 +272,14 @@
         const char* end = strchr(list, ',');
         size_t      entryLen;
 
-        if (end == NULL) // last entry
+        if (end == nullptr) // last entry
             entryLen = strlen(list);
         else
             entryLen = end - list;
 
         if (entryLen == len && memcmp(target, list, len) == 0)
             return index;
-        if (end == NULL)
+        if (end == nullptr)
             break;
 
         list = end + 1; // skip the ','
diff --git a/src/utils/SkParseColor.cpp b/src/utils/SkParseColor.cpp
index 989a609..329b304 100644
--- a/src/utils/SkParseColor.cpp
+++ b/src/utils/SkParseColor.cpp
@@ -423,11 +423,11 @@
             while ((int) gColorNames[lo] >= 0)
                 ++lo;
         } else if (hi == mid)
-            return NULL;
+            return nullptr;
         else
             hi = mid;
     }
-    return NULL;
+    return nullptr;
 }
 
 // !!! move to char utilities
@@ -435,12 +435,12 @@
 //  char c;
 //  int separators = 0;
 //  while ((c = *str++) != '\0') {
-//      if (strchr(sep, c) == NULL)
+//      if (strchr(sep, c) == nullptr)
 //          continue;
 //      do {
 //          if ((c = *str++) == '\0')
 //              goto goHome;
-//      } while (strchr(sep, c) != NULL);
+//      } while (strchr(sep, c) != nullptr);
 //      separators++;
 //  }
 //goHome:
@@ -459,7 +459,7 @@
         uint32_t    hex;
         const char* end = SkParse::FindHex(value + 1, &hex);
 //      SkASSERT(end);
-        if (end == NULL)
+        if (end == nullptr)
             return end;
         size_t len = end - value - 1;
         if (len == 3 || len == 4) {
@@ -476,7 +476,7 @@
             return end;
         } else {
 //          SkASSERT(0);
-            return NULL;
+            return nullptr;
         }
 //  } else if (strchr(value, ',')) {
 //      SkScalar array[4];
@@ -484,8 +484,8 @@
 //      SkASSERT(count == 3 || count == 4);
 //      array[0] = SK_Scalar1 * 255;
 //      const char* end = SkParse::FindScalars(value, &array[4 - count], count);
-//      if (end == NULL)
-//          return NULL;
+//      if (end == nullptr)
+//          return nullptr;
         // !!! range check for errors?
 //      *colorPtr = SkColorSetARGB(SkScalarRoundToInt(array[0]), SkScalarRoundToInt(array[1]),
 //          SkScalarRoundToInt(array[2]), SkScalarRoundToInt(array[3]));
@@ -503,7 +503,7 @@
     for (index = 0; index < colorNamesSize; index++) {
         result = SK_ColorBLACK;
         SkNameRGB nameRGB = colorNames[index];
-        SkASSERT(FindColor(nameRGB.name, &result) != NULL);
+        SkASSERT(FindColor(nameRGB.name, &result) != nullptr);
         SkASSERT(result == (SkColor) (nameRGB.rgb | 0xFF000000));
     }
     for (index = 0; index < colorNamesSize; index++) {
@@ -513,9 +513,9 @@
         size_t len = strlen(nameRGB.name);
         memcpy(bad, nameRGB.name, len);
         bad[len - 1] -= 1;
-        SkASSERT(FindColor(bad, &result) == NULL);
+        SkASSERT(FindColor(bad, &result) == nullptr);
         bad[len - 1] += 2;
-        SkASSERT(FindColor(bad, &result) == NULL);
+        SkASSERT(FindColor(bad, &result) == nullptr);
     }
     result = SK_ColorBLACK;
     SkASSERT(FindColor("lightGrey", &result));
diff --git a/src/utils/SkParsePath.cpp b/src/utils/SkParsePath.cpp
index 94c3112..3fecb46 100644
--- a/src/utils/SkParsePath.cpp
+++ b/src/utils/SkParsePath.cpp
@@ -167,7 +167,7 @@
                 break;
             case '~': {
                 SkPoint args[2];
-                data = find_points(data, args, 2, false, NULL);
+                data = find_points(data, args, 2, false, nullptr);
                 path.moveTo(args[0].fX, args[0].fY);
                 path.lineTo(args[1].fX, args[1].fY);
             } break;
diff --git a/src/utils/SkPatchGrid.cpp b/src/utils/SkPatchGrid.cpp
index 386e3a6..b7aaa82 100644
--- a/src/utils/SkPatchGrid.cpp
+++ b/src/utils/SkPatchGrid.cpp
@@ -12,12 +12,12 @@
     : fRows(0)
     , fCols(0)
     , fModeFlags(kNone_VertexType)
-    , fCornerPts(NULL)
-    , fCornerColors(NULL)
-    , fTexCoords(NULL)
-    , fHrzCtrlPts(NULL)
-    , fVrtCtrlPts(NULL)
-    , fXferMode(NULL) {
+    , fCornerPts(nullptr)
+    , fCornerColors(nullptr)
+    , fTexCoords(nullptr)
+    , fHrzCtrlPts(nullptr)
+    , fVrtCtrlPts(nullptr)
+    , fXferMode(nullptr) {
         this->reset(rows, cols, flags, xfer);
 }
 
@@ -33,7 +33,7 @@
                            const SkPoint texCoords[4]) {
     // Check for the passed paramaters to be within the range of the grid dimensions and a valid
     // pointer for the cubics' control points.
-    if (x < 0 || y < 0 || x > fCols - 1 || y > fRows - 1 || NULL == cubics) {
+    if (x < 0 || y < 0 || x > fCols - 1 || y > fRows - 1 || nullptr == cubics) {
         return false;
     }
     
@@ -79,7 +79,7 @@
 bool SkPatchGrid::getPatch(int x, int y, SkPoint cubics[12], SkColor colors[4],
                            SkPoint texCoords[4]) const {
     
-    if (x < 0 || y < 0 || x > fCols - 1 || y > fRows - 1 || NULL == cubics) {
+    if (x < 0 || y < 0 || x > fCols - 1 || y > fRows - 1 || nullptr == cubics) {
         return false;
     }
     
@@ -159,7 +159,7 @@
     for (int y = 0; y < fRows; y++) {
         for (int x = 0; x < fCols; x++) {
             SkPoint cubics[12];
-            this->getPatch(x, y, cubics, NULL, NULL);
+            this->getPatch(x, y, cubics, nullptr, nullptr);
             SkMatrix matrix = canvas->getTotalMatrix();
             SkISize lod = SkPatchUtils::GetLevelOfDetail(cubics, &matrix);
             maxCols[x] = SkMax32(maxCols[x], lod.width());
@@ -175,8 +175,8 @@
             this->getPatch(x, y, cubics, colors, texCoords);
             SkPatchUtils::VertexData data;
             if (SkPatchUtils::getVertexData(&data, cubics,
-                                            fModeFlags & kColors_VertexType ? colors : NULL,
-                                            fModeFlags & kTexs_VertexType ? texCoords : NULL,
+                                            fModeFlags & kColors_VertexType ? colors : nullptr,
+                                            fModeFlags & kTexs_VertexType ? texCoords : nullptr,
                                             maxCols[x], maxRows[y])) {
                 canvas->drawVertices(SkCanvas::kTriangles_VertexMode, data.fVertexCount,
                                      data.fPoints, data.fTexCoords, data.fColors, fXferMode,
diff --git a/src/utils/SkPatchGrid.h b/src/utils/SkPatchGrid.h
index cf90098..5bc2e65 100644
--- a/src/utils/SkPatchGrid.h
+++ b/src/utils/SkPatchGrid.h
@@ -88,7 +88,7 @@
     };
     
     SkPatchGrid(int rows = 0, int cols = 0, VertexType flags = kNone_VertexType,
-                SkXfermode* xfer = NULL);
+                SkXfermode* xfer = nullptr);
     
     ~SkPatchGrid();
     
@@ -103,9 +103,9 @@
                   const SkPoint texCoords[4]);
     
     /**
-     * Get patch at location (x,y). If cubics, colors or texCoords is not NULL it sets patch's
+     * Get patch at location (x,y). If cubics, colors or texCoords is not nullptr it sets patch's
      * array with its corresponding values.
-     * The function returns false if the cubics parameter is NULL or if the (x,y) coordinates are 
+     * The function returns false if the cubics parameter is nullptr or if the (x,y) coordinates are 
      * not within the range of the grid.
      */
     bool getPatch(int x, int y, SkPoint cubics[12], SkColor colors[4], SkPoint texCoords[4]) const;
diff --git a/src/utils/SkPatchUtils.cpp b/src/utils/SkPatchUtils.cpp
index e9ff906..ad846f7 100644
--- a/src/utils/SkPatchUtils.cpp
+++ b/src/utils/SkPatchUtils.cpp
@@ -191,7 +191,7 @@
 
 bool SkPatchUtils::getVertexData(SkPatchUtils::VertexData* data, const SkPoint cubics[12],
                    const SkColor colors[4], const SkPoint texCoords[4], int lodX, int lodY) {
-    if (lodX < 1 || lodY < 1 || NULL == cubics || NULL == data) {
+    if (lodX < 1 || lodY < 1 || nullptr == cubics || nullptr == data) {
         return false;
     }
 
diff --git a/src/utils/SkPatchUtils.h b/src/utils/SkPatchUtils.h
index 3560421..7c231f1 100644
--- a/src/utils/SkPatchUtils.h
+++ b/src/utils/SkPatchUtils.h
@@ -29,10 +29,10 @@
         VertexData()
         : fVertexCount(0)
         , fIndexCount(0)
-        , fPoints(NULL)
-        , fTexCoords(NULL)
-        , fColors(NULL)
-        , fIndices(NULL) { }
+        , fPoints(nullptr)
+        , fTexCoords(nullptr)
+        , fColors(nullptr)
+        , fIndices(nullptr) { }
         
         ~VertexData() {
             delete[] fPoints;
diff --git a/src/utils/SkRTConf.cpp b/src/utils/SkRTConf.cpp
index f441bf1..9c076cb 100644
--- a/src/utils/SkRTConf.cpp
+++ b/src/utils/SkRTConf.cpp
@@ -41,7 +41,7 @@
             continue;
         }
 
-        char *valptr = strtok(NULL, sep);
+        char *valptr = strtok(nullptr, sep);
         if (!valptr) {
             continue;
         }
@@ -240,7 +240,7 @@
 }
 
 template<typename T> bool SkRTConfRegistry::parse(const char *name, T* value) {
-    const char *str = NULL;
+    const char *str = nullptr;
 
     for (int i = fConfigFileKeys.count() - 1 ; i >= 0; i--) {
         if (fConfigFileKeys[i]->equals(name)) {
@@ -301,7 +301,7 @@
         }
         return;
     }
-    SkASSERT(confArray != NULL);
+    SkASSERT(confArray != nullptr);
     for (SkRTConfBase **confBase = confArray->begin(); confBase != confArray->end(); confBase++) {
         // static_cast here is okay because there's only one kind of child class.
         SkRTConf<T> *concrete = static_cast<SkRTConf<T> *>(*confBase);
diff --git a/src/utils/SkTextBox.cpp b/src/utils/SkTextBox.cpp
index af05cad..ba6ef53 100644
--- a/src/utils/SkTextBox.cpp
+++ b/src/utils/SkTextBox.cpp
@@ -15,7 +15,7 @@
 
 static size_t linebreak(const char text[], const char stop[],
                         const SkPaint& paint, SkScalar margin,
-                        size_t* trailing = NULL)
+                        size_t* trailing = nullptr)
 {
     size_t lengthBreak = paint.breakText(text, stop - text, margin);
 
diff --git a/src/utils/SkTextureCompressor.cpp b/src/utils/SkTextureCompressor.cpp
index c256a61..e308f6e 100644
--- a/src/utils/SkTextureCompressor.cpp
+++ b/src/utils/SkTextureCompressor.cpp
@@ -35,7 +35,7 @@
 namespace SkTextureCompressor {
 
 void GetBlockDimensions(Format format, int* dimX, int* dimY, bool matchSpec) {
-    if (NULL == dimX || NULL == dimY) {
+    if (nullptr == dimX || nullptr == dimY) {
         return;
     }
 
@@ -147,7 +147,7 @@
 SkData* CompressBitmapToFormat(const SkPixmap& pixmap, Format format) {
     int compressedDataSize = GetCompressedDataSize(format, pixmap.width(), pixmap.height());
     if (compressedDataSize < 0) {
-        return NULL;
+        return nullptr;
     }
 
     const uint8_t* src = reinterpret_cast<const uint8_t*>(pixmap.addr());
@@ -156,7 +156,7 @@
     if (!CompressBufferToFormat((uint8_t*)dst->writable_data(), src, pixmap.colorType(),
                                 pixmap.width(), pixmap.height(), pixmap.rowBytes(), format)) {
         dst->unref();
-        dst = NULL;
+        dst = nullptr;
     }
     return dst;
 }
@@ -174,10 +174,10 @@
             return CreateASTCBlitter(width, height, compressedBuffer, allocator);
 
         default:
-            return NULL;
+            return nullptr;
     }
 
-    return NULL;
+    return nullptr;
 }
 
 bool DecompressBufferFromFormat(uint8_t* dst, int dstRowBytes, const uint8_t* src,
diff --git a/src/utils/SkTextureCompressor.h b/src/utils/SkTextureCompressor.h
index f002cde..d4d4896 100644
--- a/src/utils/SkTextureCompressor.h
+++ b/src/utils/SkTextureCompressor.h
@@ -56,7 +56,7 @@
 
     // Returns an SkData holding a blob of compressed data that corresponds
     // to the pixmap. If the pixmap colorType cannot be compressed using the
-    // associated format, then we return NULL. The caller is responsible for
+    // associated format, then we return nullptr. The caller is responsible for
     // calling unref() on the returned data.
     SkData* CompressBitmapToFormat(const SkPixmap&, Format format);
 
diff --git a/src/utils/SkTextureCompressor_ASTC.cpp b/src/utils/SkTextureCompressor_ASTC.cpp
index 7969359..a6e91d6 100644
--- a/src/utils/SkTextureCompressor_ASTC.cpp
+++ b/src/utils/SkTextureCompressor_ASTC.cpp
@@ -1175,7 +1175,7 @@
     // in the maximum encoding that will fit the number of color values that
     // we need. Returns false on error. (See section C.2.22 of the spec)
     bool getColorValueEncoding(int *nBits, int *nTrits, int *nQuints) const {
-        if (NULL == nBits || NULL == nTrits || NULL == nQuints) {
+        if (nullptr == nBits || nullptr == nTrits || nullptr == nQuints) {
             return false;
         }
 
@@ -2057,7 +2057,7 @@
 SkBlitter* CreateASTCBlitter(int width, int height, void* outputBuffer,
                              SkTBlitterAllocator* allocator) {
     if ((width % 12) != 0 || (height % 12) != 0) {
-        return NULL;
+        return nullptr;
     }
 
     // Memset the output buffer to an encoding that decodes to zero. We must do this
diff --git a/src/utils/SkTextureCompressor_Blitter.h b/src/utils/SkTextureCompressor_Blitter.h
index e522375..0c259d6 100644
--- a/src/utils/SkTextureCompressor_Blitter.h
+++ b/src/utils/SkTextureCompressor_Blitter.h
@@ -366,10 +366,10 @@
     }
 
     // If the blitter just sets a single value for each pixel, return the
-    // bitmap it draws into, and assign value. If not, return NULL and ignore
+    // bitmap it draws into, and assign value. If not, return nullptr and ignore
     // the value parameter.
     const SkPixmap* justAnOpaqueColor(uint32_t* value) override {
-        return NULL;
+        return nullptr;
     }
 
     /**
diff --git a/src/utils/SkTextureCompressor_LATC.cpp b/src/utils/SkTextureCompressor_LATC.cpp
index f0cf4a9..3ee6b27 100644
--- a/src/utils/SkTextureCompressor_LATC.cpp
+++ b/src/utils/SkTextureCompressor_LATC.cpp
@@ -485,7 +485,7 @@
 SkBlitter* CreateLATCBlitter(int width, int height, void* outputBuffer,
                              SkTBlitterAllocator* allocator) {
     if ((width % 4) != 0 || (height % 4) != 0) {
-        return NULL;
+        return nullptr;
     }
 
 #if COMPRESS_LATC_FAST
@@ -502,7 +502,7 @@
         (width, height, outputBuffer);
 #elif COMPRESS_LATC_SLOW
     // TODO (krajcevski)
-    return NULL;
+    return nullptr;
 #endif
 }
 
diff --git a/src/utils/SkTextureCompressor_R11EAC.cpp b/src/utils/SkTextureCompressor_R11EAC.cpp
index c7edf37..291820b 100644
--- a/src/utils/SkTextureCompressor_R11EAC.cpp
+++ b/src/utils/SkTextureCompressor_R11EAC.cpp
@@ -638,7 +638,7 @@
                                SkTBlitterAllocator* allocator) {
 
     if ((width % 4) != 0 || (height % 4) != 0) {
-        return NULL;
+        return nullptr;
     }
 
     // Memset the output buffer to an encoding that decodes to zero. We must do this
diff --git a/src/utils/SkThreadUtils.h b/src/utils/SkThreadUtils.h
index 8963981..e89bc6d 100644
--- a/src/utils/SkThreadUtils.h
+++ b/src/utils/SkThreadUtils.h
@@ -14,7 +14,7 @@
 public:
     typedef void (*entryPointProc)(void*);
 
-    SkThread(entryPointProc entryPoint, void* data = NULL);
+    SkThread(entryPointProc entryPoint, void* data = nullptr);
 
     /**
      * Non-virtual, do not subclass.
diff --git a/src/utils/SkThreadUtils_pthread.cpp b/src/utils/SkThreadUtils_pthread.cpp
index 7dec907..0bd804d 100644
--- a/src/utils/SkThreadUtils_pthread.cpp
+++ b/src/utils/SkThreadUtils_pthread.cpp
@@ -14,8 +14,8 @@
 #include <signal.h>
 
 PThreadEvent::PThreadEvent() : fConditionFlag(false) {
-    pthread_cond_init(&fCondition, NULL);
-    pthread_mutex_init(&fConditionMutex, NULL);
+    pthread_cond_init(&fCondition, nullptr);
+    pthread_mutex_init(&fConditionMutex, nullptr);
 }
 PThreadEvent::~PThreadEvent() {
     pthread_mutex_destroy(&fConditionMutex);
@@ -65,7 +65,7 @@
     if (!pthreadData->fCanceled.isTriggered()) {
         pthreadData->fEntryPoint(pthreadData->fParam);
     }
-    return NULL;
+    return nullptr;
 }
 
 SkThread::SkThread(entryPointProc entryPoint, void* data) {
@@ -81,7 +81,7 @@
 }
 
 SkThread::~SkThread() {
-    if (fData != NULL) {
+    if (fData != nullptr) {
         SkThread_PThreadData* pthreadData = static_cast<SkThread_PThreadData*>(fData);
         // If created thread but start was never called, kill the thread.
         if (pthreadData->fValidPThread && !pthreadData->fStarted.isTriggered()) {
@@ -113,5 +113,5 @@
         return;
     }
 
-    pthread_join(pthreadData->fPThread, NULL);
+    pthread_join(pthreadData->fPThread, nullptr);
 }
diff --git a/src/utils/SkThreadUtils_win.cpp b/src/utils/SkThreadUtils_win.cpp
index a064d3b..a5efb93 100644
--- a/src/utils/SkThreadUtils_win.cpp
+++ b/src/utils/SkThreadUtils_win.cpp
@@ -11,17 +11,17 @@
 #include "SkThreadUtils_win.h"
 
 SkThread_WinData::SkThread_WinData(SkThread::entryPointProc entryPoint, void* data)
-    : fHandle(NULL)
+    : fHandle(nullptr)
     , fParam(data)
     , fThreadId(0)
     , fEntryPoint(entryPoint)
     , fStarted(false)
 {
     fCancelEvent = CreateEvent(
-        NULL,  // default security attributes
+        nullptr,  // default security attributes
         false, //auto reset
         false, //not signaled
-        NULL); //no name
+        nullptr); //no name
 }
 
 SkThread_WinData::~SkThread_WinData() {
@@ -44,12 +44,12 @@
     SkThread_WinData* winData = new SkThread_WinData(entryPoint, data);
     fData = winData;
 
-    if (NULL == winData->fCancelEvent) {
+    if (nullptr == winData->fCancelEvent) {
         return;
     }
 
     winData->fHandle = CreateThread(
-        NULL,                   // default security attributes
+        nullptr,                   // default security attributes
         0,                      // use default stack size
         thread_start,           // thread function name (proxy)
         winData,                // argument to thread function (proxy args)
@@ -58,10 +58,10 @@
 }
 
 SkThread::~SkThread() {
-    if (fData != NULL) {
+    if (fData != nullptr) {
         SkThread_WinData* winData = static_cast<SkThread_WinData*>(fData);
         // If created thread but start was never called, kill the thread.
-        if (winData->fHandle != NULL && !winData->fStarted) {
+        if (winData->fHandle != nullptr && !winData->fStarted) {
             if (SetEvent(winData->fCancelEvent) != 0) {
                 if (this->start()) {
                     this->join();
@@ -77,7 +77,7 @@
 
 bool SkThread::start() {
     SkThread_WinData* winData = static_cast<SkThread_WinData*>(fData);
-    if (NULL == winData->fHandle) {
+    if (nullptr == winData->fHandle) {
         return false;
     }
 
@@ -90,7 +90,7 @@
 
 void SkThread::join() {
     SkThread_WinData* winData = static_cast<SkThread_WinData*>(fData);
-    if (NULL == winData->fHandle || !winData->fStarted) {
+    if (nullptr == winData->fHandle || !winData->fStarted) {
         return;
     }
 
@@ -119,7 +119,7 @@
 
 bool SkThread::setProcessorAffinity(unsigned int processor) {
     SkThread_WinData* winData = static_cast<SkThread_WinData*>(fData);
-    if (NULL == winData->fHandle) {
+    if (nullptr == winData->fHandle) {
         return false;
     }
 
diff --git a/src/utils/android/SkAndroidSDKCanvas.cpp b/src/utils/android/SkAndroidSDKCanvas.cpp
index 2eec95f..5106473 100644
--- a/src/utils/android/SkAndroidSDKCanvas.cpp
+++ b/src/utils/android/SkAndroidSDKCanvas.cpp
@@ -26,16 +26,16 @@
     if (shader->isABitmap()) {
         return;
     }
-    if (shader->asACompose(NULL)) {
+    if (shader->asACompose(nullptr)) {
         return;
     }
-    SkShader::GradientType gtype = shader->asAGradient(NULL);
+    SkShader::GradientType gtype = shader->asAGradient(nullptr);
     if (gtype == SkShader::kLinear_GradientType ||
         gtype == SkShader::kRadial_GradientType ||
         gtype == SkShader::kSweep_GradientType) {
         return;
     }
-    paint->setShader(NULL);
+    paint->setShader(nullptr);
 }
 
 void Filter(SkPaint* paint) {
@@ -48,7 +48,7 @@
     SkXfermode::Mode mode;
     SkXfermode::AsMode(paint->getXfermode(), &mode);
     if (mode > SkXfermode::kLighten_Mode) {
-        paint->setXfermode(NULL);
+        paint->setXfermode(nullptr);
     }
 
     // Force bilinear scaling or none
@@ -70,22 +70,22 @@
             paint->setColorFilter(
                 SkColorFilter::CreateModeFilter(color, SkXfermode::kSrcOver_Mode));
         } else if (!isMode && !cf->asColorMatrix(srcColorMatrix)) {
-            paint->setColorFilter(NULL);
+            paint->setColorFilter(nullptr);
         }
     }
 
 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
     SkPathEffect* pe = paint->getPathEffect();
     if (pe && !pe->exposedInAndroidJavaAPI()) {
-        paint->setPathEffect(NULL);
+        paint->setPathEffect(nullptr);
     }
 #endif
 
     // TODO: Android doesn't support all the flags that can be passed to
     // blur filters; we need plumbing to get them out.
 
-    paint->setImageFilter(NULL);
-    paint->setLooper(NULL);
+    paint->setImageFilter(nullptr);
+    paint->setLooper(nullptr);
 };
 
 }  // namespace
@@ -103,7 +103,7 @@
     }
 
 
-SkAndroidSDKCanvas::SkAndroidSDKCanvas() : fProxyTarget(NULL) { }
+SkAndroidSDKCanvas::SkAndroidSDKCanvas() : fProxyTarget(nullptr) { }
 
 void SkAndroidSDKCanvas::reset(SkCanvas* newTarget) { fProxyTarget = newTarget; }
 
@@ -292,7 +292,7 @@
     SkASSERT(pmap);
     SkImageInfo info;
     size_t rowBytes; 
-    const void* addr = fProxyTarget->accessTopLayerPixels(&info, &rowBytes, NULL);
+    const void* addr = fProxyTarget->accessTopLayerPixels(&info, &rowBytes, nullptr);
     if (addr) {
         pmap->reset(info, addr, rowBytes);
         return true;
diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp
index 5ce9067..f163cc5 100644
--- a/src/utils/debugger/SkDebugCanvas.cpp
+++ b/src/utils/debugger/SkDebugCanvas.cpp
@@ -50,7 +50,7 @@
         return gTable[idx];
     }
 
-    Factory getFactory() const override { return NULL; }
+    Factory getFactory() const override { return nullptr; }
 #ifndef SK_IGNORE_TO_STRING
     void toString(SkString* str) const override { str->set("OverdrawXfermode"); }
 #endif
@@ -64,13 +64,13 @@
                            bool overrideFilterQuality,
                            SkFilterQuality quality)
         : INHERITED(width, height)
-        , fOverdrawXfermode(overdrawViz ? new OverdrawXfermode : NULL)
+        , fOverdrawXfermode(overdrawViz ? new OverdrawXfermode : nullptr)
         , fOverrideFilterQuality(overrideFilterQuality)
         , fFilterQuality(quality) {}
 
 protected:
     void onFilterPaint(SkPaint* paint, Type) const override {
-        if (NULL != fOverdrawXfermode.get()) {
+        if (nullptr != fOverdrawXfermode.get()) {
             paint->setAntiAlias(false);
             paint->setXfermode(fOverdrawXfermode.get());
         }
@@ -100,7 +100,7 @@
 
 SkDebugCanvas::SkDebugCanvas(int width, int height)
         : INHERITED(width, height)
-        , fPicture(NULL)
+        , fPicture(nullptr)
         , fFilter(false)
         , fMegaVizMode(false)
         , fOverdrawViz(false)
@@ -359,7 +359,7 @@
 
 void SkDebugCanvas::updatePaintFilterCanvas() {
     if (!fOverdrawViz && !fOverrideFilterQuality) {
-        fPaintFilterCanvas.reset(NULL);
+        fPaintFilterCanvas.reset(nullptr);
         return;
     }
 
@@ -515,7 +515,7 @@
                                    SkXfermode*, const uint16_t indices[], int indexCount,
                                    const SkPaint& paint) {
     this->addDrawCommand(new SkDrawVerticesCommand(vmode, vertexCount, vertices,
-                         texs, colors, NULL, indices, indexCount, paint));
+                         texs, colors, nullptr, indices, indexCount, paint));
 }
 
 void SkDebugCanvas::willRestore() {
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index 75d8474..a9415dd 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -63,7 +63,7 @@
             break;
     }
     SkDEBUGFAIL("DrawType UNUSED\n");
-    return NULL;
+    return nullptr;
 }
 
 SkString SkDrawCommand::toString() const {
@@ -114,7 +114,7 @@
     canvas->restore();
 }
 
-void render_bitmap(SkCanvas* canvas, const SkBitmap& input, const SkRect* srcRect = NULL) {
+void render_bitmap(SkCanvas* canvas, const SkBitmap& input, const SkRect* srcRect = nullptr) {
     const SkISize& size = canvas->getDeviceSize();
 
     SkScalar xScale = SkIntToScalar(size.fWidth-2) / input.width();
@@ -270,7 +270,7 @@
         fPaint = *paint;
         fPaintPtr = &fPaint;
     } else {
-        fPaintPtr = NULL;
+        fPaintPtr = nullptr;
     }
 
     fInfo.push(SkObjectParser::BitmapToString(bitmap));
@@ -300,7 +300,7 @@
         fPaint = *paint;
         fPaintPtr = &fPaint;
     } else {
-        fPaintPtr = NULL;
+        fPaintPtr = nullptr;
     }
 
     fInfo.push(SkObjectParser::BitmapToString(bitmap));
@@ -336,7 +336,7 @@
         fPaint = *paint;
         fPaintPtr = &fPaint;
     } else {
-        fPaintPtr = NULL;
+        fPaintPtr = nullptr;
     }
     fConstraint = constraint;
 
@@ -764,7 +764,7 @@
         fPaint = *paint;
         fPaintPtr = &fPaint;
     } else {
-        fPaintPtr = NULL;
+        fPaintPtr = nullptr;
     }
 
     fInfo.push(SkObjectParser::BitmapToString(bitmap));
@@ -829,7 +829,7 @@
 
 void SkDrawTextOnPathCommand::execute(SkCanvas* canvas) const {
     canvas->drawTextOnPath(fText, fByteLength, fPath,
-                           fMatrix.isIdentity() ? NULL : &fMatrix,
+                           fMatrix.isIdentity() ? nullptr : &fMatrix,
                            fPaint);
 }
 
@@ -850,14 +850,14 @@
         fTexs = new SkPoint[vertexCount];
         memcpy(fTexs, texs, vertexCount * sizeof(SkPoint));
     } else {
-        fTexs = NULL;
+        fTexs = nullptr;
     }
 
     if (colors) {
         fColors = new SkColor[vertexCount];
         memcpy(fColors, colors, vertexCount * sizeof(SkColor));
     } else {
-        fColors = NULL;
+        fColors = nullptr;
     }
 
     fXfermode = xfermode;
@@ -869,7 +869,7 @@
         fIndices = new uint16_t[indexCount];
         memcpy(fIndices, indices, indexCount * sizeof(uint16_t));
     } else {
-        fIndices = NULL;
+        fIndices = nullptr;
     }
 
     fIndexCount = indexCount;
@@ -924,7 +924,7 @@
         fPaint = *paint;
         fPaintPtr = &fPaint;
     } else {
-        fPaintPtr = NULL;
+        fPaintPtr = nullptr;
     }
     fFlags = flags;
 
@@ -938,7 +938,7 @@
 }
 
 void SkSaveLayerCommand::execute(SkCanvas* canvas) const {
-    canvas->saveLayer(fBounds.isEmpty() ? NULL : &fBounds,
+    canvas->saveLayer(fBounds.isEmpty() ? nullptr : &fBounds,
                       fPaintPtr,
                       fFlags);
 }
diff --git a/src/utils/debugger/SkDrawCommand.h b/src/utils/debugger/SkDrawCommand.h
index b8eca79..c7e5f00 100644
--- a/src/utils/debugger/SkDrawCommand.h
+++ b/src/utils/debugger/SkDrawCommand.h
@@ -250,7 +250,7 @@
 
     void setPaint(const SkPaint& paint) { fPaint = paint; fPaintPtr = &fPaint; }
 
-    const SkRect* srcRect() const { return fSrc.isEmpty() ? NULL : &fSrc; }
+    const SkRect* srcRect() const { return fSrc.isEmpty() ? nullptr : &fSrc; }
     void setSrcRect(const SkRect& src) { fSrc = src; }
 
     const SkRect& dstRect() const { return fDst; }
diff --git a/src/utils/debugger/SkObjectParser.cpp b/src/utils/debugger/SkObjectParser.cpp
index cba8d06..03820e1 100644
--- a/src/utils/debugger/SkObjectParser.cpp
+++ b/src/utils/debugger/SkObjectParser.cpp
@@ -151,7 +151,7 @@
     mPath->append(gConvexityStrings[path.getConvexity()]);
     mPath->append(", ");
 
-    if (path.isRect(NULL)) {
+    if (path.isRect(nullptr)) {
         mPath->append("isRect, ");
     } else {
         mPath->append("isNotRect, ");
@@ -235,7 +235,7 @@
 
     SkString* mRect = new SkString;
 
-    if (NULL == title) {
+    if (nullptr == title) {
         mRect->append("SkRect: ");
     } else {
         mRect->append(title);
@@ -256,7 +256,7 @@
 
     SkString* mRRect = new SkString;
 
-    if (NULL == title) {
+    if (nullptr == title) {
         mRRect->append("SkRRect (");
         if (rrect.isEmpty()) {
             mRRect->append("empty");
@@ -358,7 +358,7 @@
             decodedText->append("UTF-16: ");
             size_t sizeNeeded = SkUTF16_ToUTF8((uint16_t*)text,
                                                 SkToS32(byteLength / 2),
-                                                NULL);
+                                                nullptr);
             SkAutoSTMalloc<0x100, char> utf8(sizeNeeded);
             SkUTF16_ToUTF8((uint16_t*)text, SkToS32(byteLength / 2), utf8);
             decodedText->append(utf8, sizeNeeded);
diff --git a/src/utils/debugger/SkObjectParser.h b/src/utils/debugger/SkObjectParser.h
index c4d0da0..4c04935 100644
--- a/src/utils/debugger/SkObjectParser.h
+++ b/src/utils/debugger/SkObjectParser.h
@@ -89,13 +89,13 @@
         Returns a string representation of the SkRects coordinates.
         @param rect  SkRect
      */
-    static SkString* RectToString(const SkRect& rect, const char* title = NULL);
+    static SkString* RectToString(const SkRect& rect, const char* title = nullptr);
 
     /**
         Returns a string representation of an SkRRect.
         @param rrect  SkRRect
      */
-    static SkString* RRectToString(const SkRRect& rrect, const char* title = NULL);
+    static SkString* RRectToString(const SkRRect& rrect, const char* title = nullptr);
 
     /**
         Returns a string representation of the SkRegion enum.
diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp
index 4675d71..0cbf704 100644
--- a/src/utils/mac/SkCreateCGImageRef.cpp
+++ b/src/utils/mac/SkCreateCGImageRef.cpp
@@ -101,7 +101,7 @@
                                     CGBitmapInfo* info) {
     bool upscaleTo32;
     if (!getBitmapInfo(bm, bitsPerComponent, info, &upscaleTo32)) {
-        return NULL;
+        return nullptr;
     }
 
     SkBitmap* copy;
@@ -122,8 +122,8 @@
     CGBitmapInfo info       SK_INIT_TO_AVOID_WARNING;
 
     SkBitmap* bitmap = prepareForImageRef(bm, &bitsPerComponent, &info);
-    if (NULL == bitmap) {
-        return NULL;
+    if (nullptr == bitmap) {
+        return nullptr;
     }
 
     const int w = bitmap->width();
@@ -138,7 +138,7 @@
                                                              SkBitmap_ReleaseInfo);
 
     bool releaseColorSpace = false;
-    if (NULL == colorSpace) {
+    if (nullptr == colorSpace) {
         colorSpace = CGColorSpaceCreateDeviceRGB();
         releaseColorSpace = true;
     }
@@ -146,7 +146,7 @@
     CGImageRef ref = CGImageCreate(w, h, bitsPerComponent,
                                    bitmap->bytesPerPixel() * 8,
                                    bitmap->rowBytes(), colorSpace, info, dataRef,
-                                   NULL, false, kCGRenderingIntentDefault);
+                                   nullptr, false, kCGRenderingIntentDefault);
 
     if (releaseColorSpace) {
         CGColorSpaceRelease(colorSpace);
@@ -192,19 +192,19 @@
 
 bool SkPDFDocumentToBitmap(SkStream* stream, SkBitmap* output) {
     CGDataProviderRef data = SkCreateDataProviderFromStream(stream);
-    if (NULL == data) {
+    if (nullptr == data) {
         return false;
     }
 
     CGPDFDocumentRef pdf = CGPDFDocumentCreateWithProvider(data);
     CGDataProviderRelease(data);
-    if (NULL == pdf) {
+    if (nullptr == pdf) {
         return false;
     }
     SkAutoPDFRelease releaseMe(pdf);
 
     CGPDFPageRef page = CGPDFDocumentGetPage(pdf, 1);
-    if (NULL == page) {
+    if (nullptr == page) {
         return false;
     }
 
@@ -221,7 +221,7 @@
 
     size_t bitsPerComponent;
     CGBitmapInfo info;
-    getBitmapInfo(bitmap, &bitsPerComponent, &info, NULL);
+    getBitmapInfo(bitmap, &bitsPerComponent, &info, nullptr);
 
     CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB();
     CGContextRef ctx = CGBitmapContextCreate(bitmap.getPixels(), w, h,
@@ -261,7 +261,7 @@
     CGContextRef cg = CGBitmapContextCreate(pixels, info.width(), info.height(), bitsPerComponent,
                                             rowBytes, cs, cg_bitmap_info);
     CFRelease(cs);
-    if (NULL == cg) {
+    if (nullptr == cg) {
         return false;
     }
 
diff --git a/src/utils/win/SkAutoCoInitialize.cpp b/src/utils/win/SkAutoCoInitialize.cpp
index 89115bf..78326a5 100644
--- a/src/utils/win/SkAutoCoInitialize.cpp
+++ b/src/utils/win/SkAutoCoInitialize.cpp
@@ -14,7 +14,7 @@
 
 SkAutoCoInitialize::SkAutoCoInitialize() :
     fHR(
-        CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE)
+        CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE)
     )
 { }
 
diff --git a/src/utils/win/SkDWrite.cpp b/src/utils/win/SkDWrite.cpp
index 363ac43..2254961 100644
--- a/src/utils/win/SkDWrite.cpp
+++ b/src/utils/win/SkDWrite.cpp
@@ -12,7 +12,7 @@
 
 #include <dwrite.h>
 
-static IDWriteFactory* gDWriteFactory = NULL;
+static IDWriteFactory* gDWriteFactory = nullptr;
 
 static void release_dwrite_factory() {
     if (gDWriteFactory) {
@@ -52,7 +52,7 @@
 
 /** Converts a utf8 string to a WCHAR string. */
 HRESULT sk_cstring_to_wchar(const char* skname, SkSMallocWCHAR* name) {
-    int wlen = MultiByteToWideChar(CP_UTF8, 0, skname, -1, NULL, 0);
+    int wlen = MultiByteToWideChar(CP_UTF8, 0, skname, -1, nullptr, 0);
     if (0 == wlen) {
         HRM(HRESULT_FROM_WIN32(GetLastError()),
             "Could not get length for wchar to utf-8 conversion.");
@@ -67,7 +67,7 @@
 
 /** Converts a WCHAR string to a utf8 string. */
 HRESULT sk_wchar_to_skstring(WCHAR* name, int nameLen, SkString* skname) {
-    int len = WideCharToMultiByte(CP_UTF8, 0, name, nameLen, NULL, 0, NULL, NULL);
+    int len = WideCharToMultiByte(CP_UTF8, 0, name, nameLen, nullptr, 0, nullptr, nullptr);
     if (0 == len) {
         if (nameLen <= 0) {
             skname->reset();
@@ -78,7 +78,7 @@
     }
     skname->resize(len);
 
-    len = WideCharToMultiByte(CP_UTF8, 0, name, nameLen, skname->writable_str(), len, NULL, NULL);
+    len = WideCharToMultiByte(CP_UTF8, 0, name, nameLen, skname->writable_str(), len, nullptr, nullptr);
     if (0 == len) {
         HRM(HRESULT_FROM_WIN32(GetLastError()), "Could not convert utf-8 to wchar.");
     }
diff --git a/src/utils/win/SkDWriteFontFileStream.cpp b/src/utils/win/SkDWriteFontFileStream.cpp
index eb7e5dc..0e3d4fc 100644
--- a/src/utils/win/SkDWriteFontFileStream.cpp
+++ b/src/utils/win/SkDWriteFontFileStream.cpp
@@ -20,8 +20,8 @@
 SkDWriteFontFileStream::SkDWriteFontFileStream(IDWriteFontFileStream* fontFileStream)
     : fFontFileStream(SkRefComPtr(fontFileStream))
     , fPos(0)
-    , fLockedMemory(NULL)
-    , fFragmentLock(NULL) {
+    , fLockedMemory(nullptr)
+    , fFragmentLock(nullptr) {
 }
 
 SkDWriteFontFileStream::~SkDWriteFontFileStream() {
@@ -33,7 +33,7 @@
 size_t SkDWriteFontFileStream::read(void* buffer, size_t size) {
     HRESULT hr = S_OK;
 
-    if (NULL == buffer) {
+    if (nullptr == buffer) {
         size_t fileSize = this->getLength();
 
         if (fPos + size > fileSize) {
@@ -137,7 +137,7 @@
                                               SkDWriteFontFileStreamWrapper** streamFontFileStream)
 {
     *streamFontFileStream = new SkDWriteFontFileStreamWrapper(stream);
-    if (NULL == streamFontFileStream) {
+    if (nullptr == streamFontFileStream) {
         return E_OUTOFMEMORY;
     }
     return S_OK;
@@ -153,7 +153,7 @@
         AddRef();
         return S_OK;
     } else {
-        *ppvObject = NULL;
+        *ppvObject = nullptr;
         return E_NOINTERFACE;
     }
 }
@@ -180,8 +180,8 @@
     UINT64 fileSize;
     this->GetFileSize(&fileSize);
     if (fileOffset > fileSize || fragmentSize > fileSize - fileOffset) {
-        *fragmentStart = NULL;
-        *fragmentContext = NULL;
+        *fragmentStart = nullptr;
+        *fragmentContext = nullptr;
         return E_FAIL;
     }
 
@@ -192,14 +192,14 @@
     const void* data = fStream->getMemoryBase();
     if (data) {
         *fragmentStart = static_cast<BYTE const*>(data) + static_cast<size_t>(fileOffset);
-        *fragmentContext = NULL;
+        *fragmentContext = nullptr;
 
     } else {
         // May be called from multiple threads.
         SkAutoMutexAcquire ama(fStreamMutex);
 
-        *fragmentStart = NULL;
-        *fragmentContext = NULL;
+        *fragmentStart = nullptr;
+        *fragmentContext = nullptr;
 
         if (!fStream->seek(static_cast<size_t>(fileOffset))) {
             return E_FAIL;
diff --git a/src/utils/win/SkDWriteGeometrySink.cpp b/src/utils/win/SkDWriteGeometrySink.cpp
index b7ef88b..066d4a4 100644
--- a/src/utils/win/SkDWriteGeometrySink.cpp
+++ b/src/utils/win/SkDWriteGeometrySink.cpp
@@ -19,7 +19,7 @@
 SkDWriteGeometrySink::~SkDWriteGeometrySink() { }
 
 HRESULT STDMETHODCALLTYPE SkDWriteGeometrySink::QueryInterface(REFIID iid, void **object) {
-    if (NULL == object) {
+    if (nullptr == object) {
         return E_INVALIDARG;
     }
     if (iid == __uuidof(IUnknown) || iid == __uuidof(IDWriteGeometrySink)) {
@@ -27,7 +27,7 @@
         this->AddRef();
         return S_OK;
     } else {
-        *object = NULL;
+        *object = nullptr;
         return E_NOINTERFACE;
     }
 }
diff --git a/src/utils/win/SkHRESULT.cpp b/src/utils/win/SkHRESULT.cpp
index 0aea4a6..d565986 100644
--- a/src/utils/win/SkHRESULT.cpp
+++ b/src/utils/win/SkHRESULT.cpp
@@ -15,23 +15,23 @@
     }
     SkDebugf("%s(%lu) : error 0x%x: ", file, line, hr);
 
-    LPSTR errorText = NULL;
+    LPSTR errorText = nullptr;
     FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
                    FORMAT_MESSAGE_FROM_SYSTEM |
                    FORMAT_MESSAGE_IGNORE_INSERTS,
-                   NULL,
+                   nullptr,
                    hr,
                    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                    (LPSTR) &errorText,
                    0,
-                   NULL
+                   nullptr
     );
 
-    if (NULL == errorText) {
+    if (nullptr == errorText) {
         SkDebugf("<unknown>\n");
     } else {
         SkDebugf("%s", errorText);
         LocalFree(errorText);
-        errorText = NULL;
+        errorText = nullptr;
     }
 }
diff --git a/src/utils/win/SkIStream.cpp b/src/utils/win/SkIStream.cpp
index dc9d163..f1dbcb2 100644
--- a/src/utils/win/SkIStream.cpp
+++ b/src/utils/win/SkIStream.cpp
@@ -22,7 +22,7 @@
 HRESULT STDMETHODCALLTYPE SkBaseIStream::QueryInterface(REFIID iid
                                                       , void ** ppvObject)
 {
-    if (NULL == ppvObject) {
+    if (nullptr == ppvObject) {
         return E_INVALIDARG;
     }
     if (iid == __uuidof(IUnknown)
@@ -33,7 +33,7 @@
         AddRef();
         return S_OK;
     } else {
-        *ppvObject = NULL;
+        *ppvObject = nullptr;
         return E_NOINTERFACE;
     }
 }
@@ -122,7 +122,7 @@
                                     , bool deleteOnRelease
                                     , IStream ** ppStream)
 {
-    if (NULL == stream) {
+    if (nullptr == stream) {
         return E_INVALIDARG;
     }
     *ppStream = new SkIStream(stream, deleteOnRelease);
@@ -208,7 +208,7 @@
     if (0 == (grfStatFlag & STATFLAG_NONAME)) {
         return STG_E_INVALIDFLAG;
     }
-    pStatstg->pwcsName = NULL;
+    pStatstg->pwcsName = nullptr;
     // FIXME: Should not depend on getLength
     // See https://code.google.com/p/skia/issues/detail?id=1570
     pStatstg->cbSize.QuadPart = this->fSkStream->getLength();
@@ -268,7 +268,7 @@
     if (0 == (grfStatFlag & STATFLAG_NONAME)) {
         return STG_E_INVALIDFLAG;
     }
-    pStatstg->pwcsName = NULL;
+    pStatstg->pwcsName = nullptr;
     pStatstg->cbSize.QuadPart = 0;
     pStatstg->clsid = CLSID_NULL;
     pStatstg->type = STGTY_STREAM;
diff --git a/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp
index 60f3cb3..ef07bea 100644
--- a/src/utils/win/SkWGL_win.cpp
+++ b/src/utils/win/SkWGL_win.cpp
@@ -13,7 +13,7 @@
 #include "SkTSort.h"
 
 bool SkWGLExtensions::hasExtension(HDC dc, const char* ext) const {
-    if (NULL == this->fGetExtensionsString) {
+    if (nullptr == this->fGetExtensionsString) {
         return false;
     }
     if (!strcmp("WGL_ARB_extensions_string", ext)) {
@@ -168,7 +168,7 @@
 #define DUMMY_CLASS STR_LIT("DummyClass")
 
 HWND create_dummy_window() {
-    HMODULE module = GetModuleHandle(NULL);
+    HMODULE module = GetModuleHandle(nullptr);
     HWND dummy;
     RECT windowRect;
     windowRect.left = 0;
@@ -183,10 +183,10 @@
     wc.cbClsExtra = 0;
     wc.cbWndExtra = 0;
     wc.hInstance = module;
-    wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
-    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
-    wc.hbrBackground = NULL;
-    wc.lpszMenuName = NULL;
+    wc.hIcon = LoadIcon(nullptr, IDI_WINLOGO);
+    wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
+    wc.hbrBackground = nullptr;
+    wc.lpszMenuName = nullptr;
     wc.lpszClassName = DUMMY_CLASS;
 
     if(!RegisterClass(&wc)) {
@@ -205,11 +205,11 @@
                                 0, 0,
                                 windowRect.right-windowRect.left,
                                 windowRect.bottom-windowRect.top,
-                                NULL, NULL,
+                                nullptr, nullptr,
                                 module,
-                                NULL))) {
+                                nullptr))) {
         UnregisterClass(DUMMY_CLASS, module);
-        return NULL;
+        return nullptr;
     }
     ShowWindow(dummy, SW_HIDE);
 
@@ -218,7 +218,7 @@
 
 void destroy_dummy_window(HWND dummy) {
     DestroyWindow(dummy);
-    HMODULE module = GetModuleHandle(NULL);
+    HMODULE module = GetModuleHandle(nullptr);
     UnregisterClass(DUMMY_CLASS, module);
 }
 }
@@ -227,16 +227,16 @@
                      (##NAME##Proc) wglGetProcAddress("wgl" #NAME #SUFFIX)
 
 SkWGLExtensions::SkWGLExtensions()
-    : fGetExtensionsString(NULL)
-    , fChoosePixelFormat(NULL)
-    , fGetPixelFormatAttribfv(NULL)
-    , fGetPixelFormatAttribiv(NULL)
-    , fCreateContextAttribs(NULL)
-    , fSwapInterval(NULL)
-    , fCreatePbuffer(NULL)
-    , fGetPbufferDC(NULL)
-    , fReleasePbufferDC(NULL)
-    , fDestroyPbuffer(NULL)
+    : fGetExtensionsString(nullptr)
+    , fChoosePixelFormat(nullptr)
+    , fGetPixelFormatAttribfv(nullptr)
+    , fGetPixelFormatAttribiv(nullptr)
+    , fCreateContextAttribs(nullptr)
+    , fSwapInterval(nullptr)
+    , fCreatePbuffer(nullptr)
+    , fGetPbufferDC(nullptr)
+    , fReleasePbufferDC(nullptr)
+    , fDestroyPbuffer(nullptr)
  {
     HDC prevDC = wglGetCurrentDC();
     HGLRC prevGLRC = wglGetCurrentContext();
@@ -272,7 +272,7 @@
         GET_PROC(ReleasePbufferDC, ARB);
         GET_PROC(DestroyPbuffer, ARB);
 
-        wglMakeCurrent(dummyDC, NULL);
+        wglMakeCurrent(dummyDC, nullptr);
         wglDeleteContext(dummyGLRC);
         destroy_dummy_window(dummyWND);
     }
@@ -329,11 +329,11 @@
     HDC prevDC = wglGetCurrentDC();
     HGLRC prevGLRC = wglGetCurrentContext();
 
-    HGLRC glrc = NULL;
+    HGLRC glrc = nullptr;
     if (kGLES_SkWGLContextRequest == contextType) {
         if (!extensions.hasExtension(dc, "WGL_EXT_create_context_es2_profile")) {
             wglMakeCurrent(prevDC, prevGLRC);
-            return NULL;
+            return nullptr;
         }
         static const int glesAttribs[] = {
             SK_WGL_CONTEXT_MAJOR_VERSION, 3,
@@ -341,10 +341,10 @@
             SK_WGL_CONTEXT_PROFILE_MASK,  SK_WGL_CONTEXT_ES2_PROFILE_BIT,
             0,
         };
-        glrc = extensions.createContextAttribs(dc, NULL, glesAttribs);
-        if (NULL == glrc) {
+        glrc = extensions.createContextAttribs(dc, nullptr, glesAttribs);
+        if (nullptr == glrc) {
             wglMakeCurrent(prevDC, prevGLRC);
-            return NULL;
+            return nullptr;
         }
     } else {
         if (kGLPreferCoreProfile_SkWGLContextRequest == contextType &&
@@ -366,7 +366,7 @@
             for (int v = 0; v < SK_ARRAY_COUNT(kCoreGLVersions) / 2; ++v) {
                 coreProfileAttribs[1] = kCoreGLVersions[2 * v];
                 coreProfileAttribs[3] = kCoreGLVersions[2 * v + 1];
-                glrc = extensions.createContextAttribs(dc, NULL, coreProfileAttribs);
+                glrc = extensions.createContextAttribs(dc, nullptr, coreProfileAttribs);
                 if (glrc) {
                     break;
                 }
@@ -374,7 +374,7 @@
         }
     }
 
-    if (NULL == glrc) {
+    if (nullptr == glrc) {
         glrc = wglCreateContext(dc);
     }
     SkASSERT(glrc);
@@ -391,7 +391,7 @@
 HGLRC SkCreateWGLContext(HDC dc, int msaaSampleCount, SkWGLContextRequest contextType) {
     SkWGLExtensions extensions;
     if (!extensions.hasExtension(dc, "WGL_ARB_pixel_format")) {
-        return NULL;
+        return nullptr;
     }
 
     BOOL set = FALSE;
@@ -407,7 +407,7 @@
     }
 
     if (!set) {
-        return NULL;
+        return nullptr;
     }
 
     return create_gl_context(dc, extensions, contextType);}
@@ -417,7 +417,7 @@
     SkWGLExtensions extensions;
     if (!extensions.hasExtension(parentDC, "WGL_ARB_pixel_format") ||
         !extensions.hasExtension(parentDC, "WGL_ARB_pbuffer")) {
-        return NULL;
+        return nullptr;
     }
 
     // try for single buffer first
@@ -426,7 +426,7 @@
         get_pixel_formats_to_try(parentDC, extensions, (0 != dblBuffer), msaaSampleCount,
                                  pixelFormatsToTry);
         for (int f = 0; -1 != pixelFormatsToTry[f] && f < SK_ARRAY_COUNT(pixelFormatsToTry); ++f) {
-            HPBUFFER pbuf = extensions.createPbuffer(parentDC, pixelFormatsToTry[f], 1, 1, NULL);
+            HPBUFFER pbuf = extensions.createPbuffer(parentDC, pixelFormatsToTry[f], 1, 1, nullptr);
             if (0 != pbuf) {
                 HDC dc = extensions.getPbufferDC(pbuf);
                 if (dc) {
@@ -440,7 +440,7 @@
             }
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 SkWGLPbufferContext::~SkWGLPbufferContext() {
diff --git a/src/views/SkEvent.cpp b/src/views/SkEvent.cpp
index 5f204c0..5316b49 100644
--- a/src/views/SkEvent.cpp
+++ b/src/views/SkEvent.cpp
@@ -11,14 +11,14 @@
 
 void SkEvent::initialize(const char* type, size_t typeLen,
                          SkEventSinkID targetID) {
-    fType = NULL;
+    fType = nullptr;
     setType(type, typeLen);
     f32 = 0;
     fTargetID = targetID;
-    fTargetProc = NULL;
+    fTargetProc = nullptr;
 #ifdef SK_DEBUG
     fTime = 0;
-    fNextEvent = NULL;
+    fNextEvent = nullptr;
 #endif
 }
 
@@ -128,7 +128,7 @@
         this->setType(name);
 
     const char* value;
-    if ((value = dom.findAttr(node, "fast32")) != NULL)
+    if ((value = dom.findAttr(node, "fast32")) != nullptr)
     {
         int32_t n;
         if (SkParse::FindS32(value, &n))
@@ -144,25 +144,25 @@
         }
 
         name = dom.findAttr(node, "name");
-        if (name == NULL)
+        if (name == nullptr)
         {
             SkDEBUGCODE(SkDebugf("SkEvent::inflate missing required \"name\" attribute in <data> subelement\n");)
             continue;
         }
 
-        if ((value = dom.findAttr(node, "s32")) != NULL)
+        if ((value = dom.findAttr(node, "s32")) != nullptr)
         {
             int32_t n;
             if (SkParse::FindS32(value, &n))
                 this->setS32(name, n);
         }
-        else if ((value = dom.findAttr(node, "scalar")) != NULL)
+        else if ((value = dom.findAttr(node, "scalar")) != nullptr)
         {
             SkScalar x;
             if (SkParse::FindScalar(value, &x))
                 this->setScalar(name, x);
         }
-        else if ((value = dom.findAttr(node, "string")) != NULL)
+        else if ((value = dom.findAttr(node, "string")) != nullptr)
             this->setString(name, value);
 #ifdef SK_DEBUG
         else
@@ -194,7 +194,7 @@
         int                 count;
         const char*         name;
 
-        while ((name = iter.next(&mtype, &count)) != NULL)
+        while ((name = iter.next(&mtype, &count)) != nullptr)
         {
             SkASSERT(count > 0);
 
@@ -209,7 +209,7 @@
                 break;
             case SkMetaData::kScalar_Type:
                 {
-                    const SkScalar* values = md.findScalars(name, &count, NULL);
+                    const SkScalar* values = md.findScalars(name, &count, nullptr);
                     SkDebugf("%f", SkScalarToFloat(values[0]));
                     for (int i = 1; i < count; i++)
                         SkDebugf(", %f", SkScalarToFloat(values[i]));
@@ -271,9 +271,9 @@
 class SkEvent_Globals {
 public:
     SkEvent_Globals() {
-        fEventQHead = NULL;
-        fEventQTail = NULL;
-        fDelayQHead = NULL;
+        fEventQHead = nullptr;
+        fEventQTail = nullptr;
+        fDelayQHead = nullptr;
         SkDEBUGCODE(fEventCounter = 0;)
     }
 
@@ -338,14 +338,14 @@
 
     SkASSERT(evt);
 
-    bool wasEmpty = globals.fEventQHead == NULL;
+    bool wasEmpty = globals.fEventQHead == nullptr;
 
     if (globals.fEventQTail)
         globals.fEventQTail->fNextEvent = evt;
     globals.fEventQTail = evt;
-    if (globals.fEventQHead == NULL)
+    if (globals.fEventQHead == nullptr)
         globals.fEventQHead = evt;
-    evt->fNextEvent = NULL;
+    evt->fNextEvent = nullptr;
 
     SkDEBUGCODE(++globals.fEventCounter);
 
@@ -361,8 +361,8 @@
         SkDEBUGCODE(--globals.fEventCounter);
 
         globals.fEventQHead = evt->fNextEvent;
-        if (globals.fEventQHead == NULL) {
-            globals.fEventQTail = NULL;
+        if (globals.fEventQHead == nullptr) {
+            globals.fEventQTail = nullptr;
         }
     }
     globals.fEventMutex.release();
@@ -374,7 +374,7 @@
     SkEvent_Globals& globals = getGlobals();
 
     // this is not thread accurate, need a semaphore for that
-    return globals.fEventQHead != NULL;
+    return globals.fEventQHead != nullptr;
 }
 
 #ifdef SK_TRACE_EVENTS
@@ -386,7 +386,7 @@
     //  gEventMutex acquired by caller
 
     SkEvent* curr = globals.fDelayQHead;
-    SkEvent* prev = NULL;
+    SkEvent* prev = nullptr;
 
     while (curr) {
         if (SkMSec_LT(time, curr->fTime)) {
@@ -398,7 +398,7 @@
 
     evt->fTime = time;
     evt->fNextEvent = curr;
-    if (prev == NULL) {
+    if (prev == nullptr) {
         globals.fDelayQHead = evt;
     } else {
         prev->fNextEvent = evt;
diff --git a/src/views/SkEventSink.cpp b/src/views/SkEventSink.cpp
index 282f2b8..003bf8c 100644
--- a/src/views/SkEventSink.cpp
+++ b/src/views/SkEventSink.cpp
@@ -16,7 +16,7 @@
 public:
     SkEventSink_Globals() {
         fNextSinkID = 0;
-        fSinkHead = NULL;
+        fSinkHead = nullptr;
     }
 
     SkMutex         fSinkMutex;
@@ -30,7 +30,7 @@
     return *gGlobals;
 }
 
-SkEventSink::SkEventSink() : fTagHead(NULL) {
+SkEventSink::SkEventSink() : fTagHead(nullptr) {
     SkEventSink_Globals& globals = getGlobals();
 
     globals.fSinkMutex.acquire();
@@ -51,7 +51,7 @@
     globals.fSinkMutex.acquire();
 
     SkEventSink* sink = globals.fSinkHead;
-    SkEventSink* prev = NULL;
+    SkEventSink* prev = nullptr;
 
     for (;;) {
         SkEventSink* next = sink->fNextSink;
@@ -89,12 +89,12 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SkTagList* SkEventSink::findTagList(U8CPU tag) const {
-    return fTagHead ? SkTagList::Find(fTagHead, tag) : NULL;
+    return fTagHead ? SkTagList::Find(fTagHead, tag) : nullptr;
 }
 
 void SkEventSink::addTagList(SkTagList* rec) {
     SkASSERT(rec);
-    SkASSERT(fTagHead == NULL || SkTagList::Find(fTagHead, rec->fTag) == NULL);
+    SkASSERT(fTagHead == nullptr || SkTagList::Find(fTagHead, rec->fTag) == nullptr);
 
     rec->fNext = fTagHead;
     fTagHead = rec;
@@ -162,7 +162,7 @@
 void SkEventSink::copyListeners(const SkEventSink& sink)
 {
     SkListenersTagList* sinkList = (SkListenersTagList*)sink.findTagList(kListeners_SkTagList);
-    if (sinkList == NULL)
+    if (sinkList == nullptr)
         return;
     SkASSERT(sinkList->countListners() > 0);
     const SkEventSinkID* iter = sinkList->fIDs;
@@ -178,7 +178,7 @@
 
     SkListenersTagList* list = (SkListenersTagList*)this->findTagList(kListeners_SkTagList);
 
-    if (list == NULL)
+    if (list == nullptr)
         return;
 
     int index = list->find(id);
@@ -199,7 +199,7 @@
 
 bool SkEventSink::hasListeners() const
 {
-    return this->findTagList(kListeners_SkTagList) != NULL;
+    return this->findTagList(kListeners_SkTagList) != nullptr;
 }
 
 void SkEventSink::postToListeners(const SkEvent& evt, SkMSec delay) {
@@ -246,7 +246,7 @@
             return sink;
         sink = sink->fNextSink;
     }
-    return NULL;
+    return nullptr;
 }
 
 ////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/views/SkOSMenu.cpp b/src/views/SkOSMenu.cpp
index 8c2e476..ec92a7b 100644
--- a/src/views/SkOSMenu.cpp
+++ b/src/views/SkOSMenu.cpp
@@ -28,7 +28,7 @@
         if (itemID == fItems[i]->getID())
             return fItems[i];
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkOSMenu::getItems(const SkOSMenu::Item* items[]) const {
@@ -155,7 +155,7 @@
         SkString str(option);
         va_start(args, option);
         int count = 1;
-        for (const char* arg = va_arg(args, const char*); arg != NULL; arg = va_arg(args, const char*)) {
+        for (const char* arg = va_arg(args, const char*); arg != nullptr; arg = va_arg(args, const char*)) {
             str += gDelimiter;
             str += arg;
             ++count;
@@ -206,13 +206,13 @@
 bool SkOSMenu::FindListItems(const SkEvent& evt, SkString items[]) {
     if (evt.isType(gMenuEventType) && items) {
         const char* text = evt.findString(gList_Items_Str);
-        if (text != NULL) {
+        if (text != nullptr) {
             SkString temp(text);
             char* token = strtok((char*)temp.c_str(), gDelimiter);
             int index = 0;
-            while (token != NULL) {
+            while (token != nullptr) {
                 items[index].set(token, strlen(token));
-                token = strtok (NULL, gDelimiter);
+                token = strtok (nullptr, gDelimiter);
                 ++index;
             }
         }
diff --git a/src/views/SkParsePaint.cpp b/src/views/SkParsePaint.cpp
index 5b44764..1a1b706 100644
--- a/src/views/SkParsePaint.cpp
+++ b/src/views/SkParsePaint.cpp
@@ -13,8 +13,8 @@
 
 static SkShader* inflate_shader(const SkDOM& dom, const SkDOM::Node* node)
 {
-    if ((node = dom.getFirstChild(node, "shader")) == NULL)
-        return NULL;
+    if ((node = dom.getFirstChild(node, "shader")) == nullptr)
+        return nullptr;
 
     const char* str;
 
@@ -24,9 +24,9 @@
         SkPoint        pts[2];
 
         colors[0] = colors[1] = SK_ColorBLACK;    // need to initialized the alpha to opaque, since FindColor doesn't set it
-        if ((str = dom.findAttr(node, "c0")) != NULL &&
+        if ((str = dom.findAttr(node, "c0")) != nullptr &&
             SkParse::FindColor(str, &colors[0]) &&
-            (str = dom.findAttr(node, "c1")) != NULL &&
+            (str = dom.findAttr(node, "c1")) != nullptr &&
             SkParse::FindColor(str, &colors[1]) &&
             dom.findScalars(node, "p0", &pts[0].fX, 2) &&
             dom.findScalars(node, "p1", &pts[1].fX, 2))
@@ -36,13 +36,13 @@
 
             if ((index = dom.findList(node, "tile-mode", "clamp,repeat,mirror")) >= 0)
                 mode = (SkShader::TileMode)index;
-            return SkGradientShader::CreateLinear(pts, colors, NULL, 2, mode);
+            return SkGradientShader::CreateLinear(pts, colors, nullptr, 2, mode);
         }
     }
     else if (dom.hasAttr(node, "type", "bitmap"))
     {
-        if ((str = dom.findAttr(node, "src")) == NULL)
-            return NULL;
+        if ((str = dom.findAttr(node, "src")) == nullptr)
+            return nullptr;
 
         SkBitmap    bm;
 
@@ -57,7 +57,7 @@
             return SkShader::CreateBitmapShader(bm, mode, mode);
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkPaint_Inflate(SkPaint* paint, const SkDOM& dom, const SkDOM::Node* node)
diff --git a/src/views/SkProgressView.cpp b/src/views/SkProgressView.cpp
index 03e28eb..7ce022d 100644
--- a/src/views/SkProgressView.cpp
+++ b/src/views/SkProgressView.cpp
@@ -12,11 +12,11 @@
 #include "SkInterpolator.h"
 #include "SkTime.h"
 
-SkProgressView::SkProgressView(uint32_t flags) : SkView(flags), fOnShader(NULL), fOffShader(NULL)
+SkProgressView::SkProgressView(uint32_t flags) : SkView(flags), fOnShader(nullptr), fOffShader(nullptr)
 {
     fValue = 0;
     fMax = 0;
-    fInterp = NULL;
+    fInterp = nullptr;
     fDoInterp = false;
 }
 
@@ -33,7 +33,7 @@
     {
         fMax = SkToU16(max);
         if (fValue > 0)
-            this->inval(NULL);
+            this->inval(nullptr);
     }
 }
 
@@ -52,7 +52,7 @@
             fInterp->setKeyFrame(1, SkTime::GetMSecs() + 333, &x);
         }
         fValue = SkToU16(value);
-        this->inval(NULL);
+        this->inval(nullptr);
     }
 }
 
@@ -69,12 +69,12 @@
         if (fInterp->timeToValues(SkTime::GetMSecs(), &x) == SkInterpolator::kFreezeEnd_Result)
         {
             delete fInterp;
-            fInterp = NULL;
+            fInterp = nullptr;
         }
         percent = (SkFixed)x;    // now its 16.8
         percent = SkMax32(0, SkMin32(percent, fMax << 8));    // now its pinned
         percent = SkFixedDiv(percent, fMax << 8);    // now its 0.16
-        this->inval(NULL);
+        this->inval(nullptr);
     }
     else
     {
@@ -112,7 +112,7 @@
 
     return SkImageDecoder::DecodeFile(file, &bm) ?
             SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode) :
-            NULL;
+            nullptr;
 }
 
 void SkProgressView::onInflate(const SkDOM& dom, const SkDOM::Node* node)
@@ -121,12 +121,12 @@
 
     const char* s;
 
-    SkASSERT(fOnShader == NULL);
-    SkASSERT(fOffShader == NULL);
+    SkASSERT(fOnShader == nullptr);
+    SkASSERT(fOffShader == nullptr);
 
-    if ((s = dom.findAttr(node, "src-on")) != NULL)
+    if ((s = dom.findAttr(node, "src-on")) != nullptr)
         fOnShader = inflate_shader(s);
-    if ((s = dom.findAttr(node, "src-off")) != NULL)
+    if ((s = dom.findAttr(node, "src-off")) != nullptr)
         fOffShader = inflate_shader(s);
     (void)dom.findBool(node, "do-interp", &fDoInterp);
 }
diff --git a/src/views/SkStackViewLayout.cpp b/src/views/SkStackViewLayout.cpp
index aba6f2e..b0c8c8c 100644
--- a/src/views/SkStackViewLayout.cpp
+++ b/src/views/SkStackViewLayout.cpp
@@ -79,7 +79,7 @@
     SkScalar        limit = 0;
     int                n = 0, flex = 0;
 
-    while ((child = iter.next()) != NULL)
+    while ((child = iter.next()) != nullptr)
     {
         n += 1;
         if (child->getFlags() & flexMask)
@@ -145,7 +145,7 @@
     }
     crossLimit += (parent->*crossGetSizeP)();
     if (fAlign != kStretch_Align)
-        crossSetSizeP = NULL;
+        crossSetSizeP = nullptr;
 
     int            childCount, flexCount;
     SkScalar    childLimit = compute_children_limit(parent, mainGetSizeP, &childCount, flexMask, &flexCount);
@@ -164,7 +164,7 @@
     if (flexCount > 0 && parentLimit > childLimit)
         flexAmount = (parentLimit - childLimit) / flexCount;
 
-    while ((child = iter.next()) != NULL)
+    while ((child = iter.next()) != nullptr)
     {
         if (fRound)
             pos = SkScalarRoundToScalar(pos);
@@ -258,7 +258,7 @@
     SkView::B2FIter    iter(parent);
     SkView*            child;
 
-    while ((child = iter.next()) != NULL)
+    while ((child = iter.next()) != nullptr)
     {
         child->setLoc(fMargin.fLeft, fMargin.fTop);
         child->setSize(    parent->width() - fMargin.fRight - fMargin.fLeft,
diff --git a/src/views/SkTagList.cpp b/src/views/SkTagList.cpp
index 8ede870..b1d6ff6 100644
--- a/src/views/SkTagList.cpp
+++ b/src/views/SkTagList.cpp
@@ -17,7 +17,7 @@
 {
     SkASSERT(tag < kSkTagListCount);
 
-    while (rec != NULL)
+    while (rec != nullptr)
     {
         if (rec->fTag == tag)
             break;
@@ -31,9 +31,9 @@
     SkASSERT(tag < kSkTagListCount);
 
     SkTagList* rec = *head;
-    SkTagList* prev = NULL;
+    SkTagList* prev = nullptr;
 
-    while (rec != NULL)
+    while (rec != nullptr)
     {
         SkTagList* next = rec->fNext;
 
diff --git a/src/views/SkTagList.h b/src/views/SkTagList.h
index 47294e3..1cff9ca 100644
--- a/src/views/SkTagList.h
+++ b/src/views/SkTagList.h
@@ -29,7 +29,7 @@
     SkTagList(U8CPU tag) : fTag(SkToU8(tag))
     {
         SkASSERT(tag < kSkTagListCount);
-        fNext       = NULL;
+        fNext       = nullptr;
         fExtra16    = 0;
         fExtra8     = 0;
     }
diff --git a/src/views/SkView.cpp b/src/views/SkView.cpp
index 0070201..249737a 100644
--- a/src/views/SkView.cpp
+++ b/src/views/SkView.cpp
@@ -14,7 +14,7 @@
 {
     fWidth = fHeight = 0;
     fLoc.set(0, 0);
-    fParent = fFirstChild = fNextSibling = fPrevSibling = NULL;
+    fParent = fFirstChild = fNextSibling = fPrevSibling = nullptr;
     fMatrix.setIdentity();
     fContainsFocus = 0;
 }
@@ -31,13 +31,13 @@
     uint32_t diff = fFlags ^ flags;
 
     if (diff & kVisible_Mask)
-        this->inval(NULL);
+        this->inval(nullptr);
 
     fFlags = SkToU8(flags);
 
     if (diff & kVisible_Mask)
     {
-        this->inval(NULL);
+        this->inval(nullptr);
     }
 }
 
@@ -67,10 +67,10 @@
 
     if (fWidth != width || fHeight != height)
     {
-        this->inval(NULL);
+        this->inval(nullptr);
         fWidth = width;
         fHeight = height;
-        this->inval(NULL);
+        this->inval(nullptr);
         this->onSizeChange();
         this->invokeLayout();
     }
@@ -80,9 +80,9 @@
 {
     if (fLoc.fX != x || fLoc.fY != y)
     {
-        this->inval(NULL);
+        this->inval(nullptr);
         fLoc.set(x, y);
-        this->inval(NULL);
+        this->inval(nullptr);
     }
 }
 
@@ -94,9 +94,9 @@
 
 void SkView::setLocalMatrix(const SkMatrix& matrix)
 {
-    this->inval(NULL);
+    this->inval(nullptr);
     fMatrix = matrix;
-    this->inval(NULL);
+    this->inval(nullptr);
 }
 
 void SkView::draw(SkCanvas* canvas)
@@ -136,7 +136,7 @@
 
         SkCanvas* childCanvas = this->beforeChildren(canvas);
 
-        while ((child = iter.next()) != NULL)
+        while ((child = iter.next()) != nullptr)
             child->draw(childCanvas);
 
         this->afterChildren(canvas);
@@ -165,7 +165,7 @@
         }
 
         SkView* parent = view->fParent;
-        if (parent == NULL) {
+        if (parent == nullptr) {
             return;
         }
 
@@ -185,18 +185,18 @@
     do {
         if (view->onSetFocusView(fv))
             return true;
-    } while ((view = view->fParent) != NULL);
+    } while ((view = view->fParent) != nullptr);
     return false;
 }
 
 SkView* SkView::getFocusView() const
 {
-    SkView*            focus = NULL;
+    SkView*            focus = nullptr;
     const SkView*    view = this;
     do {
         if (view->onGetFocusView(&focus))
             break;
-    } while ((view = view->fParent) != NULL);
+    } while ((view = view->fParent) != nullptr);
     return focus;
 }
 
@@ -222,30 +222,30 @@
 
         B2FIter    iter(this);
         SkView*    child, *focus;
-        while ((child = iter.next()) != NULL)
-            if ((focus = child->acceptFocus(dir)) != NULL)
+        while ((child = iter.next()) != nullptr)
+            if ((focus = child->acceptFocus(dir)) != nullptr)
                 return focus;
     }
     else // prev
     {
         F2BIter    iter(this);
         SkView*    child, *focus;
-        while ((child = iter.next()) != NULL)
-            if ((focus = child->acceptFocus(dir)) != NULL)
+        while ((child = iter.next()) != nullptr)
+            if ((focus = child->acceptFocus(dir)) != nullptr)
                 return focus;
 
         if (this->acceptFocus())
             return this;
     }
 
-    return NULL;
+    return nullptr;
 }
 
 SkView* SkView::moveFocus(FocusDirection dir)
 {
     SkView* focus = this->getFocusView();
 
-    if (focus == NULL)
+    if (focus == nullptr)
     {    // start with the root
         focus = this;
         while (focus->fParent)
@@ -267,19 +267,19 @@
             while (child != parent->fFirstChild)
             {
     FIRST_CHILD:
-                if ((focus = child->acceptFocus(dir)) != NULL)
+                if ((focus = child->acceptFocus(dir)) != nullptr)
                     return focus;
                 child = child->fNextSibling;
             }
     NEXT_SIB:
             child = parent->fNextSibling;
             parent = parent->fParent;
-        } while (parent != NULL);
+        } while (parent != nullptr);
     }
     else    // prevfocus
     {
         parent = focus->fParent;
-        if (parent == NULL)    // we're the root
+        if (parent == nullptr)    // we're the root
             return focus->acceptFocus(dir);
         else
         {
@@ -289,7 +289,7 @@
                 while (child != parent->fFirstChild)
                 {
                     child = child->fPrevSibling;
-                    if ((focus = child->acceptFocus(dir)) != NULL)
+                    if ((focus = child->acceptFocus(dir)) != nullptr)
                         return focus;
                 }
                 if (parent->acceptFocus())
@@ -300,12 +300,12 @@
             }
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 void SkView::onFocusChange(bool gainFocusP)
 {
-    this->inval(NULL);
+    this->inval(nullptr);
 }
 
 ////////////////////////////////////////////////////////////////////////////
@@ -314,9 +314,9 @@
 {
     SkASSERT(target);
     fTargetID = target->getSinkID();
-    fType = NULL;
+    fType = nullptr;
     fWeOwnTheType = false;
-    fOwner = NULL;
+    fOwner = nullptr;
 }
 
 SkView::Click::~Click()
@@ -331,7 +331,7 @@
         sk_free(fType);
         fWeOwnTheType = false;
     }
-    fType = NULL;
+    fType = nullptr;
 }
 
 bool SkView::Click::isType(const char type[]) const
@@ -341,9 +341,9 @@
     if (type == t)
         return true;
 
-    if (type == NULL)
+    if (type == nullptr)
         type = "";
-    if (t == NULL)
+    if (t == nullptr)
         t = "";
     return !strcmp(t, type);
 }
@@ -371,14 +371,14 @@
 
 SkView::Click* SkView::findClickHandler(SkScalar x, SkScalar y, unsigned modi) {
     if (x < 0 || y < 0 || x >= fWidth || y >= fHeight) {
-        return NULL;
+        return nullptr;
     }
 
     if (this->onSendClickToChildren(x, y, modi)) {
         F2BIter    iter(this);
         SkView*    child;
 
-        while ((child = iter.next()) != NULL)
+        while ((child = iter.next()) != nullptr)
         {
             SkPoint p;
             if (!child->globalToLocal(x, y, &p)) {
@@ -401,7 +401,7 @@
     SkASSERT(click);
 
     SkView* target = (SkView*)SkEventSink::FindSink(click->fTargetID);
-    if (NULL == target) {
+    if (nullptr == target) {
         return;
     }
 
@@ -425,7 +425,7 @@
     SkASSERT(click);
 
     SkView* target = (SkView*)SkEventSink::FindSink(click->fTargetID);
-    if (NULL == target) {
+    if (nullptr == target) {
         return;
     }
 
@@ -449,7 +449,7 @@
     SkASSERT(click);
 
     SkView* target = (SkView*)SkEventSink::FindSink(click->fTargetID);
-    if (NULL == target) {
+    if (nullptr == target) {
         return;
     }
 
@@ -493,7 +493,7 @@
 }
 
 SkView::Click* SkView::onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) {
-    return NULL;
+    return nullptr;
 }
 
 bool SkView::onClick(Click*) {
@@ -517,17 +517,17 @@
 
 void SkView::detachFromParent_NoLayout() {
     this->validate();
-    if (fParent == NULL) {
+    if (fParent == nullptr) {
         return;
     }
 
     if (fContainsFocus) {
-        (void)this->setFocusView(NULL);
+        (void)this->setFocusView(nullptr);
     }
 
-    this->inval(NULL);
+    this->inval(nullptr);
 
-    SkView* next = NULL;
+    SkView* next = nullptr;
 
     if (fNextSibling != this) {   // do we have any siblings
         fNextSibling->fPrevSibling = fPrevSibling;
@@ -539,7 +539,7 @@
         fParent->fFirstChild = next;
     }
 
-    fParent = fNextSibling = fPrevSibling = NULL;
+    fParent = fNextSibling = fPrevSibling = nullptr;
 
     this->validate();
     this->unref();
@@ -559,13 +559,13 @@
     this->validate();
     SkASSERT(child != this);
 
-    if (child == NULL || fFirstChild == child)
+    if (child == nullptr || fFirstChild == child)
         goto DONE;
 
     child->ref();
     child->detachFromParent_NoLayout();
 
-    if (fFirstChild == NULL) {
+    if (fFirstChild == nullptr) {
         child->fNextSibling = child;
         child->fPrevSibling = child;
     } else {
@@ -577,7 +577,7 @@
 
     fFirstChild = child;
     child->fParent = this;
-    child->inval(NULL);
+    child->inval(nullptr);
 
     this->validate();
     this->invokeLayout();
@@ -589,13 +589,13 @@
     this->validate();
     SkASSERT(child != this);
 
-    if (child == NULL || (fFirstChild && fFirstChild->fPrevSibling == child))
+    if (child == nullptr || (fFirstChild && fFirstChild->fPrevSibling == child))
         goto DONE;
 
     child->ref();
     child->detachFromParent_NoLayout();
 
-    if (fFirstChild == NULL) {
+    if (fFirstChild == nullptr) {
         fFirstChild = child;
         child->fNextSibling = child;
         child->fPrevSibling = child;
@@ -607,7 +607,7 @@
     }
 
     child->fParent = this;
-    child->inval(NULL);
+    child->inval(nullptr);
 
     this->validate();
     this->invokeLayout();
@@ -699,7 +699,7 @@
 
     B2FIter    iter(this);
     SkView*    child;
-    while ((child = iter.next()) != NULL)
+    while ((child = iter.next()) != nullptr)
         child->postInflate(dict);
 }
 
@@ -714,7 +714,7 @@
         }
         parent = parent->fParent;
     }
-    return NULL;
+    return nullptr;
 }
 
 SkView* SkView::sendQueryToParents(SkEvent* evt) {
@@ -726,15 +726,15 @@
         }
         parent = parent->fParent;
     }
-    return NULL;
+    return nullptr;
 }
 
 //////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////
 
 SkView::F2BIter::F2BIter(const SkView* parent) {
-    fFirstChild = parent ? parent->fFirstChild : NULL;
-    fChild = fFirstChild ? fFirstChild->fPrevSibling : NULL;
+    fFirstChild = parent ? parent->fFirstChild : nullptr;
+    fChild = fFirstChild ? fFirstChild->fPrevSibling : nullptr;
 }
 
 SkView* SkView::F2BIter::next() {
@@ -742,7 +742,7 @@
 
     if (fChild) {
         if (fChild == fFirstChild) {
-            fChild = NULL;
+            fChild = nullptr;
         } else {
             fChild = fChild->fPrevSibling;
         }
@@ -751,7 +751,7 @@
 }
 
 SkView::B2FIter::B2FIter(const SkView* parent) {
-    fFirstChild = parent ? parent->fFirstChild : NULL;
+    fFirstChild = parent ? parent->fFirstChild : nullptr;
     fChild = fFirstChild;
 }
 
@@ -761,7 +761,7 @@
     if (fChild) {
         SkView* next = fChild->fNextSibling;
         if (next == fFirstChild)
-            next = NULL;
+            next = nullptr;
         fChild = next;
     }
     return curr;
@@ -778,8 +778,8 @@
         SkASSERT(fNextSibling);
         SkASSERT(fPrevSibling);
     } else {
-        bool nextNull = NULL == fNextSibling;
-        bool prevNull = NULL == fNextSibling;
+        bool nextNull = nullptr == fNextSibling;
+        bool prevNull = nullptr == fNextSibling;
         SkASSERT(nextNull == prevNull);
     }
 }
@@ -812,7 +812,7 @@
         SkView*            child;
         bool            noChildren = true;
 
-        while ((child = iter.next()) != NULL)
+        while ((child = iter.next()) != nullptr)
         {
             if (noChildren)
                 SkDebugf(">\n");
diff --git a/src/views/SkViewInflate.cpp b/src/views/SkViewInflate.cpp
index 59cc481..8418fb0 100644
--- a/src/views/SkViewInflate.cpp
+++ b/src/views/SkViewInflate.cpp
@@ -37,10 +37,10 @@
             const char* name = dom.getName(child);
             const char* target;
 
-            if (!strcmp(name, "listenTo") && (target = dom.findAttr(child, "target")) != NULL)
+            if (!strcmp(name, "listenTo") && (target = dom.findAttr(child, "target")) != nullptr)
                 this->addIDStr(&fListenTo, parent, target);
 
-            if (!strcmp(name, "broadcastTo") && (target = dom.findAttr(child, "target")) != NULL)
+            if (!strcmp(name, "broadcastTo") && (target = dom.findAttr(child, "target")) != nullptr)
                 this->addIDStr(&fBroadcastTo, parent, target);
         }
         child = dom.getNextSibling(child);
@@ -62,13 +62,13 @@
 {
     fIDs.reset();
 
-    if (root == NULL)
+    if (root == nullptr)
     {
         root = this->createView(dom, node);
-        if (root == NULL)
+        if (root == nullptr)
         {
-            printf("createView returned NULL on <%s>\n", dom.getName(node));
-            return NULL;
+            printf("createView returned nullptr on <%s>\n", dom.getName(node));
+            return nullptr;
         }
     }
     this->rInflate(dom, node, root);
@@ -103,21 +103,21 @@
     SkDOM                dom;
     const SkDOM::Node*    node = dom.build(xml, len);
 
-    return node ? this->inflate(dom, node, root) : NULL;
+    return node ? this->inflate(dom, node, root) : nullptr;
 }
 
 SkView* SkViewInflate::findViewByID(const char id[]) const
 {
     SkASSERT(id);
     SkView* view;
-    return fIDs.find(id, &view) ? view : NULL;
+    return fIDs.find(id, &view) ? view : nullptr;
 }
 
 SkView* SkViewInflate::createView(const SkDOM& dom, const SkDOM::Node* node)
 {
     if (!strcmp(dom.getName(node), "view"))
         return new SkView;
-    return NULL;
+    return nullptr;
 }
 
 void SkViewInflate::addIDStr(SkTDArray<IDStr>* list, SkView* view, const char* str)
diff --git a/src/views/SkViewPriv.cpp b/src/views/SkViewPriv.cpp
index 6d90814..03541fd 100644
--- a/src/views/SkViewPriv.cpp
+++ b/src/views/SkViewPriv.cpp
@@ -29,14 +29,14 @@
 SkView::Artist* SkView::getArtist() const
 {
     Artist_SkTagList* rec = (Artist_SkTagList*)this->findTagList(kViewArtist_SkTagList);
-    SkASSERT(rec == NULL || rec->fArtist != NULL);
+    SkASSERT(rec == nullptr || rec->fArtist != nullptr);
 
-    return rec ? rec->fArtist : NULL;
+    return rec ? rec->fArtist : nullptr;
 }
 
 SkView::Artist* SkView::setArtist(Artist* obj)
 {
-    if (obj == NULL)
+    if (obj == nullptr)
     {
         this->removeTagList(kViewArtist_SkTagList);
     }
@@ -75,14 +75,14 @@
 SkView::Layout* SkView::getLayout() const
 {
     Layout_SkTagList* rec = (Layout_SkTagList*)this->findTagList(kViewLayout_SkTagList);
-    SkASSERT(rec == NULL || rec->fLayout != NULL);
+    SkASSERT(rec == nullptr || rec->fLayout != nullptr);
 
-    return rec ? rec->fLayout : NULL;
+    return rec ? rec->fLayout : nullptr;
 }
 
 SkView::Layout* SkView::setLayout(Layout* obj, bool invokeLayoutNow)
 {
-    if (obj == NULL)
+    if (obj == nullptr)
     {
         this->removeTagList(kViewLayout_SkTagList);
     }
diff --git a/src/views/SkWidgets.cpp b/src/views/SkWidgets.cpp
index cde2b42..fc0ffb8 100644
--- a/src/views/SkWidgets.cpp
+++ b/src/views/SkWidgets.cpp
@@ -72,7 +72,7 @@
         if (!fAnimators[i]->decodeURI(path.c_str()))
         {
             delete fAnimators[i];
-            fAnimators[i] = NULL;
+            fAnimators[i] = nullptr;
         }
     }
 }
@@ -88,11 +88,11 @@
 static SkAnimator* get_skin_animator(SkinType st)
 {
 #if 0
-    if (gSkinSuite == NULL)
+    if (gSkinSuite == nullptr)
         gSkinSuite = new SkinSuite;
     return gSkinSuite->get(st);
 #else
-    return NULL;
+    return nullptr;
 #endif
 }
 
@@ -109,7 +109,7 @@
 
 void SkWidget::onEnabledChange()
 {
-    this->inval(NULL);
+    this->inval(nullptr);
 }
 
 void SkWidget::postWidgetEvent()
@@ -130,7 +130,7 @@
 {
     this->INHERITED::onInflate(dom, node);
 
-    if ((node = dom.getFirstChild(node, "event")) != NULL)
+    if ((node = dom.getFirstChild(node, "event")) != nullptr)
         fEvent.inflate(dom, node);
 }
 
@@ -196,7 +196,7 @@
 
 void SkButtonWidget::onButtonStateChange()
 {
-    this->inval(NULL);
+    this->inval(nullptr);
 }
 
 void SkButtonWidget::onInflate(const SkDOM& dom, const SkDOM::Node* node)
@@ -293,7 +293,7 @@
         p.setColor(SK_ColorBLUE);
         create_emboss(&p, SkIntToScalar(12)/5, this->hasFocus(), this->getButtonState() == kOn_State);
         canvas->drawRoundRect(r, SkScalarHalf(this->height()), SkScalarHalf(this->height()), p);
-        p.setMaskFilter(NULL);
+        p.setMaskFilter(nullptr);
 
         p.setTextAlign(SkPaint::kCenter_Align);
 
@@ -351,7 +351,7 @@
 {
     if (fMode == kAutoWidth_Mode)
     {
-        SkScalar width = fPaint.measureText(fText.c_str(), fText.size(), NULL, NULL);
+        SkScalar width = fPaint.measureText(fText.c_str(), fText.size(), nullptr, nullptr);
         this->setWidth(width + fMargin.fX * 2);
     }
     else if (fMode == kAutoHeight_Mode)
@@ -360,7 +360,7 @@
         int lines = width > 0 ? SkTextLineBreaker::CountLines(fText.c_str(), fText.size(), fPaint, width) : 0;
 
         SkScalar    before, after;
-        (void)fPaint.measureText(0, NULL, &before, &after);
+        (void)fPaint.measureText(0, nullptr, &before, &after);
 
         this->setHeight(lines * (after - before) + fMargin.fY * 2);
     }
@@ -380,7 +380,7 @@
 void SkStaticTextView::setSpacingAlign(SkTextBox::SpacingAlign align)
 {
     fSpacingAlign = SkToU8(align);
-    this->inval(NULL);
+    this->inval(nullptr);
 }
 
 void SkStaticTextView::getMargin(SkPoint* margin) const
@@ -395,7 +395,7 @@
     {
         fMargin.set(dx, dy);
         this->computeSize();
-        this->inval(NULL);
+        this->inval(nullptr);
     }
 }
 
@@ -429,7 +429,7 @@
     {
         fText.set(text, len);
         this->computeSize();
-        this->inval(NULL);
+        this->inval(nullptr);
     }
 }
 
@@ -445,7 +445,7 @@
     {
         fPaint = paint;
         this->computeSize();
-        this->inval(NULL);
+        this->inval(nullptr);
     }
 }
 
@@ -489,7 +489,7 @@
     if (text)
         this->setText(text);
 
-    if ((node = dom.getFirstChild(node, "paint")) != NULL)
+    if ((node = dom.getFirstChild(node, "paint")) != nullptr)
         SkPaint_Inflate(&fPaint, dom, node);
 }
 
diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp
index 9eef023..9234ac1 100644
--- a/src/views/SkWindow.cpp
+++ b/src/views/SkWindow.cpp
@@ -16,7 +16,7 @@
 
 SkWindow::SkWindow()
     : fSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType)
-    , fFocusView(NULL)
+    , fFocusView(nullptr)
 {
     fClicks.reset();
     fWaitingOnInval = false;
@@ -37,7 +37,7 @@
 void SkWindow::setMatrix(const SkMatrix& matrix) {
     if (fMatrix != matrix) {
         fMatrix = matrix;
-        this->inval(NULL);
+        this->inval(nullptr);
     }
 }
 
@@ -67,7 +67,7 @@
                                               ct, kPremul_SkAlphaType));
 
         this->setSize(SkIntToScalar(width), SkIntToScalar(height));
-        this->inval(NULL);
+        this->inval(nullptr);
     }
 }
 
@@ -146,7 +146,7 @@
         return true;
 
     SkView* focus = this->getFocusView();
-    if (focus == NULL)
+    if (focus == nullptr)
         focus = this;
 
     SkEvent evt(SK_EventType_Unichar);
@@ -164,7 +164,7 @@
     // send an event to the focus-view
     {
         SkView* focus = this->getFocusView();
-        if (focus == NULL)
+        if (focus == nullptr)
             focus = this;
 
         SkEvent evt(SK_EventType_Key);
@@ -174,8 +174,8 @@
     }
 
     if (key == kUp_SkKey || key == kDown_SkKey) {
-        if (this->moveFocus(key == kUp_SkKey ? kPrev_FocusDirection : kNext_FocusDirection) == NULL)
-            this->onSetFocusView(NULL);
+        if (this->moveFocus(key == kUp_SkKey ? kPrev_FocusDirection : kNext_FocusDirection) == nullptr)
+            this->onSetFocusView(nullptr);
         return true;
     }
     return false;
@@ -191,7 +191,7 @@
     //send an event to the focus-view
     {
         SkView* focus = this->getFocusView();
-        if (focus == NULL)
+        if (focus == nullptr)
             focus = this;
 
         //should this one be the same?
@@ -209,7 +209,7 @@
 }
 
 void SkWindow::setTitle(const char title[]) {
-    if (NULL == title) {
+    if (nullptr == title) {
         title = "";
     }
     fTitle.set(title);
diff --git a/src/views/animated/SkBorderView.cpp b/src/views/animated/SkBorderView.cpp
index 3eff605..88bff69 100644
--- a/src/views/animated/SkBorderView.cpp
+++ b/src/views/animated/SkBorderView.cpp
@@ -52,7 +52,7 @@
     SkAnimator::DifferenceType    diff = fAnim.draw(canvas, &paint, SkTime::GetMSecs());
 
     if (diff == SkAnimator::kDifferent)
-        this->inval(NULL);
+        this->inval(nullptr);
     else if (diff == SkAnimator::kPartiallyDifferent)
     {
         SkRect    bounds;
@@ -65,7 +65,7 @@
 {
     if (evt.isType(SK_EventType_Inval))
     {
-        this->inval(NULL);
+        this->inval(nullptr);
         return true;
     }
     if (evt.isType("recommendDim"))
diff --git a/src/views/animated/SkImageView.cpp b/src/views/animated/SkImageView.cpp
index 2956729..04b8258 100644
--- a/src/views/animated/SkImageView.cpp
+++ b/src/views/animated/SkImageView.cpp
@@ -16,10 +16,10 @@
 
 SkImageView::SkImageView()
 {
-    fMatrix        = NULL;
+    fMatrix        = nullptr;
     fScaleType    = kMatrix_ScaleType;
 
-    fData.fAnim    = NULL;        // handles initializing the other union values
+    fData.fAnim    = nullptr;        // handles initializing the other union values
     fDataIsAnim    = true;
 
     fUriIsValid    = false;    // an empty string is not valid
@@ -65,7 +65,7 @@
     {
         fScaleType = SkToU8(st);
         if (fUriIsValid)
-            this->inval(NULL);
+            this->inval(nullptr);
     }
 }
 
@@ -92,7 +92,7 @@
 
     if (matrix && !matrix->isIdentity())
     {
-        if (fMatrix == NULL)
+        if (fMatrix == nullptr)
             fMatrix = (SkMatrix*)sk_malloc_throw(sizeof(SkMatrix));
         *fMatrix = *matrix;
         changed = true;
@@ -103,14 +103,14 @@
         {
             SkASSERT(!fMatrix->isIdentity());
             sk_free(fMatrix);
-            fMatrix = NULL;
+            fMatrix = nullptr;
             changed = true;
         }
     }
 
     // only redraw if we changed our matrix and we're not in scaleToFit mode
     if (changed && this->getScaleType() == kMatrix_ScaleType && fUriIsValid)
-        this->inval(NULL);
+        this->inval(nullptr);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
@@ -120,7 +120,7 @@
     if (evt.isType(SK_EventType_Inval))
     {
         if (fUriIsValid)
-            this->inval(NULL);
+            this->inval(nullptr);
         return true;
     }
     return this->INHERITED::onEvent(evt);
@@ -174,7 +174,7 @@
 SkDEBUGF(("SkImageView : now = %X[%12.3f], diff = %d\n", now, now/1000., diff));
 
         if (diff == SkAnimator::kDifferent)
-            this->inval(NULL);
+            this->inval(nullptr);
         else if (diff == SkAnimator::kPartiallyDifferent)
         {
             SkRect    bounds;
@@ -207,7 +207,7 @@
 void SkImageView::onUriChange()
 {
     if (this->freeData())
-        this->inval(NULL);
+        this->inval(nullptr);
     fUriIsValid = true;        // give ensureUriIsLoaded() a shot at the new uri
 }
 
@@ -220,7 +220,7 @@
         else
             delete fData.fBitmap;
 
-        fData.fAnim = NULL;    // valid for all union values
+        fData.fAnim = nullptr;    // valid for all union values
         return true;
     }
     return false;
diff --git a/src/views/animated/SkProgressBarView.cpp b/src/views/animated/SkProgressBarView.cpp
index e7754eb..5ce944f 100644
--- a/src/views/animated/SkProgressBarView.cpp
+++ b/src/views/animated/SkProgressBarView.cpp
@@ -35,7 +35,7 @@
     SkAnimator::DifferenceType    diff = fAnim.draw(canvas, &paint, SkTime::GetMSecs());
 
     if (diff == SkAnimator::kDifferent)
-        this->inval(NULL);
+        this->inval(nullptr);
     else if (diff == SkAnimator::kPartiallyDifferent)
     {
         SkRect    bounds;
@@ -48,7 +48,7 @@
 {
     if (evt.isType(SK_EventType_Inval))
     {
-        this->inval(NULL);
+        this->inval(nullptr);
         return true;
     }
     if (evt.isType("recommendDim"))
diff --git a/src/views/animated/SkScrollBarView.cpp b/src/views/animated/SkScrollBarView.cpp
index d78cafa..9ba523e 100644
--- a/src/views/animated/SkScrollBarView.cpp
+++ b/src/views/animated/SkScrollBarView.cpp
@@ -89,7 +89,7 @@
     SkAnimator::DifferenceType    diff = fAnim.draw(canvas, &paint, SkTime::GetMSecs());
 
     if (diff == SkAnimator::kDifferent)
-        this->inval(NULL);
+        this->inval(nullptr);
     else if (diff == SkAnimator::kPartiallyDifferent)
     {
         SkRect    bounds;
@@ -102,7 +102,7 @@
 {
     if (evt.isType(SK_EventType_Inval))
     {
-        this->inval(NULL);
+        this->inval(nullptr);
         return true;
     }
     if (evt.isType("recommendDim"))
diff --git a/src/views/animated/SkStaticTextView.cpp b/src/views/animated/SkStaticTextView.cpp
index 0e4cad6..4bec510 100644
--- a/src/views/animated/SkStaticTextView.cpp
+++ b/src/views/animated/SkStaticTextView.cpp
@@ -62,7 +62,7 @@
 void SkStaticTextView::setSpacingAlign(SkTextBox::SpacingAlign align)
 {
     fSpacingAlign = SkToU8(align);
-    this->inval(NULL);
+    this->inval(nullptr);
 }
 
 void SkStaticTextView::getMargin(SkPoint* margin) const
@@ -77,7 +77,7 @@
     {
         fMargin.set(dx, dy);
         this->computeSize();
-        this->inval(NULL);
+        this->inval(nullptr);
     }
 }
 
@@ -102,7 +102,7 @@
 
 void SkStaticTextView::setText(const char text[])
 {
-    if (text == NULL)
+    if (text == nullptr)
         text = "";
     this->setText(text, strlen(text));
 }
@@ -113,7 +113,7 @@
     {
         fText.set(text, len);
         this->computeSize();
-        this->inval(NULL);
+        this->inval(nullptr);
     }
 }
 
@@ -129,7 +129,7 @@
     {
         fPaint = paint;
         this->computeSize();
-        this->inval(NULL);
+        this->inval(nullptr);
     }
 }
 
@@ -178,8 +178,8 @@
         this->setText(text);
     }
 
-    if ((node = dom.getFirstChild(node, "paint")) != NULL &&
-        (node = dom.getFirstChild(node, "screenplay")) != NULL)
+    if ((node = dom.getFirstChild(node, "paint")) != nullptr &&
+        (node = dom.getFirstChild(node, "screenplay")) != nullptr)
     {
 // FIXME: Including inflate_paint causes Windows build to fail -- it complains
 //  that SKListView::SkListView is undefined.
diff --git a/src/views/animated/SkWidgetViews.cpp b/src/views/animated/SkWidgetViews.cpp
index cd22678..9d3c936 100644
--- a/src/views/animated/SkWidgetViews.cpp
+++ b/src/views/animated/SkWidgetViews.cpp
@@ -110,7 +110,7 @@
 
 void SkWidgetView::setLabel(const char label[], size_t len)
 {
-    if ((label == NULL && fLabel.size() != 0) || !fLabel.equals(label, len))
+    if ((label == nullptr && fLabel.size() != 0) || !fLabel.equals(label, len))
     {
         SkString    tmp(label, len);
 
@@ -153,13 +153,13 @@
     if (label)
         this->setLabel(label);
 
-    if ((node = dom.getFirstChild(node, "event")) != NULL)
+    if ((node = dom.getFirstChild(node, "event")) != nullptr)
         fEvent.inflate(dom, node);
 }
 
 /*virtual*/ void SkWidgetView::onLabelChange(const char oldLabel[], const char newLabel[])
 {
-    this->inval(NULL);
+    this->inval(nullptr);
 }
 
 static const char gWidgetEventSinkIDSlotName[] = "sk-widget-sinkid-slot";
@@ -208,7 +208,7 @@
 
 /*virtual*/ void SkCheckButtonView::onCheckStateChange(CheckState oldState, CheckState newState)
 {
-    this->inval(NULL);
+    this->inval(nullptr);
 }
 
 /*virtual*/ void SkCheckButtonView::onInflate(const SkDOM& dom, const SkDOM::Node* node)
@@ -296,7 +296,7 @@
         SkAnimator::DifferenceType    diff = fAnim.draw(canvas, &paint, SkTime::GetMSecs());
 
         if (diff == SkAnimator::kDifferent)
-            this->inval(NULL);
+            this->inval(nullptr);
         else if (diff == SkAnimator::kPartiallyDifferent)
         {
             SkRect    bounds;
@@ -309,7 +309,7 @@
     {
         if (evt.isType(SK_EventType_Inval))
         {
-            this->inval(NULL);
+            this->inval(nullptr);
             return true;
         }
         if (evt.isType("recommendDim"))
@@ -346,8 +346,8 @@
 
 SkView* SkWidgetFactory(const char name[])
 {
-    if (name == NULL)
-        return NULL;
+    if (name == nullptr)
+        return nullptr;
 
     // must be in the same order as the SkSkinWidgetEnum is declared
     static const char* gNames[] = {
@@ -365,7 +365,7 @@
         if (!strcmp(gNames[i], name))
             return SkWidgetFactory((SkWidgetEnum)i);
 
-    return NULL;
+    return nullptr;
 }
 
 #include "SkImageView.h"
@@ -394,5 +394,5 @@
         SkDEBUGFAIL("unknown enum passed to SkWidgetFactory");
         break;
     }
-    return NULL;
+    return nullptr;
 }
diff --git a/src/views/sdl/SkOSWindow_SDL.cpp b/src/views/sdl/SkOSWindow_SDL.cpp
index 27783d4..1954015 100644
--- a/src/views/sdl/SkOSWindow_SDL.cpp
+++ b/src/views/sdl/SkOSWindow_SDL.cpp
@@ -17,8 +17,8 @@
     evt.type = SDL_USEREVENT;
     evt.user.type = SDL_USEREVENT;
     evt.user.code = 0;
-    evt.user.data1 = NULL;
-    evt.user.data2 = NULL;
+    evt.user.data1 = nullptr;
+    evt.user.data2 = nullptr;
     SDL_PushEvent(&evt);
 }
 
@@ -52,11 +52,11 @@
     uint32_t amask = SK_A32_MASK << SK_A32_SHIFT;
 
     if (fScreen->flags & SDL_OPENGL) {
-        fSurface = NULL;
+        fSurface = nullptr;
         fGLCanvas = new SkGLCanvas;
         fGLCanvas->setViewport(fScreen->w, fScreen->h);
     } else {
-        fGLCanvas = NULL;
+        fGLCanvas = nullptr;
         fSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, fScreen->w, fScreen->h,
                                         32, rmask, gmask, bmask, amask);
     }
@@ -102,7 +102,7 @@
             SDL_UnlockSurface(fSurface);
         }
 
-        int result = SDL_BlitSurface(fSurface, NULL, fScreen, NULL);
+        int result = SDL_BlitSurface(fSurface, nullptr, fScreen, nullptr);
         if (result) {
             SkDebugf("------- SDL_BlitSurface returned %d\n", result);
         }
@@ -200,7 +200,7 @@
 }
 
 void SkOSWindow::onSetTitle(const char title[]) {
-    SDL_WM_SetCaption(title, NULL);
+    SDL_WM_SetCaption(title, nullptr);
 }
 
 void SkOSWindow::onAddMenu(const SkOSMenu* sk_menu) {}
@@ -220,7 +220,7 @@
 
 void SkEvent::SignalQueueTimer(SkMSec delay)
 {
-    SDL_SetTimer(0, NULL);
+    SDL_SetTimer(0, nullptr);
     if (delay) {
         SDL_SetTimer(delay, timer_callback);
     }
diff --git a/src/views/unix/SkOSWindow_Unix.cpp b/src/views/unix/SkOSWindow_Unix.cpp
index 79fd011..4d4b628 100644
--- a/src/views/unix/SkOSWindow_Unix.cpp
+++ b/src/views/unix/SkOSWindow_Unix.cpp
@@ -33,11 +33,11 @@
         |ExposureMask|PointerMotionMask|KeyPressMask|KeyReleaseMask;
 
 SkOSWindow::SkOSWindow(void*)
-    : fVi(NULL)
+    : fVi(nullptr)
     , fMSAASampleCount(0) {
-    fUnixWindow.fDisplay = NULL;
-    fUnixWindow.fGLContext = NULL;
-    this->initWindow(0, NULL);
+    fUnixWindow.fDisplay = nullptr;
+    fUnixWindow.fGLContext = nullptr;
+    this->initWindow(0, nullptr);
     this->resize(WIDTH, HEIGHT);
 }
 
@@ -50,11 +50,11 @@
         this->detach();
         SkASSERT(fUnixWindow.fGc);
         XFreeGC(fUnixWindow.fDisplay, fUnixWindow.fGc);
-        fUnixWindow.fGc = NULL;
+        fUnixWindow.fGc = nullptr;
         XDestroyWindow(fUnixWindow.fDisplay, fUnixWindow.fWin);
-        fVi = NULL;
+        fVi = nullptr;
         XCloseDisplay(fUnixWindow.fDisplay);
-        fUnixWindow.fDisplay = NULL;
+        fUnixWindow.fDisplay = nullptr;
         fMSAASampleCount = 0;
     }
 }
@@ -76,9 +76,9 @@
         }
         return;
     }
-    fUnixWindow.fDisplay = XOpenDisplay(NULL);
+    fUnixWindow.fDisplay = XOpenDisplay(nullptr);
     Display* dsp = fUnixWindow.fDisplay;
-    if (NULL == dsp) {
+    if (nullptr == dsp) {
         SkDebugf("Could not open an X Display");
         return;
     }
@@ -90,7 +90,7 @@
         GLX_STENCIL_SIZE, 8,
         None
     };
-    SkASSERT(NULL == fVi);
+    SkASSERT(nullptr == fVi);
     if (requestedMSAASampleCount > 0) {
         static const GLint kAttCount = SK_ARRAY_COUNT(att);
         GLint msaaAtt[kAttCount + 4];
@@ -104,7 +104,7 @@
         fVi = glXChooseVisual(dsp, DefaultScreen(dsp), msaaAtt);
         fMSAASampleCount = requestedMSAASampleCount;
     }
-    if (NULL == fVi) {
+    if (nullptr == fVi) {
         fVi = glXChooseVisual(dsp, DefaultScreen(dsp), att);
         fMSAASampleCount = 0;
     }
@@ -146,7 +146,7 @@
                                                0);    // background value
     }
     this->mapWindowAndWait();
-    fUnixWindow.fGc = XCreateGC(dsp, fUnixWindow.fWin, 0, NULL);
+    fUnixWindow.fGc = XCreateGC(dsp, fUnixWindow.fWin, 0, nullptr);
 }
 
 static unsigned getModi(const XEvent& evt) {
@@ -190,7 +190,7 @@
         tv.tv_sec = ms / 1000;              // seconds
         tv.tv_usec = (ms % 1000) * 1000;    // microseconds
 
-        if (!select(x11_fd + 1, &input_fds, NULL, NULL, &tv)) {
+        if (!select(x11_fd + 1, &input_fds, nullptr, nullptr, &tv)) {
             if (!XPending(dsp)) {
                 return false;
             }
@@ -222,16 +222,16 @@
         case ButtonPress:
             if (evt.xbutton.button == Button1)
                 this->handleClick(evt.xbutton.x, evt.xbutton.y,
-                            SkView::Click::kDown_State, NULL, getModi(evt));
+                            SkView::Click::kDown_State, nullptr, getModi(evt));
             break;
         case ButtonRelease:
             if (evt.xbutton.button == Button1)
                 this->handleClick(evt.xbutton.x, evt.xbutton.y,
-                              SkView::Click::kUp_State, NULL, getModi(evt));
+                              SkView::Click::kUp_State, nullptr, getModi(evt));
             break;
         case MotionNotify:
             this->handleClick(evt.xmotion.x, evt.xmotion.y,
-                           SkView::Click::kMoved_State, NULL, getModi(evt));
+                           SkView::Click::kMoved_State, nullptr, getModi(evt));
             break;
         case KeyPress: {
             int shiftLevel = (evt.xkey.state & ShiftMask) ? 1 : 0;
@@ -264,7 +264,7 @@
 
 void SkOSWindow::loop() {
     Display* dsp = fUnixWindow.fDisplay;
-    if (NULL == dsp) {
+    if (nullptr == dsp) {
         return;
     }
     Window win = fUnixWindow.fWin;
@@ -298,7 +298,7 @@
                 case kPaintRequest_NextXEventResult:
                     sentExposeEvent = false;
                     if (this->isDirty()) {
-                        this->update(NULL);
+                        this->update(nullptr);
                     }
                     this->doPaint();
                     break;
@@ -352,17 +352,17 @@
 bool SkOSWindow::attach(SkBackEndTypes, int msaaSampleCount, AttachmentInfo* info) {
     this->initWindow(msaaSampleCount, info);
 
-    if (NULL == fUnixWindow.fDisplay) {
+    if (nullptr == fUnixWindow.fDisplay) {
         return false;
     }
-    if (NULL == fUnixWindow.fGLContext) {
+    if (nullptr == fUnixWindow.fGLContext) {
         SkASSERT(fVi);
 
         fUnixWindow.fGLContext = glXCreateContext(fUnixWindow.fDisplay,
                                                   fVi,
-                                                  NULL,
+                                                  nullptr,
                                                   GL_TRUE);
-        if (NULL == fUnixWindow.fGLContext) {
+        if (nullptr == fUnixWindow.fGLContext) {
             return false;
         }
     }
@@ -379,12 +379,12 @@
 }
 
 void SkOSWindow::detach() {
-    if (NULL == fUnixWindow.fDisplay || NULL == fUnixWindow.fGLContext) {
+    if (nullptr == fUnixWindow.fDisplay || nullptr == fUnixWindow.fGLContext) {
         return;
     }
-    glXMakeCurrent(fUnixWindow.fDisplay, None, NULL);
+    glXMakeCurrent(fUnixWindow.fDisplay, None, nullptr);
     glXDestroyContext(fUnixWindow.fDisplay, fUnixWindow.fGLContext);
-    fUnixWindow.fGLContext = NULL;
+    fUnixWindow.fGLContext = nullptr;
 }
 
 void SkOSWindow::present() {
@@ -394,7 +394,7 @@
 }
 
 void SkOSWindow::onSetTitle(const char title[]) {
-    if (NULL == fUnixWindow.fDisplay) {
+    if (nullptr == fUnixWindow.fDisplay) {
         return;
     }
     XTextProperty textProp;
@@ -424,7 +424,7 @@
 }
 
 void SkOSWindow::doPaint() {
-    if (NULL == fUnixWindow.fDisplay) {
+    if (nullptr == fUnixWindow.fDisplay) {
         return;
     }
     // If we are drawing with GL, we don't need XPutImage.
@@ -458,7 +458,7 @@
 
 bool SkOSWindow::makeFullscreen() {
     Display* dsp = fUnixWindow.fDisplay;
-    if (NULL == dsp) {
+    if (nullptr == dsp) {
         return false;
     }
 
@@ -490,7 +490,7 @@
 
 void SkOSWindow::closeWindow() {
     Display* dsp = fUnixWindow.fDisplay;
-    if (NULL == dsp) {
+    if (nullptr == dsp) {
         return;
     }
 
diff --git a/src/views/unix/skia_unix.cpp b/src/views/unix/skia_unix.cpp
index 03a2915..58cc040 100644
--- a/src/views/unix/skia_unix.cpp
+++ b/src/views/unix/skia_unix.cpp
@@ -10,7 +10,7 @@
 #include "SkWindow.h"
 
 int main(int argc, char** argv){
-    SkOSWindow* window = create_sk_window(NULL, argc, argv);
+    SkOSWindow* window = create_sk_window(nullptr, argc, argv);
 
     // drain any events that occurred before |window| was assigned.
     while (SkEvent::ProcessEvent());
diff --git a/src/xml/SkBML_XMLParser.cpp b/src/xml/SkBML_XMLParser.cpp
index c0a5af5..1314608 100644
--- a/src/xml/SkBML_XMLParser.cpp
+++ b/src/xml/SkBML_XMLParser.cpp
@@ -41,7 +41,7 @@
 
     size_t size = rdata(s, data);
 
-    if (array[index] == NULL)
+    if (array[index] == nullptr)
         array[index] = (char*)sk_malloc_throw(size + 1);
     else
     {
diff --git a/src/xml/SkDOM.cpp b/src/xml/SkDOM.cpp
index 3bb0835..68e2938 100644
--- a/src/xml/SkDOM.cpp
+++ b/src/xml/SkDOM.cpp
@@ -24,15 +24,15 @@
     SkDOM::AttrIter iter(dom, node);
     const char*     name, *value;
 
-    while ((name = iter.next(&value)) != NULL)
+    while ((name = iter.next(&value)) != nullptr)
         if (this->addAttribute(name, value))
             return false;
 
-    if ((node = dom.getFirstChild(node)) != NULL)
+    if ((node = dom.getFirstChild(node)) != nullptr)
         do {
             if (!this->parse(dom, node))
                 return false;
-        } while ((node = dom.getNextSibling(node)) != NULL);
+        } while ((node = dom.getNextSibling(node)) != nullptr);
 
     return !this->endElement(elemName);
 }
@@ -66,7 +66,7 @@
 
 #define kMinChunkSize   512
 
-SkDOM::SkDOM() : fAlloc(kMinChunkSize), fRoot(NULL)
+SkDOM::SkDOM() : fAlloc(kMinChunkSize), fRoot(nullptr)
 {
 }
 
@@ -86,7 +86,7 @@
 
     if (name)
     {
-        for (; child != NULL; child = child->fNextSibling)
+        for (; child != nullptr; child = child->fNextSibling)
             if (!strcmp(name, child->fName))
                 break;
     }
@@ -99,7 +99,7 @@
     const Node* sibling = node->fNextSibling;
     if (name)
     {
-        for (; sibling != NULL; sibling = sibling->fNextSibling)
+        for (; sibling != nullptr; sibling = sibling->fNextSibling)
             if (!strcmp(name, sibling->fName))
                 break;
     }
@@ -130,22 +130,22 @@
             return attr->fValue;
         attr += 1;
     }
-    return NULL;
+    return nullptr;
 }
 
 /////////////////////////////////////////////////////////////////////////////////////
 
 const SkDOM::Attr* SkDOM::getFirstAttr(const Node* node) const
 {
-    return node->fAttrCount ? node->attrs() : NULL;
+    return node->fAttrCount ? node->attrs() : nullptr;
 }
 
 const SkDOM::Attr* SkDOM::getNextAttr(const Node* node, const Attr* attr) const
 {
     SkASSERT(node);
-    if (attr == NULL)
-        return NULL;
-    return (attr - node->attrs() + 1) < node->fAttrCount ? attr + 1 : NULL;
+    if (attr == nullptr)
+        return nullptr;
+    return (attr - node->attrs() + 1) < node->fAttrCount ? attr + 1 : nullptr;
 }
 
 const char* SkDOM::getAttrName(const Node* node, const Attr* attr) const
@@ -173,7 +173,7 @@
 
 const char* SkDOM::AttrIter::next(const char** value)
 {
-    const char* name = NULL;
+    const char* name = nullptr;
 
     if (fAttr < fStop)
     {
@@ -204,7 +204,7 @@
     SkDOMParser(SkChunkAlloc* chunk) : SkXMLParser(&fParserError), fAlloc(chunk)
     {
         fAlloc->reset();
-        fRoot = NULL;
+        fRoot = nullptr;
         fLevel = 0;
         fNeedToFlush = true;
     }
@@ -222,13 +222,13 @@
                                                         SkChunkAlloc::kThrow_AllocFailType);
 
         node->fName = fElemName;
-        node->fFirstChild = NULL;
+        node->fFirstChild = nullptr;
         node->fAttrCount = SkToU16(attrCount);
         node->fType = fElemType;
 
-        if (fRoot == NULL)
+        if (fRoot == nullptr)
         {
-            node->fNextSibling = NULL;
+            node->fNextSibling = nullptr;
             fRoot = node;
         }
         else    // this adds siblings in reverse order. gets corrected in onEndElement()
@@ -268,7 +268,7 @@
         fParentStack.pop(&parent);
 
         SkDOM::Node* child = parent->fFirstChild;
-        SkDOM::Node* prev = NULL;
+        SkDOM::Node* prev = nullptr;
         while (child)
         {
             SkDOM::Node* next = child->fNextSibling;
@@ -317,9 +317,9 @@
     if (!parser.parse(doc, len))
     {
         SkDEBUGCODE(SkDebugf("xml parse error, line %d\n", parser.fParserError.getLineNumber());)
-        fRoot = NULL;
+        fRoot = nullptr;
         fAlloc.reset();
-        return NULL;
+        return nullptr;
     }
     fRoot = parser.getRoot();
     return fRoot;
@@ -341,14 +341,14 @@
     SkDOM::AttrIter iter(dom, node);
     const char*     name;
     const char*     value;
-    while ((name = iter.next(&value)) != NULL)
+    while ((name = iter.next(&value)) != nullptr)
         parser->addAttribute(name, value);
 
-    node = dom.getFirstChild(node, NULL);
+    node = dom.getFirstChild(node, nullptr);
     while (node)
     {
         walk_dom(dom, node, parser);
-        node = dom.getNextSibling(node, NULL);
+        node = dom.getNextSibling(node, nullptr);
     }
 
     parser->endElement(elem);
@@ -468,7 +468,7 @@
 
 void SkDOM::dump(const Node* node, int level) const
 {
-    if (node == NULL)
+    if (node == nullptr)
         node = this->getRootNode();
 
     SkDebugWStream debugStream;
@@ -493,7 +493,7 @@
 
     SkDOM   dom;
 
-    SkASSERT(dom.getRootNode() == NULL);
+    SkASSERT(dom.getRootNode() == nullptr);
 
     const Node* root = dom.build(gDoc, sizeof(gDoc) - 1);
     SkASSERT(root && dom.getRootNode() == root);
@@ -503,7 +503,7 @@
     v = dom.findAttr(root, "b");
     SkASSERT(v && !strcmp(v, "2"));
     v = dom.findAttr(root, "c");
-    SkASSERT(v == NULL);
+    SkASSERT(v == nullptr);
 
     SkASSERT(dom.getFirstChild(root, "elem1"));
     SkASSERT(!dom.getFirstChild(root, "subelem1"));
diff --git a/src/xml/SkXMLParser.cpp b/src/xml/SkXMLParser.cpp
index ccc7aa4..e283656 100644
--- a/src/xml/SkXMLParser.cpp
+++ b/src/xml/SkXMLParser.cpp
@@ -51,7 +51,7 @@
 
 ////////////////
 
-SkXMLParser::SkXMLParser(SkXMLParserError* parserError) : fParser(NULL), fError(parserError)
+SkXMLParser::SkXMLParser(SkXMLParserError* parserError) : fParser(nullptr), fError(parserError)
 {
 }
 
diff --git a/src/xml/SkXMLPullParser.cpp b/src/xml/SkXMLPullParser.cpp
index ed04228..34ad282 100644
--- a/src/xml/SkXMLPullParser.cpp
+++ b/src/xml/SkXMLPullParser.cpp
@@ -16,13 +16,13 @@
     curr->fIsWhitespace = false;
 }
 
-SkXMLPullParser::SkXMLPullParser() : fStream(NULL)
+SkXMLPullParser::SkXMLPullParser() : fStream(nullptr)
 {
     fCurr.fEventType = ERROR;
     fDepth = -1;
 }
 
-SkXMLPullParser::SkXMLPullParser(SkStream* stream) : fStream(NULL)
+SkXMLPullParser::SkXMLPullParser(SkStream* stream) : fStream(nullptr)
 {
     fCurr.fEventType = ERROR;
     fDepth = 0;
@@ -32,7 +32,7 @@
 
 SkXMLPullParser::~SkXMLPullParser()
 {
-    this->setStream(NULL);
+    this->setStream(nullptr);
 }
 
 SkStream* SkXMLPullParser::setStream(SkStream* stream)
@@ -89,7 +89,7 @@
     case END_TAG:
         return fCurr.fName;
     default:
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -100,7 +100,7 @@
     case IGNORABLE_WHITESPACE:
         return fCurr.fName;
     default:
-        return NULL;
+        return nullptr;
     }
 }
 
diff --git a/src/xml/SkXMLWriter.cpp b/src/xml/SkXMLWriter.cpp
index 7a1b042..5ee237f 100644
--- a/src/xml/SkXMLWriter.cpp
+++ b/src/xml/SkXMLWriter.cpp
@@ -146,7 +146,7 @@
 
     if (fDoEscapeMarkup)
     {
-        size_t   extra = escape_markup(NULL, value, length);
+        size_t   extra = escape_markup(nullptr, value, length);
         if (extra)
         {
             valueStr.resize(length + extra);
@@ -181,15 +181,15 @@
         SkDOM::AttrIter iter(dom, node);
         const char* name;
         const char* value;
-        while ((name = iter.next(&value)) != NULL)
+        while ((name = iter.next(&value)) != nullptr)
             w->addAttribute(name, value);
     }
 
-    node = dom.getFirstChild(node, NULL);
+    node = dom.getFirstChild(node, nullptr);
     while (node)
     {
         write_dom(dom, node, w, false);
-        node = dom.getNextSibling(node, NULL);
+        node = dom.getNextSibling(node, nullptr);
     }
 
     if (!skipRoot)