"NULL !=" = NULL

R=reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/544233002
diff --git a/src/core/SkBBoxHierarchyRecord.cpp b/src/core/SkBBoxHierarchyRecord.cpp
index f4e79fa..4712abb 100644
--- a/src/core/SkBBoxHierarchyRecord.cpp
+++ b/src/core/SkBBoxHierarchyRecord.cpp
@@ -34,9 +34,9 @@
                                                                  SaveFlags flags) {
     // For now, assume all filters affect transparent black.
     // FIXME: This could be made less conservative as an optimization.
-    bool paintAffectsTransparentBlack = NULL != paint &&
-        ((NULL != paint->getImageFilter()) ||
-         (NULL != paint->getColorFilter()));
+    bool paintAffectsTransparentBlack = paint &&
+        ((paint->getImageFilter()) ||
+         (paint->getColorFilter()));
     SkRect drawBounds;
     if (paintAffectsTransparentBlack) {
         SkIRect deviceBounds;
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index adb69da..e28c6fd 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -153,12 +153,12 @@
 }
 
 void SkBitmap::updatePixelsFromRef() const {
-    if (NULL != fPixelRef) {
+    if (fPixelRef) {
         if (fPixelLockCount > 0) {
             SkASSERT(fPixelRef->isLocked());
 
             void* p = fPixelRef->pixels();
-            if (NULL != p) {
+            if (p) {
                 p = (char*)p
                     + fPixelRefOrigin.fY * fRowBytes
                     + fPixelRefOrigin.fX * fInfo.bytesPerPixel();
@@ -221,7 +221,7 @@
 }
 
 void SkBitmap::lockPixels() const {
-    if (NULL != fPixelRef && 0 == sk_atomic_inc(&fPixelLockCount)) {
+    if (fPixelRef && 0 == sk_atomic_inc(&fPixelLockCount)) {
         fPixelRef->lockPixels();
         this->updatePixelsFromRef();
     }
@@ -231,7 +231,7 @@
 void SkBitmap::unlockPixels() const {
     SkASSERT(NULL == fPixelRef || fPixelLockCount > 0);
 
-    if (NULL != fPixelRef && 1 == sk_atomic_dec(&fPixelLockCount)) {
+    if (fPixelRef && 1 == sk_atomic_dec(&fPixelLockCount)) {
         fPixelRef->unlockPixels();
         this->updatePixelsFromRef();
     }
@@ -376,7 +376,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 void SkBitmap::freePixels() {
-    if (NULL != fPixelRef) {
+    if (fPixelRef) {
         if (fPixelLockCount > 0) {
             fPixelRef->unlockPixels();
         }
@@ -1103,7 +1103,7 @@
     SkMaskFilter* filter = paint ? paint->getMaskFilter() : NULL;
 
     // compute our (larger?) dst bounds if we have a filter
-    if (NULL != filter) {
+    if (filter) {
         identity.reset();
         srcM.fImage = NULL;
         if (!filter->filterMask(&dstM, srcM, identity, NULL)) {
@@ -1366,7 +1366,7 @@
         str->appendf(" pixels:%p", this->getPixels());
     } else {
         const char* uri = pr->getURI();
-        if (NULL != uri) {
+        if (uri) {
             str->appendf(" uri:\"%s\"", uri);
         } else {
             str->appendf(" pixelref:%p", pr);
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index 068a107..6c1dc30 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -188,12 +188,12 @@
 
             }
 
-            SkASSERT(NULL != fScaledBitmap.getPixels());
+            SkASSERT(fScaledBitmap.getPixels());
             fScaledBitmap.setImmutable();
             SkBitmapCache::Add(fOrigBitmap, roundedDestWidth, roundedDestHeight, fScaledBitmap);
         }
 
-        SkASSERT(NULL != fScaledBitmap.getPixels());
+        SkASSERT(fScaledBitmap.getPixels());
         fBitmap = &fScaledBitmap;
 
         // set the inv matrix type to translate-only;
diff --git a/src/core/SkBitmapScaler.cpp b/src/core/SkBitmapScaler.cpp
index 0fd2c7b..3501ac8 100644
--- a/src/core/SkBitmapScaler.cpp
+++ b/src/core/SkBitmapScaler.cpp
@@ -315,7 +315,7 @@
 
     *resultPtr = result;
     resultPtr->lockPixels();
-    SkASSERT(NULL != resultPtr->getPixels());
+    SkASSERT(resultPtr->getPixels());
     return true;
 }
 
diff --git a/src/core/SkBitmap_scroll.cpp b/src/core/SkBitmap_scroll.cpp
index 00a72aa..54158c2 100644
--- a/src/core/SkBitmap_scroll.cpp
+++ b/src/core/SkBitmap_scroll.cpp
@@ -15,7 +15,7 @@
         return false;
     }
 
-    if (NULL != subset) {
+    if (subset) {
         SkBitmap tmp;
 
         return  this->extractSubset(&tmp, *subset) &&
@@ -29,14 +29,14 @@
 
     // check if there's nothing to do
     if ((dx | dy) == 0 || width <= 0 || height <= 0) {
-        if (NULL != inval) {
+        if (inval) {
             inval->setEmpty();
         }
         return true;
     }
 
     // compute the inval region now, before we see if there are any pixels
-    if (NULL != inval) {
+    if (inval) {
         SkIRect r;
 
         r.set(0, 0, width, height);
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index b2da6ae..b9e9917 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -700,7 +700,7 @@
     virtual void toString(SkString* str) const SK_OVERRIDE {
         str->append("Sk3DShader: (");
 
-        if (NULL != fProxy) {
+        if (fProxy) {
             str->append("Proxy: ");
             fProxy->toString(str);
         }
@@ -875,7 +875,7 @@
         shader = shader3D;
     }
 
-    if (NULL != mode) {
+    if (mode) {
         switch (interpret_xfermode(*paint, mode, device.colorType())) {
             case kSrcOver_XferInterp:
                 mode = NULL;
diff --git a/src/core/SkBlitter_RGB16.cpp b/src/core/SkBlitter_RGB16.cpp
index a91c0df..8771c19 100644
--- a/src/core/SkBlitter_RGB16.cpp
+++ b/src/core/SkBlitter_RGB16.cpp
@@ -1037,7 +1037,7 @@
     SkXfermode* mode = paint.getXfermode();
 
     // we require a shader if there is an xfermode, handled by our caller
-    SkASSERT(NULL == mode || NULL != shader);
+    SkASSERT(NULL == mode || shader);
 
     if (shader) {
         SkASSERT(shaderContext != NULL);
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 87cadf4..cdc9489 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -83,7 +83,7 @@
 
     DeviceCM(SkBaseDevice* device, int x, int y, const SkPaint* paint, SkCanvas* canvas)
             : fNext(NULL) {
-        if (NULL != device) {
+        if (device) {
             device->ref();
             device->onAttachToCanvas(canvas);
         }
@@ -92,7 +92,7 @@
     }
 
     ~DeviceCM() {
-        if (NULL != fDevice) {
+        if (fDevice) {
             fDevice->onDetachFromCanvas();
             fDevice->unref();
         }
@@ -165,7 +165,7 @@
     DeviceCM*   fTopLayer;
 
     MCRec(const MCRec* prev) {
-        if (NULL != prev) {
+        if (prev) {
             fMatrix = prev->fMatrix;
             fRasterClip = prev->fRasterClip;
 
@@ -769,7 +769,7 @@
         op = SkRegion::kReplace_Op;
     }
     SkIRect ir;
-    if (NULL != bounds) {
+    if (bounds) {
         SkRect r;
 
         this->getTotalMatrix().mapRect(&r, *bounds);
@@ -923,7 +923,7 @@
         since if we're being recorded, we don't want to record this (the
         recorder will have already recorded the restore).
     */
-    if (NULL != layer) {
+    if (layer) {
         if (layer->fNext) {
             const SkIPoint& origin = layer->fDevice->getOrigin();
             this->internalDrawDevice(layer->fDevice, origin.x(), origin.y(),
@@ -1647,7 +1647,7 @@
         return false;
     }
 
-    if (NULL != bounds) {
+    if (bounds) {
         SkRect r;
         // adjust it outwards in case we are antialiasing
         const int inset = 1;
@@ -1668,7 +1668,7 @@
         return false;
     }
 
-    if (NULL != bounds) {
+    if (bounds) {
         *bounds = clip.getBounds();
     }
     return true;
@@ -1695,9 +1695,9 @@
 GrContext* SkCanvas::getGrContext() {
 #if SK_SUPPORT_GPU
     SkBaseDevice* device = this->getTopDevice();
-    if (NULL != device) {
+    if (device) {
         GrRenderTarget* renderTarget = device->accessRenderTarget();
-        if (NULL != renderTarget) {
+        if (renderTarget) {
             return renderTarget->getContext();
         }
     }
@@ -1740,7 +1740,7 @@
 }
 
 void SkCanvas::onDiscard() {
-    if (NULL != fSurfaceBase) {
+    if (fSurfaceBase) {
         fSurfaceBase->aboutToDraw(SkSurface::kDiscard_ContentChangeMode);
     }
 }
@@ -2244,7 +2244,7 @@
 }
 void SkCanvas::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
                             const SkPaint& paint) {
-    if (NULL != blob) {
+    if (blob) {
         this->onDrawTextBlob(blob, x, y, paint);
     }
 }
@@ -2412,19 +2412,19 @@
 ///////////////////////////////////////////////////////////////////////////////
 void SkCanvas::EXPERIMENTAL_optimize(const SkPicture* picture) {
     SkBaseDevice* device = this->getDevice();
-    if (NULL != device) {
+    if (device) {
         device->EXPERIMENTAL_optimize(picture);
     }
 }
 
 void SkCanvas::drawPicture(const SkPicture* picture) {
-    if (NULL != picture) {
+    if (picture) {
         this->onDrawPicture(picture, NULL, NULL);
     }
 }
 
 void SkCanvas::drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint) {
-    if (NULL != picture) {
+    if (picture) {
         if (matrix && matrix->isIdentity()) {
             matrix = NULL;
         }
@@ -2435,7 +2435,7 @@
 void SkCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix,
                              const SkPaint* paint) {
     SkBaseDevice* device = this->getTopDevice();
-    if (NULL != device) {
+    if (device) {
         // Canvas has to first give the device the opportunity to render
         // the picture itself.
         if (device->EXPERIMENTAL_drawPicture(this, picture, matrix, paint)) {
@@ -2551,17 +2551,17 @@
     : fCanvas(canvas)
     , fSaveCount(canvas->getSaveCount())
 {
-    if (NULL != paint) {
+    if (paint) {
         SkRect newBounds = bounds;
         if (matrix) {
             matrix->mapRect(&newBounds);
         }
         canvas->saveLayer(&newBounds, paint);
-    } else if (NULL != matrix) {
+    } else if (matrix) {
         canvas->save();
     }
 
-    if (NULL != matrix) {
+    if (matrix) {
         canvas->concat(*matrix);
     }
 }
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index 85746b2..3093c31 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -597,7 +597,7 @@
 void SkClipStack::getBounds(SkRect* canvFiniteBound,
                             BoundsType* boundType,
                             bool* isIntersectionOfRects) const {
-    SkASSERT(NULL != canvFiniteBound && NULL != boundType);
+    SkASSERT(canvFiniteBound && boundType);
 
     Element* element = (Element*)fDeque.back();
 
@@ -605,7 +605,7 @@
         // the clip is wide open - the infinite plane w/ no pixels un-writeable
         canvFiniteBound->setEmpty();
         *boundType = kInsideOut_BoundsType;
-        if (NULL != isIntersectionOfRects) {
+        if (isIntersectionOfRects) {
             *isIntersectionOfRects = false;
         }
         return;
@@ -613,13 +613,13 @@
 
     *canvFiniteBound = element->fFiniteBound;
     *boundType = element->fFiniteBoundType;
-    if (NULL != isIntersectionOfRects) {
+    if (isIntersectionOfRects) {
         *isIntersectionOfRects = element->fIsIntersectionOfRects;
     }
 }
 
 bool SkClipStack::intersectRectWithClip(SkRect* rect) const {
-    SkASSERT(NULL != rect);
+    SkASSERT(rect);
 
     SkRect bounds;
     SkClipStack::BoundsType bt;
@@ -667,7 +667,7 @@
     SkDeque::Iter iter(fDeque, SkDeque::Iter::kBack_IterStart);
     Element* prior = (Element*) iter.prev();
 
-    if (NULL != prior) {
+    if (prior) {
         if (prior->canBeIntersectedInPlace(fSaveCount, element.getOp())) {
             switch (prior->fType) {
                 case Element::kEmpty_Type:
@@ -766,7 +766,7 @@
     const SkClipStack::Element* element = NULL;
 
     for (element = (const SkClipStack::Element*) fIter.prev();
-         NULL != element;
+         element;
          element = (const SkClipStack::Element*) fIter.prev()) {
 
         if (op == element->fOp) {
@@ -806,7 +806,7 @@
                                         int maxHeight,
                                         SkRect* devBounds,
                                         bool* isIntersectionOfRects) const {
-    SkASSERT(NULL != devBounds);
+    SkASSERT(devBounds);
 
     devBounds->setLTRB(0, 0,
                        SkIntToScalar(maxWidth), SkIntToScalar(maxHeight));
diff --git a/src/core/SkColorTable.cpp b/src/core/SkColorTable.cpp
index b8e7b05..4d0a795 100644
--- a/src/core/SkColorTable.cpp
+++ b/src/core/SkColorTable.cpp
@@ -31,7 +31,7 @@
 SkColorTable::SkColorTable(const SkPMColor colors[], int count, SkAlphaType at)
     : f16BitCache(NULL), fAlphaType(SkToU8(at))
 {
-    SkASSERT(0 == count || NULL != colors);
+    SkASSERT(0 == count || colors);
 
     if (count < 0) {
         count = 0;
diff --git a/src/core/SkDeque.cpp b/src/core/SkDeque.cpp
index d210dcf..27f3efc 100644
--- a/src/core/SkDeque.cpp
+++ b/src/core/SkDeque.cpp
@@ -100,7 +100,7 @@
         SkASSERT(NULL == fBack);
         fFront = fBack = begin;
     } else {
-        SkASSERT(NULL != fBack);
+        SkASSERT(fBack);
         fFront = begin;
     }
 
@@ -141,7 +141,7 @@
         SkASSERT(NULL == fFront);
         fFront = fBack = end;
     } else {
-        SkASSERT(NULL != fFront);
+        SkASSERT(fFront);
         fBack = end;
     }
 
@@ -169,14 +169,14 @@
 
     if (begin < fFrontBlock->fEnd) {
         first->fBegin = begin;
-        SkASSERT(NULL != first->fBegin);
+        SkASSERT(first->fBegin);
         fFront = first->fBegin;
     } else {
         first->fBegin = first->fEnd = NULL;  // mark as empty
         if (NULL == first->fNext) {
             fFront = fBack = NULL;
         } else {
-            SkASSERT(NULL != first->fNext->fBegin);
+            SkASSERT(first->fNext->fBegin);
             fFront = first->fNext->fBegin;
         }
     }
@@ -203,14 +203,14 @@
 
     if (end > last->fBegin) {
         last->fEnd = end;
-        SkASSERT(NULL != last->fEnd);
+        SkASSERT(last->fEnd);
         fBack = last->fEnd - fElemSize;
     } else {
         last->fBegin = last->fEnd = NULL;    // mark as empty
         if (NULL == last->fPrev) {
             fFront = fBack = NULL;
         } else {
-            SkASSERT(NULL != last->fPrev->fEnd);
+            SkASSERT(last->fPrev->fEnd);
             fBack = last->fPrev->fEnd - fElemSize;
         }
     }
@@ -293,14 +293,14 @@
     if (kFront_IterStart == startLoc) {
         // initialize the iterator to start at the front
         fCurBlock = d.fFrontBlock;
-        while (NULL != fCurBlock && NULL == fCurBlock->fBegin) {
+        while (fCurBlock && NULL == fCurBlock->fBegin) {
             fCurBlock = fCurBlock->fNext;
         }
         fPos = fCurBlock ? fCurBlock->fBegin : NULL;
     } else {
         // initialize the iterator to start at the back
         fCurBlock = d.fBackBlock;
-        while (NULL != fCurBlock && NULL == fCurBlock->fEnd) {
+        while (fCurBlock && NULL == fCurBlock->fEnd) {
             fCurBlock = fCurBlock->fPrev;
         }
         fPos = fCurBlock ? fCurBlock->fEnd - fElemSize : NULL;
diff --git a/src/core/SkDistanceFieldGen.cpp b/src/core/SkDistanceFieldGen.cpp
index ef0ee86..92cf1af 100755
--- a/src/core/SkDistanceFieldGen.cpp
+++ b/src/core/SkDistanceFieldGen.cpp
@@ -332,8 +332,8 @@
 static bool generate_distance_field_from_image(unsigned char* distanceField,
                                                const unsigned char* copyPtr,
                                                int width, int height) {
-    SkASSERT(NULL != distanceField);
-    SkASSERT(NULL != copyPtr);
+    SkASSERT(distanceField);
+    SkASSERT(copyPtr);
 
     // we expand our temp data by one more on each side to simplify
     // the scanning code -- will always be treated as infinitely far away
@@ -462,8 +462,8 @@
 bool SkGenerateDistanceFieldFromA8Image(unsigned char* distanceField,
                                         const unsigned char* image,
                                         int width, int height, int rowBytes) {
-    SkASSERT(NULL != distanceField);
-    SkASSERT(NULL != image);
+    SkASSERT(distanceField);
+    SkASSERT(image);
 
     // create temp data
     SkAutoSMalloc<1024> copyStorage((width+2)*(height+2)*sizeof(char));
@@ -490,8 +490,8 @@
 bool SkGenerateDistanceFieldFromBWImage(unsigned char* distanceField,
                                         const unsigned char* image,
                                         int width, int height, int rowBytes) {
-    SkASSERT(NULL != distanceField);
-    SkASSERT(NULL != image);
+    SkASSERT(distanceField);
+    SkASSERT(image);
 
     // create temp data
     SkAutoSMalloc<1024> copyStorage((width+2)*(height+2)*sizeof(char));
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index d0d4f07..3532efd 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -628,7 +628,7 @@
             }
             case SkCanvas::kLines_PointMode:
 #ifndef SK_DISABLE_DASHING_OPTIMIZATION
-                if (2 == count && NULL != paint.getPathEffect()) {
+                if (2 == count && paint.getPathEffect()) {
                     // most likely a dashed line - see if it is one of the ones
                     // we can accelerate
                     SkStrokeRec rec(paint);
@@ -939,7 +939,7 @@
     SkScalar len0 = fast_len(dst[0]);
     SkScalar len1 = fast_len(dst[1]);
     if (len0 <= SK_Scalar1 && len1 <= SK_Scalar1) {
-        if (NULL != coverage) {
+        if (coverage) {
             *coverage = SkScalarAve(len0, len1);
         }
         return true;
@@ -2130,7 +2130,7 @@
                           const SkColor colors[], SkXfermode* xmode,
                           const uint16_t indices[], int indexCount,
                           const SkPaint& paint) const {
-    SkASSERT(0 == count || NULL != vertices);
+    SkASSERT(0 == count || vertices);
 
     // abort early if there is nothing to draw
     if (count < 3 || (indices && indexCount < 3) || fRC->isEmpty()) {
@@ -2168,7 +2168,7 @@
 
     // setup the custom shader (if needed)
     SkAutoTUnref<SkComposeShader> composeShader;
-    if (NULL != colors) {
+    if (colors) {
         if (NULL == textures) {
             // just colors (no texture)
             shader = p.setShader(&triShader);
@@ -2198,9 +2198,9 @@
     VertState       state(count, indices, indexCount);
     VertState::Proc vertProc = state.chooseProc(vmode);
 
-    if (NULL != textures || NULL != colors) {
+    if (textures || colors) {
         while (vertProc(&state)) {
-            if (NULL != textures) {
+            if (textures) {
                 SkMatrix tempM;
                 if (texture_to_matrix(state, vertices, textures, &tempM)) {
                     SkShader::ContextRec rec(*fBitmap, p, *fMatrix);
@@ -2210,7 +2210,7 @@
                     }
                 }
             }
-            if (NULL != colors) {
+            if (colors) {
                 // Find the context for triShader.
                 SkTriColorShader::TriColorShaderContext* triColorShaderContext;
 
diff --git a/src/core/SkEdge.cpp b/src/core/SkEdge.cpp
index dd5ab5f..ac0ca58 100644
--- a/src/core/SkEdge.cpp
+++ b/src/core/SkEdge.cpp
@@ -66,7 +66,7 @@
         return 0;
     }
     // are we completely above or below the clip?
-    if (NULL != clip && (top >= clip->fBottom || bot <= clip->fTop)) {
+    if (clip && (top >= clip->fBottom || bot <= clip->fTop)) {
         return 0;
     }
 
diff --git a/src/core/SkFlattenable.cpp b/src/core/SkFlattenable.cpp
index ae17be5..b0c1697 100644
--- a/src/core/SkFlattenable.cpp
+++ b/src/core/SkFlattenable.cpp
@@ -114,7 +114,7 @@
 }
 
 bool SkFlattenable::NameToType(const char name[], SkFlattenable::Type* type) {
-    SkASSERT(NULL != type);
+    SkASSERT(type);
     InitializeFlattenablesIfNeeded();
 #ifdef SK_DEBUG
     report_no_entries(__FUNCTION__);
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
index 3d29f9f..ab816f9 100755
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -339,7 +339,7 @@
             const_cast<SkGlyph&>(glyph).fImage = fGlyphAlloc.alloc(size,
                                         SkChunkAlloc::kReturnNil_AllocFailType);
             // check that alloc() actually succeeded
-            if (NULL != glyph.fImage) {
+            if (glyph.fImage) {
                 fScalerContext->getImage(glyph);
                 // TODO: the scaler may have changed the maskformat during
                 // getImage (e.g. from AA or LCD to BW) which means we may have
@@ -373,10 +373,10 @@
             }
             const void* image = this->findImage(glyph);
             // now generate the distance field
-            if (NULL != image) {
+            if (image) {
                 const_cast<SkGlyph&>(glyph).fDistanceField = fGlyphAlloc.alloc(size,
                                             SkChunkAlloc::kReturnNil_AllocFailType);
-                if (NULL != glyph.fDistanceField) {
+                if (glyph.fDistanceField) {
                     SkMask::Format maskFormat = static_cast<SkMask::Format>(glyph.fMaskFormat);
                     if (SkMask::kA8_Format == maskFormat) {
                         // make the distance field from the image
diff --git a/src/core/SkImageGenerator.cpp b/src/core/SkImageGenerator.cpp
index 551d8f7..7008e7b 100644
--- a/src/core/SkImageGenerator.cpp
+++ b/src/core/SkImageGenerator.cpp
@@ -60,10 +60,10 @@
 bool SkImageGenerator::getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3]) {
 #ifdef SK_DEBUG
     // In all cases, we need the sizes array
-    SkASSERT(NULL != sizes);
+    SkASSERT(sizes);
 
-    bool isValidWithPlanes = (NULL != planes) && (NULL != rowBytes) &&
-        ((NULL != planes[0]) && (NULL != planes[1]) && (NULL != planes[2]) &&
+    bool isValidWithPlanes = (planes) && (rowBytes) &&
+        ((planes[0]) && (planes[1]) && (planes[2]) &&
          (0  != rowBytes[0]) && (0  != rowBytes[1]) && (0  != rowBytes[2]));
     bool isValidWithoutPlanes =
         ((NULL == planes) ||
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp
index ae29310..f4ba969 100644
--- a/src/core/SkMallocPixelRef.cpp
+++ b/src/core/SkMallocPixelRef.cpp
@@ -30,7 +30,7 @@
     if (kIndex8_SkColorType == info.fColorType && NULL == ctable) {
         return false;
     }
-    if (kIndex8_SkColorType != info.fColorType && NULL != ctable) {
+    if (kIndex8_SkColorType != info.fColorType && ctable) {
         return false;
     }
 #endif
diff --git a/src/core/SkMaskGamma.h b/src/core/SkMaskGamma.h
index 08ed97f..fb67c1a 100644
--- a/src/core/SkMaskGamma.h
+++ b/src/core/SkMaskGamma.h
@@ -194,9 +194,7 @@
     ~SkTMaskPreBlend() { }
 
     /** True if this PreBlend should be applied. When false, fR, fG, and fB are NULL. */
-    bool isApplicable() const {
-        return NULL != this->fG;
-    }
+    bool isApplicable() const { return SkToBool(this->fG); }
 
     const uint8_t* fR;
     const uint8_t* fG;
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index 814f16a..2a29587 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -1766,15 +1766,15 @@
         sin1 = -sin1;
     }
 
-    if (NULL != scale) {
+    if (scale) {
         scale->fX = SkDoubleToScalar(w1);
         scale->fY = SkDoubleToScalar(w2);
     }
-    if (NULL != rotation1) {
+    if (rotation1) {
         rotation1->fX = cos1;
         rotation1->fY = sin1;
     }
-    if (NULL != rotation2) {
+    if (rotation2) {
         rotation2->fX = cos2;
         rotation2->fY = sin2;
     }
diff --git a/src/core/SkMessageBus.h b/src/core/SkMessageBus.h
index f36c42b..1290ea9 100644
--- a/src/core/SkMessageBus.h
+++ b/src/core/SkMessageBus.h
@@ -85,7 +85,7 @@
 
 template<typename Message>
 void SkMessageBus<Message>::Inbox::poll(SkTDArray<Message>* messages) {
-    SkASSERT(NULL != messages);
+    SkASSERT(messages);
     messages->reset();
     SkAutoMutexAcquire lock(fMessagesMutex);
     messages->swap(fMessages);
diff --git a/src/core/SkMultiPictureDraw.cpp b/src/core/SkMultiPictureDraw.cpp
index 50af2b7..eb1e55e 100644
--- a/src/core/SkMultiPictureDraw.cpp
+++ b/src/core/SkMultiPictureDraw.cpp
@@ -38,12 +38,12 @@
 
     data->picture = SkRef(picture);
     data->canvas = SkRef(canvas);
-    if (NULL != matrix) {
+    if (matrix) {
         data->matrix = *matrix;
     } else {
         data->matrix.setIdentity();
     }
-    if (NULL != paint) {
+    if (paint) {
         data->paint = SkNEW_ARGS(SkPaint, (*paint));
     } else {
         data->paint = NULL;
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index d19efb0..5d7c2cc 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1040,7 +1040,7 @@
 
     SkMeasureCacheProc glyphCacheProc;
     glyphCacheProc = this->getMeasureCacheProc(kForward_TextBufferDirection,
-                                               NULL != bounds);
+                                               bounds);
 
     int xyIndex;
     JoinBoundsProc joinBoundsProc;
@@ -1298,7 +1298,7 @@
         return 0;
     }
 
-    SkASSERT(NULL != textData);
+    SkASSERT(textData);
 
     if (NULL == widths && NULL == bounds) {
         return this->countText(textData, byteLength);
@@ -1312,7 +1312,7 @@
     SkGlyphCache*       cache = autoCache.getCache();
     SkMeasureCacheProc  glyphCacheProc;
     glyphCacheProc = paint.getMeasureCacheProc(kForward_TextBufferDirection,
-                                               NULL != bounds);
+                                               bounds);
 
     const char* text = (const char*)textData;
     const char* stop = text + byteLength;
@@ -2311,7 +2311,7 @@
     str->append("<dl><dt>SkPaint:</dt><dd><dl>");
 
     SkTypeface* typeface = this->getTypeface();
-    if (NULL != typeface) {
+    if (typeface) {
         SkDynamicMemoryWStream ostream;
         typeface->serialize(&ostream);
         SkAutoTUnref<SkData> data(ostream.copyToData());
@@ -2343,60 +2343,60 @@
     str->append("</dd>");
 
     SkPathEffect* pathEffect = this->getPathEffect();
-    if (NULL != pathEffect) {
+    if (pathEffect) {
         str->append("<dt>PathEffect:</dt><dd>");
         str->append("</dd>");
     }
 
     SkShader* shader = this->getShader();
-    if (NULL != shader) {
+    if (shader) {
         str->append("<dt>Shader:</dt><dd>");
         shader->toString(str);
         str->append("</dd>");
     }
 
     SkXfermode* xfer = this->getXfermode();
-    if (NULL != xfer) {
+    if (xfer) {
         str->append("<dt>Xfermode:</dt><dd>");
         xfer->toString(str);
         str->append("</dd>");
     }
 
     SkMaskFilter* maskFilter = this->getMaskFilter();
-    if (NULL != maskFilter) {
+    if (maskFilter) {
         str->append("<dt>MaskFilter:</dt><dd>");
         maskFilter->toString(str);
         str->append("</dd>");
     }
 
     SkColorFilter* colorFilter = this->getColorFilter();
-    if (NULL != colorFilter) {
+    if (colorFilter) {
         str->append("<dt>ColorFilter:</dt><dd>");
         colorFilter->toString(str);
         str->append("</dd>");
     }
 
     SkRasterizer* rasterizer = this->getRasterizer();
-    if (NULL != rasterizer) {
+    if (rasterizer) {
         str->append("<dt>Rasterizer:</dt><dd>");
         str->append("</dd>");
     }
 
     SkDrawLooper* looper = this->getLooper();
-    if (NULL != looper) {
+    if (looper) {
         str->append("<dt>DrawLooper:</dt><dd>");
         looper->toString(str);
         str->append("</dd>");
     }
 
     SkImageFilter* imageFilter = this->getImageFilter();
-    if (NULL != imageFilter) {
+    if (imageFilter) {
         str->append("<dt>ImageFilter:</dt><dd>");
         str->append("</dd>");
     }
 
     SkAnnotation* annotation = this->getAnnotation();
-    if (NULL != annotation) {
+    if (annotation) {
         str->append("<dt>Annotation:</dt><dd>");
         str->append("</dd>");
     }
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index c0049ca..b89aec3 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1914,7 +1914,7 @@
 }
 
 SkPath::Verb SkPath::RawIter::next(SkPoint pts[4]) {
-    SkASSERT(NULL != pts);
+    SkASSERT(pts);
     if (fVerbs == fVerbStop) {
         return kDone_Verb;
     }
@@ -2007,7 +2007,7 @@
         SkDEBUGCODE(this->validate();)
         buffer.skipToAlign4();
         sizeRead = buffer.pos();
-    } else if (NULL != pathRef) {
+    } else if (pathRef) {
         // If the buffer is not valid, pathRef should be NULL
         sk_throw();
     }
diff --git a/src/core/SkPathRef.cpp b/src/core/SkPathRef.cpp
index e60f618..64f6fb8 100644
--- a/src/core/SkPathRef.cpp
+++ b/src/core/SkPathRef.cpp
@@ -343,7 +343,7 @@
     }
 
     if (SkPath::kConic_Verb == verb) {
-        SkASSERT(NULL != weights);
+        SkASSERT(weights);
         *weights = fConicWeights.append(numVbs);
     }
 
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index e80a17b..9cfa6a0 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -234,7 +234,7 @@
                (fNumAAConcavePaths - fNumAAHairlineConcavePaths)
                    < kNumAAConcavePathsTol;
 
-    if (!ret && NULL != reason) {
+    if (!ret && reason) {
         if (!suitableForDash) {
             if (0 != sampleCount) {
                 *reason = "Can't use multisample on dash effect.";
@@ -296,7 +296,7 @@
 // fRecord OK
 const SkPicture::AccelData* SkPicture::EXPERIMENTAL_getAccelData(
         SkPicture::AccelData::Key key) const {
-    if (NULL != fAccelData.get() && fAccelData->getKey() == key) {
+    if (fAccelData.get() && fAccelData->getKey() == key) {
         return fAccelData.get();
     }
     return NULL;
@@ -328,20 +328,20 @@
 
 // fRecord OK
 void SkPicture::playback(SkCanvas* canvas, SkDrawPictureCallback* callback) const {
-    SkASSERT(NULL != canvas);
-    SkASSERT(NULL != fData.get() || NULL != fRecord.get());
+    SkASSERT(canvas);
+    SkASSERT(fData.get() || fRecord.get());
 
     // If the query contains the whole picture, don't bother with the BBH.
     SkRect clipBounds = { 0, 0, 0, 0 };
     (void)canvas->getClipBounds(&clipBounds);
     const bool useBBH = !clipBounds.contains(this->cullRect());
 
-    if (NULL != fData.get()) {
+    if (fData.get()) {
         SkPicturePlayback playback(this);
         playback.setUseBBH(useBBH);
         playback.draw(canvas, callback);
     }
-    if (NULL != fRecord.get()) {
+    if (fRecord.get()) {
         SkRecordDraw(*fRecord, canvas, useBBH ? fBBH.get() : NULL, callback);
     }
 }
@@ -531,10 +531,10 @@
 
     // If we're a new-format picture, backport to old format for serialization.
     SkAutoTDelete<SkPicture> oldFormat;
-    if (NULL == data && NULL != fRecord.get()) {
+    if (NULL == data && fRecord.get()) {
         oldFormat.reset(backport(*fRecord, this->cullRect()));
         data = oldFormat->fData.get();
-        SkASSERT(NULL != data);
+        SkASSERT(data);
     }
 
     SkPictInfo info;
@@ -542,7 +542,7 @@
     SkASSERT(sizeof(SkPictInfo) == 32);
     stream->write(&info, sizeof(info));
 
-    if (NULL != data) {
+    if (data) {
         stream->writeBool(true);
         data->serialize(stream, encoder);
     } else {
@@ -556,10 +556,10 @@
 
     // If we're a new-format picture, backport to old format for serialization.
     SkAutoTDelete<SkPicture> oldFormat;
-    if (NULL == data && NULL != fRecord.get()) {
+    if (NULL == data && fRecord.get()) {
         oldFormat.reset(backport(*fRecord, this->cullRect()));
         data = oldFormat->fData.get();
-        SkASSERT(NULL != data);
+        SkASSERT(data);
     }
 
     SkPictInfo info;
@@ -569,7 +569,7 @@
     buffer.writeRect(info.fCullRect);
     buffer.writeUInt(info.fFlags);
 
-    if (NULL != data) {
+    if (data) {
         buffer.writeBool(true);
         data->flatten(buffer);
     } else {
@@ -584,7 +584,7 @@
         return fAnalysis.suitableForGpuRasterization(reason, 0);
     }
     if (NULL == fData.get()) {
-        if (NULL != reason) {
+        if (reason) {
             *reason = "Missing internal data.";
         }
         return false;
@@ -657,7 +657,7 @@
 // SkGpuDevice::EXPERIMENTAL_optimize which should be only called from a single
 // thread.
 void SkPicture::addDeletionListener(DeletionListener* listener) const {
-    SkASSERT(NULL != listener);
+    SkASSERT(listener);
 
     *fDeletionListeners.append() = SkRef(listener);
 }
diff --git a/src/core/SkPictureContentInfo.cpp b/src/core/SkPictureContentInfo.cpp
index 1d19f35..937173c 100644
--- a/src/core/SkPictureContentInfo.cpp
+++ b/src/core/SkPictureContentInfo.cpp
@@ -27,7 +27,7 @@
     bool ret = suitableForDash &&
                     (fNumAAConcavePaths - fNumAAHairlineConcavePaths)
                     < kNumAAConcavePaths;
-    if (!ret && NULL != reason) {
+    if (!ret && reason) {
         if (!suitableForDash) {
             if (0 != sampleCount) {
                 *reason = "Can't use multisample on dash effect.";
@@ -66,7 +66,7 @@
 }
 
 void SkPictureContentInfo::onAddPaintPtr(const SkPaint* paint) {
-    if (NULL != paint && NULL != paint->getPathEffect()) {
+    if (paint && paint->getPathEffect()) {
         ++fNumPaintWithPathEffectUses;
     }
 }
diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp
index e5a004e..a2d10e3 100644
--- a/src/core/SkPictureData.cpp
+++ b/src/core/SkPictureData.cpp
@@ -30,7 +30,7 @@
 
 void SkPictureData::initForPlayback() const {
     // ensure that the paths bounds are pre-computed
-    if (NULL != fPathHeap.get()) {
+    if (fPathHeap.get()) {
         for (int i = 0; i < fPathHeap->count(); i++) {
             (*fPathHeap.get())[i].updateBoundsCache();
         }
@@ -53,7 +53,7 @@
     SkSafeRef(fStateTree);
     fContentInfo.set(record.fContentInfo);
 
-    if (NULL != fBoundingHierarchy) {
+    if (fBoundingHierarchy) {
         fBoundingHierarchy->flushDeferredInserts();
     }
 
diff --git a/src/core/SkPictureData.h b/src/core/SkPictureData.h
index 019bfb2..d2b5b4a 100644
--- a/src/core/SkPictureData.h
+++ b/src/core/SkPictureData.h
@@ -142,7 +142,7 @@
     void initIterator(SkPictureStateTree::Iterator* iter,
                       const SkTDArray<void*>& draws,
                       SkCanvas* canvas) const {
-        if (NULL != fStateTree) {
+        if (fStateTree) {
             fStateTree->initIterator(iter, draws, canvas);
         }
     }
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index 78b65d6..308ce9e 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -83,7 +83,7 @@
                                      SkCanvas* canvas,
                                      const SkPicture::OperationList *activeOpsList) {
 
-    if (NULL != activeOpsList) {
+    if (activeOpsList) {
         if (0 == activeOpsList->numOps()) {
             return false;  // nothing to draw
         }
@@ -150,7 +150,7 @@
     SkAutoCanvasRestore acr(canvas, false);
 
     while (!reader.eof()) {
-        if (NULL != callback && callback->abortDrawing()) {
+        if (callback && callback->abortDrawing()) {
             return;
         }
 
diff --git a/src/core/SkPicturePlayback.h b/src/core/SkPicturePlayback.h
index 6114fee..cdfa8ef 100644
--- a/src/core/SkPicturePlayback.h
+++ b/src/core/SkPicturePlayback.h
@@ -68,7 +68,7 @@
     public:
         AutoResetOpID(SkPicturePlayback* playback) : fPlayback(playback) { }
         ~AutoResetOpID() {
-            if (NULL != fPlayback) {
+            if (fPlayback) {
                 fPlayback->resetOpID();
             }
         }
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 67bd9a5..a6b6f61 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -190,7 +190,7 @@
 
     // op + bool for 'bounds'
     size_t size = 2 * kUInt32Size;
-    if (NULL != bounds) {
+    if (bounds) {
         size += sizeof(*bounds); // + rect
     }
     // + paint index + flags
@@ -558,12 +558,12 @@
                                       SkBBoxHierarchy* boundingHierarchy) {
     switch (opt) {
     case kCollapseSaveLayer_OptType:
-        if (NULL != stateTree) {
+        if (stateTree) {
             stateTree->saveCollapsed();
         }
         break;
     case kRewind_OptType:
-        if (NULL != boundingHierarchy) {
+        if (boundingHierarchy) {
             boundingHierarchy->rewindInserts();
         }
         // Note: No need to touch the state tree for this to work correctly.
@@ -596,7 +596,7 @@
     if (fOptsEnabled) {
         for (opt = 0; opt < SK_ARRAY_COUNT(gPictureRecordOpts); ++opt) {
             if (0 != (gPictureRecordOpts[opt].fFlags & kSkipIfBBoxHierarchy_Flag)
-                && NULL != fBoundingHierarchy) {
+                && fBoundingHierarchy) {
                 continue;
             }
             if ((*gPictureRecordOpts[opt].fProc)(&fWriter, fRestoreOffsetStack.top(), &fPaints)) {
@@ -972,7 +972,7 @@
 
     // id + paint index + bitmap index + bool for 'src' + flags
     size_t size = 5 * kUInt32Size;
-    if (NULL != src) {
+    if (src) {
         size += sizeof(*src);   // + rect
     }
     size += sizeof(dst);        // + rect
@@ -1264,7 +1264,7 @@
     if (indexCount > 0) {
         flags |= DRAW_VERTICES_HAS_INDICES;
     }
-    if (NULL != xfer) {
+    if (xfer) {
         SkXfermode::Mode mode;
         if (xfer->asMode(&mode) && SkXfermode::kModulate_Mode != mode) {
             flags |= DRAW_VERTICES_HAS_XFER;
@@ -1318,15 +1318,15 @@
     // op + paint index + patch 12 control points + flag + patch 4 colors + 4 texture coordinates
     size_t size = 2 * kUInt32Size + SkPatchUtils::kNumCtrlPts * sizeof(SkPoint) + kUInt32Size;
     uint32_t flag = 0;
-    if (NULL != colors) {
+    if (colors) {
         flag |= DRAW_VERTICES_HAS_COLORS;
         size += SkPatchUtils::kNumCorners * sizeof(SkColor);
     }
-    if (NULL != texCoords) {
+    if (texCoords) {
         flag |= DRAW_VERTICES_HAS_TEXS;
         size += SkPatchUtils::kNumCorners * sizeof(SkPoint);
     }
-    if (NULL != xmode) {
+    if (xmode) {
         SkXfermode::Mode mode;
         if (xmode->asMode(&mode) && SkXfermode::kModulate_Mode != mode) {
             flag |= DRAW_VERTICES_HAS_XFER;
@@ -1341,10 +1341,10 @@
     this->addInt(flag);
     
     // write optional parameters
-    if (NULL != colors) {
+    if (colors) {
         fWriter.write(colors, SkPatchUtils::kNumCorners * sizeof(SkColor));
     }
-    if (NULL != texCoords) {
+    if (texCoords) {
         fWriter.write(texCoords, SkPatchUtils::kNumCorners * sizeof(SkPoint));
     }
     if (flag & DRAW_VERTICES_HAS_XFER) {
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp
index 92deac3..77274e6 100644
--- a/src/core/SkPictureRecorder.cpp
+++ b/src/core/SkPictureRecorder.cpp
@@ -35,11 +35,11 @@
 
     const SkISize size = SkISize::Make(width, height);
 
-    if (NULL != bbhFactory) {
+    if (bbhFactory) {
         // We don't need to hold a ref on the BBH ourselves, but might as well for
         // consistency with EXPERIMENTAL_beginRecording(), which does need to.
         fBBH.reset((*bbhFactory)(width, height));
-        SkASSERT(NULL != fBBH.get());
+        SkASSERT(fBBH.get());
         fPictureRecord.reset(SkNEW_ARGS(SkBBoxHierarchyRecord, (size, recordFlags, fBBH.get())));
     } else {
         fPictureRecord.reset(SkNEW_ARGS(SkPictureRecord, (size, recordFlags)));
@@ -54,9 +54,9 @@
     fCullWidth = width;
     fCullHeight = height;
 
-    if (NULL != bbhFactory) {
+    if (bbhFactory) {
         fBBH.reset((*bbhFactory)(width, height));
-        SkASSERT(NULL != fBBH.get());
+        SkASSERT(fBBH.get());
     }
 
     fRecord.reset(SkNEW(SkRecord));
@@ -65,7 +65,7 @@
 }
 
 SkCanvas* SkPictureRecorder::getRecordingCanvas() {
-    if (NULL != fRecorder.get()) {
+    if (fRecorder.get()) {
         return fRecorder.get();
     }
     return fPictureRecord.get();
@@ -74,12 +74,12 @@
 SkPicture* SkPictureRecorder::endRecording() {
     SkPicture* picture = NULL;
 
-    if (NULL != fRecord.get()) {
+    if (fRecord.get()) {
         picture = SkNEW_ARGS(SkPicture, (fCullWidth, fCullHeight, 
                                          fRecord.detach(), fBBH.get()));
     }
 
-    if (NULL != fPictureRecord.get()) {
+    if (fPictureRecord.get()) {
         fPictureRecord->endRecording();
         const bool deepCopyOps = false;
         picture = SkNEW_ARGS(SkPicture, (fCullWidth, fCullHeight, 
@@ -90,7 +90,7 @@
 }
 
 void SkPictureRecorder::internalOnly_EnableOpts(bool enableOpts) {
-    if (NULL != fPictureRecord.get()) {
+    if (fPictureRecord.get()) {
         fPictureRecord->internalOnly_EnableOpts(enableOpts);
     }
 }
@@ -100,11 +100,11 @@
         return;
     }
 
-    if (NULL != fRecord.get()) {
+    if (fRecord.get()) {
         SkRecordDraw(*fRecord, canvas, NULL/*bbh*/, NULL/*callback*/);
     }
 
-    if (NULL != fPictureRecord.get()) {
+    if (fPictureRecord.get()) {
         const bool deepCopyOps = true;
         SkPicture picture(fCullWidth, fCullHeight, 
                           *fPictureRecord.get(), deepCopyOps);
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp
index a7b5412..03eeb74 100644
--- a/src/core/SkPictureShader.cpp
+++ b/src/core/SkPictureShader.cpp
@@ -22,7 +22,7 @@
                                  const SkMatrix* localMatrix, const SkRect* tile)
     : INHERITED(localMatrix)
     , fPicture(SkRef(picture))
-    , fTile(NULL != tile ? *tile : picture->cullRect())
+    , fTile(tile ? *tile : picture->cullRect())
     , fTmx(tmx)
     , fTmy(tmy) {
 }
@@ -42,7 +42,7 @@
 
 SkPictureShader* SkPictureShader::Create(const SkPicture* picture, TileMode tmx, TileMode tmy,
                                          const SkMatrix* localMatrix, const SkRect* tile) {
-    if (!picture || picture->cullRect().isEmpty() || (NULL != tile && tile->isEmpty())) {
+    if (!picture || picture->cullRect().isEmpty() || (tile && tile->isEmpty())) {
         return NULL;
     }
     return SkNEW_ARGS(SkPictureShader, (picture, tmx, tmy, localMatrix, tile));
diff --git a/src/core/SkPictureStateTree.cpp b/src/core/SkPictureStateTree.cpp
index d2f0e6e..704a04e 100644
--- a/src/core/SkPictureStateTree.cpp
+++ b/src/core/SkPictureStateTree.cpp
@@ -46,7 +46,7 @@
 }
 
 void SkPictureStateTree::saveCollapsed() {
-    SkASSERT(NULL != fLastRestoredNode);
+    SkASSERT(fLastRestoredNode);
     SkASSERT(SkToBool(fLastRestoredNode->fFlags & \
         (Node::kSaveLayer_Flag | Node::kSave_Flag)));
     SkASSERT(fLastRestoredNode->fParent == fCurrentState.fNode);
@@ -102,7 +102,7 @@
 }
 
 void SkPictureStateTree::Iterator::setCurrentMatrix(const SkMatrix* matrix) {
-    SkASSERT(NULL != matrix);
+    SkASSERT(matrix);
 
     if (matrix == fCurrentMatrix) {
         return;
diff --git a/src/core/SkPoint.cpp b/src/core/SkPoint.cpp
index 8a6d056..5fee0e8 100644
--- a/src/core/SkPoint.cpp
+++ b/src/core/SkPoint.cpp
@@ -224,7 +224,7 @@
 
     SkScalar uLengthSqd = u.lengthSqd();
     SkScalar det = u.cross(v);
-    if (NULL != side) {
+    if (side) {
         SkASSERT(-1 == SkPoint::kLeft_Side &&
                   0 == SkPoint::kOn_Side &&
                   1 == kRight_Side);
diff --git a/src/core/SkRTree.cpp b/src/core/SkRTree.cpp
index 77f94e2..17872ba 100644
--- a/src/core/SkRTree.cpp
+++ b/src/core/SkRTree.cpp
@@ -75,7 +75,7 @@
     Branch* newSibling = insert(fRoot.fChild.subtree, &newBranch);
     fRoot.fBounds = this->computeBounds(fRoot.fChild.subtree);
 
-    if (NULL != newSibling) {
+    if (newSibling) {
         Node* oldRoot = fRoot.fChild.subtree;
         Node* newRoot = this->allocateNode(oldRoot->fLevel + 1);
         newRoot->fNumChildren = 2;
@@ -143,7 +143,7 @@
         root->child(childIndex)->fBounds = this->computeBounds(
             root->child(childIndex)->fChild.subtree);
     }
-    if (NULL != toInsert) {
+    if (toInsert) {
         if (root->fNumChildren == fMaxChildren) {
             // handle overflow by splitting. TODO: opportunistic reinsertion
 
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index 3845a5c..ac1e429 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -14,7 +14,7 @@
                   SkDrawPictureCallback* callback) {
     SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
 
-    if (NULL != bbh) {
+    if (bbh) {
         // Draw only ops that affect pixels in the canvas's current clip.
         // The SkRecord and BBH were recorded in identity space.  This canvas
         // is not necessarily in that same space.  getClipBounds() returns us
@@ -28,7 +28,7 @@
 
         SkRecords::Draw draw(canvas);
         for (int i = 0; i < ops.count(); i++) {
-            if (NULL != callback && callback->abortDrawing()) {
+            if (callback && callback->abortDrawing()) {
                 return;
             }
             record.visit<void>((uintptr_t)ops[i], draw);  // See FillBounds below.
@@ -37,7 +37,7 @@
         // Draw all ops.
         SkRecords::Draw draw(canvas);
         for (unsigned i = 0; i < record.count(); i++) {
-            if (NULL != callback && callback->abortDrawing()) {
+            if (callback && callback->abortDrawing()) {
                 return;
             }
             record.visit<void>(i, draw);
@@ -154,7 +154,7 @@
         }
 
         // Finally feed all stored bounds into the BBH.  They'll be returned in this order.
-        SkASSERT(NULL != bbh);
+        SkASSERT(bbh);
         for (uintptr_t i = 0; i < record.count(); i++) {
             if (!fBounds[i].isEmpty()) {
                 bbh->insert((void*)i, fBounds[i], true/*ok to defer*/);
diff --git a/src/core/SkResourceCache.cpp b/src/core/SkResourceCache.cpp
index 7ffdfff..73f788c 100644
--- a/src/core/SkResourceCache.cpp
+++ b/src/core/SkResourceCache.cpp
@@ -222,7 +222,7 @@
     SkASSERT(rec);
     // See if we already have this key (racy inserts, etc.)
     const Rec* existing = this->findAndLock(rec->getKey());
-    if (NULL != existing) {
+    if (existing) {
         SkDELETE(rec);
         return existing;
     }
@@ -242,7 +242,7 @@
     SkASSERT(rec);
     // See if we already have this key (racy inserts, etc.)
     const Rec* existing = this->findAndLock(rec->getKey());
-    if (NULL != existing) {
+    if (existing) {
         SkDELETE(rec);
         this->unlock(existing);
         return;
@@ -414,9 +414,9 @@
     }
 
     SkASSERT(NULL == fHead->fPrev);
-    SkASSERT(NULL != fHead->fNext);
+    SkASSERT(fHead->fNext);
     SkASSERT(NULL == fTail->fNext);
-    SkASSERT(NULL != fTail->fPrev);
+    SkASSERT(fTail->fPrev);
 
     size_t used = 0;
     int count = 0;
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp
index b32d68e..0d95061 100644
--- a/src/core/SkScan_Path.cpp
+++ b/src/core/SkScan_Path.cpp
@@ -727,7 +727,7 @@
 
     SkScanClipper clipper(blitter, clipRgn, ir);
     blitter = clipper.getBlitter();
-    if (NULL != blitter) {
+    if (blitter) {
         sk_fill_triangle(pts, clipper.getClipRect(), blitter, ir);
     }
 }
diff --git a/src/core/SkSpriteBlitter_ARGB32.cpp b/src/core/SkSpriteBlitter_ARGB32.cpp
index a4ae41c..142d6ca 100644
--- a/src/core/SkSpriteBlitter_ARGB32.cpp
+++ b/src/core/SkSpriteBlitter_ARGB32.cpp
@@ -135,12 +135,12 @@
         do {
             const SkPMColor* tmp = src;
 
-            if (NULL != colorFilter) {
+            if (colorFilter) {
                 colorFilter->filterSpan(src, width, fBuffer);
                 tmp = fBuffer;
             }
 
-            if (NULL != xfermode) {
+            if (xfermode) {
                 xfermode->xfer32(dst, tmp, width, NULL);
             } else {
                 fProc32(dst, tmp, width, fAlpha);
@@ -183,10 +183,10 @@
         do {
             fillbuffer(buffer, src, width);
 
-            if (NULL != colorFilter) {
+            if (colorFilter) {
                 colorFilter->filterSpan(buffer, width, buffer);
             }
-            if (NULL != xfermode) {
+            if (xfermode) {
                 xfermode->xfer32(dst, buffer, width, NULL);
             } else {
                 fProc32(dst, buffer, width, fAlpha);
diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp
index 5069bb0..ca9f51f 100644
--- a/src/core/SkStream.cpp
+++ b/src/core/SkStream.cpp
@@ -255,7 +255,7 @@
         return new SkMemoryStream();
     }
 
-    if (NULL != fData.get()) {
+    if (fData.get()) {
         return new SkMemoryStream(fData);
     }
 
diff --git a/src/core/SkTDynamicHash.h b/src/core/SkTDynamicHash.h
index 496dc8d..23544c8 100644
--- a/src/core/SkTDynamicHash.h
+++ b/src/core/SkTDynamicHash.h
@@ -114,13 +114,13 @@
 
     // Remove the entry with this key.  We require that an entry with this key is present.
     void remove(const Key& key) {
-        SkASSERT(NULL != this->find(key));
+        SkASSERT(this->find(key));
         this->innerRemove(key);
         SkASSERT(this->validate());
     }
 
     void rewind() {
-        if (NULL != fArray) {
+        if (fArray) {
             sk_bzero(fArray, sizeof(T*)* fCapacity);
         }
         fCount = 0;
@@ -177,7 +177,7 @@
                     deleted++;
                 } else if (Empty() != fArray[i]) {
                     count++;
-                    SKTDYNAMICHASH_CHECK(NULL != this->find(GetKey(*fArray[i])));
+                    SKTDYNAMICHASH_CHECK(this->find(GetKey(*fArray[i])));
                 }
             }
             SKTDYNAMICHASH_CHECK(count == fCount);
diff --git a/src/core/SkTLList.h b/src/core/SkTLList.h
index e2b9691..5cb74cf 100644
--- a/src/core/SkTLList.h
+++ b/src/core/SkTLList.h
@@ -53,7 +53,7 @@
         this->validate();
         typename NodeList::Iter iter;
         Node* node = iter.init(fList, Iter::kHead_IterStart);
-        while (NULL != node) {
+        while (node) {
             SkTCast<T*>(node->fObj)->~T();
             Block* block = node->fBlock;
             node = iter.next();
@@ -126,7 +126,7 @@
     void popHead() {
         this->validate();
         Node* node = fList.head();
-        if (NULL != node) {
+        if (node) {
             this->removeNode(node);
         }
         this->validate();
@@ -135,7 +135,7 @@
     void popTail() {
         this->validate();
         Node* node = fList.head();
-        if (NULL != node) {
+        if (node) {
             this->removeNode(node);
         }
         this->validate();
@@ -175,7 +175,7 @@
         for (Iter a(*this, Iter::kHead_IterStart), b(list, Iter::kHead_IterStart);
              a.get();
              a.next(), b.next()) {
-            SkASSERT(NULL != b.get()); // already checked that counts match.
+            SkASSERT(b.get()); // already checked that counts match.
             if (!(*a.get() == *b.get())) {
                 return false;
             }
@@ -219,7 +219,7 @@
         Node* getNode() { return INHERITED::get(); }
 
         T* nodeToObj(Node* node) {
-            if (NULL != node) {
+            if (node) {
                 return reinterpret_cast<T*>(node->fObj);
             } else {
                 return NULL;
@@ -243,7 +243,7 @@
 
     Node* createNode() {
         Node* node = fFreeList.head();
-        if (NULL != node) {
+        if (node) {
             fFreeList.remove(node);
             ++node->fBlock->fNodesInUse;
         } else {
@@ -263,7 +263,7 @@
     }
 
     void removeNode(Node* node) {
-        SkASSERT(NULL != node);
+        SkASSERT(node);
         fList.remove(node);
         SkTCast<T*>(node->fObj)->~T();
         if (0 == --node->fBlock->fNodesInUse) {
@@ -369,7 +369,7 @@
 void *operator new(size_t, SkTLList<T>* list,
                    typename SkTLList<T>::Placement placement,
                    const typename SkTLList<T>::Iter& location) {
-    SkASSERT(NULL != list);
+    SkASSERT(list);
     if (SkTLList<T>::kBefore_Placement == placement) {
         return list->internalAddBefore(location);
     } else {
diff --git a/src/core/SkTLS.cpp b/src/core/SkTLS.cpp
index f7bf304..3f78a24 100755
--- a/src/core/SkTLS.cpp
+++ b/src/core/SkTLS.cpp
@@ -45,7 +45,7 @@
         SkTLSRec* next = rec->fNext;
         SkDELETE(rec);
         rec = next;
-    } while (NULL != rec);
+    } while (rec);
 }
 
 void* SkTLS::Get(CreateProc createProc, DeleteProc deleteProc) {
diff --git a/src/core/SkTMultiMap.h b/src/core/SkTMultiMap.h
index c0b59ba..70076f0 100644
--- a/src/core/SkTMultiMap.h
+++ b/src/core/SkTMultiMap.h
@@ -37,7 +37,7 @@
 
     void insert(const Key& key, T* value) {
         ValueList* list = fHash.find(key);
-        if (NULL != list) {
+        if (list) {
             // The new ValueList entry is inserted as the second element in the
             // linked list, and it will contain the value of the first element.
             ValueList* newEntry = SkNEW_ARGS(ValueList, (list->fValue));
@@ -57,19 +57,19 @@
         ValueList* list = fHash.find(key);
         // Since we expect the caller to be fully aware of what is stored, just
         // assert that the caller removes an existing value.
-        SkASSERT(NULL != list);
+        SkASSERT(list);
         ValueList* prev = NULL;
         while (list->fValue != value) {
             prev = list;
             list = list->fNext;
         }
 
-        if (NULL != list->fNext) {
+        if (list->fNext) {
             ValueList* next = list->fNext;
             list->fValue = next->fValue;
             list->fNext = next->fNext;
             SkDELETE(next);
-        } else if (NULL != prev) {
+        } else if (prev) {
             prev->fNext = NULL;
             SkDELETE(list);
         } else {
@@ -82,7 +82,7 @@
 
     T* find(const Key& key) const {
         ValueList* list = fHash.find(key);
-        if (NULL != list) {
+        if (list) {
             return list->fValue;
         }
         return NULL;
@@ -91,7 +91,7 @@
     template<class FindPredicate>
     T* find(const Key& key, const FindPredicate f) {
         ValueList* list = fHash.find(key);
-        while (NULL != list) {
+        while (list) {
             if (f(list->fValue)){
                 return list->fValue;
             }
diff --git a/src/core/SkTextBlob.cpp b/src/core/SkTextBlob.cpp
index d928d7b..ee110c7 100644
--- a/src/core/SkTextBlob.cpp
+++ b/src/core/SkTextBlob.cpp
@@ -112,7 +112,7 @@
 SkTextBlob::RunIterator::RunIterator(const SkTextBlob* blob)
     : fBlob(blob)
     , fIndex(0) {
-    SkASSERT(NULL != blob);
+    SkASSERT(blob);
 }
 
 bool SkTextBlob::RunIterator::done() const {
@@ -194,7 +194,7 @@
 }
 
 void SkTextBlobBuilder::updateDeferredBounds() {
-    SkASSERT(!fDeferredBounds || (NULL != fRuns && !fRuns->empty()));
+    SkASSERT(!fDeferredBounds || (fRuns && !fRuns->empty()));
 
     if (!fDeferredBounds) {
         return;
@@ -249,7 +249,7 @@
     fGlyphBuffer.append(count);
     fPosBuffer.append(count * posScalarsPerGlyph);
 
-    SkASSERT(NULL != fRuns && !fRuns->empty());
+    SkASSERT(fRuns && !fRuns->empty());
     SkTextBlob::Run& run = fRuns->back();
 
     run.count += count;
@@ -264,7 +264,7 @@
     SkASSERT(NULL == fCurrentRunBuffer.pos || fCurrentRunBuffer.pos >= fPosBuffer.begin());
 
     if (!fDeferredBounds) {
-        if (NULL != bounds) {
+        if (bounds) {
             fBounds.join(*bounds);
         } else {
             fDeferredBounds = true;
@@ -301,7 +301,7 @@
 
     if (fGlyphBuffer.count() > 0) {
         // we have some glyphs, construct a real blob
-        SkASSERT(NULL != fRuns && !fRuns->empty());
+        SkASSERT(fRuns && !fRuns->empty());
 
         this->updateDeferredBounds();
 
diff --git a/src/core/SkUtils.cpp b/src/core/SkUtils.cpp
index eff718b..b063071 100644
--- a/src/core/SkUtils.cpp
+++ b/src/core/SkUtils.cpp
@@ -193,7 +193,7 @@
 }
 
 int SkUTF8_CountUnichars(const char utf8[], size_t byteLength) {
-    SkASSERT(NULL != utf8 || 0 == byteLength);
+    SkASSERT(utf8 || 0 == byteLength);
 
     int         count = 0;
     const char* stop = utf8 + byteLength;
@@ -206,7 +206,7 @@
 }
 
 SkUnichar SkUTF8_ToUnichar(const char utf8[]) {
-    SkASSERT(NULL != utf8);
+    SkASSERT(utf8);
 
     const uint8_t*  p = (const uint8_t*)utf8;
     int             c = *p;
@@ -227,7 +227,7 @@
 }
 
 SkUnichar SkUTF8_NextUnichar(const char** ptr) {
-    SkASSERT(NULL != ptr && NULL != *ptr);
+    SkASSERT(ptr && *ptr);
 
     const uint8_t*  p = (const uint8_t*)*ptr;
     int             c = *p;
@@ -249,7 +249,7 @@
 }
 
 SkUnichar SkUTF8_PrevUnichar(const char** ptr) {
-    SkASSERT(NULL != ptr && NULL != *ptr);
+    SkASSERT(ptr && *ptr);
 
     const char* p = *ptr;
 
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index b10b5e1..91aa847 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -840,7 +840,7 @@
             } else {
                 dstColor = fsBuilder->dstColor();
             }
-            SkASSERT(NULL != dstColor);
+            SkASSERT(dstColor);
 
             // We don't try to optimize for this case at all
             if (NULL == inputColor) {
@@ -1298,7 +1298,7 @@
 
     SkXfermodeProc proc = fProc;
 
-    if (NULL != proc) {
+    if (proc) {
         if (NULL == aa) {
             for (int i = count - 1; i >= 0; --i) {
                 dst[i] = proc(src[i], dst[i]);
@@ -1326,7 +1326,7 @@
 
     SkXfermodeProc proc = fProc;
 
-    if (NULL != proc) {
+    if (proc) {
         if (NULL == aa) {
             for (int i = count - 1; i >= 0; --i) {
                 SkPMColor dstC = SkPixel16ToPixel32(dst[i]);
@@ -1355,7 +1355,7 @@
 
     SkXfermodeProc proc = fProc;
 
-    if (NULL != proc) {
+    if (proc) {
         if (NULL == aa) {
             for (int i = count - 1; i >= 0; --i) {
                 SkPMColor res = proc(src[i], dst[i] << SK_A32_SHIFT);
@@ -1381,9 +1381,9 @@
 #if SK_SUPPORT_GPU
 bool SkProcCoeffXfermode::asNewEffect(GrEffect** effect, GrTexture* background) const {
     if (XferEffect::IsSupportedMode(fMode)) {
-        if (NULL != effect) {
+        if (effect) {
             *effect = XferEffect::Create(fMode, background);
-            SkASSERT(NULL != *effect);
+            SkASSERT(*effect);
         }
         return true;
     }
@@ -1594,7 +1594,7 @@
     if (count <= 0) {
         return;
     }
-    if (NULL != aa) {
+    if (aa) {
         return this->INHERITED::xfer32(dst, src, count, aa);
     }
 
@@ -1641,7 +1641,7 @@
     if (count <= 0) {
         return;
     }
-    if (NULL != aa) {
+    if (aa) {
         return this->INHERITED::xfer32(dst, src, count, aa);
     }