"NULL !=" = NULL

R=reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/544233002
diff --git a/bench/ChartBench.cpp b/bench/ChartBench.cpp
index f33d2da..8d05ef1 100644
--- a/bench/ChartBench.cpp
+++ b/bench/ChartBench.cpp
@@ -64,7 +64,7 @@
         x += xDelta;
     }
 
-    if (NULL != bottomData) {
+    if (bottomData) {
         SkASSERT(bottomData->count() == topData.count());
         // iterate backwards over the previous graph's data to generate the bottom of the filled
         // area (and account for leftShift).
diff --git a/bench/ETCBitmapBench.cpp b/bench/ETCBitmapBench.cpp
index 529f5f6..36573c8 100644
--- a/bench/ETCBitmapBench.cpp
+++ b/bench/ETCBitmapBench.cpp
@@ -21,7 +21,7 @@
 // This takes the etc1 data pointed to by orig, and copies it `factor` times in each
 // dimension. The return value is the new data or NULL on error.
 static etc1_byte* create_expanded_etc1_bitmap(const uint8_t* orig, int factor) {
-    SkASSERT(NULL != orig);
+    SkASSERT(orig);
     SkASSERT(factor > 1);
 
     const etc1_byte* origData = reinterpret_cast<const etc1_byte*>(orig);
diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp
index 068aff2..d86ccf4 100644
--- a/bench/GrResourceCacheBench.cpp
+++ b/bench/GrResourceCacheBench.cpp
@@ -146,7 +146,7 @@
         desc.fHeight |= 1;
         GrResourceKey key = TextureResource::ComputeKey(desc);
         GrGpuResource* item = cache->find(key);
-        if (NULL != item) {
+        if (item) {
             SkFAIL("cache add does not work as expected");
             return;
         }
@@ -157,7 +157,7 @@
         h |= 1;
         GrResourceKey key = StencilResource::ComputeKey(w, h, s);
         GrGpuResource* item = cache->find(key);
-        if (NULL != item) {
+        if (item) {
             SkFAIL("cache add does not work as expected");
             return;
         }
diff --git a/bench/HairlinePathBench.cpp b/bench/HairlinePathBench.cpp
index e7e2b42..7b413c4 100644
--- a/bench/HairlinePathBench.cpp
+++ b/bench/HairlinePathBench.cpp
@@ -181,7 +181,7 @@
 #if SK_SUPPORT_GPU
         GrContext* context = canvas->getGrContext();
         // This is a workaround for skbug.com/2078. See also skbug.com/2033.
-        if (NULL != context) {
+        if (context) {
             GrTestTarget tt;
             context->getTestTarget(&tt);
             if (tt.target()->caps()->pathRenderingSupport()) {
diff --git a/bench/ResultsWriter.h b/bench/ResultsWriter.h
index 5628373..f17bce3 100644
--- a/bench/ResultsWriter.h
+++ b/bench/ResultsWriter.h
@@ -98,7 +98,7 @@
         fBench = &fResults[id.c_str()];
     }
     virtual void config(const char name[]) {
-        SkASSERT(NULL != fBench);
+        SkASSERT(fBench);
         fConfig = &(*fBench)[name];
     }
     virtual void configOption(const char name[], const char* value) {
@@ -109,7 +109,7 @@
         if (sk_double_isnan(ms)) {
             return;
         }
-        SkASSERT(NULL != fConfig);
+        SkASSERT(fConfig);
         (*fConfig)[name] = ms;
     }
 
diff --git a/bench/XfermodeBench.cpp b/bench/XfermodeBench.cpp
index f73943b..54272da 100644
--- a/bench/XfermodeBench.cpp
+++ b/bench/XfermodeBench.cpp
@@ -18,12 +18,12 @@
 public:
     XfermodeBench(SkXfermode::Mode mode) {
         fXfermode.reset(SkXfermode::Create(mode));
-        SkASSERT(NULL != fXfermode.get() || SkXfermode::kSrcOver_Mode == mode);
+        SkASSERT(fXfermode.get() || SkXfermode::kSrcOver_Mode == mode);
         fName.printf("Xfermode_%s", SkXfermode::ModeName(mode));
     }
 
     XfermodeBench(SkXfermode* xferMode, const char* name) {
-        SkASSERT(NULL != xferMode);
+        SkASSERT(xferMode);
         fXfermode.reset(xferMode);
         fName.printf("Xfermode_%s", name);
     }
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index ea62570..452da1f 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -619,7 +619,7 @@
 #endif
                  cpu_bench(       overhead, bench.get(), canvas, samples.get());
 
-            if (canvas && !FLAGS_writePath.isEmpty() && NULL != FLAGS_writePath[0]) {
+            if (canvas && !FLAGS_writePath.isEmpty() && FLAGS_writePath[0]) {
                 SkString pngFilename = SkOSPath::Join(FLAGS_writePath[0], config);
                 pngFilename = SkOSPath::Join(pngFilename.c_str(), bench->getName());
                 pngFilename.append(".png");
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index 1a324fd..b03b8f3 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -186,7 +186,7 @@
         int opIndex = -1;
 
         while (!reader.eof()) {
-            if (NULL != callback && callback->abortDrawing()) {
+            if (callback && callback->abortDrawing()) {
                 return;
             }
 
diff --git a/debugger/SkDebugger.cpp b/debugger/SkDebugger.cpp
index 8833df3..b220043 100644
--- a/debugger/SkDebugger.cpp
+++ b/debugger/SkDebugger.cpp
@@ -98,7 +98,7 @@
         overview->append(SkDrawCommand::GetCommandString((DrawType) i));
         overview->append(": ");
         overview->appendS32(counts[i]);
-        if (NULL != typeTimes && totTime >= 0.0) {
+        if (typeTimes && totTime >= 0.0) {
             overview->append(" - ");
             overview->appendf("%.2f", (*typeTimes)[i]/(float)numRuns);
             overview->append("ms");
@@ -115,7 +115,7 @@
         total += counts[i];
     }
 #ifdef SK_DEBUG
-    if (NULL != typeTimes) {
+    if (typeTimes) {
         SkASSERT(SkScalarNearlyEqual(SkDoubleToScalar(totPercent),
                                      SkDoubleToScalar(100.0)));
         SkASSERT(SkScalarNearlyEqual(SkDoubleToScalar(tempSum),
diff --git a/debugger/SkDebugger.h b/debugger/SkDebugger.h
index 9ad21e2..53b480a 100644
--- a/debugger/SkDebugger.h
+++ b/debugger/SkDebugger.h
@@ -100,25 +100,25 @@
     }
 
     void setOverdrawViz(bool overDrawViz) {
-        if (NULL != fDebugCanvas) {
+        if (fDebugCanvas) {
             fDebugCanvas->setOverdrawViz(overDrawViz);
         }
     }
 
     void setPathOps(bool pathOps) {
-        if (NULL != fDebugCanvas) {
+        if (fDebugCanvas) {
             fDebugCanvas->setAllowSimplifyClip(pathOps);
         }
     }
 
     void setMegaViz(bool megaViz) {
-        if (NULL != fDebugCanvas) {
+        if (fDebugCanvas) {
             fDebugCanvas->setMegaVizMode(megaViz);
         }
     }
 
     void setTexFilterOverride(bool texFilterOverride, SkPaint::FilterLevel level) {
-        if (NULL != fDebugCanvas) {
+        if (fDebugCanvas) {
             fDebugCanvas->overrideTexFiltering(texFilterOverride, level);
         }
     }
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index f150b7c..f2e09b0 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -166,7 +166,7 @@
 
                     GrTestTarget tt;
                     context->getTestTarget(&tt);
-                    SkASSERT(NULL != tt.target());
+                    SkASSERT(tt.target());
                     GrDrawState* drawState = tt.target()->drawState();
                     drawState->setVertexAttribs<kAttribs>(2, sizeof(Vertex));
 
@@ -321,7 +321,7 @@
 
                     GrTestTarget tt;
                     context->getTestTarget(&tt);
-                    SkASSERT(NULL != tt.target());
+                    SkASSERT(tt.target());
                     GrDrawState* drawState = tt.target()->drawState();
                     drawState->setVertexAttribs<kAttribs>(2, sizeof(Vertex));
 
@@ -505,7 +505,7 @@
 
                     GrTestTarget tt;
                     context->getTestTarget(&tt);
-                    SkASSERT(NULL != tt.target());
+                    SkASSERT(tt.target());
                     GrDrawState* drawState = tt.target()->drawState();
                     drawState->setVertexAttribs<kAttribs>(2, sizeof(Vertex));
 
diff --git a/gm/bleed.cpp b/gm/bleed.cpp
index 99dba70..aa2b0df 100644
--- a/gm/bleed.cpp
+++ b/gm/bleed.cpp
@@ -212,7 +212,7 @@
 #if SK_SUPPORT_GPU
             GrContext* ctx = canvas->getGrContext();
             int oldMaxTextureSize = 0;
-            if (NULL != ctx) {
+            if (ctx) {
                 // shrink the max texture size so all our textures can be reasonably sized
                 oldMaxTextureSize = ctx->getMaxTextureSize();
                 ctx->setMaxTextureSizeOverride(kMaxTextureSize);
@@ -244,7 +244,7 @@
             this->drawCase4(canvas, kCol6X, kRow3Y, SkCanvas::kBleed_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
 
 #if SK_SUPPORT_GPU
-            if (NULL != ctx) {
+            if (ctx) {
                 ctx->setMaxTextureSizeOverride(oldMaxTextureSize);
             }
 #endif
diff --git a/gm/convexpolyclip.cpp b/gm/convexpolyclip.cpp
index 35c4426..328cdb5 100644
--- a/gm/convexpolyclip.cpp
+++ b/gm/convexpolyclip.cpp
@@ -158,7 +158,7 @@
         int testLayers = kBench_Mode != this->getMode();
         for (int doLayer = 0; doLayer <= testLayers; ++doLayer) {
             for (SkTLList<Clip>::Iter iter(fClips, SkTLList<Clip>::Iter::kHead_IterStart);
-                 NULL != iter.get();
+                 iter.get();
                  iter.next()) {
                 const Clip* clip = iter.get();
                 SkScalar x = startX;
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index 275193f..8d73da5 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -114,7 +114,7 @@
 
         SkScalar y = 0;
         for (SkTLList<SkPath>::Iter iter(fPaths, SkTLList<SkPath>::Iter::kHead_IterStart);
-             NULL != iter.get();
+             iter.get();
              iter.next()) {
             const SkPath* path = iter.get();
             SkScalar x = 0;
@@ -172,7 +172,7 @@
         }
 
         for (SkTLList<SkRect>::Iter iter(fRects, SkTLList<SkRect>::Iter::kHead_IterStart);
-             NULL != iter.get();
+             iter.get();
              iter.next()) {
 
             SkScalar x = 0;
diff --git a/gm/factory.cpp b/gm/factory.cpp
index 608c049..a9bf519 100644
--- a/gm/factory.cpp
+++ b/gm/factory.cpp
@@ -32,7 +32,7 @@
         // Copyright-free file from http://openclipart.org/detail/29213/paper-plane-by-ddoo
         SkString pngFilename = GetResourcePath("plane.png");
         SkAutoDataUnref data(SkData::NewFromFileName(pngFilename.c_str()));
-        if (NULL != data.get()) {
+        if (data.get()) {
             // Create a cache which will boot the pixels out anytime the
             // bitmap is unlocked.
             SkAutoTUnref<SkDiscardableMemoryPool> pool(
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 40d616e..94df02c 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -849,7 +849,7 @@
             // If we have access to a single expected bitmap, log more
             // detail about the mismatch.
             const SkBitmap *expectedBitmapPtr = expectations.asBitmap();
-            if (NULL != expectedBitmapPtr) {
+            if (expectedBitmapPtr) {
                 report_bitmap_diffs(*expectedBitmapPtr, actualBitmapAndDigest.fBitmap,
                                     completeName);
             }
@@ -1762,7 +1762,7 @@
                 desc.fHeight = gm->getISize().height();
                 desc.fSampleCnt = config.fSampleCnt;
                 auGpuTarget.reset(gr->createUncachedTexture(desc, NULL, 0));
-                if (NULL != auGpuTarget) {
+                if (auGpuTarget) {
                     gpuTarget = auGpuTarget;
                     grSuccess = true;
                     // Set the user specified cache limits if non-default.
@@ -2297,10 +2297,10 @@
         if (FLAGS_writePath.count() == 1) {
             SkDebugf("writing to %s\n", FLAGS_writePath[0]);
         }
-        if (NULL != gmmain.fMismatchPath) {
+        if (gmmain.fMismatchPath) {
             SkDebugf("writing mismatches to %s\n", gmmain.fMismatchPath);
         }
-        if (NULL != gmmain.fMissingExpectationsPath) {
+        if (gmmain.fMissingExpectationsPath) {
             SkDebugf("writing images without expectations to %s\n",
                      gmmain.fMissingExpectationsPath);
         }
@@ -2324,13 +2324,13 @@
                 return -1;
             }
         }
-        if (NULL != gmmain.fMismatchPath) {
+        if (gmmain.fMismatchPath) {
             if (!prepare_subdirectories(gmmain.fMismatchPath, gmmain.fUseFileHierarchy,
                                         configs, pdfRasterizers)) {
                 return -1;
             }
         }
-        if (NULL != gmmain.fMissingExpectationsPath) {
+        if (gmmain.fMissingExpectationsPath) {
             if (!prepare_subdirectories(gmmain.fMissingExpectationsPath, gmmain.fUseFileHierarchy,
                                         configs, pdfRasterizers)) {
                 return -1;
diff --git a/gm/image.cpp b/gm/image.cpp
index ff184d1..e405a05 100644
--- a/gm/image.cpp
+++ b/gm/image.cpp
@@ -192,7 +192,7 @@
         canvas->translate(80, 0);
         test_surface(canvas, surf1, true);
 #if SK_SUPPORT_GPU
-        if (NULL != ctx) {
+        if (ctx) {
             canvas->translate(80, 0);
             test_surface(canvas, surf4, true);
         }
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp
index 37ed885..8af268e 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -46,7 +46,7 @@
         SkBitmap source = src;
         SkImageFilter* input = getInput(0);
         SkIPoint srcOffset = SkIPoint::Make(0, 0);
-        if (NULL != input && !input->filterImage(proxy, src, ctx, &source, &srcOffset)) {
+        if (input && !input->filterImage(proxy, src, ctx, &source, &srcOffset)) {
             return false;
         }
 
diff --git a/gm/samplerstress.cpp b/gm/samplerstress.cpp
index c395b08..29be684 100644
--- a/gm/samplerstress.cpp
+++ b/gm/samplerstress.cpp
@@ -71,7 +71,7 @@
     }
 
     void createShader() {
-        if (NULL != fShader.get()) {
+        if (fShader.get()) {
             return;
         }
 
@@ -83,7 +83,7 @@
     }
 
     void createMaskFilter() {
-        if (NULL != fMaskFilter.get()) {
+        if (fMaskFilter.get()) {
             return;
         }
 
diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp
index e3e1629..74ca643 100644
--- a/gm/xfermodes3.cpp
+++ b/gm/xfermodes3.cpp
@@ -125,7 +125,7 @@
         SkCanvas* tempCanvas = NULL;
 #if SK_SUPPORT_GPU
         GrContext* context = baseCanvas->getGrContext();
-        if (NULL != context) {
+        if (context) {
             GrTextureDesc desc;
             desc.fWidth = w;
             desc.fHeight = h;
@@ -133,7 +133,7 @@
             desc.fFlags = kRenderTarget_GrTextureFlagBit;
             SkAutoTUnref<GrSurface> surface(context->createUncachedTexture(desc, NULL, 0));
             SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(surface.get()));
-            if (NULL != device.get()) {
+            if (device.get()) {
                 tempCanvas = SkNEW_ARGS(SkCanvas, (device.get()));
             }
         }
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 4e512c0..b36a1fd 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -444,7 +444,7 @@
     */
     bool readyToDraw() const {
         return this->getPixels() != NULL &&
-               (this->colorType() != kIndex_8_SkColorType || NULL != fColorTable);
+               (this->colorType() != kIndex_8_SkColorType || fColorTable);
     }
 
     /** Returns the pixelRef's texture, or NULL
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 6b2266a..f514d18 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -1442,13 +1442,13 @@
 public:
     SkAutoCommentBlock(SkCanvas* canvas, const char* description) {
         fCanvas = canvas;
-        if (NULL != fCanvas) {
+        if (fCanvas) {
             fCanvas->beginCommentGroup(description);
         }
     }
 
     ~SkAutoCommentBlock() {
-        if (NULL != fCanvas) {
+        if (fCanvas) {
             fCanvas->endCommentGroup();
         }
     }
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index d2fb737..9f44bed 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -349,7 +349,7 @@
     bool SK_WARN_UNUSED_RESULT invert(SkMatrix* inverse) const {
         // Allow the trivial case to be inlined.
         if (this->isIdentity()) {
-            if (NULL != inverse) {
+            if (inverse) {
                 inverse->reset();
             }
             return true;
diff --git a/include/core/SkMetaData.h b/include/core/SkMetaData.h
index 5db437c..c8ca7f1 100644
--- a/include/core/SkMetaData.h
+++ b/include/core/SkMetaData.h
@@ -81,7 +81,7 @@
     bool hasData(const char name[], const void* data, size_t byteCount) const {
         size_t len;
         const void* ptr = this->findData(name, &len);
-        return NULL != ptr && len == byteCount && !memcmp(ptr, data, len);
+        return ptr && len == byteCount && !memcmp(ptr, data, len);
     }
 
     void setS32(const char name[], int32_t value);
diff --git a/include/core/SkPathRef.h b/include/core/SkPathRef.h
index ba68fcb..0b661b4 100644
--- a/include/core/SkPathRef.h
+++ b/include/core/SkPathRef.h
@@ -144,7 +144,7 @@
      *              fact ovals can report false.
      */
     bool isOval(SkRect* rect) const {
-        if (fIsOval && NULL != rect) {
+        if (fIsOval && rect) {
             *rect = getBounds();
         }
 
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index ce38c67..f092e77 100644
--- a/include/core/SkRefCnt.h
+++ b/include/core/SkRefCnt.h
@@ -168,7 +168,7 @@
 }
 
 template<typename T> static inline void SkSafeSetNull(T*& obj) {
-    if (NULL != obj) {
+    if (obj) {
         obj->unref();
         obj = NULL;
     }
diff --git a/include/core/SkTArray.h b/include/core/SkTArray.h
index 6c76c78..06a85bc 100644
--- a/include/core/SkTArray.h
+++ b/include/core/SkTArray.h
@@ -384,7 +384,7 @@
                                     gMIN_ALLOC_COUNT;
         fPreAllocMemArray   = preAllocStorage;
         if (fReserveCount >= fCount &&
-            NULL != preAllocStorage) {
+            preAllocStorage) {
             fAllocCount = fReserveCount;
             fMemArray = preAllocStorage;
         } else {
@@ -427,7 +427,7 @@
             fAllocCount = newAllocCount;
             char* newMemArray;
 
-            if (fAllocCount == fReserveCount && NULL != fPreAllocMemArray) {
+            if (fAllocCount == fReserveCount && fPreAllocMemArray) {
                 newMemArray = (char*) fPreAllocMemArray;
             } else {
                 newMemArray = (char*) sk_malloc_throw(fAllocCount*sizeof(T));
diff --git a/include/core/SkTInternalLList.h b/include/core/SkTInternalLList.h
index 1c82a71..1aa1a12 100644
--- a/include/core/SkTInternalLList.h
+++ b/include/core/SkTInternalLList.h
@@ -46,18 +46,18 @@
     }
 
     void remove(T* entry) {
-        SkASSERT(NULL != fHead && NULL != fTail);
+        SkASSERT(fHead && fTail);
         SkASSERT(this->isInList(entry));
 
         T* prev = entry->fPrev;
         T* next = entry->fNext;
 
-        if (NULL != prev) {
+        if (prev) {
             prev->fNext = next;
         } else {
             fHead = next;
         }
-        if (NULL != next) {
+        if (next) {
             next->fPrev = prev;
         } else {
             fTail = prev;
@@ -77,7 +77,7 @@
 
         entry->fPrev = NULL;
         entry->fNext = fHead;
-        if (NULL != fHead) {
+        if (fHead) {
             fHead->fPrev = entry;
         }
         fHead = entry;
@@ -96,7 +96,7 @@
 
         entry->fPrev = fTail;
         entry->fNext = NULL;
-        if (NULL != fTail) {
+        if (fTail) {
             fTail->fNext = entry;
         }
         fTail = entry;
@@ -115,7 +115,7 @@
      * at the tail.
      */
     void addBefore(T* newEntry, T* existingEntry) {
-        SkASSERT(NULL != newEntry);
+        SkASSERT(newEntry);
 
         if (NULL == existingEntry) {
             this->addToTail(newEntry);
@@ -144,7 +144,7 @@
      * at the head.
      */
     void addAfter(T* newEntry, T* existingEntry) {
-        SkASSERT(NULL != newEntry);
+        SkASSERT(newEntry);
 
         if (NULL == existingEntry) {
             this->addToHead(newEntry);
@@ -227,7 +227,7 @@
     void validate() const {
         SkASSERT(!fHead == !fTail);
         Iter iter;
-        for (T* item = iter.init(*this, Iter::kHead_IterStart); NULL != item; item = iter.next()) {
+        for (T* item = iter.init(*this, Iter::kHead_IterStart); item; item = iter.next()) {
             SkASSERT(this->isInList(item));
             if (NULL == item->fPrev) {
                 SkASSERT(fHead == item);
@@ -255,7 +255,7 @@
      */
     int countEntries() const {
         int count = 0;
-        for (T* entry = fHead; NULL != entry; entry = entry->fNext) {
+        for (T* entry = fHead; entry; entry = entry->fNext) {
             ++count;
         }
         return count;
diff --git a/include/core/SkTLazy.h b/include/core/SkTLazy.h
index a291e22..a1dc001 100644
--- a/include/core/SkTLazy.h
+++ b/include/core/SkTLazy.h
@@ -88,7 +88,7 @@
      *  Returns true if a valid object has been initialized in the SkTLazy,
      *  false otherwise.
      */
-    bool isValid() const { return NULL != fPtr; }
+    bool isValid() const { return SkToBool(fPtr); }
 
     /**
      * Returns the object. This version should only be called when the caller
@@ -166,7 +166,7 @@
      * Returns a writable T*. The first time this is called the initial object is cloned.
      */
     T* writable() {
-        SkASSERT(NULL != fObj);
+        SkASSERT(fObj);
         if (!fLazy.isValid()) {
             fLazy.set(*fObj);
             fObj = fLazy.get();
diff --git a/include/core/SkTemplates.h b/include/core/SkTemplates.h
index f561f46..5ef28ea 100644
--- a/include/core/SkTemplates.h
+++ b/include/core/SkTemplates.h
@@ -170,7 +170,7 @@
 public:
     SkAutoTDestroy(T* obj = NULL) : fObj(obj) {}
     ~SkAutoTDestroy() {
-        if (NULL != fObj) {
+        if (fObj) {
             fObj->~T();
         }
     }
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index bdd2e93..0e9e230 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -539,7 +539,7 @@
      */
     void* reset(size_t size, OnShrink shrink = kAlloc_OnShrink,  bool* didChangeAlloc = NULL) {
         if (size == fSize || (kReuse_OnShrink == shrink && size < fSize)) {
-            if (NULL != didChangeAlloc) {
+            if (didChangeAlloc) {
                 *didChangeAlloc = false;
             }
             return fPtr;
@@ -548,7 +548,7 @@
         sk_free(fPtr);
         fPtr = size ? sk_malloc_throw(size) : NULL;
         fSize = size;
-        if (NULL != didChangeAlloc) {
+        if (didChangeAlloc) {
             *didChangeAlloc = true;
         }
 
@@ -643,7 +643,7 @@
                 bool* didChangeAlloc = NULL) {
         size = (size < kSize) ? kSize : size;
         bool alloc = size != fSize && (SkAutoMalloc::kAlloc_OnShrink == shrink || size > fSize);
-        if (NULL != didChangeAlloc) {
+        if (didChangeAlloc) {
             *didChangeAlloc = alloc;
         }
         if (alloc) {
diff --git a/include/gpu/GrClipData.h b/include/gpu/GrClipData.h
index 1dc4b0d..12a23b3 100644
--- a/include/gpu/GrClipData.h
+++ b/include/gpu/GrClipData.h
@@ -35,7 +35,7 @@
             return false;
         }
 
-        if (NULL != fClipStack && NULL != other.fClipStack) {
+        if (fClipStack && other.fClipStack) {
             return *fClipStack == *other.fClipStack;
         }
 
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 4f9b642..4172543 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -745,7 +745,7 @@
             fContext = context;
         }
         ~AutoRenderTarget() {
-            if (NULL != fContext) {
+            if (fContext) {
                 fContext->setRenderTarget(fPrevTarget);
             }
             SkSafeUnref(fPrevTarget);
@@ -779,7 +779,7 @@
          * Initializes by pre-concat'ing the context's current matrix with the preConcat param.
          */
         void setPreConcat(GrContext* context, const SkMatrix& preConcat, GrPaint* paint = NULL) {
-            SkASSERT(NULL != context);
+            SkASSERT(context);
 
             this->restore();
 
@@ -793,11 +793,11 @@
          * update a paint but the matrix cannot be inverted.
          */
         bool setIdentity(GrContext* context, GrPaint* paint = NULL) {
-            SkASSERT(NULL != context);
+            SkASSERT(context);
 
             this->restore();
 
-            if (NULL != paint) {
+            if (paint) {
                 if (!paint->localCoordChangeInverse(context->getMatrix())) {
                     return false;
                 }
@@ -813,7 +813,7 @@
          * required to update a paint but the matrix cannot be inverted.
          */
         bool set(GrContext* context, const SkMatrix& newMatrix, GrPaint* paint = NULL) {
-            if (NULL != paint) {
+            if (paint) {
                 if (!this->setIdentity(context, paint)) {
                     return false;
                 }
@@ -835,7 +835,7 @@
          * performs an incremental update of the paint.
          */
         void preConcat(const SkMatrix& preConcat, GrPaint* paint = NULL) {
-            if (NULL != paint) {
+            if (paint) {
                 paint->localCoordChange(preConcat);
             }
             fContext->concatMatrix(preConcat);
@@ -845,13 +845,13 @@
          * Returns false if never initialized or the inverse matrix was required to update a paint
          * but the matrix could not be inverted.
          */
-        bool succeeded() const { return NULL != fContext; }
+        bool succeeded() const { return SkToBool(fContext); }
 
         /**
          * If this has been initialized then the context's original matrix is restored.
          */
         void restore() {
-            if (NULL != fContext) {
+            if (fContext) {
                 fContext->setMatrix(fMatrix);
                 fContext = NULL;
             }
@@ -890,7 +890,7 @@
         }
 
         ~AutoClip() {
-            if (NULL != fContext) {
+            if (fContext) {
                 fContext->setClip(fOldClip);
             }
         }
@@ -1091,7 +1091,7 @@
     }
 
     void reset() {
-        if (NULL != fContext && NULL != fTexture) {
+        if (fContext && fTexture) {
             fContext->unlockScratchTexture(fTexture);
             fTexture->unref();
             fTexture = NULL;
@@ -1124,7 +1124,7 @@
         SkASSERT(!texture->unique());
         texture->impl()->setFlag((GrTextureFlags) GrTextureImpl::kReturnToCache_FlagBit);
         texture->unref();
-        SkASSERT(NULL != texture->getCacheEntry());
+        SkASSERT(texture->getCacheEntry());
 
         return texture;
     }
@@ -1135,7 +1135,7 @@
         this->reset();
 
         fContext = context;
-        if (NULL != fContext) {
+        if (fContext) {
             fTexture = fContext->lockAndRefScratchTexture(desc, match);
             if (NULL == fTexture) {
                 fContext = NULL;
diff --git a/include/gpu/GrContextFactory.h b/include/gpu/GrContextFactory.h
index bc06594..d78120c 100644
--- a/include/gpu/GrContextFactory.h
+++ b/include/gpu/GrContextFactory.h
@@ -95,11 +95,11 @@
 
     void destroyContexts() {
         for (int i = 0; i < fContexts.count(); ++i) {
-            if (NULL != fContexts[i].fGLContext) {  //  could be abandoned.
+            if (fContexts[i].fGLContext) {  //  could be abandoned.
                 fContexts[i].fGLContext->makeCurrent();
             }
             fContexts[i].fGrContext->unref();
-            if (NULL != fContexts[i].fGLContext) {
+            if (fContexts[i].fGLContext) {
                 fContexts[i].fGLContext->unref();
             }
         }
@@ -108,7 +108,7 @@
 
     void abandonContexts() {
         for (int i = 0; i < fContexts.count(); ++i) {
-            if (NULL != fContexts[i].fGLContext) {
+            if (fContexts[i].fGLContext) {
                 fContexts[i].fGLContext->testAbandon();
                 SkSafeSetNull(fContexts[i].fGLContext);
             }
diff --git a/include/gpu/GrCoordTransform.h b/include/gpu/GrCoordTransform.h
index 0bd7da0..734c26f 100644
--- a/include/gpu/GrCoordTransform.h
+++ b/include/gpu/GrCoordTransform.h
@@ -63,7 +63,7 @@
 
     void reset(GrCoordSet sourceCoords, const GrTexture* texture) {
         SkASSERT(!fInEffect);
-        SkASSERT(NULL != texture);
+        SkASSERT(texture);
         this->reset(sourceCoords, MakeDivByTextureWHMatrix(texture), texture);
     }
 
@@ -71,7 +71,7 @@
         SkASSERT(!fInEffect);
         fSourceCoords = sourceCoords;
         fMatrix = m;
-        fReverseY = NULL != texture && kBottomLeft_GrSurfaceOrigin == texture->origin();
+        fReverseY = texture && kBottomLeft_GrSurfaceOrigin == texture->origin();
     }
 
     GrCoordTransform& operator= (const GrCoordTransform& other) {
@@ -104,7 +104,7 @@
     /** Useful for effects that want to insert a texture matrix that is implied by the texture
         dimensions */
     static inline SkMatrix MakeDivByTextureWHMatrix(const GrTexture* texture) {
-        SkASSERT(NULL != texture);
+        SkASSERT(texture);
         SkMatrix mat;
         mat.setIDiv(texture->width(), texture->height());
         return mat;
diff --git a/include/gpu/GrDrawEffect.h b/include/gpu/GrDrawEffect.h
index 6aff82e..2bf17d8 100644
--- a/include/gpu/GrDrawEffect.h
+++ b/include/gpu/GrDrawEffect.h
@@ -21,8 +21,8 @@
     GrDrawEffect(const GrEffectStage& stage, bool explicitLocalCoords)
         : fEffectStage(&stage)
         , fExplicitLocalCoords(explicitLocalCoords) {
-        SkASSERT(NULL != fEffectStage);
-        SkASSERT(NULL != fEffectStage->getEffect());
+        SkASSERT(fEffectStage);
+        SkASSERT(fEffectStage->getEffect());
     }
     const GrEffect* effect() const { return fEffectStage->getEffect(); }
 
diff --git a/include/gpu/GrEffectStage.h b/include/gpu/GrEffectStage.h
index 65c7beb..f4cee51 100644
--- a/include/gpu/GrEffectStage.h
+++ b/include/gpu/GrEffectStage.h
@@ -43,8 +43,8 @@
     
     static bool AreCompatible(const GrEffectStage& a, const GrEffectStage& b,
                               bool usingExplicitLocalCoords) {
-        SkASSERT(NULL != a.fEffect.get());
-        SkASSERT(NULL != b.fEffect.get());
+        SkASSERT(a.fEffect.get());
+        SkASSERT(b.fEffect.get());
 
         if (!a.getEffect()->isEqual(*b.getEffect())) {
             return false;
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h
index c81e022..626f027 100644
--- a/include/gpu/GrGpuResource.h
+++ b/include/gpu/GrGpuResource.h
@@ -186,7 +186,7 @@
     GrGpuResource(GrGpu*, bool isWrapped);
     virtual ~GrGpuResource();
 
-    bool isInCache() const { return NULL != fCacheEntry; }
+    bool isInCache() const { return SkToBool(fCacheEntry); }
 
     GrGpu* getGpu() const { return fGpu; }
 
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h
index 20dec35..900ab4c 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -88,7 +88,7 @@
      * Appends an additional color effect to the color computation.
      */
     const GrEffect* addColorEffect(const GrEffect* effect, int attr0 = -1, int attr1 = -1) {
-        SkASSERT(NULL != effect);
+        SkASSERT(effect);
         if (!effect->willUseInputColor()) {
             fColorStages.reset();
         }
@@ -100,7 +100,7 @@
      * Appends an additional coverage effect to the coverage computation.
      */
     const GrEffect* addCoverageEffect(const GrEffect* effect, int attr0 = -1, int attr1 = -1) {
-        SkASSERT(NULL != effect);
+        SkASSERT(effect);
         if (!effect->willUseInputColor()) {
             fCoverageStages.reset();
         }
diff --git a/include/gpu/GrProgramElementRef.h b/include/gpu/GrProgramElementRef.h
index ea11f44..1e3b4f8 100644
--- a/include/gpu/GrProgramElementRef.h
+++ b/include/gpu/GrProgramElementRef.h
@@ -55,7 +55,7 @@
     }
 
     ~GrProgramElementRef() {
-        if (NULL != fObj) {
+        if (fObj) {
             if (fOwnPendingExec) {
                 fObj->completedExecution();
             } else {
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h
index 6a3f26f..4c5ec18 100644
--- a/include/gpu/GrRenderTarget.h
+++ b/include/gpu/GrRenderTarget.h
@@ -162,7 +162,7 @@
     friend class GrTexture;
     // called by ~GrTexture to remove the non-ref'ed back ptr.
     void owningTextureDestroyed() {
-        SkASSERT(NULL != fTexture);
+        SkASSERT(fTexture);
         fTexture = NULL;
     }
 
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index 6087ef4..8315c63 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -80,11 +80,11 @@
      */
     bool isSameAs(const GrSurface* other) const {
         const GrRenderTarget* thisRT = this->asRenderTarget();
-        if (NULL != thisRT) {
+        if (thisRT) {
             return thisRT == other->asRenderTarget();
         } else {
             const GrTexture* thisTex = this->asTexture();
-            SkASSERT(NULL != thisTex); // We must be one or the other
+            SkASSERT(thisTex); // We must be one or the other
             return thisTex == other->asTexture();
         }
     }
diff --git a/include/gpu/gl/SkGLContextHelper.h b/include/gpu/gl/SkGLContextHelper.h
index 8eab62e..c4d9bdf 100644
--- a/include/gpu/gl/SkGLContextHelper.h
+++ b/include/gpu/gl/SkGLContextHelper.h
@@ -46,7 +46,7 @@
     virtual void swapBuffers() const = 0;
 
     bool hasExtension(const char* extensionName) const {
-        SkASSERT(NULL != fGL);
+        SkASSERT(fGL);
         return fGL->hasExtension(extensionName);
     }
 
diff --git a/include/pipe/SkGPipe.h b/include/pipe/SkGPipe.h
index 879ab04..98e081d 100644
--- a/include/pipe/SkGPipe.h
+++ b/include/pipe/SkGPipe.h
@@ -99,7 +99,7 @@
     SkGPipeWriter();
     ~SkGPipeWriter();
 
-    bool isRecording() const { return NULL != fCanvas; }
+    bool isRecording() const { return SkToBool(fCanvas); }
 
     enum Flags {
         /**
diff --git a/include/utils/win/SkTScopedComPtr.h b/include/utils/win/SkTScopedComPtr.h
index 8f18a42..38d1048 100644
--- a/include/utils/win/SkTScopedComPtr.h
+++ b/include/utils/win/SkTScopedComPtr.h
@@ -54,7 +54,7 @@
     T **operator&() { SkASSERT(fPtr == NULL); return &fPtr; }
     T *get() const { return fPtr; }
     void reset() {
-        if (NULL != this->fPtr) {
+        if (this->fPtr) {
             this->fPtr->Release();
             this->fPtr = NULL;
         }
diff --git a/include/views/SkView.h b/include/views/SkView.h
index d03c741..c083cf1 100644
--- a/include/views/SkView.h
+++ b/include/views/SkView.h
@@ -210,7 +210,7 @@
      *  Return true on success; false on failure
      */
     bool        globalToLocal(SkPoint* pt) const {
-        if (NULL != pt) {
+        if (pt) {
             return this->globalToLocal(pt->fX, pt->fY, pt);
         }
         return true;  // nothing to do so return true
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 9c9b343..9d7e727 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -274,7 +274,7 @@
     virtual SkCanvas* createCanvas(SampleWindow::DeviceType dType,
                                    SampleWindow* win) {
 #if SK_SUPPORT_GPU
-        if (IsGpuDeviceType(dType) && NULL != fCurContext) {
+        if (IsGpuDeviceType(dType) && fCurContext) {
             SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(fCurRenderTarget));
             return new SkCanvas(device);
         } else
@@ -2053,7 +2053,7 @@
 
 #if SK_SUPPORT_GPU
     if (IsGpuDeviceType(fDeviceType) &&
-        NULL != fDevManager &&
+        fDevManager &&
         fDevManager->getGrRenderTarget() &&
         fDevManager->getGrRenderTarget()->numSamples() > 0) {
         title.appendf(" [MSAA: %d]",
diff --git a/samplecode/SampleChart.cpp b/samplecode/SampleChart.cpp
index 630ff6e..12a6afe 100644
--- a/samplecode/SampleChart.cpp
+++ b/samplecode/SampleChart.cpp
@@ -60,7 +60,7 @@
         x += xDelta;
     }
 
-    if (NULL != bottomData) {
+    if (bottomData) {
         SkASSERT(bottomData->count() == topData.count());
         // iterate backwards over the previous graph's data to generate the bottom of the filled
         // area (and account for leftShift).
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index f4157cd..a996a4b 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -435,7 +435,7 @@
         printf("Fuzzing with %u\n", kSeed);
     }
     numFilters++;
-    if (NULL != filter) {
+    if (filter) {
         numValidFilters++;
     }
     printf("Filter no : %u. Valid filters so far : %u\r", numFilters, numValidFilters);
diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp
index 6bb9c74..4f073bd 100644
--- a/samplecode/SampleTiling.cpp
+++ b/samplecode/SampleTiling.cpp
@@ -102,7 +102,7 @@
             textCanvas = recorder.beginRecording(1000, 1000, NULL, 0);
         }
 
-        if (NULL != textCanvas) {
+        if (textCanvas) {
             for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {
                 for (size_t ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) {
                     SkPaint p;
@@ -139,7 +139,7 @@
                         x += r.width() * 4 / 3;
                     }
                 }
-                if (NULL != textCanvas) {
+                if (textCanvas) {
                     SkPaint p;
                     SkString str;
                     p.setAntiAlias(true);
@@ -152,12 +152,12 @@
             }
         }
 
-        if (NULL != textCanvas) {
+        if (textCanvas) {
             SkASSERT(NULL == fTextPicture);
             fTextPicture.reset(recorder.endRecording());
         }
 
-        SkASSERT(NULL != fTextPicture);
+        SkASSERT(fTextPicture);
         canvas->drawPicture(fTextPicture);
     }
 
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);
     }
 
diff --git a/src/device/xps/SkXPSDevice.cpp b/src/device/xps/SkXPSDevice.cpp
index 194d23a..1a12153 100644
--- a/src/device/xps/SkXPSDevice.cpp
+++ b/src/device/xps/SkXPSDevice.cpp
@@ -809,7 +809,7 @@
 
     SkTScopedComPtr<IXpsOMMatrixTransform> xpsMatrixToUse;
     HR(this->createXpsTransform(localMatrix, &xpsMatrixToUse));
-    if (NULL != xpsMatrixToUse.get()) {
+    if (xpsMatrixToUse.get()) {
         HRM((*xpsBrush)->SetTransformLocal(xpsMatrixToUse.get()),
             "Could not set transform for image brush.");
     } else {
@@ -838,7 +838,7 @@
                                              IXpsOMBrush** xpsBrush) {
     XPS_POINT startPoint;
     XPS_POINT endPoint;
-    if (NULL != xpsMatrix) {
+    if (xpsMatrix) {
         startPoint = xps_point(info.fPoint[0]);
         endPoint = xps_point(info.fPoint[1]);
     } else {
@@ -866,7 +866,7 @@
                                                      &endPoint,
                                                      &gradientBrush),
         "Could not create linear gradient brush.");
-    if (NULL != xpsMatrix) {
+    if (xpsMatrix) {
         HRM(gradientBrush->SetTransformLocal(xpsMatrix),
             "Could not set transform on linear gradient brush.");
     }
@@ -912,7 +912,7 @@
     XPS_POINT centerPoint;
     XPS_POINT gradientOrigin;
     XPS_SIZE radiiSizes;
-    if (NULL != xpsMatrix) {
+    if (xpsMatrix) {
         centerPoint = xps_point(info.fPoint[0]);
         gradientOrigin = xps_point(info.fPoint[0]);
         radiiSizes.width = SkScalarToFLOAT(info.fRadius[0]);
@@ -943,7 +943,7 @@
                                                      &radiiSizes,
                                                      &gradientBrush),
         "Could not create radial gradient brush.");
-    if (NULL != xpsMatrix) {
+    if (xpsMatrix) {
         HRM(gradientBrush->SetTransformLocal(xpsMatrix),
             "Could not set transform on radial gradient brush.");
     }
@@ -1019,7 +1019,7 @@
         }
 
         SkMatrix localMatrix = shader->getLocalMatrix();
-        if (NULL != parentTransform) {
+        if (parentTransform) {
             localMatrix.preConcat(*parentTransform);
         }
         SkTScopedComPtr<IXpsOMMatrixTransform> xpsMatrixToUse;
@@ -1065,7 +1065,7 @@
         case SkShader::kDefault_BitmapType: {
             //TODO: outMatrix??
             SkMatrix localMatrix = shader->getLocalMatrix();
-            if (NULL != parentTransform) {
+            if (parentTransform) {
                 localMatrix.preConcat(*parentTransform);
             }
 
@@ -1327,7 +1327,7 @@
     while ((verb = iter.next(points)) != SkPath::kDone_Verb) {
         switch (verb) {
             case SkPath::kMove_Verb: {
-                if (NULL != xpsFigure.get()) {
+                if (xpsFigure.get()) {
                     HR(close_figure(segmentTypes, segmentStrokes, segmentData,
                                     stroke, fill,
                                     xpsFigure.get() , xpsFigures));
@@ -1378,7 +1378,7 @@
                 break;
         }
     }
-    if (NULL != xpsFigure.get()) {
+    if (xpsFigure.get()) {
         HR(close_figure(segmentTypes, segmentStrokes, segmentData,
                         stroke, fill,
                         xpsFigure.get(), xpsFigures));
@@ -1834,7 +1834,7 @@
     }
 
     SkTScopedComPtr<IXpsOMGeometryFigure> rectFigure;
-    if (NULL != xpsTransform.get()) {
+    if (xpsTransform.get()) {
         const SkShader::TileMode xy[2] = {
             SkShader::kClamp_TileMode,
             SkShader::kClamp_TileMode,
@@ -1979,12 +1979,12 @@
     SkTScopedComPtr<IXpsOMGlyphsEditor> glyphsEditor;
     HRM(glyphs->GetGlyphsEditor(&glyphsEditor), "Could not get glyph editor.");
 
-    if (NULL != text) {
+    if (text) {
         HRM(glyphsEditor->SetUnicodeString(text),
             "Could not set unicode string.");
     }
 
-    if (NULL != xpsGlyphs) {
+    if (xpsGlyphs) {
         HRM(glyphsEditor->SetGlyphIndices(xpsGlyphsLen, xpsGlyphs),
             "Could not set glyphs.");
     }
diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp
index be636c5..22f464c 100644
--- a/src/effects/SkArithmeticMode.cpp
+++ b/src/effects/SkArithmeticMode.cpp
@@ -379,7 +379,7 @@
         dstColor = fsBuilder->dstColor();
     }
 
-    SkASSERT(NULL != dstColor);
+    SkASSERT(dstColor);
     fKUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
                                 kVec4f_GrSLType, "k");
     const char* kUni = builder->getUniformCStr(fKUni);
diff --git a/src/effects/SkAvoidXfermode.cpp b/src/effects/SkAvoidXfermode.cpp
index aae6ba5..b596bfd 100644
--- a/src/effects/SkAvoidXfermode.cpp
+++ b/src/effects/SkAvoidXfermode.cpp
@@ -108,7 +108,7 @@
         SkASSERT(d <= 256);
 
         if (d > 0) {
-            if (NULL != aa) {
+            if (aa) {
                 d = SkAlphaMul(d, Accurate255To256(*aa++));
                 if (0 == d) {
                     continue;
@@ -157,7 +157,7 @@
         SkASSERT(d <= 32);
 
         if (d > 0) {
-            if (NULL != aa) {
+            if (aa) {
                 d = SkAlphaMul(d, Accurate255To256(*aa++));
                 if (0 == d) {
                     continue;
diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp
index 7c3e9e8..2a8df5c 100755
--- a/src/effects/SkColorFilterImageFilter.cpp
+++ b/src/effects/SkColorFilterImageFilter.cpp
@@ -64,7 +64,7 @@
     SkColorFilter* inputColorFilter;
     if (input && cf->asColorMatrix(colorMatrix)
               && input->asColorFilter(&inputColorFilter)
-              && (NULL != inputColorFilter)) {
+              && (inputColorFilter)) {
         SkAutoUnref autoUnref(inputColorFilter);
         if (inputColorFilter->asColorMatrix(inputMatrix) && !matrix_needs_clamping(inputMatrix)) {
             SkScalar combinedMatrix[20];
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index beed67e..5667048 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -186,7 +186,7 @@
         analyze the array, so we don't miss the case where the caller has zeros
         which could make us accidentally take the General or Add case.
     */
-    if (NULL != fProc) {
+    if (fProc) {
         int32_t add = 1 << (fState.fShift - 1);
         array[4] += add;
         array[9] += add;
diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp
index 66462af..f9a56d0 100644
--- a/src/effects/SkDashPathEffect.cpp
+++ b/src/effects/SkDashPathEffect.cpp
@@ -104,7 +104,7 @@
         return false;
     }
 
-    if (NULL != results) {
+    if (results) {
         results->fFlags = 0;
         SkScalar clampedInitialDashLength = SkMinScalar(length, fInitialDashLength);
 
@@ -229,7 +229,7 @@
 
 SkPathEffect::DashType SkDashPathEffect::asADash(DashInfo* info) const {
     if (info) {
-        if (info->fCount >= fCount && NULL != info->fIntervals) {
+        if (info->fCount >= fCount && info->fIntervals) {
             memcpy(info->fIntervals, fIntervals, fCount * sizeof(SkScalar));
         }
         info->fCount = fCount;
diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp
index aa7f995..a9a53f2 100644
--- a/src/effects/SkGpuBlurUtils.cpp
+++ b/src/effects/SkGpuBlurUtils.cpp
@@ -146,7 +146,7 @@
                         bool cropToRect,
                         float sigmaX,
                         float sigmaY) {
-    SkASSERT(NULL != context);
+    SkASSERT(context);
 
     GrContext::AutoRenderTarget art(context);
 
diff --git a/src/effects/SkLayerDrawLooper.cpp b/src/effects/SkLayerDrawLooper.cpp
index 19525ec..30709c4 100644
--- a/src/effects/SkLayerDrawLooper.cpp
+++ b/src/effects/SkLayerDrawLooper.cpp
@@ -337,7 +337,7 @@
     if (NULL == fRecs) {
         fRecs = rec;
     } else {
-        SkASSERT(NULL != fTopRec);
+        SkASSERT(fTopRec);
         fTopRec->fNext = rec;
     }
     fTopRec = rec;
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index 9293f7f..45e966f 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -205,7 +205,7 @@
         texture->height() / (float) y,
         (float) inset / texture->width(),
         (float) inset / texture->height());
-    SkASSERT(NULL != effect);
+    SkASSERT(effect);
     return effect;
 }
 
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index c6c470c..df04cb1 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -502,7 +502,7 @@
                       SkISize radius,
                       SkBitmap* dst) {
     GrTexture* srcTexture = input.getTexture();
-    SkASSERT(NULL != srcTexture);
+    SkASSERT(srcTexture);
     GrContext* context = srcTexture->getContext();
     srcTexture->ref();
     SkAutoTUnref<GrTexture> src(srcTexture);
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index b0ebb39..0247ed9 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -966,7 +966,7 @@
 bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint,
                                       const SkMatrix* externalLocalMatrix, GrColor* paintColor,
                                       GrEffect** effect) const {
-    SkASSERT(NULL != context);
+    SkASSERT(context);
     
     *paintColor = SkColor2GrColorJustAlpha(paint.getColor());
 
@@ -1001,7 +1001,7 @@
     SkMatrix m = context->getMatrix();
     m.setTranslateX(-localMatrix.getTranslateX() + SK_Scalar1);
     m.setTranslateY(-localMatrix.getTranslateY() + SK_Scalar1);
-    if ((NULL != permutationsTexture) && (NULL != noiseTexture)) {
+    if ((permutationsTexture) && (noiseTexture)) {
         *effect = GrPerlinNoiseEffect::Create(fType,
                                                 fNumOctaves,
                                                 fStitchTiles,
@@ -1016,10 +1016,10 @@
     // Unlock immediately, this is not great, but we don't have a way of
     // knowing when else to unlock it currently. TODO: Remove this when
     // unref becomes the unlock replacement for all types of textures.
-    if (NULL != permutationsTexture) {
+    if (permutationsTexture) {
         GrUnlockAndUnrefCachedBitmapTexture(permutationsTexture);
     }
-    if (NULL != noiseTexture) {
+    if (noiseTexture) {
         GrUnlockAndUnrefCachedBitmapTexture(noiseTexture);
     }
 
diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp
index 3ca0c09..bed19ef 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -15,7 +15,7 @@
 SkPictureImageFilter::SkPictureImageFilter(const SkPicture* picture, uint32_t uniqueID)
     : INHERITED(0, 0, NULL, uniqueID)
     , fPicture(SkSafeRef(picture))
-    , fCropRect(NULL != picture ? picture->cullRect() : SkRect::MakeEmpty()) {
+    , fCropRect(picture ? picture->cullRect() : SkRect::MakeEmpty()) {
 }
 
 SkPictureImageFilter::SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect,
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index 8b391ee..3cab107 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -438,7 +438,7 @@
     this->asComponentTable(&bitmap);
     // passing NULL because this effect does no tiling or filtering.
     GrTexture* texture = GrLockAndRefCachedBitmapTexture(context, bitmap, NULL);
-    if (NULL != texture) {
+    if (texture) {
         effect = ColorTableEffect::Create(texture, fFlags);
 
         // Unlock immediately, this is not great, but we don't have a way of
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 3ac3635..23c473f 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -1150,7 +1150,7 @@
         desc.fContext = ctx;
         desc.fConfig = SkImageInfo2GrPixelConfig(bitmap.info());
         fAtlas = GrTextureStripAtlas::GetAtlas(desc);
-        SkASSERT(NULL != fAtlas);
+        SkASSERT(fAtlas);
 
         // We always filter the gradient table. Each table is one row of a texture, always y-clamp.
         GrTextureParams params;
@@ -1239,7 +1239,7 @@
     SkScalar stop = 0.f;
     for (int i = 0; i < outColors; ++i) {
         colors[i] = random->nextU();
-        if (NULL != *stops) {
+        if (*stops) {
             (*stops)[i] = stop;
             stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - stop) : 1.f;
         }
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 551afaa..b26d606 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -569,7 +569,7 @@
 bool SkLinearGradient::asNewEffect(GrContext* context, const SkPaint& paint,
                                    const SkMatrix* localMatrix, GrColor* paintColor,
                                    GrEffect** effect)  const {
-    SkASSERT(NULL != context);
+    SkASSERT(context);
     
     SkMatrix matrix;
     if (!this->getLocalMatrix().invert(&matrix)) {
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index aeae24a..895dbb9 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -579,7 +579,7 @@
 bool SkRadialGradient::asNewEffect(GrContext* context, const SkPaint& paint,
                                    const SkMatrix* localMatrix, GrColor* paintColor,
                                    GrEffect** effect) const {
-    SkASSERT(NULL != context);
+    SkASSERT(context);
     
     SkMatrix matrix;
     if (!this->getLocalMatrix().invert(&matrix)) {
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 9284e7c..0ecad3a 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -423,7 +423,7 @@
 bool SkTwoPointConicalGradient::asNewEffect(GrContext* context, const SkPaint& paint,
                                              const SkMatrix* localMatrix, GrColor* paintColor,
                                              GrEffect** effect)  const {
-    SkASSERT(NULL != context);
+    SkASSERT(context);
     SkASSERT(fPtsToUnit.isIdentity());
 
     *effect = Gr2PtConicalGradientEffect::Create(context, *this, fTileMode, localMatrix);
diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp
index bb5ec04..75b1e79 100644
--- a/src/effects/gradients/SkTwoPointRadialGradient.cpp
+++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp
@@ -687,7 +687,7 @@
 bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& paint,
                                            const SkMatrix* localMatrix, GrColor* paintColor,
                                            GrEffect** effect)  const {
-    SkASSERT(NULL != context);
+    SkASSERT(context);
     
     // invert the localM, translate to center1 (fPtsToUni), rotate so center2 is on x axis.
     SkMatrix matrix;
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index 9986ac8..0b3b878 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -684,7 +684,7 @@
         (*vert)[5].fPos = b + vec - ortho;
         (*vert)[5].fCoverage = 0;
 
-        if (NULL != toSrc) {
+        if (toSrc) {
             toSrc->mapPointsWithStride(&(*vert)->fPos,
                                        sizeof(LineVertex),
                                        kVertsPerLineSeg);
@@ -808,7 +808,7 @@
         seedPts[0] = conics[0];
         seedPts[1] = conics[2];
     }
-    if (NULL != toDevice) {
+    if (toDevice) {
         toDevice->mapPoints(seedPts, 2);
     }
     devBounds->set(seedPts[0], seedPts[1]);
@@ -999,7 +999,7 @@
         if (quadCnt > 0) {
             GrEffect* hairQuadEffect = GrQuadEffect::Create(kHairlineAA_GrEffectEdgeType,
                                                             *target->caps());
-            SkASSERT(NULL != hairQuadEffect);
+            SkASSERT(hairQuadEffect);
             GrDrawState::AutoRestoreEffects are(drawState);
             target->setIndexSourceToBuffer(fQuadsIndexBuffer);
             drawState->setGeometryProcessor(hairQuadEffect, kEdgeAttrIndex)->unref();
@@ -1020,7 +1020,7 @@
             GrDrawState::AutoRestoreEffects are(drawState);
             GrEffect* hairConicEffect = GrConicEffect::Create(kHairlineAA_GrEffectEdgeType,
                                                               *target->caps());
-            SkASSERT(NULL != hairConicEffect);
+            SkASSERT(hairConicEffect);
             drawState->setGeometryProcessor(hairConicEffect, 1, 2)->unref();
             int conics = 0;
             while (conics < conicCnt) {
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp
index 9384457..d19e26d 100644
--- a/src/gpu/GrAARectRenderer.cpp
+++ b/src/gpu/GrAARectRenderer.cpp
@@ -315,7 +315,7 @@
 
     if (NULL == fAAFillRectIndexBuffer) {
         fAAFillRectIndexBuffer = gpu->createIndexBuffer(kAAFillRectIndexBufferSize, false);
-        if (NULL != fAAFillRectIndexBuffer) {
+        if (fAAFillRectIndexBuffer) {
             uint16_t* data = (uint16_t*) fAAFillRectIndexBuffer->map();
             bool useTempData = (NULL == data);
             if (useTempData) {
@@ -428,7 +428,7 @@
         if (NULL == fAAMiterStrokeRectIndexBuffer) {
             fAAMiterStrokeRectIndexBuffer =
                 gpu->createIndexBuffer(sizeof(gMiterStrokeAARectIdx), false);
-            if (NULL != fAAMiterStrokeRectIndexBuffer) {
+            if (fAAMiterStrokeRectIndexBuffer) {
 #ifdef SK_DEBUG
                 bool updated =
 #endif
@@ -442,7 +442,7 @@
         if (NULL == fAABevelStrokeRectIndexBuffer) {
             fAABevelStrokeRectIndexBuffer =
                 gpu->createIndexBuffer(sizeof(gBevelStrokeAARectIdx), false);
-            if (NULL != fAABevelStrokeRectIndexBuffer) {
+            if (fAABevelStrokeRectIndexBuffer) {
 #ifdef SK_DEBUG
                 bool updated =
 #endif
diff --git a/src/gpu/GrAllocPool.cpp b/src/gpu/GrAllocPool.cpp
index c92ebbd..9594c94 100644
--- a/src/gpu/GrAllocPool.cpp
+++ b/src/gpu/GrAllocPool.cpp
@@ -90,7 +90,7 @@
 void GrAllocPool::release(size_t bytes) {
     this->validate();
 
-    while (bytes && NULL != fBlock) {
+    while (bytes && fBlock) {
         bytes = fBlock->release(bytes);
         if (fBlock->empty()) {
             Block* next = fBlock->fNext;
diff --git a/src/gpu/GrAllocator.h b/src/gpu/GrAllocator.h
index 37c123f..fd45e8a 100644
--- a/src/gpu/GrAllocator.h
+++ b/src/gpu/GrAllocator.h
@@ -244,14 +244,14 @@
      */
     T& push_back() {
         void* item = fAllocator.push_back();
-        SkASSERT(NULL != item);
+        SkASSERT(item);
         SkNEW_PLACEMENT(item, T);
         return *(T*)item;
     }
 
     T& push_back(const T& t) {
         void* item = fAllocator.push_back();
-        SkASSERT(NULL != item);
+        SkASSERT(item);
         SkNEW_PLACEMENT_ARGS(item, T, (t));
         return *(T*)item;
     }
diff --git a/src/gpu/GrAtlas.cpp b/src/gpu/GrAtlas.cpp
index 353bf55..e75f859 100644
--- a/src/gpu/GrAtlas.cpp
+++ b/src/gpu/GrAtlas.cpp
@@ -73,7 +73,7 @@
     }
 
     // if we have backing memory, copy to the memory and set for future upload
-    if (NULL != fPlotData) {
+    if (fPlotData) {
         const unsigned char* imagePtr = (const unsigned char*) image;
         // point ourselves at the right starting spot
         unsigned char* dataPtr = fPlotData;
@@ -90,7 +90,7 @@
         adjust_for_offset(loc, fOffset);
         fDirty = true;
     // otherwise, just upload the image directly
-    } else if (NULL != image) {
+    } else if (image) {
         adjust_for_offset(loc, fOffset);
         GrContext* context = fTexture->getContext();
         TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), "GrPlot::uploadToTexture");
@@ -117,7 +117,7 @@
 
     if (fDirty) {
         TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), "GrPlot::uploadToTexture");
-        SkASSERT(NULL != fTexture);
+        SkASSERT(fTexture);
         GrContext* context = fTexture->getContext();
         // We pass the flag that does not force a flush. We assume our caller is
         // smart and hasn't referenced the part of the texture we're about to update
@@ -144,7 +144,7 @@
 }
 
 void GrPlot::resetRects() {
-    SkASSERT(NULL != fRects);
+    SkASSERT(fRects);
     fRects->reset();
 }
 
@@ -241,7 +241,7 @@
     GrPlotList::Iter plotIter;
     plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart);
     GrPlot* plot;
-    while (NULL != (plot = plotIter.get())) {
+    while ((plot = plotIter.get())) {
         // make sure texture is set for quick lookup
         plot->fTexture = fTexture;
         if (plot->addSubImage(width, height, image, loc)) {
@@ -270,7 +270,7 @@
     GrPlotList::Iter plotIter;
     plotIter.init(fPlotList, GrPlotList::Iter::kTail_IterStart);
     GrPlot* plot;
-    while (NULL != (plot = plotIter.get())) {
+    while ((plot = plotIter.get())) {
         if (plot->drawToken().isIssued()) {
             return plot;
         }
@@ -285,7 +285,7 @@
         GrPlotList::Iter plotIter;
         plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart);
         GrPlot* plot;
-        while (NULL != (plot = plotIter.get())) {
+        while ((plot = plotIter.get())) {
             plot->uploadToTexture();
             plotIter.next();
         }
diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp
index ac4c078..70785a6 100755
--- a/src/gpu/GrBitmapTextContext.cpp
+++ b/src/gpu/GrBitmapTextContext.cpp
@@ -109,7 +109,7 @@
         int coordsIdx = drawState->hasColorVertexAttribute() ? kGlyphCoordsWithColorAttributeIndex :
                                                                kGlyphCoordsNoColorAttributeIndex;
         drawState->setGeometryProcessor(fCachedEffect.get(), coordsIdx);
-        SkASSERT(NULL != fStrike);
+        SkASSERT(fStrike);
         switch (fStrike->getMaskFormat()) {
             // Color bitmap text
             case kARGB_GrMaskFormat:
diff --git a/src/gpu/GrBlend.cpp b/src/gpu/GrBlend.cpp
index c8631c4..52e335e 100644
--- a/src/gpu/GrBlend.cpp
+++ b/src/gpu/GrBlend.cpp
@@ -59,7 +59,7 @@
                                    GrColor constantColor) {
 
     SkASSERT(!GrBlendCoeffRefsSrc(*srcCoeff));
-    SkASSERT(NULL != srcCoeff);
+    SkASSERT(srcCoeff);
 
     // Check whether srcCoeff can be reduced to kOne or kZero based on known color inputs.
     // We could pick out the coeff r,g,b,a values here and use them to compute the blend term color,
diff --git a/src/gpu/GrBufferAllocPool.cpp b/src/gpu/GrBufferAllocPool.cpp
index a197a67..226f451 100644
--- a/src/gpu/GrBufferAllocPool.cpp
+++ b/src/gpu/GrBufferAllocPool.cpp
@@ -42,7 +42,7 @@
                                      int preallocBufferCnt) :
         fBlocks(SkTMax(8, 2*preallocBufferCnt)) {
 
-    SkASSERT(NULL != gpu);
+    SkASSERT(gpu);
     fGpu = gpu;
     fGpu->ref();
     fGpuIsReffed = true;
@@ -58,7 +58,7 @@
     fPreallocBufferStartIdx = 0;
     for (int i = 0; i < preallocBufferCnt; ++i) {
         GrGeometryBuffer* buffer = this->createBuffer(fMinBlockSize);
-        if (NULL != buffer) {
+        if (buffer) {
             *fPreallocBuffers.append() = buffer;
         }
     }
@@ -116,7 +116,7 @@
 void GrBufferAllocPool::unmap() {
     VALIDATE();
 
-    if (NULL != fBufferPtr) {
+    if (fBufferPtr) {
         BufferBlock& block = fBlocks.back();
         if (block.fBuffer->isMapped()) {
             UNMAP_BUFFER(block);
@@ -131,7 +131,7 @@
 
 #ifdef SK_DEBUG
 void GrBufferAllocPool::validate(bool unusedBlockAllowed) const {
-    if (NULL != fBufferPtr) {
+    if (fBufferPtr) {
         SkASSERT(!fBlocks.empty());
         if (fBlocks.back().fBuffer->isMapped()) {
             GrGeometryBuffer* buf = fBlocks.back().fBuffer;
@@ -168,10 +168,10 @@
                                    size_t* offset) {
     VALIDATE();
 
-    SkASSERT(NULL != buffer);
-    SkASSERT(NULL != offset);
+    SkASSERT(buffer);
+    SkASSERT(offset);
 
-    if (NULL != fBufferPtr) {
+    if (fBufferPtr) {
         BufferBlock& back = fBlocks.back();
         size_t usedBytes = back.fBuffer->gpuMemorySize() - back.fBytesFree;
         size_t pad = GrSizeAlignUpPad(usedBytes,
@@ -198,7 +198,7 @@
     if (!createBlock(size)) {
         return NULL;
     }
-    SkASSERT(NULL != fBufferPtr);
+    SkASSERT(fBufferPtr);
 
     *offset = 0;
     BufferBlock& back = fBlocks.back();
@@ -211,7 +211,7 @@
 
 int GrBufferAllocPool::currentBufferItems(size_t itemSize) const {
     VALIDATE();
-    if (NULL != fBufferPtr) {
+    if (fBufferPtr) {
         const BufferBlock& back = fBlocks.back();
         size_t usedBytes = back.fBuffer->gpuMemorySize() - back.fBytesFree;
         size_t pad = GrSizeAlignUpPad(usedBytes, itemSize);
@@ -295,7 +295,7 @@
     }
 
     block.fBytesFree = size;
-    if (NULL != fBufferPtr) {
+    if (fBufferPtr) {
         SkASSERT(fBlocks.count() > 1);
         BufferBlock& prev = fBlocks.fromBack(1);
         if (prev.fBuffer->isMapped()) {
@@ -356,7 +356,7 @@
 
 void GrBufferAllocPool::flushCpuData(const BufferBlock& block, size_t flushSize) {
     GrGeometryBuffer* buffer = block.fBuffer;
-    SkASSERT(NULL != buffer);
+    SkASSERT(buffer);
     SkASSERT(!buffer->isMapped());
     SkASSERT(fCpuData.get() == fBufferPtr);
     SkASSERT(flushSize <= buffer->gpuMemorySize());
@@ -365,7 +365,7 @@
     if (GrDrawTargetCaps::kNone_MapFlags != fGpu->caps()->mapBufferFlags() &&
         flushSize > GR_GEOM_BUFFER_MAP_THRESHOLD) {
         void* data = buffer->map();
-        if (NULL != data) {
+        if (data) {
             memcpy(data, fBufferPtr, flushSize);
             UNMAP_BUFFER(block);
             return;
@@ -403,8 +403,8 @@
                                          int* startVertex) {
 
     SkASSERT(vertexCount >= 0);
-    SkASSERT(NULL != buffer);
-    SkASSERT(NULL != startVertex);
+    SkASSERT(buffer);
+    SkASSERT(startVertex);
 
     size_t offset = 0; // assign to suppress warning
     const GrGeometryBuffer* geomBuffer = NULL; // assign to suppress warning
@@ -425,7 +425,7 @@
                                              const GrVertexBuffer** buffer,
                                              int* startVertex) {
     void* space = makeSpace(vertexSize, vertexCount, buffer, startVertex);
-    if (NULL != space) {
+    if (space) {
         memcpy(space,
                vertices,
                vertexSize * vertexCount);
@@ -461,8 +461,8 @@
                                         int* startIndex) {
 
     SkASSERT(indexCount >= 0);
-    SkASSERT(NULL != buffer);
-    SkASSERT(NULL != startIndex);
+    SkASSERT(buffer);
+    SkASSERT(startIndex);
 
     size_t offset = 0; // assign to suppress warning
     const GrGeometryBuffer* geomBuffer = NULL; // assign to suppress warning
@@ -482,7 +482,7 @@
                                            const GrIndexBuffer** buffer,
                                            int* startIndex) {
     void* space = makeSpace(indexCount, buffer, startIndex);
-    if (NULL != space) {
+    if (space) {
         memcpy(space, indices, sizeof(uint16_t) * indexCount);
         return true;
     } else {
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index a0c49b5..2cc764f 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -114,7 +114,7 @@
 
     GrDrawState* drawState = fGpu->drawState();
     SkRect boundsInClipSpace;
-    if (NULL != drawBounds) {
+    if (drawBounds) {
         boundsInClipSpace = *drawBounds;
         boundsInClipSpace.offset(-clipToRTOffset.fX, -clipToRTOffset.fY);
     }
@@ -126,7 +126,7 @@
     bool setARE = false;
     bool failed = false;
 
-    while (NULL != iter.get()) {
+    while (iter.get()) {
         SkRegion::Op op = iter.get()->getOp();
         bool invert;
         bool skip = false;
@@ -136,7 +136,7 @@
                 // Fallthrough, handled same as intersect.
             case SkRegion::kIntersect_Op:
                 invert = false;
-                if (NULL != drawBounds && iter.get()->contains(boundsInClipSpace)) {
+                if (drawBounds && iter.get()->contains(boundsInClipSpace)) {
                     skip = true;
                 }
                 break;
@@ -225,7 +225,7 @@
 
     const GrRenderTarget* rt = drawState->getRenderTarget();
     // GrDrawTarget should have filtered this for us
-    SkASSERT(NULL != rt);
+    SkASSERT(rt);
 
     bool ignoreClip = !drawState->isClipState() || clipDataIn->fClipStack->isWideOpen();
 
@@ -299,7 +299,7 @@
                                                clipSpaceIBounds);
         }
 
-        if (NULL != result) {
+        if (result) {
             // The mask's top left coord should be pinned to the rounded-out top left corner of
             // clipSpace bounds. We determine the mask's position WRT to the render target here.
             SkIRect rtSpaceMaskBounds = clipSpaceIBounds;
@@ -453,7 +453,7 @@
             GrPathRendererChain::kStencilAndColorAntiAlias_DrawType :
             GrPathRendererChain::kStencilAndColor_DrawType;
         *pr = this->getContext()->getPathRenderer(path, stroke, fGpu, false, type);
-        return NULL != *pr;
+        return SkToBool(*pr);
     }
 }
 
@@ -486,7 +486,7 @@
 // get a texture to act as a temporary buffer for AA clip boolean operations
 // TODO: given the expense of createTexture we may want to just cache this too
 void GrClipMaskManager::getTemp(int width, int height, GrAutoScratchTexture* temp) {
-    if (NULL != temp->texture()) {
+    if (temp->texture()) {
         // we've already allocated the temp texture
         return;
     }
@@ -546,7 +546,7 @@
 
     // First, check for cached texture
     GrTexture* result = this->getCachedMaskTexture(elementsGenID, clipSpaceIBounds);
-    if (NULL != result) {
+    if (result) {
         fCurrClipMaskType = kAlpha_ClipMaskType;
         return result;
     }
@@ -701,7 +701,7 @@
     SkASSERT(drawState->isClipState());
 
     GrRenderTarget* rt = drawState->getRenderTarget();
-    SkASSERT(NULL != rt);
+    SkASSERT(rt);
 
     // TODO: dynamically attach a SB when needed.
     GrStencilBuffer* stencilBuffer = rt->getStencilBuffer();
@@ -743,7 +743,7 @@
 
         // walk through each clip element and perform its set op
         // with the existing clip.
-        for (ElementList::Iter iter(elements.headIter()); NULL != iter.get(); iter.next()) {
+        for (ElementList::Iter iter(elements.headIter()); iter.get(); iter.next()) {
             const Element* element = iter.get();
             bool fillInverted = false;
             // enabled at bottom of loop
@@ -946,7 +946,7 @@
     int stencilBits = 0;
     GrStencilBuffer* stencilBuffer =
         drawState.getRenderTarget()->getStencilBuffer();
-    if (NULL != stencilBuffer) {
+    if (stencilBuffer) {
         stencilBits = stencilBuffer->bits();
     }
 
@@ -1045,7 +1045,7 @@
     SkASSERT(kNone_ClipMaskType == fCurrClipMaskType);
 
     GrTexture* result = this->getCachedMaskTexture(elementsGenID, clipSpaceIBounds);
-    if (NULL != result) {
+    if (result) {
         return result;
     }
 
@@ -1064,7 +1064,7 @@
 
     SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle);
 
-    for (ElementList::Iter iter(elements.headIter()) ; NULL != iter.get(); iter.next()) {
+    for (ElementList::Iter iter(elements.headIter()) ; iter.get(); iter.next()) {
 
         const Element* element = iter.get();
         SkRegion::Op op = element->getOp();
@@ -1140,7 +1140,7 @@
     int stencilBits = 0;
     GrStencilBuffer* stencilBuffer =
         drawState.getRenderTarget()->getStencilBuffer();
-    if (NULL != stencilBuffer) {
+    if (stencilBuffer) {
         stencilBits = stencilBuffer->bits();
         this->adjustStencilParams(settings, clipMode, stencilBits);
     }
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 85d5311..8d515bf 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -73,7 +73,7 @@
 
 class GrContext::AutoCheckFlush {
 public:
-    AutoCheckFlush(GrContext* context) : fContext(context) { SkASSERT(NULL != context); }
+    AutoCheckFlush(GrContext* context) : fContext(context) { SkASSERT(context); }
 
     ~AutoCheckFlush() {
         if (fContext->fFlushToReduceCacheSize) {
@@ -220,7 +220,7 @@
     this->flush();
 
     fGpu->purgeResources();
-    if (NULL != fDrawBuffer) {
+    if (fDrawBuffer) {
         fDrawBuffer->purgeResources();
     }
 
@@ -236,10 +236,10 @@
 }
 
 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const {
-  if (NULL != resourceCount) {
+  if (resourceCount) {
     *resourceCount = fResourceCache->getCachedResourceCount();
   }
-  if (NULL != resourceBytes) {
+  if (resourceBytes) {
     *resourceBytes = fResourceCache->getCachedResourceBytes();
   }
 }
@@ -353,7 +353,7 @@
 
     GrTexture* texture = fGpu->createTexture(rtDesc, NULL, 0);
 
-    if (NULL != texture) {
+    if (texture) {
         GrDrawTarget::AutoStateRestore asr(fGpu, GrDrawTarget::kReset_ASRInit);
         GrDrawState* drawState = fGpu->drawState();
         drawState->setRenderTarget(texture->asRenderTarget());
@@ -398,7 +398,7 @@
         size_t stretchedRowBytes = rtDesc.fWidth * bpp;
 
         texture = fGpu->createTexture(rtDesc, stretchedPixels.get(), stretchedRowBytes);
-        SkASSERT(NULL != texture);
+        SkASSERT(texture);
     }
 
     return texture;
@@ -424,13 +424,13 @@
         texture = fGpu->createTexture(desc, srcData, rowBytes);
     }
 
-    if (NULL != texture) {
+    if (texture) {
         // Adding a resource could put us overbudget. Try to free up the
         // necessary space before adding it.
         fResourceCache->purgeAsNeeded(1, texture->gpuMemorySize());
         fResourceCache->addResource(resourceKey, texture);
 
-        if (NULL != cacheKey) {
+        if (cacheKey) {
             *cacheKey = resourceKey;
         }
     }
@@ -442,7 +442,7 @@
                                          GrResourceCache* resourceCache,
                                          const GrTextureDesc& desc) {
     GrTexture* texture = gpu->createTexture(desc, NULL, 0);
-    if (NULL != texture) {
+    if (texture) {
         GrResourceKey key = GrTextureImpl::ComputeScratchKey(texture->desc());
         // Adding a resource could put us overbudget. Try to free up the
         // necessary space before adding it.
@@ -486,7 +486,7 @@
         GrResourceKey key = GrTextureImpl::ComputeScratchKey(desc);
         // Ensure we have exclusive access to the texture so future 'find' calls don't return it
         resource = fResourceCache->find(key, GrResourceCache::kHide_OwnershipFlag);
-        if (NULL != resource) {
+        if (resource) {
             resource->ref();
             break;
         }
@@ -524,7 +524,7 @@
 
     // This texture should already have a cache entry since it was once
     // attached
-    SkASSERT(NULL != texture->getCacheEntry());
+    SkASSERT(texture->getCacheEntry());
 
     // Conceptually, the cache entry is going to assume responsibility
     // for the creation ref. Assert refcnt == 1.
@@ -532,7 +532,7 @@
     // abandoned. In that case the ref count may be > 1.
     // SkASSERT(texture->unique());
 
-    if (fGpu->caps()->reuseScratchTextures() || NULL != texture->asRenderTarget()) {
+    if (fGpu->caps()->reuseScratchTextures() || texture->asRenderTarget()) {
         // Since this texture came from an AutoScratchTexture it should
         // still be in the exclusive pile. Recycle it.
         fResourceCache->makeNonExclusive(texture->getCacheEntry());
@@ -557,13 +557,13 @@
     }
 
     ASSERT_OWNED_RESOURCE(texture);
-    SkASSERT(NULL != texture->getCacheEntry());
+    SkASSERT(texture->getCacheEntry());
 
     // If this is a scratch texture we detached it from the cache
     // while it was locked (to avoid two callers simultaneously getting
     // the same texture).
     if (texture->getCacheEntry()->key().isScratch()) {
-        if (fGpu->caps()->reuseScratchTextures() || NULL != texture->asRenderTarget()) {
+        if (fGpu->caps()->reuseScratchTextures() || texture->asRenderTarget()) {
             fResourceCache->makeNonExclusive(texture->getCacheEntry());
             this->purgeCache();
         } else if (texture->unique()) {
@@ -586,13 +586,13 @@
 }
 
 void GrContext::purgeCache() {
-    if (NULL != fResourceCache) {
+    if (fResourceCache) {
         fResourceCache->purgeAsNeeded();
     }
 }
 
 bool GrContext::OverbudgetCB(void* data) {
-    SkASSERT(NULL != data);
+    SkASSERT(data);
 
     GrContext* context = reinterpret_cast<GrContext*>(data);
 
@@ -652,7 +652,7 @@
     bool isPow2 = SkIsPow2(width) && SkIsPow2(height);
 
     if (!isPow2) {
-        bool tiled = NULL != params && params->isTiled();
+        bool tiled = params && params->isTiled();
         if (tiled && !caps->npotTextureTileSupport()) {
             return false;
         }
@@ -795,7 +795,7 @@
 void GrContext::drawRect(const GrPaint& paint,
                          const SkRect& rect,
                          const GrStrokeInfo* strokeInfo) {
-    if (NULL != strokeInfo && strokeInfo->isDashed()) {
+    if (strokeInfo && strokeInfo->isDashed()) {
         SkPath path;
         path.addRect(rect);
         this->drawPath(paint, path, *strokeInfo);
@@ -820,7 +820,7 @@
         target->getDrawState().getRenderTarget()->getBoundsRect(&rtRect);
         SkRect clipSpaceRTRect = rtRect;
         bool checkClip = false;
-        if (NULL != this->getClip()) {
+        if (this->getClip()) {
             checkClip = true;
             clipSpaceRTRect.offset(SkIntToScalar(this->getClip()->fOrigin.fX),
                                    SkIntToScalar(this->getClip()->fOrigin.fY));
@@ -955,14 +955,14 @@
     *texOffset = -1;
     *colorOffset = -1;
 
-    if (NULL != texCoords && NULL != colors) {
+    if (texCoords && colors) {
         *texOffset = sizeof(SkPoint);
         *colorOffset = 2*sizeof(SkPoint);
         drawState->setVertexAttribs<gPosUVColorAttribs>(3, kPosUVColorAttribsSize);
-    } else if (NULL != texCoords) {
+    } else if (texCoords) {
         *texOffset = sizeof(SkPoint);
         drawState->setVertexAttribs<gPosUVColorAttribs>(2, kPosUVAttribsSize);
-    } else if (NULL != colors) {
+    } else if (colors) {
         *colorOffset = sizeof(SkPoint);
         drawState->setVertexAttribs<gPosColorAttribs>(2, kPosColorAttribsSize);
     } else {
@@ -1021,7 +1021,7 @@
     // we don't currently apply offscreen AA to this path. Need improved
     // management of GrDrawTarget's geometry to avoid copying points per-tile.
 
-    if (NULL != indices) {
+    if (indices) {
         target->setIndexSourceToArray(indices, indexCount);
         target->drawIndexed(primitiveType, 0, 0, vertexCount, indexCount);
         target->resetIndexSource();
@@ -1338,7 +1338,7 @@
     ASSERT_OWNED_RESOURCE(texture);
 
     if ((kUnpremul_PixelOpsFlag & flags) || !fGpu->canWriteTexturePixels(texture, config)) {
-        if (NULL != texture->asRenderTarget()) {
+        if (texture->asRenderTarget()) {
             return this->writeRenderTargetPixels(texture->asRenderTarget(),
                                                  left, top, width, height,
                                                  config, buffer, rowBytes, flags);
@@ -1362,7 +1362,7 @@
     ASSERT_OWNED_RESOURCE(texture);
 
     GrRenderTarget* target = texture->asRenderTarget();
-    if (NULL != target) {
+    if (target) {
         return this->readRenderTargetPixels(target,
                                             left, top, width, height,
                                             config, buffer, rowBytes,
@@ -1381,7 +1381,7 @@
         desc.fOrigin = kTopLeft_GrSurfaceOrigin;
         ast.set(this, desc, kExact_ScratchTexMatch);
         GrTexture* dst = ast.texture();
-        if (NULL != dst && NULL != (target = dst->asRenderTarget())) {
+        if (dst && (target = dst->asRenderTarget())) {
             this->copyTexture(texture, target, NULL);
             return this->readRenderTargetPixels(target,
                                                 left, top, width, height,
@@ -1455,7 +1455,7 @@
     // on the read back pixels.
     GrTexture* src = target->asTexture();
     GrAutoScratchTexture ast;
-    if (NULL != src && (swapRAndB || unpremul || flipY)) {
+    if (src && (swapRAndB || unpremul || flipY)) {
         // Make the scratch a render target because we don't have a robust readTexturePixels as of
         // yet. It calls this function.
         GrTextureDesc desc;
@@ -1488,13 +1488,13 @@
             SkAutoTUnref<const GrEffect> effect;
             if (unpremul) {
                 effect.reset(this->createPMToUPMEffect(src, swapRAndB, textureMatrix));
-                if (NULL != effect) {
+                if (effect) {
                     unpremul = false; // we no longer need to do this on CPU after the read back.
                 }
             }
             // If we failed to create a PM->UPM effect and have no other conversions to perform then
             // there is no longer any point to using the scratch.
-            if (NULL != effect || flipY || swapRAndB) {
+            if (effect || flipY || swapRAndB) {
                 if (!effect) {
                     effect.reset(GrConfigConversionEffect::Create(
                                                     src,
@@ -1555,7 +1555,7 @@
     // target. We don't today so we always perform a flush. We don't promise
     // this to our clients, though.
     this->flush();
-    if (NULL != fGpu) {
+    if (fGpu) {
         fGpu->resolveRenderTarget(target);
     }
 }
@@ -1590,7 +1590,7 @@
     SkMatrix sampleM;
     sampleM.setIDiv(src->width(), src->height());
     SkIRect srcRect = SkIRect::MakeWH(dst->width(), dst->height());
-    if (NULL != topLeft) {
+    if (topLeft) {
         srcRect.offset(*topLeft);
     }
     SkIRect srcBounds = SkIRect::MakeWH(src->width(), src->height());
@@ -1633,7 +1633,7 @@
     // At least some drivers on the Mac get confused when glTexImage2D is called on a texture
     // attached to an FBO. The FBO still sees the old image. TODO: determine what OS versions and/or
     // HW is affected.
-    if (NULL != target->asTexture() && !(kUnpremul_PixelOpsFlag & flags) &&
+    if (target->asTexture() && !(kUnpremul_PixelOpsFlag & flags) &&
         fGpu->canWriteTexturePixels(target->asTexture(), srcConfig)) {
         return this->writeTexturePixels(target->asTexture(),
                                         left, top, width, height,
@@ -1750,9 +1750,9 @@
         fLastDrawWasBuffered = kNo_BufferedDraw;
     }
     ASSERT_OWNED_RESOURCE(fRenderTarget.get());
-    if (NULL != paint) {
-        SkASSERT(NULL != are);
-        SkASSERT(NULL != acf);
+    if (paint) {
+        SkASSERT(are);
+        SkASSERT(acf);
         are->set(fDrawState);
         fDrawState->setFromPaint(*paint, fViewMatrix, fRenderTarget.get());
 #if GR_DEBUG_PARTIAL_COVERAGE_CHECK
@@ -1777,7 +1777,7 @@
         fLastDrawWasBuffered = kNo_BufferedDraw;
         target = fGpu;
     }
-    fDrawState->setState(GrDrawState::kClip_StateBit, NULL != fClip &&
+    fDrawState->setState(GrDrawState::kClip_StateBit, fClip &&
                                                      !fClip->fClipStack->isWideOpen());
     target->setClip(fClip);
     SkASSERT(fDrawState == target->drawState());
@@ -1916,7 +1916,7 @@
     // TODO: now we add to fResourceCache. This should change to fResourceCache.
     GrResourceKey resourceKey = GrPath::ComputeKey(inPath, stroke);
     GrPath* path = static_cast<GrPath*>(fResourceCache->find(resourceKey));
-    if (NULL != path && path->isEqualTo(inPath, stroke)) {
+    if (path && path->isEqualTo(inPath, stroke)) {
         path->ref();
     } else {
         path = fGpu->createPath(inPath, stroke);
@@ -1939,14 +1939,14 @@
 
 void GrContext::addGpuTraceMarker(const GrGpuTraceMarker* marker) {
     fGpu->addGpuTraceMarker(marker);
-    if (NULL != fDrawBuffer) {
+    if (fDrawBuffer) {
         fDrawBuffer->addGpuTraceMarker(marker);
     }
 }
 
 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) {
     fGpu->removeGpuTraceMarker(marker);
-    if (NULL != fDrawBuffer) {
+    if (fDrawBuffer) {
         fDrawBuffer->removeGpuTraceMarker(marker);
     }
 }
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index dd6ae9d..9d08997 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -240,7 +240,7 @@
     uint16_t subpathIdxStart = 0;
 
     SkPoint* base = reinterpret_cast<SkPoint*>(arg->vertices());
-    SkASSERT(NULL != base);
+    SkASSERT(base);
     SkPoint* vert = base;
 
     SkPoint pts[4];
@@ -361,7 +361,7 @@
         return false;
     }
 
-    SkASSERT(NULL != target);
+    SkASSERT(target);
     GrDrawTarget::AutoStateRestore asr(target, GrDrawTarget::kPreserve_ASRInit);
     GrDrawState* drawState = target->drawState();
     bool colorWritesWereDisabled = drawState->isColorWriteDisabled();
@@ -465,7 +465,7 @@
 
     for (int p = 0; p < passCount; ++p) {
         drawState->setDrawFace(drawFace[p]);
-        if (NULL != passes[p]) {
+        if (passes[p]) {
             *drawState->stencil() = *passes[p];
         }
 
@@ -476,7 +476,7 @@
             SkRect bounds;
             GrDrawState::AutoViewMatrixRestore avmr;
             if (reverse) {
-                SkASSERT(NULL != drawState->getRenderTarget());
+                SkASSERT(drawState->getRenderTarget());
                 // draw over the dev bounds (which will be the whole dst surface for inv fill).
                 bounds = devBounds;
                 SkMatrix vmi;
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index dc0ea95..0aafc54 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -188,7 +188,7 @@
         // get our current color
         SkColor filteredColor;
         SkColorFilter* colorFilter = fSkPaint.getColorFilter();
-        if (NULL != colorFilter) {
+        if (colorFilter) {
             filteredColor = colorFilter->filterColor(fSkPaint.getColor());
         } else {
             filteredColor = fSkPaint.getColor();
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index f2028ea..4834811 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -287,7 +287,7 @@
 
 GrDrawState::AutoVertexAttribRestore::AutoVertexAttribRestore(
     GrDrawState* drawState) {
-    SkASSERT(NULL != drawState);
+    SkASSERT(drawState);
     fDrawState = drawState;
     fVAPtr = drawState->fVAPtr;
     fVACount = drawState->fVACount;
@@ -298,7 +298,7 @@
 //////////////////////////////////////////////////////////////////////////////s
 
 void GrDrawState::AutoRestoreEffects::set(GrDrawState* ds) {
-    if (NULL != fDrawState) {
+    if (fDrawState) {
         // See the big comment on the class definition about GPs.
         if (SK_InvalidUniqueID == fOriginalGPID) {
             fDrawState->fGeometryProcessor.reset(NULL);
@@ -447,7 +447,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 void GrDrawState::AutoViewMatrixRestore::restore() {
-    if (NULL != fDrawState) {
+    if (fDrawState) {
         SkDEBUGCODE(--fDrawState->fBlockEffectRemovalCnt;)
         fDrawState->fViewMatrix = fViewMatrix;
         SkASSERT(fDrawState->numColorStages() >= fNumColorStages);
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 6223f53..f7dc69f 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -172,7 +172,7 @@
      */
 
     const GrEffect* setGeometryProcessor(const GrEffect* effect, int attr0 = -1, int attr1 = -1) {
-        SkASSERT(NULL != effect);
+        SkASSERT(effect);
         SkASSERT(!this->hasGeometryProcessor());
         fGeometryProcessor.reset(new GrEffectStage(effect, attr0, attr1));
         this->invalidateBlendOptFlags();
@@ -200,14 +200,14 @@
     ////
 
     const GrEffect* addColorEffect(const GrEffect* effect, int attr0 = -1, int attr1 = -1) {
-        SkASSERT(NULL != effect);
+        SkASSERT(effect);
         SkNEW_APPEND_TO_TARRAY(&fColorStages, GrEffectStage, (effect, attr0, attr1));
         this->invalidateBlendOptFlags();
         return effect;
     }
 
     const GrEffect* addCoverageEffect(const GrEffect* effect, int attr0 = -1, int attr1 = -1) {
-        SkASSERT(NULL != effect);
+        SkASSERT(effect);
         SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrEffectStage, (effect, attr0, attr1));
         this->invalidateBlendOptFlags();
         return effect;
@@ -272,7 +272,7 @@
 
         void set(GrDrawState* ds);
 
-        bool isSet() const { return NULL != fDrawState; }
+        bool isSet() const { return SkToBool(fDrawState); }
 
     private:
         GrDrawState*    fDrawState;
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 191194e..3f1d1c8 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -32,7 +32,7 @@
     fVerticesPerInstance    = di.fVerticesPerInstance;
     fIndicesPerInstance     = di.fIndicesPerInstance;
 
-    if (NULL != di.fDevBounds) {
+    if (di.fDevBounds) {
         SkASSERT(di.fDevBounds == &di.fDevBoundsStorage);
         fDevBoundsStorage = di.fDevBoundsStorage;
         fDevBounds = &fDevBoundsStorage;
@@ -91,7 +91,7 @@
     : fClip(NULL)
     , fContext(context)
     , fGpuTraceMarkerCount(0) {
-    SkASSERT(NULL != context);
+    SkASSERT(context);
 
     fDrawState = &fDefaultDrawState;
     // We assume that fDrawState always owns a ref to the object it points at.
@@ -135,7 +135,7 @@
 }
 
 void GrDrawTarget::setDrawState(GrDrawState*  drawState) {
-    SkASSERT(NULL != fDrawState);
+    SkASSERT(fDrawState);
     if (NULL == drawState) {
         drawState = &fDefaultDrawState;
     }
@@ -152,7 +152,7 @@
     GeometrySrcState& geoSrc = fGeoSrcStateStack.back();
     bool acquired = false;
     if (vertexCount > 0) {
-        SkASSERT(NULL != vertices);
+        SkASSERT(vertices);
         this->releasePreviousVertexSource();
         geoSrc.fVertexSrc = kNone_GeometrySrcType;
 
@@ -164,7 +164,7 @@
         geoSrc.fVertexSrc = kReserved_GeometrySrcType;
         geoSrc.fVertexCount = vertexCount;
         geoSrc.fVertexSize = vertexSize;
-    } else if (NULL != vertices) {
+    } else if (vertices) {
         *vertices = NULL;
     }
     return acquired;
@@ -175,7 +175,7 @@
     GeometrySrcState& geoSrc = fGeoSrcStateStack.back();
     bool acquired = false;
     if (indexCount > 0) {
-        SkASSERT(NULL != indices);
+        SkASSERT(indices);
         this->releasePreviousIndexSource();
         geoSrc.fIndexSrc = kNone_GeometrySrcType;
 
@@ -184,7 +184,7 @@
     if (acquired) {
         geoSrc.fIndexSrc = kReserved_GeometrySrcType;
         geoSrc.fIndexCount = indexCount;
-    } else if (NULL != indices) {
+    } else if (indices) {
         *indices = NULL;
     }
     return acquired;
@@ -218,10 +218,10 @@
 
 bool GrDrawTarget::geometryHints(int32_t* vertexCount,
                                  int32_t* indexCount) const {
-    if (NULL != vertexCount) {
+    if (vertexCount) {
         *vertexCount = -1;
     }
-    if (NULL != indexCount) {
+    if (indexCount) {
         *indexCount = -1;
     }
     return false;
@@ -387,7 +387,7 @@
         }
     }
 
-    SkASSERT(NULL != drawState.getRenderTarget());
+    SkASSERT(drawState.getRenderTarget());
 
     if (drawState.hasGeometryProcessor()) {
         const GrEffect* effect = drawState.getGeometryProcessor()->getEffect();
@@ -432,7 +432,7 @@
     const GrClipData* clip = this->getClip();
     clip->getConservativeBounds(rt, &copyRect);
 
-    if (NULL != drawBounds) {
+    if (drawBounds) {
         SkIRect drawIBounds;
         drawBounds->roundOut(&drawIBounds);
         if (!copyRect.intersect(drawIBounds)) {
@@ -488,7 +488,7 @@
         info.fVerticesPerInstance   = 0;
         info.fIndicesPerInstance    = 0;
 
-        if (NULL != devBounds) {
+        if (devBounds) {
             info.setDevBounds(*devBounds);
         }
         // TODO: We should continue with incorrect blending.
@@ -515,7 +515,7 @@
         info.fVerticesPerInstance   = 0;
         info.fIndicesPerInstance    = 0;
 
-        if (NULL != devBounds) {
+        if (devBounds) {
             info.setDevBounds(*devBounds);
         }
         // TODO: We should continue with incorrect blending.
@@ -528,7 +528,7 @@
 
 void GrDrawTarget::stencilPath(const GrPath* path, SkPath::FillType fill) {
     // TODO: extract portions of checkDraw that are relevant to path stenciling.
-    SkASSERT(NULL != path);
+    SkASSERT(path);
     SkASSERT(this->caps()->pathRenderingSupport());
     SkASSERT(!SkPath::IsInverseFillType(fill));
     this->onStencilPath(path, fill);
@@ -536,7 +536,7 @@
 
 void GrDrawTarget::drawPath(const GrPath* path, SkPath::FillType fill) {
     // TODO: extract portions of checkDraw that are relevant to path rendering.
-    SkASSERT(NULL != path);
+    SkASSERT(path);
     SkASSERT(this->caps()->pathRenderingSupport());
     const GrDrawState* drawState = &getDrawState();
 
@@ -563,9 +563,9 @@
                              const float transforms[], PathTransformType transformsType,
                              SkPath::FillType fill) {
     SkASSERT(this->caps()->pathRenderingSupport());
-    SkASSERT(NULL != pathRange);
-    SkASSERT(NULL != indices);
-    SkASSERT(NULL != transforms);
+    SkASSERT(pathRange);
+    SkASSERT(indices);
+    SkASSERT(transforms);
 
     // Don't compute a bounding box for setupDstReadIfNecessary(), we'll opt
     // instead for it to just copy the entire dst. Realistically this is a moot
@@ -645,7 +645,7 @@
     info.fVerticesPerInstance = verticesPerInstance;
 
     // Set the same bounds for all the draws.
-    if (NULL != devBounds) {
+    if (devBounds) {
         info.setDevBounds(*devBounds);
     }
     // TODO: We should continue with incorrect blending.
@@ -694,7 +694,7 @@
                               const SkRect* localRect,
                               const SkMatrix* localMatrix) {
 
-    set_vertex_attributes(this->drawState(), NULL != localRect);
+    set_vertex_attributes(this->drawState(), SkToBool(localRect));
 
     AutoReleaseGeometry geo(this, 4, 0);
     if (!geo.succeeded()) {
@@ -704,13 +704,13 @@
 
     size_t vstride = this->drawState()->getVertexStride();
     geo.positions()->setRectFan(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, vstride);
-    if (NULL != localRect) {
+    if (localRect) {
         SkPoint* coords = GrTCast<SkPoint*>(GrTCast<intptr_t>(geo.vertices()) +
                                             sizeof(SkPoint));
         coords->setRectFan(localRect->fLeft, localRect->fTop,
                            localRect->fRight, localRect->fBottom,
                            vstride);
-        if (NULL != localMatrix) {
+        if (localMatrix) {
             localMatrix->mapPointsWithStride(coords, vstride, 4);
         }
     }
@@ -737,7 +737,7 @@
 }
 
 GrDrawTarget::AutoStateRestore::~AutoStateRestore() {
-    if (NULL != fDrawTarget) {
+    if (fDrawTarget) {
         fDrawTarget->setDrawState(fSavedState);
         fSavedState->unref();
     }
@@ -817,7 +817,7 @@
     this->reset();
     fTarget = target;
     bool success = true;
-    if (NULL != fTarget) {
+    if (fTarget) {
         fTarget = target;
         success = target->reserveVertexAndIndexSpace(vertexCount,
                                                      indexCount,
@@ -828,16 +828,16 @@
             this->reset();
         }
     }
-    SkASSERT(success == (NULL != fTarget));
+    SkASSERT(success == SkToBool(fTarget));
     return success;
 }
 
 void GrDrawTarget::AutoReleaseGeometry::reset() {
-    if (NULL != fTarget) {
-        if (NULL != fVertices) {
+    if (fTarget) {
+        if (fVertices) {
             fTarget->resetVertexSource();
         }
-        if (NULL != fIndices) {
+        if (fIndices) {
             fTarget->resetIndexSource();
         }
         fTarget = NULL;
@@ -912,8 +912,8 @@
                                GrSurface* src,
                                const SkIRect& srcRect,
                                const SkIPoint& dstPoint) {
-    SkASSERT(NULL != dst);
-    SkASSERT(NULL != src);
+    SkASSERT(dst);
+    SkASSERT(src);
 
     SkIRect clippedSrcRect;
     SkIPoint clippedDstPoint;
@@ -937,8 +937,8 @@
                                   GrSurface* src,
                                   const SkIRect& srcRect,
                                   const SkIPoint& dstPoint) {
-    SkASSERT(NULL != dst);
-    SkASSERT(NULL != src);
+    SkASSERT(dst);
+    SkASSERT(src);
 
     SkIRect clippedSrcRect;
     SkIPoint clippedDstPoint;
@@ -965,7 +965,7 @@
     SkASSERT(dstPoint.fX + srcRect.width() <= dst->width() &&
              dstPoint.fY + srcRect.height() <= dst->height());
 
-    return !dst->isSameAs(src) && NULL != dst->asRenderTarget() && NULL != src->asTexture();
+    return !dst->isSameAs(src) && dst->asRenderTarget() && src->asTexture();
 }
 
 bool GrDrawTarget::onCopySurface(GrSurface* dst,
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 998f412..814d57f 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -593,7 +593,7 @@
         bool set(GrDrawTarget*  target,
                  int            vertexCount,
                  int            indexCount);
-        bool succeeded() const { return NULL != fTarget; }
+        bool succeeded() const { return SkToBool(fTarget); }
         void* vertices() const { SkASSERT(this->succeeded()); return fVertices; }
         void* indices() const { SkASSERT(this->succeeded()); return fIndices; }
         SkPoint* positions() const {
@@ -639,7 +639,7 @@
     public:
         AutoGeometryPush(GrDrawTarget* target)
             : fAttribRestore(target->drawState()) {
-            SkASSERT(NULL != target);
+            SkASSERT(target);
             fTarget = target;
             target->pushGeometrySource();
         }
@@ -661,7 +661,7 @@
                                  ASRInit init,
                                  const SkMatrix* viewMatrix = NULL)
             : fState(target, init, viewMatrix) {
-            SkASSERT(NULL != target);
+            SkASSERT(target);
             fTarget = target;
             target->pushGeometrySource();
             if (kPreserve_ASRInit == init) {
@@ -683,7 +683,7 @@
         DrawToken(GrDrawTarget* drawTarget, uint32_t drawID) :
                   fDrawTarget(drawTarget), fDrawID(drawID) {}
 
-        bool isIssued() { return NULL != fDrawTarget && fDrawTarget->isIssued(fDrawID); }
+        bool isIssued() { return fDrawTarget && fDrawTarget->isIssued(fDrawID); }
 
     private:
         GrDrawTarget*  fDrawTarget;
@@ -822,7 +822,7 @@
 
         // NULL if no copy of the dst is needed for the draw.
         const GrDeviceCoordTexture* getDstCopy() const {
-            if (NULL != fDstCopy.texture()) {
+            if (fDstCopy.texture()) {
                 return &fDstCopy;
             } else {
                 return NULL;
diff --git a/src/gpu/GrGeometryBuffer.h b/src/gpu/GrGeometryBuffer.h
index 3d57f1d..c3e1c65 100644
--- a/src/gpu/GrGeometryBuffer.h
+++ b/src/gpu/GrGeometryBuffer.h
@@ -58,7 +58,7 @@
      * The pointer returned by the previous map call will no longer be valid.
      */
      void unmap() {
-         SkASSERT(NULL != fMapPtr);
+         SkASSERT(fMapPtr);
          this->onUnmap();
          fMapPtr = NULL;
      }
@@ -76,7 +76,7 @@
 
      @return true if the buffer is mapped, false otherwise.
      */
-     bool isMapped() const { return NULL != fMapPtr; }
+     bool isMapped() const { return SkToBool(fMapPtr); }
 
     /**
      * Updates the buffer data.
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 2ceef60..667cae9 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -87,10 +87,10 @@
     } else {
         this->handleDirtyContext();
         tex = this->onCreateTexture(desc, srcData, rowBytes);
-        if (NULL != tex &&
+        if (tex &&
             (kRenderTarget_GrTextureFlagBit & desc.fFlags) &&
             !(kNoStencil_GrTextureFlagBit & desc.fFlags)) {
-            SkASSERT(NULL != tex->asRenderTarget());
+            SkASSERT(tex->asRenderTarget());
             // TODO: defer this and attach dynamically
             if (!this->attachStencilBufferToRenderTarget(tex->asRenderTarget())) {
                 tex->unref();
@@ -107,7 +107,7 @@
         this->getContext()->findStencilBuffer(rt->width(),
                                               rt->height(),
                                               rt->numSamples());
-    if (NULL != sb) {
+    if (sb) {
         rt->setStencilBuffer(sb);
         bool attached = this->attachStencilBufferToRenderTarget(sb, rt);
         if (!attached) {
@@ -140,7 +140,7 @@
     }
     // TODO: defer this and attach dynamically
     GrRenderTarget* tgt = tex->asRenderTarget();
-    if (NULL != tgt &&
+    if (tgt &&
         !this->attachStencilBufferToRenderTarget(tgt)) {
         tex->unref();
         return NULL;
@@ -274,9 +274,9 @@
         static const int SIZE = sizeof(uint16_t) * 6 * MAX_QUADS;
         GrGpu* me = const_cast<GrGpu*>(this);
         fQuadIndexBuffer = me->createIndexBuffer(SIZE, false);
-        if (NULL != fQuadIndexBuffer) {
+        if (fQuadIndexBuffer) {
             uint16_t* indices = (uint16_t*)fQuadIndexBuffer->map();
-            if (NULL != indices) {
+            if (indices) {
                 fill_indices(indices, MAX_QUADS);
                 fQuadIndexBuffer->unmap();
             } else {
@@ -393,12 +393,12 @@
 }
 
 void GrGpu::finalizeReservedVertices() {
-    SkASSERT(NULL != fVertexPool);
+    SkASSERT(fVertexPool);
     fVertexPool->unmap();
 }
 
 void GrGpu::finalizeReservedIndices() {
-    SkASSERT(NULL != fIndexPool);
+    SkASSERT(fIndexPool);
     fIndexPool->unmap();
 }
 
@@ -434,7 +434,7 @@
     GeometryPoolState& geomPoolState = fGeomPoolStateStack.back();
 
     SkASSERT(vertexCount > 0);
-    SkASSERT(NULL != vertices);
+    SkASSERT(vertices);
 
     this->prepareVertexPool();
 
@@ -453,7 +453,7 @@
     GeometryPoolState& geomPoolState = fGeomPoolStateStack.back();
 
     SkASSERT(indexCount > 0);
-    SkASSERT(NULL != indices);
+    SkASSERT(indices);
 
     this->prepareIndexPool();
 
diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp
index d29ab6d..a8d7bbf 100644
--- a/src/gpu/GrGpuResource.cpp
+++ b/src/gpu/GrGpuResource.cpp
@@ -22,9 +22,9 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 static inline GrResourceCache2* get_resource_cache2(GrGpu* gpu) {
-    SkASSERT(NULL != gpu);
-    SkASSERT(NULL != gpu->getContext());
-    SkASSERT(NULL != gpu->getContext()->getResourceCache2());
+    SkASSERT(gpu);
+    SkASSERT(gpu->getContext());
+    SkASSERT(gpu->getContext()->getResourceCache2());
     return gpu->getContext()->getResourceCache2();
 }
 
@@ -50,7 +50,7 @@
 }
 
 void GrGpuResource::release() { 
-    if (NULL != fGpu) {
+    if (fGpu) {
         this->onRelease();
         get_resource_cache2(fGpu)->removeResource(this);
         fGpu = NULL;
@@ -58,7 +58,7 @@
 }
 
 void GrGpuResource::abandon() {
-    if (NULL != fGpu) {
+    if (fGpu) {
         this->onAbandon();
         get_resource_cache2(fGpu)->removeResource(this);
         fGpu = NULL;
@@ -66,7 +66,7 @@
 }
 
 const GrContext* GrGpuResource::getContext() const {
-    if (NULL != fGpu) {
+    if (fGpu) {
         return fGpu->getContext();
     } else {
         return NULL;
@@ -74,7 +74,7 @@
 }
 
 GrContext* GrGpuResource::getContext() {
-    if (NULL != fGpu) {
+    if (fGpu) {
         return fGpu->getContext();
     } else {
         return NULL;
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index 4fd6b4e..b7180da 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -34,8 +34,8 @@
     fDstGpu->ref();
     fCaps.reset(SkRef(fDstGpu->caps()));
 
-    SkASSERT(NULL != vertexPool);
-    SkASSERT(NULL != indexPool);
+    SkASSERT(vertexPool);
+    SkASSERT(indexPool);
 
     GeometryPoolState& poolState = fGeoPoolStateStack.push_back();
     poolState.fUsedPoolVertexBytes = 0;
@@ -124,7 +124,7 @@
 
     GrColor color = drawState->getColor();
 
-    set_vertex_attributes(drawState, NULL != localRect,  color);
+    set_vertex_attributes(drawState, SkToBool(localRect),  color);
 
     AutoReleaseGeometry geo(this, 4, 0);
     if (!geo.succeeded()) {
@@ -153,13 +153,13 @@
     // unnecessary clipping in our onDraw().
     get_vertex_bounds(geo.vertices(), vstride, 4, &devBounds);
 
-    if (NULL != localRect) {
+    if (localRect) {
         static const int kLocalOffset = sizeof(SkPoint) + sizeof(GrColor);
         SkPoint* coords = GrTCast<SkPoint*>(GrTCast<intptr_t>(geo.vertices()) + kLocalOffset);
         coords->setRectFan(localRect->fLeft, localRect->fTop,
                            localRect->fRight, localRect->fBottom,
                            vstride);
-        if (NULL != localMatrix) {
+        if (localMatrix) {
             localMatrix->mapPointsWithStride(coords, vstride, 4);
         }
     }
@@ -288,7 +288,7 @@
 public:
     AutoClipReenable() : fDrawState(NULL) {}
     ~AutoClipReenable() {
-        if (NULL != fDrawState) {
+        if (fDrawState) {
             fDrawState->enableState(GrDrawState::kClip_StateBit);
         }
     }
@@ -309,7 +309,7 @@
     AutoClipReenable acr;
 
     if (drawState.isClipState() &&
-        NULL != info.getDevBounds() &&
+        info.getDevBounds() &&
         this->quickInsideClip(*info.getDevBounds())) {
         acr.set(this->drawState());
     }
@@ -407,7 +407,7 @@
     cp->fPath.reset(path);
     path->ref();
     cp->fFill = fill;
-    if (NULL != dstCopy) {
+    if (dstCopy) {
         cp->fDstCopy = *dstCopy;
     }
 }
@@ -416,9 +416,9 @@
                                       const uint32_t indices[], int count,
                                       const float transforms[], PathTransformType transformsType,
                                       SkPath::FillType fill, const GrDeviceCoordTexture* dstCopy) {
-    SkASSERT(NULL != pathRange);
-    SkASSERT(NULL != indices);
-    SkASSERT(NULL != transforms);
+    SkASSERT(pathRange);
+    SkASSERT(indices);
+    SkASSERT(transforms);
 
     if (this->needsNewClip()) {
         this->recordClip();
@@ -437,7 +437,7 @@
 
     dp->fFill = fill;
 
-    if (NULL != dstCopy) {
+    if (dstCopy) {
         dp->fDstCopy = *dstCopy;
     }
 }
@@ -447,7 +447,7 @@
     SkIRect r;
     if (NULL == renderTarget) {
         renderTarget = this->drawState()->getRenderTarget();
-        SkASSERT(NULL != renderTarget);
+        SkASSERT(renderTarget);
     }
     if (NULL == rect) {
         // We could do something smart and remove previous draws and clears to
@@ -471,7 +471,7 @@
     }
     if (NULL == renderTarget) {
         renderTarget = this->drawState()->getRenderTarget();
-        SkASSERT(NULL != renderTarget);
+        SkASSERT(renderTarget);
     }
     Clear* clr = this->recordClear();
     clr->fColor = GrColor_ILLEGAL;
@@ -487,7 +487,7 @@
     DrawAllocator::Iter drawIter(&fDraws);
     while (drawIter.next()) {
         // we always have a VB, but not always an IB
-        SkASSERT(NULL != drawIter->fVertexBuffer);
+        SkASSERT(drawIter->fVertexBuffer);
         drawIter->fVertexBuffer->unref();
         SkSafeUnref(drawIter->fIndexBuffer);
     }
@@ -576,7 +576,7 @@
                 SkASSERT(fDstGpu->drawState() != prevDrawState);
                 SkAssertResult(drawPathIter.next());
                 fDstGpu->executeDrawPath(drawPathIter->fPath.get(), drawPathIter->fFill,
-                                         NULL != drawPathIter->fDstCopy.texture() ?
+                                         drawPathIter->fDstCopy.texture() ?
                                             &drawPathIter->fDstCopy :
                                             NULL);
                 break;
@@ -585,7 +585,7 @@
                 SkASSERT(fDstGpu->drawState() != prevDrawState);
                 SkAssertResult(drawPathsIter.next());
                 const GrDeviceCoordTexture* dstCopy =
-                    NULL !=drawPathsIter->fDstCopy.texture() ? &drawPathsIter->fDstCopy : NULL;
+                    drawPathsIter->fDstCopy.texture() ? &drawPathsIter->fDstCopy : NULL;
                 fDstGpu->executeDrawPaths(drawPathsIter->fPathRange.get(),
                                           drawPathsIter->fIndices,
                                           drawPathsIter->fCount,
@@ -715,7 +715,7 @@
     // preallocated buffer but none are left and it can't fit
     // in the current buffer (which may not be prealloced).
     bool flush = false;
-    if (NULL != indexCount) {
+    if (indexCount) {
         int32_t currIndices = fIndexPool.currentBufferIndices();
         if (*indexCount > currIndices &&
             (!fIndexPool.preallocatedBuffersRemaining() &&
@@ -725,7 +725,7 @@
         }
         *indexCount = currIndices;
     }
-    if (NULL != vertexCount) {
+    if (vertexCount) {
         size_t vertexStride = this->getDrawState().getVertexStride();
         int32_t currVertices = fVertexPool.currentBufferVertices(vertexStride);
         if (*vertexCount > currVertices &&
@@ -744,26 +744,26 @@
                                                void** vertices) {
     GeometryPoolState& poolState = fGeoPoolStateStack.back();
     SkASSERT(vertexCount > 0);
-    SkASSERT(NULL != vertices);
+    SkASSERT(vertices);
     SkASSERT(0 == poolState.fUsedPoolVertexBytes);
 
     *vertices = fVertexPool.makeSpace(vertexSize,
                                       vertexCount,
                                       &poolState.fPoolVertexBuffer,
                                       &poolState.fPoolStartVertex);
-    return NULL != *vertices;
+    return SkToBool(*vertices);
 }
 
 bool GrInOrderDrawBuffer::onReserveIndexSpace(int indexCount, void** indices) {
     GeometryPoolState& poolState = fGeoPoolStateStack.back();
     SkASSERT(indexCount > 0);
-    SkASSERT(NULL != indices);
+    SkASSERT(indices);
     SkASSERT(0 == poolState.fUsedPoolIndexBytes);
 
     *indices = fIndexPool.makeSpace(indexCount,
                                     &poolState.fPoolIndexBuffer,
                                     &poolState.fPoolStartIndex);
-    return NULL != *indices;
+    return SkToBool(*indices);
 }
 
 void GrInOrderDrawBuffer::releaseReservedVertexSpace() {
diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp
index 9325497..0c2e6b0 100644
--- a/src/gpu/GrLayerCache.cpp
+++ b/src/gpu/GrLayerCache.cpp
@@ -17,7 +17,7 @@
     SkASSERT(fKey.start() > 0 && fKey.stop() > 0);
 
 
-    if (NULL != fTexture) {
+    if (fTexture) {
         // If the layer is in some texture then it must occupy some rectangle
         SkASSERT(!fRect.isEmpty());
         if (!this->isAtlased()) {
@@ -30,17 +30,17 @@
         SkASSERT(!fLocked);     // layers without a texture cannot be locked
     }
 
-    if (NULL != fPlot) {
+    if (fPlot) {
         // If a layer has a plot (i.e., is atlased) then it must point to
         // the backing texture. Additionally, its rect should be non-empty.
-        SkASSERT(NULL != fTexture && backingTexture == fTexture);
+        SkASSERT(fTexture && backingTexture == fTexture);
         SkASSERT(!fRect.isEmpty());
     }
 
     if (fLocked) {
         // If a layer is locked it must have a texture (though it need not be
         // the atlas-backing texture) and occupy some space.
-        SkASSERT(NULL != fTexture);
+        SkASSERT(fTexture);
         SkASSERT(!fRect.isEmpty());
     }
 }
@@ -50,12 +50,12 @@
     GrAutoValidateLayer(GrTexture* backingTexture, const GrCachedLayer* layer) 
         : fBackingTexture(backingTexture)
         , fLayer(layer) {
-        if (NULL != fLayer) {
+        if (fLayer) {
             fLayer->validate(backingTexture);
         }
     }
     ~GrAutoValidateLayer() {
-        if (NULL != fLayer) {
+        if (fLayer) {
             fLayer->validate(fBackingTexture);
         }
     }
@@ -183,7 +183,7 @@
                                               NULL, &loc);
             // addToAtlas can allocate the backing texture
             SkDEBUGCODE(avl.setBackingTexture(fAtlas->getTexture()));
-            if (NULL != plot) {
+            if (plot) {
                 // The layer was successfully added to the atlas
                 GrIRect16 bounds = GrIRect16::MakeXYWH(loc.fX, loc.fY,
                                                        SkToS16(desc.fWidth),
@@ -234,7 +234,7 @@
         // can be used to separate the performance contribution of less
         // render target pingponging from that due to the re-use of cached layers
         GrPictureInfo* pictInfo = fPictureHash.find(layer->pictureID());
-        SkASSERT(NULL != pictInfo);
+        SkASSERT(pictInfo);
         
         GrAtlas::RemovePlot(&pictInfo->fPlotUsage, layer->plot());
         
@@ -262,7 +262,7 @@
         layer->validate(fAtlas->getTexture());
 
         const GrPictureInfo* pictInfo = fPictureHash.find(layer->pictureID());
-        if (NULL != pictInfo) {
+        if (pictInfo) {
             // In aggressive cleanup mode a picture info should only exist if
             // it has some atlased layers
 #if !DISABLE_CACHING
@@ -274,8 +274,8 @@
             SkASSERT(!layer->isAtlased());
         }
 
-        if (NULL != layer->plot()) {
-            SkASSERT(NULL != pictInfo);
+        if (layer->plot()) {
+            SkASSERT(pictInfo);
             SkASSERT(pictInfo->fPictureID == layer->pictureID());
 
             SkASSERT(pictInfo->fPlotUsage.contains(layer->plot()));
@@ -326,7 +326,7 @@
     }
 
     GrPictureInfo* pictInfo = fPictureHash.find(pictureID);
-    if (NULL != pictInfo) {
+    if (pictInfo) {
         fPictureHash.remove(pictureID);
         SkDELETE(pictInfo);
     }
@@ -338,7 +338,7 @@
     GrAtlas::PlotIter iter;
     GrPlot* plot;
     for (plot = fAtlas->iterInit(&iter, GrAtlas::kLRUFirst_IterOrder);
-         NULL != plot;
+         plot;
          plot = iter.prev()) {
         if (fPlotLocks[plot->id()] > 0) {
             continue;
@@ -368,7 +368,7 @@
         SkASSERT(!toBeRemoved[i]->locked());
 
         GrPictureInfo* pictInfo = fPictureHash.find(toBeRemoved[i]->pictureID());
-        SkASSERT(NULL != pictInfo);
+        SkASSERT(pictInfo);
 
         GrAtlas::RemovePlot(&pictInfo->fPlotUsage, plot);
 
@@ -389,7 +389,7 @@
     GrAtlas::PlotIter iter;
     GrPlot* plot;
     for (plot = fAtlas->iterInit(&iter, GrAtlas::kLRUFirst_IterOrder);
-         NULL != plot;
+         plot;
          plot = iter.prev()) {
         SkASSERT(0 == fPlotLocks[plot->id()]);
 
diff --git a/src/gpu/GrLayerCache.h b/src/gpu/GrLayerCache.h
index fcf62f9..fc1467e 100644
--- a/src/gpu/GrLayerCache.h
+++ b/src/gpu/GrLayerCache.h
@@ -122,7 +122,7 @@
     }
     GrPlot* plot() { return fPlot; }
 
-    bool isAtlased() const { return NULL != fPlot; }
+    bool isAtlased() const { return SkToBool(fPlot); }
 
     void setLocked(bool locked) { fLocked = locked; }
     bool locked() const { return fLocked; }
@@ -146,7 +146,7 @@
     // It is always NULL for non-atlased layers.
     GrPlot*         fPlot;
 
-    // For non-atlased layers 'fLocked' should always match "NULL != fTexture".
+    // For non-atlased layers 'fLocked' should always match "fTexture".
     // (i.e., if there is a texture it is locked).
     // For atlased layers, 'fLocked' is true if the layer is in a plot and
     // actively required for rendering. If the layer is in a plot but not
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index 2ed5b0a..ac09df8 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -139,7 +139,7 @@
     SkPicture::AccelData::Key key = GrAccelData::ComputeAccelDataKey();
 
     const SkPicture::AccelData* data = picture->EXPERIMENTAL_getAccelData(key);
-    SkASSERT(NULL != data);
+    SkASSERT(data);
 
     const GrAccelData *gpuData = static_cast<const GrAccelData*>(data);
     SkASSERT(0 != gpuData->numSaveLayers());
diff --git a/src/gpu/GrMemoryPool.cpp b/src/gpu/GrMemoryPool.cpp
index 8839c66..5009f20 100644
--- a/src/gpu/GrMemoryPool.cpp
+++ b/src/gpu/GrMemoryPool.cpp
@@ -127,7 +127,7 @@
     do {
         allocCount += block->fLiveCount;
         SkASSERT(prev == block->fPrev);
-        if (NULL != prev) {
+        if (prev) {
             SkASSERT(prev->fNext == block);
         }
 
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 330d4e9..f694678 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -881,7 +881,7 @@
     if (NULL == fRRectIndexBuffer) {
         fRRectIndexBuffer =
         gpu->createIndexBuffer(sizeof(gRRectIndices), false);
-        if (NULL != fRRectIndexBuffer) {
+        if (fRRectIndexBuffer) {
 #ifdef SK_DEBUG
             bool updated =
 #endif
diff --git a/src/gpu/GrPaint.cpp b/src/gpu/GrPaint.cpp
index 328484b..0e5b2cc 100644
--- a/src/gpu/GrPaint.cpp
+++ b/src/gpu/GrPaint.cpp
@@ -76,7 +76,7 @@
     GrSimplifyBlend(&srcCoeff, &dstCoeff, color, colorComps, 0, 0, 0);
 
     bool opaque = kZero_GrBlendCoeff == dstCoeff && !GrBlendCoeffRefsDst(srcCoeff);
-    if (NULL != solidColor) {
+    if (solidColor) {
         if (opaque) {
             switch (srcCoeff) {
                 case kZero_GrBlendCoeff:
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index 88665c1..1099b2b 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -143,7 +143,7 @@
     static bool IsStrokeHairlineOrEquivalent(const SkStrokeRec& stroke, const SkMatrix& matrix,
                                              SkScalar* outCoverage) {
         if (stroke.isHairlineStyle()) {
-            if (NULL != outCoverage) {
+            if (outCoverage) {
                 *outCoverage = SK_Scalar1;
             }
             return true;
diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp
index cac0475..8108572 100644
--- a/src/gpu/GrPathRendererChain.cpp
+++ b/src/gpu/GrPathRendererChain.cpp
@@ -65,7 +65,7 @@
                                                                                       target);
                 if (support < minStencilSupport) {
                     continue;
-                } else if (NULL != stencilSupport) {
+                } else if (stencilSupport) {
                     *stencilSupport = support;
                 }
             }
diff --git a/src/gpu/GrPictureUtils.cpp b/src/gpu/GrPictureUtils.cpp
index 4b0f77f..8810eb8 100644
--- a/src/gpu/GrPictureUtils.cpp
+++ b/src/gpu/GrPictureUtils.cpp
@@ -89,7 +89,7 @@
     void updateClipBounds(const SkRecords::ClipRect& op)   { fCurrentClipBounds = op.devBounds; }
     void updateClipBounds(const SkRecords::ClipRegion& op) { fCurrentClipBounds = op.devBounds; }
     void updateClipBounds(const SkRecords::SaveLayer& op)  {
-        if (NULL != op.bounds) {
+        if (op.bounds) {
             fCurrentClipBounds.intersect(this->adjustAndMap(*op.bounds, op.paint));
         }
     }
@@ -264,7 +264,7 @@
 
     const GrAccelData* existing = 
                             static_cast<const GrAccelData*>(pict->EXPERIMENTAL_getAccelData(key));
-    if (NULL != existing) {
+    if (existing) {
         return existing;
     }
 
diff --git a/src/gpu/GrProgramResource.cpp b/src/gpu/GrProgramResource.cpp
index 3bf25a1..482caff 100644
--- a/src/gpu/GrProgramResource.cpp
+++ b/src/gpu/GrProgramResource.cpp
@@ -24,7 +24,7 @@
 
 GrProgramResource::~GrProgramResource() {
     if (fOwnRef) {
-        SkASSERT(NULL != fResource);
+        SkASSERT(fResource);
         fResource->unref();
     }
     if (fPendingIO) {
@@ -48,7 +48,7 @@
 
 void GrProgramResource::reset() {
     SkASSERT(!fPendingIO);
-    SkASSERT((NULL != fResource) == fOwnRef);
+    SkASSERT(SkToBool(fResource) == fOwnRef);
     if (fOwnRef) {
         fResource->unref();
         fOwnRef = false;
@@ -59,7 +59,7 @@
 
 void GrProgramResource::setResource(GrGpuResource* resource, IOType ioType) {
     SkASSERT(!fPendingIO);
-    SkASSERT((NULL != fResource) == fOwnRef);
+    SkASSERT(SkToBool(fResource) == fOwnRef);
     SkSafeUnref(fResource);
     if (NULL == resource) {
         fResource = NULL;
@@ -77,7 +77,7 @@
     // This should only be called when the owning GrProgramElement gets its first
     // pendingExecution ref.
     SkASSERT(!fPendingIO);
-    SkASSERT(NULL != fResource);
+    SkASSERT(fResource);
     fPendingIO = true;
     switch (fIOType) {
         case kNone_IOType:
@@ -127,7 +127,7 @@
     SkASSERT(fOwnRef);
     SkASSERT(fPendingIO);
     SkASSERT(kNone_IOType != fIOType);
-    SkASSERT(NULL != fResource);
+    SkASSERT(fResource);
     fResource->unref();
     fOwnRef = false;
 }
diff --git a/src/gpu/GrRODrawState.cpp b/src/gpu/GrRODrawState.cpp
index 2f02482..f2ac34b 100644
--- a/src/gpu/GrRODrawState.cpp
+++ b/src/gpu/GrRODrawState.cpp
@@ -82,7 +82,7 @@
     if (this->hasGeometryProcessor()) {
         const GrEffectStage& stage = *this->getGeometryProcessor();
         const GrEffect* effect = stage.getEffect();
-        SkASSERT(NULL != effect);
+        SkASSERT(effect);
         // make sure that any attribute indices have the correct binding type, that the attrib
         // type and effect's shader lang type are compatible, and that attributes shared by
         // multiple effects use the same shader lang type.
diff --git a/src/gpu/GrRODrawState.h b/src/gpu/GrRODrawState.h
index 88392ba..19bbfc1 100644
--- a/src/gpu/GrRODrawState.h
+++ b/src/gpu/GrRODrawState.h
@@ -126,7 +126,7 @@
                  (this->hasGeometryProcessor() ? 1 : 0);
     }
 
-    bool hasGeometryProcessor() const { return NULL != fGeometryProcessor.get(); }
+    bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()); }
     const GrEffectStage* getGeometryProcessor() const { return fGeometryProcessor.get(); }
     const GrEffectStage& getColorStage(int stageIdx) const { return fColorStages[stageIdx]; }
     const GrEffectStage& getCoverageStage(int stageIdx) const { return fCoverageStages[stageIdx]; }
diff --git a/src/gpu/GrRecordReplaceDraw.cpp b/src/gpu/GrRecordReplaceDraw.cpp
index ab51926..f0abd64 100644
--- a/src/gpu/GrRecordReplaceDraw.cpp
+++ b/src/gpu/GrRecordReplaceDraw.cpp
@@ -71,7 +71,7 @@
     const GrReplacements::ReplacementInfo* ri = NULL;
     int searchStart = 0;
 
-    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
@@ -84,11 +84,11 @@
         bbh->search(query, &ops);
 
         for (int i = 0; i < ops.count(); i++) {
-            if (NULL != callback && callback->abortDrawing()) {
+            if (callback && callback->abortDrawing()) {
                 return;
             }
             ri = replacements->lookupByStart((uintptr_t)ops[i], &searchStart);
-            if (NULL != ri) {
+            if (ri) {
                 draw_replacement_bitmap(ri, canvas);
 
                 while ((uintptr_t)ops[i] < ri->fStop) {
@@ -102,11 +102,11 @@
         }
     } else {
         for (unsigned int i = 0; i < record.count(); ++i) {
-            if (NULL != callback && callback->abortDrawing()) {
+            if (callback && callback->abortDrawing()) {
                 return;
             }
             ri = replacements->lookupByStart(i, &searchStart);
-            if (NULL != ri) {
+            if (ri) {
                 draw_replacement_bitmap(ri, canvas);
 
                 i = ri->fStop;
diff --git a/src/gpu/GrRedBlackTree.h b/src/gpu/GrRedBlackTree.h
index d9b1a04..c58ae27 100644
--- a/src/gpu/GrRedBlackTree.h
+++ b/src/gpu/GrRedBlackTree.h
@@ -204,7 +204,7 @@
     }
     Iter& operator --() {
         SkASSERT(*this != fTree->begin());
-        if (NULL != fN) {
+        if (fN) {
             fN = PredecessorNode(fN);
         } else {
             *this = fTree->last();
@@ -254,7 +254,7 @@
 template <typename T, typename C>
 typename GrRedBlackTree<T,C>::Iter GrRedBlackTree<T,C>::find(const T& t) {
     Node* n = fRoot;
-    while (NULL != n) {
+    while (n) {
         if (fComp(t, n->fItem)) {
             n = n->fChildren[kLeft_Child];
         } else {
@@ -271,7 +271,7 @@
 typename GrRedBlackTree<T,C>::Iter GrRedBlackTree<T,C>::findFirst(const T& t) {
     Node* n = fRoot;
     Node* leftMost = NULL;
-    while (NULL != n) {
+    while (n) {
         if (fComp(t, n->fItem)) {
             n = n->fChildren[kLeft_Child];
         } else {
@@ -291,7 +291,7 @@
 typename GrRedBlackTree<T,C>::Iter GrRedBlackTree<T,C>::findLast(const T& t) {
     Node* n = fRoot;
     Node* rightMost = NULL;
-    while (NULL != n) {
+    while (n) {
         if (fComp(t, n->fItem)) {
             n = n->fChildren[kLeft_Child];
         } else {
@@ -313,7 +313,7 @@
 template <typename T, typename C>
 int GrRedBlackTree<T,C>::onCountOf(const Node* n, const T& t) const {
     // this is count*log(n) :(
-    while (NULL != n) {
+    while (n) {
         if (fComp(t, n->fItem)) {
             n = n->fChildren[kLeft_Child];
         } else {
@@ -360,7 +360,7 @@
 
     bool first = true;
     bool last = true;
-    while (NULL != n) {
+    while (n) {
         gpc = pc;
         pc = fComp(x->fItem, n->fItem) ? kLeft_Child : kRight_Child;
         first = first && kLeft_Child == pc;
@@ -389,10 +389,10 @@
 
     do {
         // assumptions at loop start.
-        SkASSERT(NULL != x);
+        SkASSERT(x);
         SkASSERT(kRed_Color == x->fColor);
         // can't have a grandparent but no parent.
-        SkASSERT(!(NULL != gp && NULL == p));
+        SkASSERT(!(gp && NULL == p));
         // make sure pc and gpc are correct
         SkASSERT(NULL == p  || p->fChildren[pc] == x);
         SkASSERT(NULL == gp || gp->fChildren[gpc] == p);
@@ -403,7 +403,7 @@
             return Iter(returnNode, this);
         }
         // gp must be valid because if p was the root then it is black
-        SkASSERT(NULL != gp);
+        SkASSERT(gp);
         // gp must be black since it's child, p, is red.
         SkASSERT(kBlack_Color == gp->fColor);
 
@@ -413,7 +413,7 @@
         // if x's uncle (p's sibling) is also red then we can flip
         // p and u to black and make gp red. But then we have to recurse
         // up to gp since it's parent may also be red.
-        if (NULL != u && kRed_Color == u->fColor) {
+        if (u && kRed_Color == u->fColor) {
             p->fColor = kBlack_Color;
             u->fColor = kBlack_Color;
             gp->fColor = kRed_Color;
@@ -429,7 +429,7 @@
             gp = p->fParent;
             pc = (p->fChildren[kLeft_Child] == x) ? kLeft_Child :
                                                     kRight_Child;
-            if (NULL != gp) {
+            if (gp) {
                 gpc = (gp->fChildren[kLeft_Child] == p) ? kLeft_Child :
                                                           kRight_Child;
             }
@@ -493,10 +493,10 @@
      */
     Node* d = n->fParent;
     Node* s = n->fChildren[kLeft_Child];
-    SkASSERT(NULL != s);
+    SkASSERT(s);
     Node* b = s->fChildren[kRight_Child];
 
-    if (NULL != d) {
+    if (d) {
         Child c = d->fChildren[kLeft_Child] == n ? kLeft_Child :
                                              kRight_Child;
         d->fChildren[c] = s;
@@ -508,7 +508,7 @@
     s->fChildren[kRight_Child] = n;
     n->fParent = s;
     n->fChildren[kLeft_Child] = b;
-    if (NULL != b) {
+    if (b) {
         b->fParent = n;
     }
 
@@ -525,10 +525,10 @@
 
     Node* d = n->fParent;
     Node* s = n->fChildren[kRight_Child];
-    SkASSERT(NULL != s);
+    SkASSERT(s);
     Node* b = s->fChildren[kLeft_Child];
 
-    if (NULL != d) {
+    if (d) {
         Child c = d->fChildren[kRight_Child] == n ? kRight_Child :
                                                    kLeft_Child;
         d->fChildren[c] = s;
@@ -540,7 +540,7 @@
     s->fChildren[kLeft_Child] = n;
     n->fParent = s;
     n->fChildren[kRight_Child] = b;
-    if (NULL != b) {
+    if (b) {
         b->fParent = n;
     }
 
@@ -554,15 +554,15 @@
 
 template <typename T, typename C>
 typename GrRedBlackTree<T,C>::Node* GrRedBlackTree<T,C>::SuccessorNode(Node* x) {
-    SkASSERT(NULL != x);
-    if (NULL != x->fChildren[kRight_Child]) {
+    SkASSERT(x);
+    if (x->fChildren[kRight_Child]) {
         x = x->fChildren[kRight_Child];
-        while (NULL != x->fChildren[kLeft_Child]) {
+        while (x->fChildren[kLeft_Child]) {
             x = x->fChildren[kLeft_Child];
         }
         return x;
     }
-    while (NULL != x->fParent && x == x->fParent->fChildren[kRight_Child]) {
+    while (x->fParent && x == x->fParent->fChildren[kRight_Child]) {
         x = x->fParent;
     }
     return x->fParent;
@@ -570,15 +570,15 @@
 
 template <typename T, typename C>
 typename GrRedBlackTree<T,C>::Node* GrRedBlackTree<T,C>::PredecessorNode(Node* x) {
-    SkASSERT(NULL != x);
-    if (NULL != x->fChildren[kLeft_Child]) {
+    SkASSERT(x);
+    if (x->fChildren[kLeft_Child]) {
         x = x->fChildren[kLeft_Child];
-        while (NULL != x->fChildren[kRight_Child]) {
+        while (x->fChildren[kRight_Child]) {
             x = x->fChildren[kRight_Child];
         }
         return x;
     }
-    while (NULL != x->fParent && x == x->fParent->fChildren[kLeft_Child]) {
+    while (x->fParent && x == x->fParent->fChildren[kLeft_Child]) {
         x = x->fParent;
     }
     return x->fParent;
@@ -586,12 +586,12 @@
 
 template <typename T, typename C>
 void GrRedBlackTree<T,C>::deleteAtNode(Node* x) {
-    SkASSERT(NULL != x);
+    SkASSERT(x);
     validate();
     --fCount;
 
-    bool hasLeft =  NULL != x->fChildren[kLeft_Child];
-    bool hasRight = NULL != x->fChildren[kRight_Child];
+    bool hasLeft =  SkToBool(x->fChildren[kLeft_Child]);
+    bool hasRight = SkToBool(x->fChildren[kRight_Child]);
     Child c = hasLeft ? kLeft_Child : kRight_Child;
 
     if (hasLeft && hasRight) {
@@ -601,10 +601,10 @@
         // if x is an interior node then we find it's successor
         // and swap them.
         Node* s = x->fChildren[kRight_Child];
-        while (NULL != s->fChildren[kLeft_Child]) {
+        while (s->fChildren[kLeft_Child]) {
             s = s->fChildren[kLeft_Child];
         }
-        SkASSERT(NULL != s);
+        SkASSERT(s);
         // this might be expensive relative to swapping node ptrs around.
         // depends on T.
         x->fItem = s->fItem;
@@ -615,7 +615,7 @@
         // the new root (if the tree is not empty) black.
         SkASSERT(fRoot == x);
         fRoot = x->fChildren[c];
-        if (NULL != fRoot) {
+        if (fRoot) {
             fRoot->fParent = NULL;
             fRoot->fColor = kBlack_Color;
             if (x == fLast) {
@@ -665,7 +665,7 @@
         //s cannot be an implicit black node because the original
         // black-height at x was >= 2 and s's black-height must equal the
         // initial black height of x.
-        SkASSERT(NULL != s);
+        SkASSERT(s);
         SkASSERT(p == s->fParent);
 
         // assigned in loop
@@ -682,7 +682,7 @@
             // be real nodes.
             // The x side of p has a black-height that is one less than the
             // s side. It must be rebalanced.
-            SkASSERT(NULL != s);
+            SkASSERT(s);
             SkASSERT(p == s->fParent);
             SkASSERT(NULL == x || x->fParent == p);
 
@@ -697,8 +697,8 @@
                 SkASSERT(kBlack_Color == p->fColor);
                 // s's children must also be black since s is red. They can't
                 // be implicit since s is red and it's black-height is >= 2.
-                SkASSERT(NULL != sl && kBlack_Color == sl->fColor);
-                SkASSERT(NULL != sr && kBlack_Color == sr->fColor);
+                SkASSERT(sl && kBlack_Color == sl->fColor);
+                SkASSERT(sr && kBlack_Color == sr->fColor);
                 p->fColor = kRed_Color;
                 s->fColor = kBlack_Color;
                 if (kLeft_Child == pc) {
@@ -718,8 +718,8 @@
             SkASSERT(NULL == x || p == x->fParent);
 
             // when x is deleted its subtree will have reduced black-height.
-            slRed = (NULL != sl && kRed_Color == sl->fColor);
-            srRed = (NULL != sr && kRed_Color == sr->fColor);
+            slRed = (sl && kRed_Color == sl->fColor);
+            srRed = (sr && kRed_Color == sr->fColor);
             if (!slRed && !srRed) {
                 // if s can be made red that will balance out x's removal
                 // to make both subtrees of p have the same black-height.
@@ -744,7 +744,7 @@
 
                     }
                     s = p->fChildren[1-pc];
-                    SkASSERT(NULL != s);
+                    SkASSERT(s);
                     SkASSERT(p == s->fParent);
                     continue;
                 } else if (kRed_Color == p->fColor) {
@@ -789,11 +789,11 @@
         s->fColor = p->fColor;
         p->fColor = kBlack_Color;
         if (kLeft_Child == pc) {
-            SkASSERT(NULL != sr && kRed_Color == sr->fColor);
+            SkASSERT(sr && kRed_Color == sr->fColor);
             sr->fColor = kBlack_Color;
             rotateLeft(p);
         } else {
-            SkASSERT(NULL != sl && kRed_Color == sl->fColor);
+            SkASSERT(sl && kRed_Color == sl->fColor);
             sl->fColor = kBlack_Color;
             rotateRight(p);
         }
@@ -815,14 +815,14 @@
         if (x == fFirst) {
             SkASSERT(c == kRight_Child);
             fFirst = c1;
-            while (NULL != fFirst->fChildren[kLeft_Child]) {
+            while (fFirst->fChildren[kLeft_Child]) {
                 fFirst = fFirst->fChildren[kLeft_Child];
             }
             SkASSERT(fFirst == SuccessorNode(x));
         } else if (x == fLast) {
             SkASSERT(c == kLeft_Child);
             fLast = c1;
-            while (NULL != fLast->fChildren[kRight_Child]) {
+            while (fLast->fChildren[kRight_Child]) {
                 fLast = fLast->fChildren[kRight_Child];
             }
             SkASSERT(fLast == PredecessorNode(x));
@@ -838,7 +838,7 @@
 
 template <typename T, typename C>
 void GrRedBlackTree<T,C>::RecursiveDelete(Node* x) {
-    if (NULL != x) {
+    if (x) {
         RecursiveDelete(x->fChildren[kLeft_Child]);
         RecursiveDelete(x->fChildren[kRight_Child]);
         delete x;
@@ -850,8 +850,8 @@
 void GrRedBlackTree<T,C>::validate() const {
     if (fCount) {
         SkASSERT(NULL == fRoot->fParent);
-        SkASSERT(NULL != fFirst);
-        SkASSERT(NULL != fLast);
+        SkASSERT(fFirst);
+        SkASSERT(fLast);
 
         SkASSERT(kBlack_Color == fRoot->fColor);
         if (1 == fCount) {
@@ -874,7 +874,7 @@
 
 template <typename T, typename C>
 int GrRedBlackTree<T,C>::checkNode(Node* n, int* bh) const {
-    if (NULL != n) {
+    if (n) {
         SkASSERT(validateChildRelations(n, false));
         if (kBlack_Color == n->fColor) {
             *bh += 1;
@@ -895,21 +895,21 @@
 template <typename T, typename C>
 bool GrRedBlackTree<T,C>::validateChildRelations(const Node* n,
                                                  bool allowRedRed) const {
-    if (NULL != n) {
-        if (NULL != n->fChildren[kLeft_Child] ||
-            NULL != n->fChildren[kRight_Child]) {
+    if (n) {
+        if (n->fChildren[kLeft_Child] ||
+            n->fChildren[kRight_Child]) {
             if (n->fChildren[kLeft_Child] == n->fChildren[kRight_Child]) {
                 return validateChildRelationsFailed();
             }
             if (n->fChildren[kLeft_Child] == n->fParent &&
-                NULL != n->fParent) {
+                n->fParent) {
                 return validateChildRelationsFailed();
             }
             if (n->fChildren[kRight_Child] == n->fParent &&
-                NULL != n->fParent) {
+                n->fParent) {
                 return validateChildRelationsFailed();
             }
-            if (NULL != n->fChildren[kLeft_Child]) {
+            if (n->fChildren[kLeft_Child]) {
                 if (!allowRedRed &&
                     kRed_Color == n->fChildren[kLeft_Child]->fColor &&
                     kRed_Color == n->fColor) {
@@ -924,7 +924,7 @@
                     return validateChildRelationsFailed();
                 }
             }
-            if (NULL != n->fChildren[kRight_Child]) {
+            if (n->fChildren[kRight_Child]) {
                 if (!allowRedRed &&
                     kRed_Color == n->fChildren[kRight_Child]->fColor &&
                     kRed_Color == n->fColor) {
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
index 6ad9cc6..2083af9 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -65,21 +65,21 @@
         SkRect isectRect;
         if (stackBounds.contains(scalarQueryBounds)) {
             *initialState = kAllIn_InitialState;
-            if (NULL != tighterBounds) {
+            if (tighterBounds) {
                 *tighterBounds = queryBounds;
             }
-            if (NULL != requiresAA) {
+            if (requiresAA) {
                *requiresAA = false;
             }
         } else if (isectRect.intersect(stackBounds, scalarQueryBounds)) {
             // If the caller asked for tighter integer bounds we may be able to
             // return kAllIn and give the bounds with no elements
-            if (NULL != tighterBounds) {
+            if (tighterBounds) {
                 isectRect.roundOut(tighterBounds);
                 SkRect scalarTighterBounds = SkRect::Make(*tighterBounds);
                 if (scalarTighterBounds == isectRect) {
                     // the round-out didn't add any area outside the clip rect.
-                    if (NULL != requiresAA) {
+                    if (requiresAA) {
                         *requiresAA = false;
                     }
                     *initialState = kAllIn_InitialState;
@@ -91,12 +91,12 @@
             SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart);
             bool doAA = iter.prev()->isAA();
             SkNEW_INSERT_AT_LLIST_HEAD(result, Element, (isectRect, SkRegion::kReplace_Op, doAA));
-            if (NULL != requiresAA) {
+            if (requiresAA) {
                 *requiresAA = doAA;
             }
         } else {
             *initialState = kAllOut_InitialState;
-             if (NULL != requiresAA) {
+             if (requiresAA) {
                 *requiresAA = false;
              }
         }
@@ -105,12 +105,12 @@
         if (SkClipStack::kNormal_BoundsType == stackBoundsType) {
             if (!SkRect::Intersects(stackBounds, scalarQueryBounds)) {
                 *initialState = kAllOut_InitialState;
-                if (NULL != requiresAA) {
+                if (requiresAA) {
                    *requiresAA = false;
                 }
                 return;
             }
-            if (NULL != tighterBounds) {
+            if (tighterBounds) {
                 SkIRect stackIBounds;
                 stackBounds.roundOut(&stackIBounds);
                 tighterBounds->intersect(queryBounds, stackIBounds);
@@ -119,12 +119,12 @@
         } else {
             if (stackBounds.contains(scalarQueryBounds)) {
                 *initialState = kAllOut_InitialState;
-                if (NULL != requiresAA) {
+                if (requiresAA) {
                    *requiresAA = false;
                 }
                 return;
             }
-            if (NULL != tighterBounds) {
+            if (tighterBounds) {
                 *tighterBounds = queryBounds;
             }
         }
@@ -367,7 +367,7 @@
         result->reset();
     } else {
         Element* element = result->headIter().get();
-        while (NULL != element) {
+        while (element) {
             bool skippable = false;
             switch (element->getOp()) {
                 case SkRegion::kDifference_Op:
@@ -435,7 +435,7 @@
             }
         }
     }
-    if (NULL != requiresAA) {
+    if (requiresAA) {
         *requiresAA = numAAElements > 0;
     }
 
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index 505cc78..b976332 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -79,7 +79,7 @@
 
 void GrRenderTarget::flagAsNeedingResolve(const SkIRect* rect) {
     if (kCanResolve_ResolveType == getResolveType()) {
-        if (NULL != rect) {
+        if (rect) {
             fResolveRect.join(*rect);
             if (!fResolveRect.intersect(0, 0, this->width(), this->height())) {
                 fResolveRect.setEmpty();
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index 8a21002..e9be509 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -117,10 +117,10 @@
 }
 
 void GrResourceCache::getLimits(int* maxResources, size_t* maxResourceBytes) const{
-    if (NULL != maxResources) {
+    if (maxResources) {
         *maxResources = fMaxCount;
     }
-    if (NULL != maxResourceBytes) {
+    if (maxResourceBytes) {
         *maxResourceBytes = fMaxBytes;
     }
 }
@@ -343,7 +343,7 @@
     this->internalPurge(extraCount, extraBytes);
     if (((fEntryCount+extraCount) > fMaxCount ||
         (fEntryBytes+extraBytes) > fMaxBytes) &&
-        NULL != fOverbudgetCB) {
+        fOverbudgetCB) {
         // Despite the purge we're still over budget. See if Ganesh can
         // release some resources and purge again.
         if ((*fOverbudgetCB)(fOverbudgetData)) {
@@ -402,7 +402,7 @@
         // in internalDetach)
         GrResourceCacheEntry* entry = iter.init(fList, EntryList::Iter::kTail_IterStart);
 
-        while (NULL != entry) {
+        while (entry) {
             GrAutoResourceCacheValidate atcv(this);
 
             if ((fEntryCount+extraCount) <= fMaxCount &&
@@ -462,7 +462,7 @@
     const GrResourceCacheEntry* entry = iter.init(const_cast<EntryList&>(list),
                                                   EntryList::Iter::kTail_IterStart);
 
-    for ( ; NULL != entry; entry = iter.prev()) {
+    for ( ; entry; entry = iter.prev()) {
         bytes += entry->resource()->gpuMemorySize();
     }
     return bytes;
@@ -487,7 +487,7 @@
     const GrResourceCacheEntry* entry = iter.init(const_cast<EntryList&>(fExclusiveList),
                                                   EntryList::Iter::kHead_IterStart);
 
-    for ( ; NULL != entry; entry = iter.next()) {
+    for ( ; entry; entry = iter.next()) {
         entry->validate();
     }
 
@@ -495,7 +495,7 @@
     entry = iter.init(const_cast<EntryList&>(fList), EntryList::Iter::kHead_IterStart);
 
     int count = 0;
-    for ( ; NULL != entry; entry = iter.next()) {
+    for ( ; entry; entry = iter.next()) {
         entry->validate();
         SkASSERT(fCache.find(entry->key()));
         count += 1;
@@ -523,7 +523,7 @@
 
     GrResourceCacheEntry* entry = iter.init(fList, EntryList::Iter::kTail_IterStart);
 
-    for ( ; NULL != entry; entry = iter.prev()) {
+    for ( ; entry; entry = iter.prev()) {
         if (entry->fResource->getRefCnt() > 1) {
             ++locked;
         }
diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h
index 460387f..8333780 100644
--- a/src/gpu/GrResourceCache.h
+++ b/src/gpu/GrResourceCache.h
@@ -181,7 +181,7 @@
      * Determines if the cache contains an entry matching a key. If a matching
      * entry exists but was detached then it will not be found.
      */
-    bool hasKey(const GrResourceKey& key) const { return NULL != fCache.find(key); }
+    bool hasKey(const GrResourceKey& key) const { return SkToBool(fCache.find(key)); }
 
     /**
      * Hide 'entry' so that future searches will not find it. Such
diff --git a/src/gpu/GrResourceCache2.cpp b/src/gpu/GrResourceCache2.cpp
index a5732f7..e0ba26a 100644
--- a/src/gpu/GrResourceCache2.cpp
+++ b/src/gpu/GrResourceCache2.cpp
@@ -15,7 +15,7 @@
 }
 
 void GrResourceCache2::insertResource(GrGpuResource* resource) {
-    SkASSERT(NULL != resource);
+    SkASSERT(resource);
     SkASSERT(!resource->wasDestroyed());
     SkASSERT(!this->isInCache(resource));
     fResources.addToHead(resource);
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index b51bae4..d3d4648 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -142,7 +142,7 @@
     SkTBlitterAllocator allocator;
     SkBlitter* blitter = NULL;
     if (kBlitter_CompressionMode == fCompressionMode) {
-        SkASSERT(NULL != fCompressedBuffer.get());
+        SkASSERT(fCompressedBuffer.get());
         blitter = SkTextureCompressor::CreateBlitterForFormat(
             fBM.width(), fBM.height(), fCompressedBuffer.get(), &allocator, fCompressedFormat);
     }
@@ -160,7 +160,7 @@
 bool GrSWMaskHelper::init(const SkIRect& resultBounds,
                           const SkMatrix* matrix,
                           bool allowCompression) {
-    if (NULL != matrix) {
+    if (matrix) {
         fMatrix = *matrix;
     } else {
         fMatrix.setIdentity();
@@ -249,7 +249,7 @@
     }
 
     texture->set(fContext, desc);
-    return NULL != texture->texture();
+    return SkToBool(texture->texture());
 }
 
 void GrSWMaskHelper::sendTextureData(GrTexture *texture, const GrTextureDesc& desc,
@@ -273,7 +273,7 @@
     SkASSERT(fmt_to_config(fCompressedFormat) == desc.fConfig);
 
     SkAutoDataUnref cmpData(SkTextureCompressor::CompressBitmapToFormat(fBM, fCompressedFormat));
-    SkASSERT(NULL != cmpData);
+    SkASSERT(cmpData);
 
     this->sendTextureData(texture, desc, cmpData->data(), 0);
 }
@@ -300,7 +300,7 @@
             break;
 
         case kBlitter_CompressionMode:
-            SkASSERT(NULL != fCompressedBuffer.get());
+            SkASSERT(fCompressedBuffer.get());
             this->sendTextureData(texture, desc, fCompressedBuffer.get(), 0);
             break;
     }
diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp
index 273c01b..5548790 100644
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp
@@ -15,8 +15,8 @@
 #include "SkStrokeRec.h"
 
 GrPathRenderer* GrStencilAndCoverPathRenderer::Create(GrContext* context) {
-    SkASSERT(NULL != context);
-    SkASSERT(NULL != context->getGpu());
+    SkASSERT(context);
+    SkASSERT(context->getGpu());
     if (context->getGpu()->caps()->pathRenderingSupport()) {
         return SkNEW_ARGS(GrStencilAndCoverPathRenderer, (context->getGpu()));
     } else {
@@ -40,7 +40,7 @@
                                                 bool antiAlias) const {
     return !stroke.isHairlineStyle() &&
            !antiAlias && // doesn't do per-path AA, relies on the target having MSAA
-           NULL != target->getDrawState().getRenderTarget()->getStencilBuffer() &&
+           target->getDrawState().getRenderTarget()->getStencilBuffer() &&
            target->getDrawState().getStencil().isDisabled();
 }
 
diff --git a/src/gpu/GrStrokeInfo.h b/src/gpu/GrStrokeInfo.h
index b9ba5ea..2bd056e 100644
--- a/src/gpu/GrStrokeInfo.h
+++ b/src/gpu/GrStrokeInfo.h
@@ -56,7 +56,7 @@
      * dashed effect and we are stroking, otherwise it retruns false.
      */
     bool setDashInfo(const SkPathEffect* pe) {
-        if (NULL != pe && !fStroke.isFillStyle()) {
+        if (pe && !fStroke.isFillStyle()) {
             fDashInfo.fIntervals = NULL;
             fDashType = pe->asADash(&fDashInfo);
             if (SkPathEffect::kDash_DashType == fDashType) {
diff --git a/src/gpu/GrTemplates.h b/src/gpu/GrTemplates.h
index 2cab132..8e43a15 100644
--- a/src/gpu/GrTemplates.h
+++ b/src/gpu/GrTemplates.h
@@ -41,20 +41,20 @@
 
     GrAutoTRestore(T* ptr) {
         fPtr = ptr;
-        if (NULL != ptr) {
+        if (ptr) {
             fVal = *ptr;
         }
     }
 
     ~GrAutoTRestore() {
-        if (NULL != fPtr) {
+        if (fPtr) {
             *fPtr = fVal;
         }
     }
 
     // restores previously saved value (if any) and saves value for passed T*
     void reset(T* ptr) {
-        if (NULL != fPtr) {
+        if (fPtr) {
             *fPtr = fVal;
         }
         fPtr = ptr;
diff --git a/src/gpu/GrTextStrike.cpp b/src/gpu/GrTextStrike.cpp
index 5606fe3..24fa707 100644
--- a/src/gpu/GrTextStrike.cpp
+++ b/src/gpu/GrTextStrike.cpp
@@ -130,7 +130,7 @@
 }
 
 bool GrFontCache::freeUnusedPlot(GrTextStrike* preserveStrike) {
-    SkASSERT(NULL != preserveStrike);
+    SkASSERT(preserveStrike);
 
     GrAtlas* atlas = preserveStrike->fAtlas;
     GrPlot* plot = atlas->getUnusedPlot();
@@ -197,9 +197,9 @@
 void GrFontCache::dump() const {
     static int gDumpCount = 0;
     for (int i = 0; i < kAtlasCount; ++i) {
-        if (NULL != fAtlases[i]) {
+        if (fAtlases[i]) {
             GrTexture* texture = fAtlases[i]->getTexture();
-            if (NULL != texture) {
+            if (texture) {
                 SkString filename;
 #ifdef SK_BUILD_FOR_ANDROID
                 filename.printf("/sdcard/fontcache_%d%d.png", gDumpCount, i);
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index bcff356..667ddd1 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -16,7 +16,7 @@
 #include "GrResourceCache.h"
 
 GrTexture::~GrTexture() {
-    if (NULL != fRenderTarget.get()) {
+    if (fRenderTarget.get()) {
         fRenderTarget.get()->owningTextureDestroyed();
     }
 }
@@ -27,7 +27,7 @@
  */
 void GrTexture::internal_dispose() const {
     if (this->impl()->isSetFlag((GrTextureFlags) GrTextureImpl::kReturnToCache_FlagBit) &&
-        NULL != this->INHERITED::getContext()) {
+        this->INHERITED::getContext()) {
         GrTexture* nonConstThis = const_cast<GrTexture *>(this);
         this->ref(); // restore ref count to initial setting
 
@@ -123,18 +123,18 @@
 
 void GrTexture::onAbandon() {
     this->abandonReleaseCommon();
-    if (NULL != fRenderTarget.get()) {
+    if (fRenderTarget.get()) {
         fRenderTarget->abandon();
     }
     INHERITED::onAbandon();
 }
 
 void GrTexture::validateDesc() const {
-    if (NULL != this->asRenderTarget()) {
+    if (this->asRenderTarget()) {
         // This texture has a render target
         SkASSERT(0 != (fDesc.fFlags & kRenderTarget_GrTextureFlagBit));
 
-        if (NULL != this->asRenderTarget()->getStencilBuffer()) {
+        if (this->asRenderTarget()->getStencilBuffer()) {
             SkASSERT(0 != (fDesc.fFlags & kNoStencil_GrTextureFlagBit));
         } else {
             SkASSERT(0 == (fDesc.fFlags & kNoStencil_GrTextureFlagBit));
@@ -170,7 +170,7 @@
                                                const GrTextureParams* params,
                                                const GrTextureDesc& desc) {
     GrResourceKey::ResourceFlags flags = 0;
-    bool tiled = NULL != params && params->isTiled();
+    bool tiled = params && params->isTiled();
     if (tiled && !gpu->caps()->npotTextureTileSupport()) {
         if (!SkIsPow2(desc.fWidth) || !SkIsPow2(desc.fHeight)) {
             flags |= kStretchToPOT_TextureFlag;
diff --git a/src/gpu/GrTextureAccess.cpp b/src/gpu/GrTextureAccess.cpp
index 91db08b..b0c760f 100644
--- a/src/gpu/GrTextureAccess.cpp
+++ b/src/gpu/GrTextureAccess.cpp
@@ -42,7 +42,7 @@
 void GrTextureAccess::reset(GrTexture* texture,
                             const char* swizzle,
                             const GrTextureParams& params) {
-    SkASSERT(NULL != texture);
+    SkASSERT(texture);
     SkASSERT(strlen(swizzle) >= 1 && strlen(swizzle) <= 4);
 
     fParams = params;
@@ -54,7 +54,7 @@
                             const char* swizzle,
                             GrTextureParams::FilterMode filterMode,
                             SkShader::TileMode tileXAndY) {
-    SkASSERT(NULL != texture);
+    SkASSERT(texture);
     SkASSERT(strlen(swizzle) >= 1 && strlen(swizzle) <= 4);
 
     fParams.reset(tileXAndY, filterMode);
@@ -64,7 +64,7 @@
 
 void GrTextureAccess::reset(GrTexture* texture,
                             const GrTextureParams& params) {
-    SkASSERT(NULL != texture);
+    SkASSERT(texture);
     fTexture.reset(SkRef(texture));
     fParams = params;
     memcpy(fSwizzle, "rgba", 5);
@@ -74,7 +74,7 @@
 void GrTextureAccess::reset(GrTexture* texture,
                             GrTextureParams::FilterMode filterMode,
                             SkShader::TileMode tileXAndY) {
-    SkASSERT(NULL != texture);
+    SkASSERT(texture);
     fTexture.reset(SkRef(texture));
     fParams.reset(tileXAndY, filterMode);
     memcpy(fSwizzle, "rgba", 5);
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 375d0e6..122af65 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -90,12 +90,12 @@
                         GrTexture** texture)
         : fDevice(NULL)
         , fTexture(NULL) {
-        SkASSERT(NULL != texture);
+        SkASSERT(texture);
         *texture = this->set(device, bitmap, params);
     }
 
     ~SkAutoCachedTexture() {
-        if (NULL != fTexture) {
+        if (fTexture) {
             GrUnlockAndUnrefCachedBitmapTexture(fTexture);
         }
     }
@@ -103,7 +103,7 @@
     GrTexture* set(SkGpuDevice* device,
                    const SkBitmap& bitmap,
                    const GrTextureParams* params) {
-        if (NULL != fTexture) {
+        if (fTexture) {
             GrUnlockAndUnrefCachedBitmapTexture(fTexture);
             fTexture = NULL;
         }
@@ -134,7 +134,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 SkGpuDevice* SkGpuDevice::Create(GrSurface* surface, unsigned flags) {
-    SkASSERT(NULL != surface);
+    SkASSERT(surface);
     if (NULL == surface->asRenderTarget() || surface->wasDestroyed()) {
         return NULL;
     }
@@ -278,7 +278,7 @@
 // call this every draw call, to ensure that the context reflects our state,
 // and not the state from some other canvas/device
 void SkGpuDevice::prepareDraw(const SkDraw& draw, bool forceIdentity) {
-    SkASSERT(NULL != fClipData.fClipStack);
+    SkASSERT(fClipData.fClipStack);
 
     fContext->setRenderTarget(fRenderTarget);
 
@@ -425,7 +425,7 @@
     GrStrokeInfo strokeInfo(paint);
 
     const SkPathEffect* pe = paint.getPathEffect();
-    if (!usePath && NULL != pe && !strokeInfo.isDashed()) {
+    if (!usePath && pe && !strokeInfo.isDashed()) {
         usePath = true;
     }
 
@@ -489,7 +489,7 @@
         usePath = true;
     } else {
         const SkPathEffect* pe = paint.getPathEffect();
-        if (NULL != pe && !strokeInfo.isDashed()) {
+        if (pe && !strokeInfo.isDashed()) {
             usePath = true;
         }
     }
@@ -547,7 +547,7 @@
         usePath = true;
     } else {
         const SkPathEffect* pe = paint.getPathEffect();
-        if (NULL != pe && !strokeInfo.isDashed()) {
+        if (pe && !strokeInfo.isDashed()) {
             usePath = true;
         }
     }
@@ -859,7 +859,7 @@
     }
     SkRect clippedSrcRect = SkRect::Make(*clippedSrcIRect);
     inv.mapRect(&clippedSrcRect);
-    if (NULL != srcRectPtr) {
+    if (srcRectPtr) {
         // we've setup src space 0,0 to map to the top left of the src rect.
         clippedSrcRect.offset(srcRectPtr->fLeft, srcRectPtr->fTop);
         if (!clippedSrcRect.intersect(*srcRectPtr)) {
@@ -881,7 +881,7 @@
                                    int* tileSize,
                                    SkIRect* clippedSrcRect) const {
     // if bitmap is explictly texture backed then just use the texture
-    if (NULL != bitmap.getTexture()) {
+    if (bitmap.getTexture()) {
         return false;
     }
 
@@ -1058,7 +1058,7 @@
         srcRect.set(0, 0, w, h);
         flags = (SkCanvas::DrawBitmapRectFlags) (flags | SkCanvas::kBleed_DrawBitmapRectFlag);
     } else {
-        SkASSERT(NULL != dstSizePtr);
+        SkASSERT(dstSizePtr);
         srcRect = *srcRectPtr;
         dstSize = *dstSizePtr;
         if (srcRect.fLeft <= 0 && srcRect.fTop <= 0 &&
@@ -1073,7 +1073,7 @@
         SkBitmap        tmp;    // subset of bitmap, if necessary
         const SkBitmap* bitmapPtr = &bitmap;
         SkMatrix localM;
-        if (NULL != srcRectPtr) {
+        if (srcRectPtr) {
             localM.setTranslate(-srcRectPtr->fLeft, -srcRectPtr->fTop);
             localM.postScale(dstSize.fWidth / srcRectPtr->width(),
                              dstSize.fHeight / srcRectPtr->height());
@@ -1392,7 +1392,7 @@
     // This bitmap will own the filtered result as a texture.
     SkBitmap filteredBitmap;
 
-    if (NULL != filter) {
+    if (filter) {
         SkIPoint offset = SkIPoint::Make(0, 0);
         SkMatrix matrix(*draw.fMatrix);
         matrix.postTranslate(SkIntToScalar(-left), SkIntToScalar(-top));
@@ -1442,7 +1442,7 @@
                      SkIntToScalar(bitmap.height()));
 
     // Compute matrix from the two rectangles
-    if (NULL != src) {
+    if (src) {
         tmpSrc = *src;
     } else {
         tmpSrc = bitmapBounds;
@@ -1451,7 +1451,7 @@
     matrix.setRectToRect(tmpSrc, dst, SkMatrix::kFill_ScaleToFit);
 
     // clip the tmpSrc to the bounds of the bitmap. No check needed if src==null.
-    if (NULL != src) {
+    if (src) {
         if (!bitmapBounds.contains(tmpSrc)) {
             if (!tmpSrc.intersect(bitmapBounds)) {
                 return; // nothing to draw
@@ -1503,7 +1503,7 @@
     // This bitmap will own the filtered result as a texture.
     SkBitmap filteredBitmap;
 
-    if (NULL != filter) {
+    if (filter) {
         SkIPoint offset = SkIPoint::Make(0, 0);
         SkMatrix matrix(*draw.fMatrix);
         matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y));
@@ -1651,7 +1651,7 @@
     }
 
 #if 0
-    if (NULL != xmode && NULL != texs && NULL != colors) {
+    if (xmode && texs && colors) {
         if (!SkXfermode::IsMode(xmode, SkXfermode::kModulate_Mode)) {
             SkDebugf("Unsupported vertex-color/texture xfer mode.\n");
             return;
@@ -1660,7 +1660,7 @@
 #endif
 
     SkAutoSTMalloc<128, GrColor> convertedColors(0);
-    if (NULL != colors) {
+    if (colors) {
         // need to convert byte order and from non-PM to PM
         convertedColors.reset(vertexCount);
         SkColor color;
@@ -1804,7 +1804,7 @@
 #else
     texture.reset(fContext->createUncachedTexture(desc, NULL, 0));
 #endif
-    if (NULL != texture.get()) {
+    if (texture.get()) {
         return SkGpuDevice::Create(texture, flags);
     } else {
         GrPrintf("---- failed to create compatible device texture [%d %d]\n",
@@ -1820,14 +1820,14 @@
 void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) {
     fContext->getLayerCache()->processDeletedPictures();
 
-    if (NULL != picture->fData.get() && !picture->fData->suitableForLayerOptimization()) {
+    if (picture->fData.get() && !picture->fData->suitableForLayerOptimization()) {
         return;
     }
 
     SkPicture::AccelData::Key key = GrAccelData::ComputeAccelDataKey();
 
     const SkPicture::AccelData* existing = picture->EXPERIMENTAL_getAccelData(key);
-    if (NULL != existing) {
+    if (existing) {
         return;
     }
 
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 085ad2b..f1fd407 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -131,7 +131,7 @@
 }  // namespace
 
 static void add_genID_listener(GrResourceKey key, SkPixelRef* pixelRef) {
-    SkASSERT(NULL != pixelRef);
+    SkASSERT(pixelRef);
     pixelRef->addGenIDChangeListener(SkNEW_ARGS(GrResourceInvalidator, (key)));
 }
 
@@ -188,7 +188,7 @@
 
     GrResourceKey key;
     GrTexture* result = ctx->createTexture(params, desc, cacheID, bytes, 0, &key);
-    if (NULL != result) {
+    if (result) {
         add_genID_listener(key, bm.pixelRef());
     }
     return result;
@@ -250,7 +250,7 @@
     GrResourceKey key;
     result = ctx->createTexture(params, rtDesc, cacheID, NULL, 0, &key);
     GrRenderTarget* renderTarget = result ? result->asRenderTarget() : NULL;
-    if (NULL != renderTarget) {
+    if (renderTarget) {
         add_genID_listener(key, bm.pixelRef());
         SkAutoTUnref<GrEffect> yuvToRgbEffect(GrYUVtoRGBEffect::Create(
             yuvTextures[0].texture(), yuvTextures[1].texture(), yuvTextures[2].texture()));
@@ -301,7 +301,7 @@
                 GrResourceKey key;
                 GrTexture* result = ctx->createTexture(params, desc, cacheID,
                                                        storage.get(), bitmap->width(), &key);
-                if (NULL != result) {
+                if (result) {
                     add_genID_listener(key, origBitmap.pixelRef());
                 }
                 return result;
@@ -336,7 +336,7 @@
         // data is.
         && !(bitmap->readyToDraw())) {
         GrTexture *texture = load_etc1_texture(ctx, params, *bitmap, desc);
-        if (NULL != texture) {
+        if (texture) {
             return texture;
         }
     }
@@ -344,7 +344,7 @@
 
     else {
         GrTexture *texture = load_yuv_texture(ctx, params, *bitmap, desc);
-        if (NULL != texture) {
+        if (texture) {
             return texture;
         }
     }
@@ -360,7 +360,7 @@
         GrResourceKey key;
         GrTexture* result = ctx->createTexture(params, desc, cacheID,
                                                bitmap->getPixels(), bitmap->rowBytes(), &key);
-        if (NULL != result) {
+        if (result) {
             add_genID_listener(key, origBitmap.pixelRef());
         }
         return result;
@@ -420,7 +420,7 @@
 }
 
 void GrUnlockAndUnrefCachedBitmapTexture(GrTexture* texture) {
-    SkASSERT(NULL != texture->getContext());
+    SkASSERT(texture->getContext());
 
     texture->getContext()->unlockScratchTexture(texture);
     texture->unref();
@@ -495,7 +495,7 @@
     SkXfermode* mode = skPaint.getXfermode();
     GrEffect* xferEffect = NULL;
     if (SkXfermode::AsNewEffectOrCoeff(mode, &xferEffect, &sm, &dm)) {
-        if (NULL != xferEffect) {
+        if (xferEffect) {
             grPaint->addColorEffect(xferEffect)->unref();
             sm = SkXfermode::kOne_Coeff;
             dm = SkXfermode::kZero_Coeff;
@@ -512,7 +512,7 @@
     grPaint->setColor(paintColor);
 
     SkColorFilter* colorFilter = skPaint.getColorFilter();
-    if (NULL != colorFilter) {
+    if (colorFilter) {
         // if the source color is a constant then apply the filter here once rather than per pixel
         // in a shader.
         if (constantColor) {
@@ -520,7 +520,7 @@
             grPaint->setColor(SkColor2GrColor(filtered));
         } else {
             SkAutoTUnref<GrEffect> effect(colorFilter->asNewEffect(context));
-            if (NULL != effect.get()) {
+            if (effect.get()) {
                 grPaint->addColorEffect(effect);
             }
         }
@@ -532,7 +532,7 @@
     if (skPaint.isDither() && grPaint->numColorStages() > 0) {
         // What are we rendering into?
         const GrRenderTarget *target = context->getRenderTarget();
-        SkASSERT(NULL != target);
+        SkASSERT(target);
 
         // Suspect the dithering flag has no effect on these configs, otherwise
         // fall back on setting the appropriate state.
@@ -541,7 +541,7 @@
             // The dither flag is set and the target is likely
             // not going to be dithered by the GPU.
             SkAutoTUnref<GrEffect> effect(GrDitherEffect::Create());
-            if (NULL != effect.get()) {
+            if (effect.get()) {
                 grPaint->addColorEffect(effect);
                 grPaint->setDither(false);
             }
@@ -562,7 +562,7 @@
         fContext = context;
     }
     ~AutoMatrix() {
-        SkASSERT(NULL != fContext);
+        SkASSERT(fContext);
         fContext->setMatrix(fMatrix);
     }
 private:
@@ -595,7 +595,7 @@
         // Allow the shader to modify paintColor and also create an effect to be installed as
         // the first color effect on the GrPaint.
         GrEffect* effect = NULL;
-        if (shader->asNewEffect(context, skPaint, NULL, &paintColor, &effect) && NULL != effect) {
+        if (shader->asNewEffect(context, skPaint, NULL, &paintColor, &effect) && effect) {
             grPaint->addColorEffect(effect)->unref();
             constantColor = false;
         }
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp
index f56c3b6..d5be965 100644
--- a/src/gpu/SkGrPixelRef.cpp
+++ b/src/gpu/SkGrPixelRef.cpp
@@ -125,7 +125,7 @@
     if (fUnlock) {
         GrContext* context = fSurface->getContext();
         GrTexture* texture = fSurface->asTexture();
-        if (NULL != context && NULL != texture) {
+        if (context && texture) {
             context->unlockScratchTexture(texture);
         }
     }
@@ -133,7 +133,7 @@
 }
 
 GrTexture* SkGrPixelRef::getTexture() {
-    if (NULL != fSurface) {
+    if (fSurface) {
         return fSurface->asTexture();
     }
     return NULL;
@@ -159,7 +159,7 @@
     }
 
     int left, top, width, height;
-    if (NULL != subset) {
+    if (subset) {
         left = subset->fLeft;
         width = subset->width();
         top = subset->fTop;
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index ba9f814..90a655c 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -158,7 +158,7 @@
                                          float bounds[2])
     : Gr1DKernelEffect(texture, direction, radius), fUseBounds(useBounds) {
     SkASSERT(radius <= kMaxKernelRadius);
-    SkASSERT(NULL != kernel);
+    SkASSERT(kernel);
     int width = this->width();
     for (int i = 0; i < width; i++) {
         fKernel[i] = kernel[i];
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp
index e3927c0..91df897 100644
--- a/src/gpu/effects/GrTextureStripAtlas.cpp
+++ b/src/gpu/effects/GrTextureStripAtlas.cpp
@@ -35,7 +35,7 @@
 
 // Remove the specified atlas from the cache
 void GrTextureStripAtlas::CleanUp(const GrContext*, void* info) {
-    SkASSERT(NULL != info);
+    SkASSERT(info);
 
     AtlasEntry* entry = static_cast<AtlasEntry*>(info);
 
@@ -209,11 +209,11 @@
         this->initLRU();
         fKeyTable.rewind();
     }
-    SkASSERT(NULL != fTexture);
+    SkASSERT(fTexture);
 }
 
 void GrTextureStripAtlas::unlockTexture() {
-    SkASSERT(NULL != fTexture && 0 == fLockedRows);
+    SkASSERT(fTexture && 0 == fLockedRows);
     fTexture->unref();
     fTexture = NULL;
     fDesc.fContext->purgeCache();
@@ -246,8 +246,8 @@
 }
 
 void GrTextureStripAtlas::removeFromLRU(AtlasRow* row) {
-    SkASSERT(NULL != row);
-    if (NULL != row->fNext && NULL != row->fPrev) {
+    SkASSERT(row);
+    if (row->fNext && row->fPrev) {
         row->fPrev->fNext = row->fNext;
         row->fNext->fPrev = row->fPrev;
     } else {
@@ -342,7 +342,7 @@
     if (fLockedRows == 0) {
         SkASSERT(NULL == fTexture);
     } else {
-        SkASSERT(NULL != fTexture);
+        SkASSERT(fTexture);
     }
 }
 #endif
diff --git a/src/gpu/gl/GrGLBufferImpl.cpp b/src/gpu/gl/GrGLBufferImpl.cpp
index ae578a2..8b5eda5 100644
--- a/src/gpu/gl/GrGLBufferImpl.cpp
+++ b/src/gpu/gl/GrGLBufferImpl.cpp
@@ -38,7 +38,7 @@
 void GrGLBufferImpl::release(GrGpuGL* gpu) {
     VALIDATE();
     // make sure we've not been abandoned or already released
-    if (NULL != fCPUData) {
+    if (fCPUData) {
         sk_free(fCPUData);
         fCPUData = NULL;
     } else if (fDesc.fID && !fDesc.fIsWrapped) {
@@ -157,7 +157,7 @@
 
 bool GrGLBufferImpl::isMapped() const {
     VALIDATE();
-    return NULL != fMapPtr;
+    return SkToBool(fMapPtr);
 }
 
 bool GrGLBufferImpl::updateData(GrGpuGL* gpu, const void* src, size_t srcSizeInBytes) {
@@ -218,9 +218,9 @@
 void GrGLBufferImpl::validate() const {
     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) == (NULL != fCPUData));
+    // SkASSERT((0 == fDesc.fID) == (fCPUData));
     SkASSERT(0 != fDesc.fID || !fDesc.fIsWrapped);
     SkASSERT(NULL == fCPUData || 0 == fGLSizeInBytes);
-    SkASSERT(NULL == fMapPtr || NULL != fCPUData || fGLSizeInBytes == fDesc.fSizeInBytes);
+    SkASSERT(NULL == fMapPtr || fCPUData || fGLSizeInBytes == fDesc.fSizeInBytes);
     SkASSERT(NULL == fCPUData || NULL == fMapPtr || fCPUData == fMapPtr);
 }
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 5acb922..dc4ef4c 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -342,7 +342,7 @@
                 (fMaxFixedFunctionTextureCoords > 0 ||
                  ((ctxInfo.version() >= GR_GL_VER(4,3) ||
                    ctxInfo.hasExtension("GL_ARB_program_interface_query")) &&
-                  NULL != gli->fFunctions.fProgramPathFragmentInputGen));
+                  gli->fFunctions.fProgramPathFragmentInputGen));
         } else {
             fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3,1);
         }
@@ -519,7 +519,7 @@
     bool hasCompressTex2D = (kGL_GrGLStandard != standard || version >= GR_GL_VER(1, 3));
 
     fCompressedTexSubImageSupport =
-        hasCompressTex2D && (NULL != gli->fFunctions.fCompressedTexSubImage2D);
+        hasCompressTex2D && (gli->fFunctions.fCompressedTexSubImage2D);
 
     // Check for ETC1
     bool hasETC1 = false;
diff --git a/src/gpu/gl/GrGLContext.cpp b/src/gpu/gl/GrGLContext.cpp
index 5bc5b6f..5373634 100644
--- a/src/gpu/gl/GrGLContext.cpp
+++ b/src/gpu/gl/GrGLContext.cpp
@@ -62,9 +62,7 @@
     return false;
 }
 
-bool GrGLContextInfo::isInitialized() const {
-    return NULL != fInterface.get();
-}
+bool GrGLContextInfo::isInitialized() const { return SkToBool(fInterface.get()); }
 
 void GrGLContextInfo::reset() {
     fInterface.reset(NULL);
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp
index 8b6d9a6..9cac1c6 100644
--- a/src/gpu/gl/GrGLCreateNullInterface.cpp
+++ b/src/gpu/gl/GrGLCreateNullInterface.cpp
@@ -21,7 +21,7 @@
     ~BufferObj() { SkDELETE_ARRAY(fDataPtr); }
 
     void allocate(GrGLsizeiptr size, const GrGLchar* dataPtr) {
-        if (NULL != fDataPtr) {
+        if (fDataPtr) {
             SkASSERT(0 != fSize);
             SkDELETE_ARRAY(fDataPtr);
         }
@@ -65,7 +65,7 @@
 
     BufferObj* lookUp(GrGLuint id) {
         BufferObj* buffer = fBuffers[id];
-        SkASSERT(NULL != buffer && buffer->id() == id);
+        SkASSERT(buffer && buffer->id() == id);
         return buffer;
     }
 
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp
index c192611..4c2713d 100644
--- a/src/gpu/gl/GrGLInterface.cpp
+++ b/src/gpu/gl/GrGLInterface.cpp
@@ -74,7 +74,7 @@
 }
 
 GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) {
-    SkASSERT(NULL != interface);
+    SkASSERT(interface);
 
     GrGLInterface* clone = SkNEW(GrGLInterface);
     clone->fStandard = interface->fStandard;
diff --git a/src/gpu/gl/GrGLPathRange.cpp b/src/gpu/gl/GrGLPathRange.cpp
index 5295207..48a073c 100644
--- a/src/gpu/gl/GrGLPathRange.cpp
+++ b/src/gpu/gl/GrGLPathRange.cpp
@@ -39,7 +39,7 @@
 }
 
 void GrGLPathRange::onRelease() {
-    SkASSERT(NULL != this->getGpu());
+    SkASSERT(this->getGpu());
 
     if (0 != fBasePathID && !this->isWrapped()) {
         static_cast<GrGpuGL*>(this->getGpu())->glPathRendering()->deletePaths(fBasePathID, fSize);
diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp
index 337e83e..f524ff2 100644
--- a/src/gpu/gl/GrGLPathRendering.cpp
+++ b/src/gpu/gl/GrGLPathRendering.cpp
@@ -49,13 +49,13 @@
     : fGpu(gpu) {
     const GrGLInterface* glInterface = gpu->glInterface();
     fCaps.stencilThenCoverSupport =
-        NULL != glInterface->fFunctions.fStencilThenCoverFillPath &&
-        NULL != glInterface->fFunctions.fStencilThenCoverStrokePath &&
-        NULL != glInterface->fFunctions.fStencilThenCoverFillPathInstanced &&
-        NULL != glInterface->fFunctions.fStencilThenCoverStrokePathInstanced;
+        glInterface->fFunctions.fStencilThenCoverFillPath &&
+        glInterface->fFunctions.fStencilThenCoverStrokePath &&
+        glInterface->fFunctions.fStencilThenCoverFillPathInstanced &&
+        glInterface->fFunctions.fStencilThenCoverStrokePathInstanced;
     fCaps.fragmentInputGenSupport =
         kGLES_GrGLStandard == glInterface->fStandard &&
-        NULL != glInterface->fFunctions.fProgramPathFragmentInputGen;
+        glInterface->fFunctions.fProgramPathFragmentInputGen;
 
     if (!fCaps.fragmentInputGenSupport) {
         fHWPathTexGenSettings.reset(fGpu->glCaps().maxFixedFunctionTextureCoords());
@@ -97,8 +97,8 @@
 
 void GrGLPathRendering::stencilPath(const GrPath* path, SkPath::FillType fill) {
     GrGLuint id = static_cast<const GrGLPath*>(path)->pathID();
-    SkASSERT(NULL != fGpu->drawState()->getRenderTarget());
-    SkASSERT(NULL != fGpu->drawState()->getRenderTarget()->getStencilBuffer());
+    SkASSERT(fGpu->drawState()->getRenderTarget());
+    SkASSERT(fGpu->drawState()->getRenderTarget()->getStencilBuffer());
 
     this->flushPathStencilSettings(fill);
     SkASSERT(!fHWPathStencilSettings.isTwoSided());
@@ -111,8 +111,8 @@
 
 void GrGLPathRendering::drawPath(const GrPath* path, SkPath::FillType fill) {
     GrGLuint id = static_cast<const GrGLPath*>(path)->pathID();
-    SkASSERT(NULL != fGpu->drawState()->getRenderTarget());
-    SkASSERT(NULL != fGpu->drawState()->getRenderTarget()->getStencilBuffer());
+    SkASSERT(fGpu->drawState()->getRenderTarget());
+    SkASSERT(fGpu->drawState()->getRenderTarget()->getStencilBuffer());
 
     this->flushPathStencilSettings(fill);
     SkASSERT(!fHWPathStencilSettings.isTwoSided());
@@ -167,8 +167,8 @@
                                   const float transforms[], PathTransformType transformsType,
                                   SkPath::FillType fill) {
     SkASSERT(fGpu->caps()->pathRenderingSupport());
-    SkASSERT(NULL != fGpu->drawState()->getRenderTarget());
-    SkASSERT(NULL != fGpu->drawState()->getRenderTarget()->getStencilBuffer());
+    SkASSERT(fGpu->drawState()->getRenderTarget());
+    SkASSERT(fGpu->drawState()->getRenderTarget()->getStencilBuffer());
 
     GrGLuint baseID = static_cast<const GrGLPathRange*>(pathRange)->basePathID();
 
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 7b5dbb4..916c31c 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -100,7 +100,7 @@
         fProgramDataManager.setSampler(fBuiltinUniformHandles.fDstCopySamplerUni, texUnitIdx);
         fDstCopyTexUnit = texUnitIdx++;
     }
-    if (NULL != fGeometryProcessor.get()) {
+    if (fGeometryProcessor.get()) {
         fGeometryProcessor->initSamplers(fProgramDataManager, &texUnitIdx);
     }
     fColorEffects->initSamplers(fProgramDataManager, &texUnitIdx);
@@ -135,7 +135,7 @@
     this->setCoverage(drawState, coverage, sharedState);
     this->setMatrixAndRenderTargetHeight(drawType, drawState);
 
-    if (NULL != dstCopy) {
+    if (dstCopy) {
         if (fBuiltinUniformHandles.fDstCopyTopLeftUni.isValid()) {
             fProgramDataManager.set2f(fBuiltinUniformHandles.fDstCopyTopLeftUni,
                                        static_cast<GrGLfloat>(dstCopy->offset().fX),
@@ -156,8 +156,8 @@
         SkASSERT(!fBuiltinUniformHandles.fDstCopySamplerUni.isValid());
     }
 
-    if (NULL != fGeometryProcessor.get()) {
-        SkASSERT(NULL != geometryProcessor);
+    if (fGeometryProcessor.get()) {
+        SkASSERT(geometryProcessor);
         fGeometryProcessor->setData(fGpu, drawType,fProgramDataManager, geometryProcessor);
     }
     fColorEffects->setData(fGpu, drawType,fProgramDataManager, colorStages);
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 8d0ea3d..d7ba287 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -243,9 +243,9 @@
     }
 
     if (readsDst) {
-        SkASSERT(NULL != dstCopy || gpu->caps()->dstReadInShaderSupport());
+        SkASSERT(dstCopy || gpu->caps()->dstReadInShaderSupport());
         const GrTexture* dstCopyTexture = NULL;
-        if (NULL != dstCopy) {
+        if (dstCopy) {
             dstCopyTexture = dstCopy->texture();
         }
         header->fDstReadKey = GrGLFragmentShaderBuilder::KeyForDstRead(dstCopyTexture,
diff --git a/src/gpu/gl/GrGLProgramEffects.cpp b/src/gpu/gl/GrGLProgramEffects.cpp
index 45edca8..98e8138 100644
--- a/src/gpu/gl/GrGLProgramEffects.cpp
+++ b/src/gpu/gl/GrGLProgramEffects.cpp
@@ -461,7 +461,7 @@
                                                  const char* outColor,
                                                  const char* inColor,
                                                  int stageIndex) {
-    SkASSERT(NULL != fProgramEffects.get());
+    SkASSERT(fProgramEffects.get());
     fProgramEffects->emitEffect(fBuilder, stage, key, outColor, inColor, stageIndex);
 }
 
@@ -570,7 +570,7 @@
                                                      const char* outColor,
                                                      const char* inColor,
                                                      int stageIndex) {
-    SkASSERT(NULL != fProgramEffects.get());
+    SkASSERT(fProgramEffects.get());
     fProgramEffects->emitEffect(fBuilder, stage, key, outColor, inColor, stageIndex);
 }
 
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index 6143f34..49186bf 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -53,8 +53,8 @@
                          viewport.fWidth, viewport.fHeight,
                          desc.fConfig, desc.fSampleCnt,
                          desc.fOrigin)) {
-    SkASSERT(NULL != texID);
-    SkASSERT(NULL != texture);
+    SkASSERT(texID);
+    SkASSERT(texture);
     // FBO 0 can't also be a texture, right?
     SkASSERT(0 != desc.fRTFBOID);
     SkASSERT(0 != desc.fTexFBOID);
@@ -102,7 +102,7 @@
     fRTFBOID                = 0;
     fTexFBOID               = 0;
     fMSColorRenderbufferID  = 0;
-    if (NULL != fTexIDObj.get()) {
+    if (fTexIDObj.get()) {
         fTexIDObj->abandon();
         fTexIDObj.reset(NULL);
     }
diff --git a/src/gpu/gl/GrGLSL.cpp b/src/gpu/gl/GrGLSL.cpp
index 468b13b..6c8f883 100644
--- a/src/gpu/gl/GrGLSL.cpp
+++ b/src/gpu/gl/GrGLSL.cpp
@@ -10,7 +10,7 @@
 #include "SkString.h"
 
 bool GrGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation) {
-    SkASSERT(NULL != generation);
+    SkASSERT(generation);
     GrGLSLVersion ver = GrGLGetGLSLVersion(gl);
     if (GR_GLSL_INVALID_VER == ver) {
         return false;
diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp
index bc013bc..202fc42 100644
--- a/src/gpu/gl/GrGLTexture.cpp
+++ b/src/gpu/gl/GrGLTexture.cpp
@@ -24,7 +24,7 @@
                                            textureDesc.fTextureID,
                                            textureDesc.fIsWrapped)));
 
-    if (NULL != rtDesc) {
+    if (rtDesc) {
         GrGLIRect vp;
         vp.fLeft   = 0;
         vp.fWidth  = textureDesc.fWidth;
@@ -55,7 +55,7 @@
 }
 
 void GrGLTexture::onAbandon() {
-    if (NULL != fTexIDObj.get()) {
+    if (fTexIDObj.get()) {
         fTexIDObj->abandon();
         fTexIDObj.reset(NULL);
     }
diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h
index a8800fa..23ae3fa 100644
--- a/src/gpu/gl/GrGLTexture.h
+++ b/src/gpu/gl/GrGLTexture.h
@@ -89,7 +89,7 @@
         fTexParamsTimestamp = timestamp;
     }
 
-    GrGLuint textureID() const { return (NULL != fTexIDObj.get()) ? fTexIDObj->id() : 0; }
+    GrGLuint textureID() const { return (fTexIDObj.get()) ? fTexIDObj->id() : 0; }
 
 protected:
     // overrides of GrTexture
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index 9bc2c5d..1ef66e0 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -40,10 +40,10 @@
     uint32_t err = GR_GL_GET_ERROR(gl);
     if (GR_GL_NO_ERROR != err) {
         GrPrintf("---- glGetError 0x%x(%s)", err, get_error_string(err));
-        if (NULL != location) {
+        if (location) {
             GrPrintf(" at\n\t%s", location);
         }
-        if (NULL != call) {
+        if (call) {
             GrPrintf("\n\t\t%s", call);
         }
         GrPrintf("\n");
@@ -167,7 +167,7 @@
 }
 
 GrGLVendor GrGLGetVendorFromString(const char* vendorString) {
-    if (NULL != vendorString) {
+    if (vendorString) {
         if (0 == strcmp(vendorString, "ARM")) {
             return kARM_GrGLVendor;
         }
@@ -188,7 +188,7 @@
 }
 
 GrGLRenderer GrGLGetRendererFromString(const char* rendererString) {
-    if (NULL != rendererString) {
+    if (rendererString) {
         if (0 == strcmp(rendererString, "NVIDIA Tegra 3")) {
             return kTegra3_GrGLRenderer;
         } else if (0 == strcmp(rendererString, "NVIDIA Tegra")) {
diff --git a/src/gpu/gl/GrGLVertexArray.cpp b/src/gpu/gl/GrGLVertexArray.cpp
index 39fd48c..4acf292 100644
--- a/src/gpu/gl/GrGLVertexArray.cpp
+++ b/src/gpu/gl/GrGLVertexArray.cpp
@@ -100,7 +100,7 @@
 
 GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(const GrGLIndexBuffer* buffer) {
     GrGLAttribArrayState* state = this->bind();
-    if (NULL != state && NULL != buffer) {
+    if (state && buffer) {
         GrGLuint bufferID = buffer->bufferID();
         if (!fIndexBufferIDIsValid || bufferID != fIndexBufferID) {
             GL_CALL(BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, bufferID));
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index f5802ef..39cb84e 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -542,7 +542,7 @@
                             GrPixelConfig dataConfig,
                             const void* data,
                             size_t rowBytes) {
-    SkASSERT(NULL != data || isNewTexture);
+    SkASSERT(data || isNewTexture);
 
     // If we're uploading compressed data then we should be using uploadCompressedTexData
     SkASSERT(!GrPixelConfigIsCompressed(dataConfig));
@@ -602,7 +602,7 @@
     bool restoreGLRowLength = false;
     bool swFlipY = false;
     bool glFlipY = false;
-    if (NULL != data) {
+    if (data) {
         if (kBottomLeft_GrSurfaceOrigin == desc.fOrigin) {
             if (this->glCaps().unpackFlipYSupport()) {
                 glFlipY = true;
@@ -673,7 +673,7 @@
         } else {
             // if we have data and we used TexStorage to create the texture, we
             // now upload with TexSubImage.
-            if (NULL != data && useTexStorage) {
+            if (data && useTexStorage) {
                 GL_CALL(TexSubImage2D(GR_GL_TEXTURE_2D,
                                       0, // level
                                       left, top,
@@ -712,7 +712,7 @@
                                       const void* data,
                                       bool isNewTexture,
                                       int left, int top, int width, int height) {
-    SkASSERT(NULL != data || isNewTexture);
+    SkASSERT(data || isNewTexture);
 
     // No support for software flip y, yet...
     SkASSERT(kBottomLeft_GrSurfaceOrigin != desc.fOrigin);
@@ -1225,7 +1225,7 @@
     GrGLuint fbo = glrt->renderFBOID();
 
     if (NULL == sb) {
-        if (NULL != rt->getStencilBuffer()) {
+        if (rt->getStencilBuffer()) {
             GL_CALL(FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
                                             GR_GL_STENCIL_ATTACHMENT,
                                             GR_GL_RENDERBUFFER, 0));
@@ -1382,7 +1382,7 @@
 void GrGpuGL::onClear(GrRenderTarget* target, const SkIRect* rect, GrColor color,
                       bool canIgnoreRect) {
     // parent class should never let us get here with no RT
-    SkASSERT(NULL != target);
+    SkASSERT(target);
     GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target);
 
     if (canIgnoreRect && this->glCaps().fullClearIsFree()) {
@@ -1390,7 +1390,7 @@
     }
 
     SkIRect clippedRect;
-    if (NULL != rect) {
+    if (rect) {
         // flushScissor expects rect to be clipped to the target.
         clippedRect = *rect;
         SkIRect rtRect = SkIRect::MakeWH(target->width(), target->height());
@@ -1403,7 +1403,7 @@
 
     this->flushRenderTarget(glRT, rect);
     GrAutoTRestore<ScissorState> asr(&fScissorState);
-    fScissorState.fEnabled = (NULL != rect);
+    fScissorState.fEnabled = SkToBool(rect);
     if (fScissorState.fEnabled) {
         fScissorState.fRect = *rect;
     }
@@ -1495,11 +1495,11 @@
 }
 
 void GrGpuGL::clearStencilClip(GrRenderTarget* target, const SkIRect& rect, bool insideClip) {
-    SkASSERT(NULL != target);
+    SkASSERT(target);
 
     // this should only be called internally when we know we have a
     // stencil buffer.
-    SkASSERT(NULL != target->getStencilBuffer());
+    SkASSERT(target->getStencilBuffer());
     GrGLint stencilBitCount =  target->getStencilBuffer()->bits();
 #if 0
     SkASSERT(stencilBitCount > 0);
@@ -1693,7 +1693,7 @@
 
 void GrGpuGL::flushRenderTarget(GrGLRenderTarget* target, const SkIRect* bound) {
 
-    SkASSERT(NULL != target);
+    SkASSERT(target);
 
     uint32_t rtID = target->getUniqueID();
     if (fHWBoundRenderTargetUniqueID != rtID) {
@@ -1723,7 +1723,7 @@
     }
 
     GrTexture *texture = target->asTexture();
-    if (NULL != texture) {
+    if (texture) {
         texture->impl()->dirtyMipMaps(true);
     }
 }
@@ -2006,13 +2006,13 @@
 }
 
 void GrGpuGL::bindTexture(int unitIdx, const GrTextureParams& params, GrGLTexture* texture) {
-    SkASSERT(NULL != texture);
+    SkASSERT(texture);
 
     // If we created a rt/tex and rendered to it without using a texture and now we're texturing
     // from the rt it will still be the last bound texture, but it needs resolving. So keep this
     // out of the "last != next" check.
     GrGLRenderTarget* texRT =  static_cast<GrGLRenderTarget*>(texture->asRenderTarget());
-    if (NULL != texRT) {
+    if (texRT) {
         this->onResolveRenderTarget(texRT);
     }
 
@@ -2318,7 +2318,7 @@
             (src->desc().fSampleCnt > 0 || src->config() != dst->config())) {
            return false;
         }
-        if (NULL != wouldNeedTempFBO) {
+        if (wouldNeedTempFBO) {
             *wouldNeedTempFBO = NULL == dst->asRenderTarget() || NULL == src->asRenderTarget();
         }
         return true;
@@ -2341,20 +2341,20 @@
     const GrGLRenderTarget* dstRT = static_cast<const GrGLRenderTarget*>(dst->asRenderTarget());
     // If dst is multisampled (and uses an extension where there is a separate MSAA renderbuffer)
     // then we don't want to copy to the texture but to the MSAA buffer.
-    if (NULL != dstRT && dstRT->renderFBOID() != dstRT->textureFBOID()) {
+    if (dstRT && dstRT->renderFBOID() != dstRT->textureFBOID()) {
         return false;
     }
     const GrGLRenderTarget* srcRT = static_cast<const GrGLRenderTarget*>(src->asRenderTarget());
     // If the src is multisampled (and uses an extension where there is a separate MSAA
     // renderbuffer) then it is an invalid operation to call CopyTexSubImage
-    if (NULL != srcRT && srcRT->renderFBOID() != srcRT->textureFBOID()) {
+    if (srcRT && srcRT->renderFBOID() != srcRT->textureFBOID()) {
         return false;
     }
     if (gpu->glCaps().isConfigRenderable(src->config(), src->desc().fSampleCnt > 0) &&
-        NULL != dst->asTexture() &&
+        dst->asTexture() &&
         dst->origin() == src->origin() &&
         !GrPixelConfigIsCompressed(src->config())) {
-        if (NULL != wouldNeedTempFBO) {
+        if (wouldNeedTempFBO) {
             *wouldNeedTempFBO = NULL == src->asRenderTarget();
         }
         return true;
@@ -2372,7 +2372,7 @@
     GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(surface->asRenderTarget());
     GrGLuint tempFBOID;
     if (NULL == rt) {
-        SkASSERT(NULL != surface->asTexture());
+        SkASSERT(surface->asTexture());
         GrGLuint texID = static_cast<GrGLTexture*>(surface->asTexture())->textureID();
         GR_GL_CALL(gl, GenFramebuffers(1, &tempFBOID));
         GR_GL_CALL(gl, BindFramebuffer(fboTarget, tempFBOID));
@@ -2411,7 +2411,7 @@
     }
 
     const GrGLRenderTarget* srcRT = static_cast<const GrGLRenderTarget*>(src->asRenderTarget());
-    if (NULL != srcRT && srcRT->renderFBOID() != srcRT->textureFBOID()) {
+    if (srcRT && srcRT->renderFBOID() != srcRT->textureFBOID()) {
         // It's illegal to call CopyTexSubImage2D on a MSAA renderbuffer.
         INHERITED::initCopySurfaceDstDesc(src, desc);
     } else {
@@ -2434,7 +2434,7 @@
         GrGLIRect srcVP;
         srcFBO = bind_surface_as_fbo(this->glInterface(), src, GR_GL_FRAMEBUFFER, &srcVP);
         GrGLTexture* dstTex = static_cast<GrGLTexture*>(dst->asTexture());
-        SkASSERT(NULL != dstTex);
+        SkASSERT(dstTex);
         // We modified the bound FBO
         fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID;
         GrGLIRect srcGLRect;
@@ -2577,7 +2577,7 @@
                                                 GrGpuGL* gpu,
                                                 const GrGLVertexBuffer* vbuffer,
                                                 const GrGLIndexBuffer* ibuffer) {
-    SkASSERT(NULL != vbuffer);
+    SkASSERT(vbuffer);
     GrGLAttribArrayState* attribState;
 
     // We use a vertex array if we're on a core profile and the verts are in a VBO.
@@ -2591,7 +2591,7 @@
         }
         attribState = fVBOVertexArray->bindWithIndexBuffer(ibuffer);
     } else {
-        if (NULL != ibuffer) {
+        if (ibuffer) {
             this->setIndexBufferIDOnDefaultVertexArray(gpu, ibuffer->bufferID());
         } else {
             this->setVertexArrayID(gpu, 0);
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index 004ce25..2859b43 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -314,7 +314,7 @@
             fDefaultVertexArrayBoundIndexBufferID = false;
             fDefaultVertexArrayBoundIndexBufferIDIsValid = false;
             fDefaultVertexArrayAttribState.invalidate();
-            if (NULL != fVBOVertexArray) {
+            if (fVBOVertexArray) {
                 fVBOVertexArray->invalidateCachedState();
             }
         }
@@ -342,7 +342,7 @@
             if (fBoundVertexBufferIDIsValid && id == fBoundVertexBufferID) {
                 fBoundVertexBufferID = 0;
             }
-            if (NULL != fVBOVertexArray) {
+            if (fVBOVertexArray) {
                 fVBOVertexArray->notifyVertexBufferDelete(id);
             }
             fDefaultVertexArrayAttribState.notifyVertexBufferDelete(id);
@@ -353,7 +353,7 @@
                 id == fDefaultVertexArrayBoundIndexBufferID) {
                 fDefaultVertexArrayBoundIndexBufferID = 0;
             }
-            if (NULL != fVBOVertexArray) {
+            if (fVBOVertexArray) {
                 fVBOVertexArray->notifyIndexBufferDelete(id);
             }
         }
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 67c0cd3..be21abf 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -30,12 +30,12 @@
 
 struct GrGpuGL::ProgramCache::ProgDescLess {
     bool operator() (const GrGLProgramDesc& desc, const Entry* entry) {
-        SkASSERT(NULL != entry->fProgram.get());
+        SkASSERT(entry->fProgram.get());
         return GrGLProgramDesc::Less(desc, entry->fProgram->getDesc());
     }
 
     bool operator() (const Entry* entry, const GrGLProgramDesc& desc) {
-        SkASSERT(NULL != entry->fProgram.get());
+        SkASSERT(entry->fProgram.get());
         return GrGLProgramDesc::Less(entry->fProgram->getDesc(), desc);
     }
 };
@@ -77,7 +77,7 @@
 
 void GrGpuGL::ProgramCache::abandon() {
     for (int i = 0; i < fCount; ++i) {
-        SkASSERT(NULL != fEntries[i]->fProgram.get());
+        SkASSERT(fEntries[i]->fProgram.get());
         fEntries[i]->fProgram->abandon();
         SkDELETE(fEntries[i]);
     }
@@ -106,8 +106,8 @@
     }
     hashIdx &=((1 << kHashBits) - 1);
     Entry* hashedEntry = fHashTable[hashIdx];
-    if (NULL != hashedEntry && hashedEntry->fProgram->getDesc() == desc) {
-        SkASSERT(NULL != hashedEntry->fProgram);
+    if (hashedEntry && hashedEntry->fProgram->getDesc() == desc) {
+        SkASSERT(hashedEntry->fProgram);
         entry = hashedEntry;
     }
 
@@ -175,9 +175,9 @@
             fEntries[entryIdx - 1] = entry;
         }
 #ifdef SK_DEBUG
-        SkASSERT(NULL != fEntries[0]->fProgram.get());
+        SkASSERT(fEntries[0]->fProgram.get());
         for (int i = 0; i < fCount - 1; ++i) {
-            SkASSERT(NULL != fEntries[i + 1]->fProgram.get());
+            SkASSERT(fEntries[i + 1]->fProgram.get());
             const GrGLProgramDesc& a = fEntries[i]->fProgram->getDesc();
             const GrGLProgramDesc& b = fEntries[i + 1]->fProgram->getDesc();
             SkASSERT(GrGLProgramDesc::Less(a, b));
@@ -207,7 +207,7 @@
     const GrDrawState& drawState = this->getDrawState();
 
     // GrGpu::setupClipAndFlushState should have already checked this and bailed if not true.
-    SkASSERT(NULL != drawState.getRenderTarget());
+    SkASSERT(drawState.getRenderTarget());
 
     if (kStencilPath_DrawType == type) {
         const GrRenderTarget* rt = this->getDrawState().getRenderTarget();
@@ -314,13 +314,13 @@
             SkFAIL("Unknown geometry src type!");
     }
 
-    SkASSERT(NULL != vbuf);
+    SkASSERT(vbuf);
     SkASSERT(!vbuf->isMapped());
     vertexOffsetInBytes += vbuf->baseOffset();
 
     GrGLIndexBuffer* ibuf = NULL;
     if (info.isIndexed()) {
-        SkASSERT(NULL != indexOffsetInBytes);
+        SkASSERT(indexOffsetInBytes);
 
         switch (this->getGeomSrc().fIndexSrc) {
         case kBuffer_GeometrySrcType:
@@ -338,7 +338,7 @@
             SkFAIL("Unknown geometry src type!");
         }
 
-        SkASSERT(NULL != ibuf);
+        SkASSERT(ibuf);
         SkASSERT(!ibuf->isMapped());
         *indexOffsetInBytes += ibuf->baseOffset();
     }
diff --git a/src/gpu/gl/SkGLContextHelper.cpp b/src/gpu/gl/SkGLContextHelper.cpp
index 411e1de..03b70c3 100644
--- a/src/gpu/gl/SkGLContextHelper.cpp
+++ b/src/gpu/gl/SkGLContextHelper.cpp
@@ -136,7 +136,7 @@
 }
 
 void SkGLContextHelper::testAbandon() {
-    if (NULL != fGL) {
+    if (fGL) {
         fGL->abandon();
     }
 }
diff --git a/src/gpu/gl/android/SkNativeGLContext_android.cpp b/src/gpu/gl/android/SkNativeGLContext_android.cpp
index 705bd8f..2e605c7 100644
--- a/src/gpu/gl/android/SkNativeGLContext_android.cpp
+++ b/src/gpu/gl/android/SkNativeGLContext_android.cpp
@@ -15,7 +15,7 @@
 }
 
 SkNativeGLContext::AutoContextRestore::~AutoContextRestore() {
-    if (NULL != fOldDisplay) {
+    if (fOldDisplay) {
         eglMakeCurrent(fOldDisplay, fOldSurface, fOldSurface, fOldEGLContext);
     }
 }
diff --git a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
index 0d06b2d..e4f5467 100644
--- a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
+++ b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
@@ -16,7 +16,7 @@
 
 static GrGLFuncPtr angle_get_gl_proc(void* ctx, const char name[]) {
     GrGLFuncPtr proc = (GrGLFuncPtr) GetProcAddress((HMODULE)ctx, name);
-    if (NULL != proc) {
+    if (proc) {
         return proc;
     }
     return eglGetProcAddress(name);
diff --git a/src/gpu/gl/angle/SkANGLEGLContext.cpp b/src/gpu/gl/angle/SkANGLEGLContext.cpp
index 884fe7c..81fcceb 100644
--- a/src/gpu/gl/angle/SkANGLEGLContext.cpp
+++ b/src/gpu/gl/angle/SkANGLEGLContext.cpp
@@ -16,7 +16,7 @@
 }
 
 SkANGLEGLContext::AutoContextRestore::~AutoContextRestore() {
-    if (NULL != fOldDisplay) {
+    if (fOldDisplay) {
         eglMakeCurrent(fOldDisplay, fOldSurface, fOldSurface, fOldEGLContext);
     }
 }
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
index fef3691..6c92684 100644
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
@@ -48,7 +48,7 @@
     if (caps.fbFetchSupport()) {
         return key;
     }
-    SkASSERT(NULL != dstCopy);
+    SkASSERT(dstCopy);
     if (!caps.textureSwizzleSupport() && GrPixelConfigIsAlphaOnly(dstCopy->config())) {
         // The fact that the config is alpha-only must be considered when generating code.
         key |= kUseAlphaConfig_DstReadKeyBit;
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index ab64e28..3844a30 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -156,7 +156,7 @@
         uni.fVariable.setPrecision(kDefaultFragmentPrecision);
     }
 
-    if (NULL != outName) {
+    if (outName) {
         *outName = uni.fVariable.c_str();
     }
     return GrGLProgramDataManager::UniformHandle::CreateFromUniformIndex(fUniforms.count() - 1);
@@ -190,7 +190,7 @@
     GrGLSLExpr4 outColor;
 
     for (int e = 0; e < effectCnt; ++e) {
-        SkASSERT(NULL != effectStages[e] && NULL != effectStages[e]->getEffect());
+        SkASSERT(effectStages[e] && effectStages[e]->getEffect());
         const GrEffectStage& stage = *effectStages[e];
 
         CodeStage::AutoStageRestore csar(&fCodeStage, &stage);
@@ -344,7 +344,7 @@
 
 void GrGLFullProgramBuilder::emitGeometryProcessor(const GrEffectStage* geometryProcessor,
                                                    GrGLSLExpr4* coverage) {
-    if (NULL != geometryProcessor) {
+    if (geometryProcessor) {
         GrGLProgramDesc::EffectKeyProvider geometryProcessorKeyProvider(
                 &this->desc(), GrGLProgramDesc::EffectKeyProvider::kGeometryProcessor_EffectType);
         fGeometryProcessor.reset(this->createAndEmitEffect(
@@ -411,7 +411,7 @@
     GrGLSLExpr4 inColor = *fsInOutColor;
     GrGLSLExpr4 outColor;
 
-    SkASSERT(NULL != effectStages && NULL != effectStages->getEffect());
+    SkASSERT(effectStages && effectStages->getEffect());
     const GrEffectStage& stage = *effectStages;
 
     // Using scope to force ASR destructor to be triggered
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h
index deb3708..01269aa 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h
@@ -184,7 +184,7 @@
 
         bool inStageCode() const {
             this->validate();
-            return NULL != fEffectStage;
+            return SkToBool(fEffectStage);
         }
 
         const GrEffectStage* effectStage() const {
@@ -200,7 +200,7 @@
         class AutoStageRestore : SkNoncopyable {
         public:
             AutoStageRestore(CodeStage* codeStage, const GrEffectStage* newStage) {
-                SkASSERT(NULL != codeStage);
+                SkASSERT(codeStage);
                 fSavedIndex = codeStage->fCurrentIndex;
                 fSavedEffectStage = codeStage->fEffectStage;
 
diff --git a/src/gpu/gl/builders/GrGLShaderBuilder.cpp b/src/gpu/gl/builders/GrGLShaderBuilder.cpp
index 6b3e1d1..b7c7bbf 100644
--- a/src/gpu/gl/builders/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLShaderBuilder.cpp
@@ -26,7 +26,7 @@
                            uint32_t configComponentMask,
                            const char* swizzle,
                            GrSLType varyingType = kVec2f_GrSLType) {
-    SkASSERT(NULL != coordName);
+    SkASSERT(coordName);
 
     out->appendf("%s(%s, %s)",
                  sample_function_name(varyingType, gpu->glslGeneration()),
diff --git a/src/gpu/gl/builders/GrGLShaderBuilder.h b/src/gpu/gl/builders/GrGLShaderBuilder.h
index ffb3247..4921fd3 100644
--- a/src/gpu/gl/builders/GrGLShaderBuilder.h
+++ b/src/gpu/gl/builders/GrGLShaderBuilder.h
@@ -118,7 +118,7 @@
     class ShaderBlock {
     public:
         ShaderBlock(GrGLShaderBuilder* builder) : fBuilder(builder) {
-            SkASSERT(NULL != builder);
+            SkASSERT(builder);
             fBuilder->codeAppend("{");
         }
 
diff --git a/src/gpu/gl/debug/GrDebugGL.cpp b/src/gpu/gl/debug/GrDebugGL.cpp
index 71607c8..e5b00c1 100644
--- a/src/gpu/gl/debug/GrDebugGL.cpp
+++ b/src/gpu/gl/debug/GrDebugGL.cpp
@@ -112,7 +112,7 @@
 }
 
 void GrDebugGL::setVertexArray(GrVertexArrayObj* vertexArray) {
-    if (NULL != vertexArray) {
+    if (vertexArray) {
         SkASSERT(!vertexArray->getDeleted());
     }
     SkRefCnt_SafeAssign(fVertexArray, vertexArray);
diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
index 0279427..4bd8f99 100644
--- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
+++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
@@ -256,15 +256,15 @@
 
          for (int i = 0; i < n; ++i) {
 
-             if (NULL != frameBuffer->getColor() &&
+             if (frameBuffer->getColor() &&
                  textures[i] == frameBuffer->getColor()->getID()) {
                  frameBuffer->setColor(NULL);
              }
-             if (NULL != frameBuffer->getDepth() &&
+             if (frameBuffer->getDepth() &&
                  textures[i] == frameBuffer->getDepth()->getID()) {
                  frameBuffer->setDepth(NULL);
              }
-             if (NULL != frameBuffer->getStencil() &&
+             if (frameBuffer->getStencil() &&
                  textures[i] == frameBuffer->getStencil()->getID()) {
                  frameBuffer->setStencil(NULL);
              }
@@ -341,15 +341,15 @@
 
          for (int i = 0; i < n; ++i) {
 
-             if (NULL != frameBuffer->getColor() &&
+             if (frameBuffer->getColor() &&
                  renderBuffers[i] == frameBuffer->getColor()->getID()) {
                  frameBuffer->setColor(NULL);
              }
-             if (NULL != frameBuffer->getDepth() &&
+             if (frameBuffer->getDepth() &&
                  renderBuffers[i] == frameBuffer->getDepth()->getID()) {
                  frameBuffer->setDepth(NULL);
              }
-             if (NULL != frameBuffer->getStencil() &&
+             if (frameBuffer->getStencil() &&
                  renderBuffers[i] == frameBuffer->getStencil()->getID()) {
                  frameBuffer->setStencil(NULL);
              }
@@ -390,7 +390,7 @@
 
      GrFrameBufferObj *framebuffer = GrDebugGL::getInstance()->getFrameBuffer();
      // A render buffer cannot be attached to the default framebuffer
-     GrAlwaysAssert(NULL != framebuffer);
+     GrAlwaysAssert(framebuffer);
 
      // a renderBufferID of 0 is acceptable - it unbinds the current
      // render buffer
@@ -430,7 +430,7 @@
 
      GrFrameBufferObj *framebuffer = GrDebugGL::getInstance()->getFrameBuffer();
      // A texture cannot be attached to the default framebuffer
-     GrAlwaysAssert(NULL != framebuffer);
+     GrAlwaysAssert(framebuffer);
 
      // A textureID of 0 is allowed - it unbinds the currently bound texture
      GrTextureObj *texture = GR_FIND(textureID, GrTextureObj,
@@ -566,7 +566,7 @@
 
 GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindVertexArray(GrGLuint id) {
     GrVertexArrayObj* array = GR_FIND(id, GrVertexArrayObj, GrDebugGL::kVertexArray_ObjTypes);
-    GrAlwaysAssert((0 == id) || NULL != array);
+    GrAlwaysAssert((0 == id) || array);
     GrDebugGL::getInstance()->setVertexArray(array);
 }
 
@@ -644,7 +644,7 @@
             break;
     }
 
-    if (NULL != buffer) {
+    if (buffer) {
         GrAlwaysAssert(offset >= 0 && offset + length <= buffer->getSize());
         GrAlwaysAssert(!buffer->getMapped());
         buffer->setMapped(offset, length);
@@ -695,7 +695,7 @@
             break;
     }
 
-    if (NULL != buffer) {
+    if (buffer) {
         GrAlwaysAssert(buffer->getMapped());
         buffer->resetMapped();
         return GR_GL_TRUE;
@@ -724,7 +724,7 @@
             break;
     }
 
-    if (NULL != buffer) {
+    if (buffer) {
         GrAlwaysAssert(buffer->getMapped());
         GrAlwaysAssert(offset >= 0 && (offset + length) <= buffer->getMappedLength());
     } else {
@@ -757,17 +757,17 @@
     switch (value) {
         case GR_GL_BUFFER_MAPPED:
             *params = GR_GL_FALSE;
-            if (NULL != buffer)
+            if (buffer)
                 *params = buffer->getMapped() ? GR_GL_TRUE : GR_GL_FALSE;
             break;
         case GR_GL_BUFFER_SIZE:
             *params = 0;
-            if (NULL != buffer)
+            if (buffer)
                 *params = SkToInt(buffer->getSize());
             break;
         case GR_GL_BUFFER_USAGE:
             *params = GR_GL_STATIC_DRAW;
-            if (NULL != buffer)
+            if (buffer)
                 *params = buffer->getUsage();
             break;
         default:
diff --git a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
index 024a631..ccbc50f 100644
--- a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
+++ b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
@@ -19,7 +19,7 @@
     }
 
     ~GLLoader() {
-        if (NULL != fLibrary) {
+        if (fLibrary) {
             dlclose(fLibrary);
         }
     }
@@ -45,7 +45,7 @@
 };
 
 static GrGLFuncPtr ios_get_gl_proc(void* ctx, const char name[]) {
-    SkASSERT(NULL != ctx);
+    SkASSERT(ctx);
     const GLProcGetter* getter = (const GLProcGetter*) ctx;
     return getter->getProc(name);
 }
diff --git a/src/gpu/gl/iOS/SkNativeGLContext_iOS.mm b/src/gpu/gl/iOS/SkNativeGLContext_iOS.mm
index f04229f..1bdaf70 100644
--- a/src/gpu/gl/iOS/SkNativeGLContext_iOS.mm
+++ b/src/gpu/gl/iOS/SkNativeGLContext_iOS.mm
@@ -36,7 +36,7 @@
 }
 
 void SkNativeGLContext::destroyGLContext() {
-    if (NULL != fEAGLContext) {
+    if (fEAGLContext) {
         if ([EAGLContext currentContext] == EAGLCTX) {
             [EAGLContext setCurrentContext:nil];
         }
diff --git a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
index ab3f0ad..a0c50c7 100644
--- a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
+++ b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
@@ -21,7 +21,7 @@
     }
 
     ~GLLoader() {
-        if (NULL != fLibrary) {
+        if (fLibrary) {
             dlclose(fLibrary);
         }
     }
@@ -47,7 +47,7 @@
 };
 
 static GrGLFuncPtr mac_get_gl_proc(void* ctx, const char name[]) {
-    SkASSERT(NULL != ctx);
+    SkASSERT(ctx);
     const GLProcGetter* getter = (const GLProcGetter*) ctx;
     return getter->getProc(name);
 }
diff --git a/src/gpu/gl/mac/SkNativeGLContext_mac.cpp b/src/gpu/gl/mac/SkNativeGLContext_mac.cpp
index fefbb4c..f63471c 100644
--- a/src/gpu/gl/mac/SkNativeGLContext_mac.cpp
+++ b/src/gpu/gl/mac/SkNativeGLContext_mac.cpp
@@ -27,7 +27,7 @@
 }
 
 void SkNativeGLContext::destroyGLContext() {
-    if (NULL != fContext) {
+    if (fContext) {
         CGLReleaseContext(fContext);
     }
 }
diff --git a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
index b914b0b..ab48718 100644
--- a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
+++ b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
@@ -13,7 +13,7 @@
 
 static GrGLFuncPtr osmesa_get(void* ctx, const char name[]) {
     SkASSERT(NULL == ctx);
-    SkASSERT(NULL != OSMesaGetCurrentContext());
+    SkASSERT(OSMesaGetCurrentContext());
     return OSMesaGetProcAddress(name);
 }
 
diff --git a/src/gpu/gl/mesa/SkMesaGLContext.cpp b/src/gpu/gl/mesa/SkMesaGLContext.cpp
index 58e325d..31402c5 100644
--- a/src/gpu/gl/mesa/SkMesaGLContext.cpp
+++ b/src/gpu/gl/mesa/SkMesaGLContext.cpp
@@ -13,7 +13,7 @@
 
 SkMesaGLContext::AutoContextRestore::AutoContextRestore() {
     fOldContext = (Context)OSMesaGetCurrentContext();
-    if (NULL != (OSMesaContext)fOldContext) {
+    if (fOldContext) {
         OSMesaGetColorBuffer((OSMesaContext)fOldContext,
                               &fOldWidth, &fOldHeight,
                               &fOldFormat, &fOldImage);
@@ -21,7 +21,7 @@
 }
 
 SkMesaGLContext::AutoContextRestore::~AutoContextRestore() {
-    if (NULL != (OSMesaContext)fOldContext) {
+    if (fOldContext) {
         OSMesaMakeCurrent((OSMesaContext)fOldContext, fOldImage,
                           fOldFormat, fOldWidth, fOldHeight);
     }
diff --git a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp b/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp
index 45c8dc7..19eec7e 100644
--- a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp
+++ b/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp
@@ -14,7 +14,7 @@
 
 static GrGLFuncPtr glx_get(void* ctx, const char name[]) {
     SkASSERT(NULL == ctx);
-    SkASSERT(NULL != glXGetCurrentContext());
+    SkASSERT(glXGetCurrentContext());
     return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name));
 }
 
diff --git a/src/gpu/gl/unix/SkNativeGLContext_unix.cpp b/src/gpu/gl/unix/SkNativeGLContext_unix.cpp
index 4910057..bd130b5 100644
--- a/src/gpu/gl/unix/SkNativeGLContext_unix.cpp
+++ b/src/gpu/gl/unix/SkNativeGLContext_unix.cpp
@@ -18,7 +18,7 @@
 }
 
 SkNativeGLContext::AutoContextRestore::~AutoContextRestore() {
-    if (NULL != fOldDisplay) {
+    if (fOldDisplay) {
         glXMakeCurrent(fOldDisplay, fOldDrawable, fOldGLXContext);
     }
 }
diff --git a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
index 3aab86d..cba380b 100644
--- a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
+++ b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
@@ -18,7 +18,7 @@
         fModule = LoadLibrary(moduleName);
     }
     ~AutoLibraryUnload() {
-        if (NULL != fModule) {
+        if (fModule) {
             FreeLibrary(fModule);
         }
     }
@@ -32,14 +32,14 @@
 public:
     GLProcGetter() : fGLLib("opengl32.dll") {}
 
-    bool isInitialized() const { return NULL != fGLLib.get(); }
+    bool isInitialized() const { return SkToBool(fGLLib.get()); }
 
     GrGLFuncPtr getProc(const char name[]) const {
         GrGLFuncPtr proc;
-        if (NULL != (proc = (GrGLFuncPtr) GetProcAddress(fGLLib.get(), name))) {
+        if ((proc = (GrGLFuncPtr) GetProcAddress(fGLLib.get(), name))) {
             return proc;
         }
-        if (NULL != (proc = (GrGLFuncPtr) wglGetProcAddress(name))) {
+        if ((proc = (GrGLFuncPtr) wglGetProcAddress(name))) {
             return proc;
         }
         return NULL;
@@ -50,8 +50,8 @@
 };
 
 static GrGLFuncPtr win_get_gl_proc(void* ctx, const char name[]) {
-    SkASSERT(NULL != ctx);
-    SkASSERT(NULL != wglGetCurrentContext());
+    SkASSERT(ctx);
+    SkASSERT(wglGetCurrentContext());
     const GLProcGetter* getter = (const GLProcGetter*) ctx;
     return getter->getProc(name);
 }
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index d98a536..5733a89 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -45,7 +45,7 @@
 SkImage_Gpu::SkImage_Gpu(const SkBitmap& bitmap)
     : INHERITED(bitmap.width(), bitmap.height())
     , fBitmap(bitmap) {
-    SkASSERT(NULL != fBitmap.getTexture());
+    SkASSERT(fBitmap.getTexture());
 }
 
 SkImage_Gpu::~SkImage_Gpu() {
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index 9f24e97..3a28e42 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -45,7 +45,7 @@
 
     SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this);
 
-    if (NULL != fCachedImage) {
+    if (fCachedImage) {
         // the surface may need to fork its backend, if its sharing it with
         // the cached image. Note: we only call if there is an outstanding owner
         // on the image (besides us).
diff --git a/src/image/SkSurface_Base.h b/src/image/SkSurface_Base.h
index 2314341..e7fa57a 100644
--- a/src/image/SkSurface_Base.h
+++ b/src/image/SkSurface_Base.h
@@ -79,7 +79,7 @@
 SkCanvas* SkSurface_Base::getCachedCanvas() {
     if (NULL == fCachedCanvas) {
         fCachedCanvas = this->onNewCanvas();
-        if (NULL != fCachedCanvas) {
+        if (fCachedCanvas) {
             fCachedCanvas->setSurfaceBase(this);
         }
     }
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index fab130c..f94dc5b 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -77,7 +77,7 @@
 void SkSurface_Gpu::onCopyOnWrite(ContentChangeMode mode) {
     GrRenderTarget* rt = fDevice->accessRenderTarget();
     // are we sharing our render target with the image?
-    SkASSERT(NULL != this->getCachedImage());
+    SkASSERT(this->getCachedImage());
     if (rt->asTexture() == SkTextureImageGetTexture(this->getCachedImage())) {
         // We call createCompatibleDevice because it uses the texture cache. This isn't
         // necessarily correct (http://skbug.com/2252), but never using the cache causes
@@ -88,7 +88,7 @@
         if (kRetain_ContentChangeMode == mode) {
             fDevice->context()->copyTexture(rt->asTexture(), newDevice->accessRenderTarget());
         }
-        SkASSERT(NULL != this->getCachedCanvas());
+        SkASSERT(this->getCachedCanvas());
         SkASSERT(this->getCachedCanvas()->getDevice() == fDevice);
 
         this->getCachedCanvas()->setRootDevice(newDevice);
diff --git a/src/image/SkSurface_Raster.cpp b/src/image/SkSurface_Raster.cpp
index 167f773..13f2155 100644
--- a/src/image/SkSurface_Raster.cpp
+++ b/src/image/SkSurface_Raster.cpp
@@ -118,7 +118,7 @@
 
 void SkSurface_Raster::onCopyOnWrite(ContentChangeMode mode) {
     // are we sharing pixelrefs with the image?
-    SkASSERT(NULL != this->getCachedImage());
+    SkASSERT(this->getCachedImage());
     if (SkBitmapImageGetPixelRef(this->getCachedImage()) == fBitmap.pixelRef()) {
         SkASSERT(fWeOwnThePixels);
         if (kDiscard_ContentChangeMode == mode) {
@@ -131,7 +131,7 @@
         // Now fBitmap is a deep copy of itself (and therefore different from
         // what is being used by the image. Next we update the canvas to use
         // this as its backend, so we can't modify the image's pixels anymore.
-        SkASSERT(NULL != this->getCachedCanvas());
+        SkASSERT(this->getCachedCanvas());
         this->getCachedCanvas()->getDevice()->replaceBitmapBackendForRasterSurface(fBitmap);
     }
 }
diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp
index 4a5e734..b25e7db 100644
--- a/src/images/SkImageDecoder.cpp
+++ b/src/images/SkImageDecoder.cpp
@@ -271,7 +271,7 @@
     bool success = false;
     SkImageDecoder* codec = SkImageDecoder::Factory(stream);
 
-    if (NULL != codec) {
+    if (codec) {
         success = codec->decode(stream, bm, pref, mode);
         if (success && format) {
             *format = codec->getFormat();
diff --git a/src/images/SkImageDecoder_ktx.cpp b/src/images/SkImageDecoder_ktx.cpp
index 64a37d9..20c8bbc 100644
--- a/src/images/SkImageDecoder_ktx.cpp
+++ b/src/images/SkImageDecoder_ktx.cpp
@@ -272,7 +272,7 @@
     SkAutoDataUnref data(bitmap.pixelRef()->refEncodedData());
 
     // Is this even encoded data?
-    if (NULL != data) {
+    if (data) {
         const uint8_t *bytes = data->bytes();
         if (etc1_pkm_is_valid(bytes)) {
             return this->encodePKM(stream, data);
diff --git a/src/images/SkImageDecoder_libgif.cpp b/src/images/SkImageDecoder_libgif.cpp
index 0c8461f..745f4e1 100644
--- a/src/images/SkImageDecoder_libgif.cpp
+++ b/src/images/SkImageDecoder_libgif.cpp
@@ -194,7 +194,7 @@
 static void sanitize_indexed_bitmap(SkBitmap* bm) {
     if ((kIndex_8_SkColorType == bm->colorType()) && !(bm->empty())) {
         SkAutoLockPixels alp(*bm);
-        if (NULL != bm->getPixels()) {
+        if (bm->getPixels()) {
             SkColorTable* ct = bm->getColorTable();  // Index8 must have it.
             SkASSERT(ct != NULL);
             uint32_t count = ct->count();
diff --git a/src/images/SkImageDecoder_libpng.cpp b/src/images/SkImageDecoder_libpng.cpp
index b69f879..dd1d1c8 100644
--- a/src/images/SkImageDecoder_libpng.cpp
+++ b/src/images/SkImageDecoder_libpng.cpp
@@ -62,7 +62,7 @@
         stream->ref();
     }
     ~SkPNGImageIndex() {
-        if (NULL != fPng_ptr) {
+        if (fPng_ptr) {
             png_destroy_read_struct(&fPng_ptr, &fInfo_ptr, png_infopp_NULL);
         }
     }
@@ -1161,7 +1161,7 @@
 
     // we must do this after we have locked the pixels
     SkColorTable* ctable = bitmap.getColorTable();
-    if (NULL != ctable) {
+    if (ctable) {
         if (ctable->count() == 0) {
             return false;
         }
diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp
index 6c13951..f8f44d0 100644
--- a/src/lazy/SkDiscardableMemoryPool.cpp
+++ b/src/lazy/SkDiscardableMemoryPool.cpp
@@ -155,7 +155,7 @@
     typedef SkTInternalLList<PoolDiscardableMemory>::Iter Iter;
     Iter iter;
     PoolDiscardableMemory* cur = iter.init(fList, Iter::kTail_IterStart);
-    while ((fUsed > budget) && (NULL != cur)) {
+    while ((fUsed > budget) && (cur)) {
         if (!cur->fLocked) {
             PoolDiscardableMemory* dm = cur;
             SkASSERT(dm->fPointer != NULL);
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index b5d2522..f361e5e 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -1035,15 +1035,15 @@
     
     size_t size = SkPatchUtils::kNumCtrlPts * sizeof(SkPoint);
     unsigned flags = 0;
-    if (NULL != colors) {
+    if (colors) {
         flags |= kDrawVertices_HasColors_DrawOpFlag;
         size += SkPatchUtils::kNumCorners * sizeof(SkColor);
     }
-    if (NULL != texCoords) {
+    if (texCoords) {
         flags |= kDrawVertices_HasTexs_DrawOpFlag;
         size += SkPatchUtils::kNumCorners * sizeof(SkPoint);
     }
-    if (NULL != xmode) {
+    if (xmode) {
         SkXfermode::Mode mode;
         if (xmode->asMode(&mode) && SkXfermode::kModulate_Mode != mode) {
             flags |= kDrawVertices_HasXfermode_DrawOpFlag;
@@ -1057,11 +1057,11 @@
         
         fWriter.write(cubics, SkPatchUtils::kNumCtrlPts * sizeof(SkPoint));
         
-        if (NULL != colors) {
+        if (colors) {
             fWriter.write(colors, SkPatchUtils::kNumCorners * sizeof(SkColor));
         }
         
-        if (NULL != texCoords) {
+        if (texCoords) {
             fWriter.write(texCoords, SkPatchUtils::kNumCorners * sizeof(SkPoint));
         }
         
diff --git a/src/ports/SkFontConfigParser_android.cpp b/src/ports/SkFontConfigParser_android.cpp
index b38ec8c..41f5c4a 100644
--- a/src/ports/SkFontConfigParser_android.cpp
+++ b/src/ports/SkFontConfigParser_android.cpp
@@ -587,7 +587,7 @@
     parseConfigFile(testMainConfigFile, fontFamilies);
 
     SkTDArray<FontFamily*> fallbackFonts;
-    if (NULL != testFallbackConfigFile) {
+    if (testFallbackConfigFile) {
         parseConfigFile(testFallbackConfigFile, fallbackFonts);
     }
 
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index 0307d36..98a4454 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -143,13 +143,13 @@
 #elif defined(SK_CAN_USE_DLOPEN) && SK_CAN_USE_DLOPEN == 1
         //The FreeType library is already loaded, so symbols are available in process.
         void* self = dlopen(NULL, RTLD_LAZY);
-        if (NULL != self) {
+        if (self) {
             FT_Library_SetLcdFilterWeightsProc setLcdFilterWeights;
             //The following cast is non-standard, but safe for POSIX.
             *reinterpret_cast<void**>(&setLcdFilterWeights) = dlsym(self, "FT_Library_SetLcdFilterWeights");
             dlclose(self);
 
-            if (NULL != setLcdFilterWeights) {
+            if (setLcdFilterWeights) {
                 err = setLcdFilterWeights(gFTLibrary, gGaussianLikeHeavyWeights);
             }
         }
@@ -316,7 +316,7 @@
     memset(&args, 0, sizeof(args));
     const void* memoryBase = strm->getMemoryBase();
 
-    if (NULL != memoryBase) {
+    if (memoryBase) {
 //printf("mmap(%s)\n", keyString.c_str());
         args.flags = FT_OPEN_MEMORY;
         args.memory_base = (const FT_Byte*)memoryBase;
@@ -1654,7 +1654,7 @@
         return 0;
     }
     FT_ULong size = SkTMin((FT_ULong)length, tableLength - (FT_ULong)offset);
-    if (NULL != data) {
+    if (data) {
         error = FT_Load_Sfnt_Table(face, tag, offset, reinterpret_cast<FT_Byte*>(data), &size);
         if (error) {
             return 0;
@@ -1681,7 +1681,7 @@
     const void* memoryBase = stream->getMemoryBase();
     FT_StreamRec    streamRec;
 
-    if (NULL != memoryBase) {
+    if (memoryBase) {
         args.flags = FT_OPEN_MEMORY;
         args.memory_base = (const FT_Byte*)memoryBase;
         args.memory_size = stream->getLength();
diff --git a/src/ports/SkFontHost_fontconfig.cpp b/src/ports/SkFontHost_fontconfig.cpp
index b1a512b..ace7058 100644
--- a/src/ports/SkFontHost_fontconfig.cpp
+++ b/src/ports/SkFontHost_fontconfig.cpp
@@ -137,7 +137,7 @@
         size_t length = stream->getLength();
 
         const void* memory = stream->getMemoryBase();
-        if (NULL != memory) {
+        if (memory) {
             return new SkMemoryStream(memory, length, true);
         }
 
diff --git a/src/ports/SkFontHost_linux.cpp b/src/ports/SkFontHost_linux.cpp
index 891e461..72a6399 100644
--- a/src/ports/SkFontHost_linux.cpp
+++ b/src/ports/SkFontHost_linux.cpp
@@ -293,7 +293,7 @@
                                                  : SkFontStyle::kUpright_Slant);
         SkTypeface* tf = NULL;
 
-        if (NULL != familyName) {
+        if (familyName) {
             tf = this->onMatchFamilyStyle(familyName, style);
         }
 
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 72a3274..3c73493 100755
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -897,7 +897,7 @@
 
 bool SkScalerContext_Mac::generateBBoxes() {
     if (fGeneratedFBoundingBoxes) {
-        return NULL != fFBoundingBoxes.get();
+        return SkToBool(fFBoundingBoxes.get());
     }
     fGeneratedFBoundingBoxes = true;
 
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index e966c84..bcf544c 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -422,7 +422,7 @@
                                                  ? SkFontStyle::kItalic_Slant
                                                  : SkFontStyle::kUpright_Slant);
 
-        if (NULL != familyName) {
+        if (familyName) {
             // On Android, we must return NULL 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
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index b54835d..8dec85f 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -796,7 +796,7 @@
                                         italic ? SkFontStyle::kItalic_Slant
                                                : SkFontStyle::kUpright_Slant);
         SkAutoTUnref<SkTypeface> typeface(this->matchFamilyStyle(familyName, style));
-        if (NULL != typeface.get()) {
+        if (typeface.get()) {
             return typeface.detach();
         }
 
diff --git a/src/ports/SkOSFile_win.cpp b/src/ports/SkOSFile_win.cpp
index 1430d7f..ded5858 100644
--- a/src/ports/SkOSFile_win.cpp
+++ b/src/ports/SkOSFile_win.cpp
@@ -66,7 +66,7 @@
     SkAutoNullKernelHandle(const HANDLE handle) : fHandle(handle) { }
     ~SkAutoNullKernelHandle() { CloseHandle(fHandle); }
     operator HANDLE() const { return fHandle; }
-    bool isValid() const { return NULL != fHandle; }
+    bool isValid() const { return SkToBool(fHandle); }
 private:
     HANDLE fHandle;
 };
diff --git a/src/ports/SkScalerContext_win_dw.cpp b/src/ports/SkScalerContext_win_dw.cpp
index 33ef0d5..e72746a 100644
--- a/src/ports/SkScalerContext_win_dw.cpp
+++ b/src/ports/SkScalerContext_win_dw.cpp
@@ -524,7 +524,7 @@
     metrics->fFlags |= SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag;
     metrics->fFlags |= SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag;
 
-    if (NULL != fTypeface->fDWriteFontFace1.get()) {
+    if (fTypeface->fDWriteFontFace1.get()) {
         DWRITE_FONT_METRICS1 dwfm1;
         fTypeface->fDWriteFontFace1->GetMetrics(&dwfm1);
         metrics->fTop = -fTextSizeRender * SkIntToScalar(dwfm1.glyphBoxTop) / upem;
diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp
index 7b6b522..9c727e7 100644
--- a/src/ports/SkTypeface_win_dw.cpp
+++ b/src/ports/SkTypeface_win_dw.cpp
@@ -199,7 +199,7 @@
         return 0;
     }
     size_t size = SkTMin(length, table.fSize - offset);
-    if (NULL != data) {
+    if (data) {
         memcpy(data, table.fData + offset, size);
     }
 
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index cb69b4e..b46e92a 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -46,7 +46,7 @@
         if (shader && !shader->asAGradient(NULL)) {
             SkBitmap bm;
             if (shader->asABitmap(&bm, NULL, NULL) &&
-                NULL != bm.getTexture()) {
+                bm.getTexture()) {
                 return true;
             }
         }
@@ -336,11 +336,11 @@
 
 void SkDeferredDevice::aboutToDraw()
 {
-    if (NULL != fNotificationClient) {
+    if (fNotificationClient) {
         fNotificationClient->prepareForDraw();
     }
     if (fCanDiscardCanvasContents) {
-        if (NULL != fSurface) {
+        if (fSurface) {
             fSurface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);
         }
         fCanDiscardCanvasContents = false;
@@ -604,7 +604,7 @@
 
 SkSurface* SkDeferredCanvas::setSurface(SkSurface* surface) {
     SkDeferredDevice* deferredDevice = this->getDeferredDevice();
-    SkASSERT(NULL != deferredDevice);
+    SkASSERT(deferredDevice);
     // By swapping the surface into the existing device, we preserve
     // all pending commands, which can help to seamlessly recover from
     // a lost accelerated graphics context.
diff --git a/src/utils/SkEventTracer.cpp b/src/utils/SkEventTracer.cpp
index 65e8372..694becf 100644
--- a/src/utils/SkEventTracer.cpp
+++ b/src/utils/SkEventTracer.cpp
@@ -54,6 +54,6 @@
 SkEventTracer* SkEventTracer::GetInstance() {
     SK_DECLARE_STATIC_ONCE(once);
     SkOnce(&once, intialize_default_tracer, SkEventTracer::gInstance);
-    SkASSERT(NULL != SkEventTracer::gInstance);
+    SkASSERT(SkEventTracer::gInstance);
     return SkEventTracer::gInstance;
 }
diff --git a/src/utils/SkGatherPixelRefsAndRects.h b/src/utils/SkGatherPixelRefsAndRects.h
index 5d980aa..e1e5ccd 100644
--- a/src/utils/SkGatherPixelRefsAndRects.h
+++ b/src/utils/SkGatherPixelRefsAndRects.h
@@ -103,7 +103,7 @@
         }
 
         SkRect pathBounds = path.getBounds();
-        if (NULL != prePathMatrix) {
+        if (prePathMatrix) {
             prePathMatrix->mapRect(&pathBounds);
         }
 
@@ -295,7 +295,7 @@
 
     static bool GetBitmapFromPaint(const SkPaint &paint, SkBitmap* bitmap) {
         SkShader* shader = paint.getShader();
-        if (NULL != shader) {
+        if (shader) {
             if (SkShader::kNone_GradientType == shader->asAGradient(NULL)) {
                 return SkShader::kNone_BitmapType != shader->asABitmap(bitmap, NULL, NULL);
             }
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index 773af54..48493b8 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -317,7 +317,7 @@
     SkClipStack::B2TIter iter(stack);
     const SkClipStack::Element* element;
     int i = 0;
-    while (NULL != (element = iter.next())) {
+    while ((element = iter.next())) {
         this->pushClipStackElement(*element);
         lua_rawseti(fL, -2, ++i);
     }
@@ -521,7 +521,7 @@
     GrReducedClip::ElementList::Iter iter(elements);
     int i = 0;
     lua_newtable(L);
-    while(NULL != iter.get()) {
+    while(iter.get()) {
         SkLua(L).pushClipStackElement(*iter.get());
         iter.next();
         lua_rawseti(L, -2, ++i);
diff --git a/src/utils/SkPatchGrid.cpp b/src/utils/SkPatchGrid.cpp
index a0809f3..96e3c8f 100644
--- a/src/utils/SkPatchGrid.cpp
+++ b/src/utils/SkPatchGrid.cpp
@@ -59,14 +59,14 @@
     fVrtCtrlPts[vrtPos + (fCols + 1) + 1] = cubics[SkPatchUtils::kRightP2_CubicCtrlPts];
     
     // set optional values (colors and texture coordinates)
-    if ((fModeFlags & kColors_VertexType)  && NULL != colors) {
+    if ((fModeFlags & kColors_VertexType)  && colors) {
         fCornerColors[cornerPos] = colors[0];
         fCornerColors[cornerPos + 1] = colors[1];
         fCornerColors[cornerPos + (fCols + 1)] = colors[3];
         fCornerColors[cornerPos + (fCols + 1) + 1] = colors[2];
     }
     
-    if ((fModeFlags & kTexs_VertexType) && NULL != texCoords) {
+    if ((fModeFlags & kTexs_VertexType) && texCoords) {
         fTexCoords[cornerPos] = texCoords[0];
         fTexCoords[cornerPos + 1] = texCoords[1];
         fTexCoords[cornerPos + (fCols + 1)] = texCoords[3];
@@ -102,14 +102,14 @@
     cubics[SkPatchUtils::kLeftP2_CubicCtrlPts] = fVrtCtrlPts[vrtPos + (fCols + 1)];
     cubics[SkPatchUtils::kRightP2_CubicCtrlPts] = fVrtCtrlPts[vrtPos + (fCols + 1) + 1];
     
-    if ((fModeFlags & kColors_VertexType)  && NULL != colors) {
+    if ((fModeFlags & kColors_VertexType)  && colors) {
         colors[0] = fCornerColors[cornerPos];
         colors[1] = fCornerColors[cornerPos + 1];
         colors[3] = fCornerColors[cornerPos + (fCols + 1)];
         colors[2] = fCornerColors[cornerPos + (fCols + 1) + 1];
     }
     
-    if ((fModeFlags & kTexs_VertexType)  && NULL != texCoords) {
+    if ((fModeFlags & kTexs_VertexType)  && texCoords) {
         texCoords[0] = fTexCoords[cornerPos];
         texCoords[1] = fTexCoords[cornerPos + 1];
         texCoords[3] = fTexCoords[cornerPos + (fCols + 1)];
diff --git a/src/utils/SkPatchUtils.cpp b/src/utils/SkPatchUtils.cpp
index a0be328..c9c526e 100644
--- a/src/utils/SkPatchUtils.cpp
+++ b/src/utils/SkPatchUtils.cpp
@@ -233,7 +233,7 @@
     
     // if colors is not null then create array for colors
     SkPMColor colorsPM[kNumCorners];
-    if (NULL != colors) {
+    if (colors) {
         // premultiply colors to avoid color bleeding.
         for (int i = 0; i < kNumCorners; i++) {
             colorsPM[i] = SkPreMultiplyColor(colors[i]);
@@ -242,7 +242,7 @@
     }
     
     // if texture coordinates are not null then create array for them
-    if (NULL != texCoords) {
+    if (texCoords) {
         data->fTexCoords = SkNEW_ARRAY(SkPoint, data->fVertexCount);
     }
     
@@ -286,7 +286,7 @@
                                               + u * fBottom.getCtrlPoints()[3].y()));
             data->fPoints[dataIndex] = s0 + s1 - s2;
             
-            if (NULL != colors) {
+            if (colors) {
                 uint8_t a = uint8_t(bilerp(u, v,
                                    SkScalar(SkColorGetA(colorsPM[kTopLeft_Corner])),
                                    SkScalar(SkColorGetA(colorsPM[kTopRight_Corner])),
@@ -310,7 +310,7 @@
                 data->fColors[dataIndex] = SkPackARGB32(a,r,g,b);
             }
             
-            if (NULL != texCoords) {
+            if (texCoords) {
                 data->fTexCoords[dataIndex] = SkPoint::Make(
                                             bilerp(u, v, texCoords[kTopLeft_Corner].x(),
                                                    texCoords[kTopRight_Corner].x(),
diff --git a/src/utils/SkRTConf.cpp b/src/utils/SkRTConf.cpp
index 8ca9981..20b8b43 100644
--- a/src/utils/SkRTConf.cpp
+++ b/src/utils/SkRTConf.cpp
@@ -28,7 +28,7 @@
         if (commentptr == line) {
             continue;
         }
-        if (NULL != commentptr) {
+        if (commentptr) {
             *commentptr = '\0';
         }
 
@@ -99,7 +99,7 @@
 void SkRTConfRegistry::printAll(const char *fname) const {
     SkWStream *o;
 
-    if (NULL != fname) {
+    if (fname) {
         o = new SkFILEWStream(fname);
     } else {
         o = new SkDebugWStream();
@@ -133,7 +133,7 @@
 void SkRTConfRegistry::printNonDefault(const char *fname) const {
     SkWStream *o;
 
-    if (NULL != fname) {
+    if (fname) {
         o = new SkFILEWStream(fname);
     } else {
         o = new SkDebugWStream();
diff --git a/src/utils/SkTextureCompressor.cpp b/src/utils/SkTextureCompressor.cpp
index 0dfc229..07b58c5 100644
--- a/src/utils/SkTextureCompressor.cpp
+++ b/src/utils/SkTextureCompressor.cpp
@@ -166,7 +166,7 @@
         }
     }
 
-    if (NULL != proc) {
+    if (proc) {
         return proc(dst, src, width, height, rowBytes);
     }
 
diff --git a/src/utils/SkTextureCompressor_Blitter.h b/src/utils/SkTextureCompressor_Blitter.h
index beffbfc..3d30501 100644
--- a/src/utils/SkTextureCompressor_Blitter.h
+++ b/src/utils/SkTextureCompressor_Blitter.h
@@ -440,7 +440,7 @@
     typedef uint32_t Block[BlockDim][BlockDim/4];
     inline void updateBlockColumns(Block block, const int col,
                                    const int colsLeft, const Column curAlphai) {
-        SkASSERT(NULL != block);
+        SkASSERT(block);
         SkASSERT(col + colsLeft <= BlockDim);
 
         for (int i = col; i < (col + colsLeft); ++i) {
diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h
index 4bb33b7..c61627d 100644
--- a/src/utils/debugger/SkDebugCanvas.h
+++ b/src/utils/debugger/SkDebugCanvas.h
@@ -208,7 +208,7 @@
     virtual bool isClipEmpty() const SK_OVERRIDE { return false; }
     virtual bool isClipRect() const SK_OVERRIDE { return true; }
     virtual bool getClipBounds(SkRect* bounds) const SK_OVERRIDE {
-        if (NULL != bounds) {
+        if (bounds) {
             bounds->setXYWH(0, 0,
                             SkIntToScalar(this->imageInfo().width()),
                             SkIntToScalar(this->imageInfo().height()));
@@ -216,7 +216,7 @@
         return true;
     }
     virtual bool getClipDeviceBounds(SkIRect* bounds) const SK_OVERRIDE {
-        if (NULL != bounds) {
+        if (bounds) {
             bounds->setLargest();
         }
         return true;
@@ -308,7 +308,7 @@
 
     size_t getOpID() const {
 #if 0
-        if (NULL != fPicture) {
+        if (fPicture) {
             return fPicture->EXPERIMENTAL_curOpID();
         }
 #endif
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index b9742c3..0da8f98 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -148,7 +148,7 @@
     canvas->clear(0xFFFFFFFF);
     canvas->drawBitmapRect(input, NULL, dst);
 
-    if (NULL != srcRect) {
+    if (srcRect) {
         SkRect r = SkRect::MakeLTRB(srcRect->fLeft * xScale + SK_Scalar1,
                                     srcRect->fTop * yScale + SK_Scalar1,
                                     srcRect->fRight * xScale + SK_Scalar1,
@@ -281,7 +281,7 @@
     fBitmap = bitmap;
     fLeft = left;
     fTop = top;
-    if (NULL != paint) {
+    if (paint) {
         fPaint = *paint;
         fPaintPtr = &fPaint;
     } else {
@@ -291,7 +291,7 @@
     fInfo.push(SkObjectParser::BitmapToString(bitmap));
     fInfo.push(SkObjectParser::ScalarToString(left, "SkScalar left: "));
     fInfo.push(SkObjectParser::ScalarToString(top, "SkScalar top: "));
-    if (NULL != paint) {
+    if (paint) {
         fInfo.push(SkObjectParser::PaintToString(*paint));
     }
 }
@@ -311,7 +311,7 @@
     : INHERITED(DRAW_BITMAP_MATRIX) {
     fBitmap = bitmap;
     fMatrix = matrix;
-    if (NULL != paint) {
+    if (paint) {
         fPaint = *paint;
         fPaintPtr = &fPaint;
     } else {
@@ -320,7 +320,7 @@
 
     fInfo.push(SkObjectParser::BitmapToString(bitmap));
     fInfo.push(SkObjectParser::MatrixToString(matrix));
-    if (NULL != paint) {
+    if (paint) {
         fInfo.push(SkObjectParser::PaintToString(*paint));
     }
 }
@@ -340,7 +340,7 @@
     fBitmap = bitmap;
     fCenter = center;
     fDst = dst;
-    if (NULL != paint) {
+    if (paint) {
         fPaint = *paint;
         fPaintPtr = &fPaint;
     } else {
@@ -350,7 +350,7 @@
     fInfo.push(SkObjectParser::BitmapToString(bitmap));
     fInfo.push(SkObjectParser::IRectToString(center));
     fInfo.push(SkObjectParser::RectToString(dst, "Dst: "));
-    if (NULL != paint) {
+    if (paint) {
         fInfo.push(SkObjectParser::PaintToString(*paint));
     }
 }
@@ -369,14 +369,14 @@
                                                  SkCanvas::DrawBitmapRectFlags flags)
     : INHERITED(DRAW_BITMAP_RECT_TO_RECT) {
     fBitmap = bitmap;
-    if (NULL != src) {
+    if (src) {
         fSrc = *src;
     } else {
         fSrc.setEmpty();
     }
     fDst = dst;
 
-    if (NULL != paint) {
+    if (paint) {
         fPaint = *paint;
         fPaintPtr = &fPaint;
     } else {
@@ -385,11 +385,11 @@
     fFlags = flags;
 
     fInfo.push(SkObjectParser::BitmapToString(bitmap));
-    if (NULL != src) {
+    if (src) {
         fInfo.push(SkObjectParser::RectToString(*src, "Src: "));
     }
     fInfo.push(SkObjectParser::RectToString(dst, "Dst: "));
-    if (NULL != paint) {
+    if (paint) {
         fInfo.push(SkObjectParser::PaintToString(*paint));
     }
     fInfo.push(SkObjectParser::IntToString(fFlags, "Flags: "));
@@ -513,11 +513,11 @@
     , fMatrixPtr(NULL)
     , fPaintPtr(NULL) {
 
-    if (NULL != matrix) {
+    if (matrix) {
         fMatrix = *matrix;
         fMatrixPtr = &fMatrix;
     }
-    if (NULL != paint) {
+    if (paint) {
         fPaint = *paint;
         fPaintPtr = &fPaint;
     }
@@ -527,10 +527,10 @@
                   picture->cullRect().fLeft, picture->cullRect().fTop,
                   picture->cullRect().fRight, picture->cullRect().fBottom);
     fInfo.push(temp);
-    if (NULL != matrix) {
+    if (matrix) {
         fInfo.push(SkObjectParser::MatrixToString(*matrix));
     }
-    if (NULL != paint) {
+    if (paint) {
         fInfo.push(SkObjectParser::PaintToString(*paint));
     }
 }
@@ -739,7 +739,7 @@
     fBitmap = bitmap;
     fLeft = left;
     fTop = top;
-    if (NULL != paint) {
+    if (paint) {
         fPaint = *paint;
         fPaintPtr = &fPaint;
     } else {
@@ -749,7 +749,7 @@
     fInfo.push(SkObjectParser::BitmapToString(bitmap));
     fInfo.push(SkObjectParser::IntToString(left, "Left: "));
     fInfo.push(SkObjectParser::IntToString(top, "Top: "));
-    if (NULL != paint) {
+    if (paint) {
         fInfo.push(SkObjectParser::PaintToString(*paint));
     }
 }
@@ -791,7 +791,7 @@
     memcpy(fText, text, byteLength);
     fByteLength = byteLength;
     fPath = path;
-    if (NULL != matrix) {
+    if (matrix) {
         fMatrix = *matrix;
     } else {
         fMatrix.setIdentity();
@@ -800,7 +800,7 @@
 
     fInfo.push(SkObjectParser::TextToString(text, byteLength, paint.getTextEncoding()));
     fInfo.push(SkObjectParser::PathToString(path));
-    if (NULL != matrix) {
+    if (matrix) {
         fInfo.push(SkObjectParser::MatrixToString(*matrix));
     }
     fInfo.push(SkObjectParser::PaintToString(paint));
@@ -825,14 +825,14 @@
     fVertices = new SkPoint[vertexCount];
     memcpy(fVertices, vertices, vertexCount * sizeof(SkPoint));
 
-    if (NULL != texs) {
+    if (texs) {
         fTexs = new SkPoint[vertexCount];
         memcpy(fTexs, texs, vertexCount * sizeof(SkPoint));
     } else {
         fTexs = NULL;
     }
 
-    if (NULL != colors) {
+    if (colors) {
         fColors = new SkColor[vertexCount];
         memcpy(fColors, colors, vertexCount * sizeof(SkColor));
     } else {
@@ -840,7 +840,7 @@
     }
 
     fXfermode = xfermode;
-    if (NULL != fXfermode) {
+    if (fXfermode) {
         fXfermode->ref();
     }
 
@@ -912,13 +912,13 @@
 SkSaveLayerCommand::SkSaveLayerCommand(const SkRect* bounds, const SkPaint* paint,
                                        SkCanvas::SaveFlags flags)
     : INHERITED(SAVE_LAYER) {
-    if (NULL != bounds) {
+    if (bounds) {
         fBounds = *bounds;
     } else {
         fBounds.setEmpty();
     }
 
-    if (NULL != paint) {
+    if (paint) {
         fPaint = *paint;
         fPaintPtr = &fPaint;
     } else {
@@ -926,10 +926,10 @@
     }
     fFlags = flags;
 
-    if (NULL != bounds) {
+    if (bounds) {
         fInfo.push(SkObjectParser::RectToString(*bounds, "Bounds: "));
     }
-    if (NULL != paint) {
+    if (paint) {
         fInfo.push(SkObjectParser::PaintToString(*paint));
     }
     fInfo.push(SkObjectParser::SaveFlagsToString(flags));
diff --git a/src/utils/debugger/SkObjectParser.cpp b/src/utils/debugger/SkObjectParser.cpp
index a9bad40..798db95 100644
--- a/src/utils/debugger/SkObjectParser.cpp
+++ b/src/utils/debugger/SkObjectParser.cpp
@@ -174,7 +174,7 @@
 
     SkString* boundStr = SkObjectParser::RectToString(path.getBounds(), "    Bound: ");
 
-    if (NULL != boundStr) {
+    if (boundStr) {
         mPath->append(*boundStr);
         SkDELETE(boundStr);
     }
diff --git a/src/utils/win/SkDWriteFontFileStream.cpp b/src/utils/win/SkDWriteFontFileStream.cpp
index c7dc3b2..0f0c628 100644
--- a/src/utils/win/SkDWriteFontFileStream.cpp
+++ b/src/utils/win/SkDWriteFontFileStream.cpp
@@ -188,7 +188,7 @@
     }
 
     const void* data = fStream->getMemoryBase();
-    if (NULL != data) {
+    if (data) {
         *fragmentStart = static_cast<BYTE const*>(data) + static_cast<size_t>(fileOffset);
         *fragmentContext = NULL;
 
diff --git a/src/utils/win/SkHRESULT.cpp b/src/utils/win/SkHRESULT.cpp
index 495f074..0aea4a6 100644
--- a/src/utils/win/SkHRESULT.cpp
+++ b/src/utils/win/SkHRESULT.cpp
@@ -10,7 +10,7 @@
 #include "SkHRESULT.h"
 
 void SkTraceHR(const char* file, unsigned long line, HRESULT hr, const char* msg) {
-    if (NULL != msg) {
+    if (msg) {
         SkDebugf("%s\n", msg);
     }
     SkDebugf("%s(%lu) : error 0x%x: ", file, line, hr);
diff --git a/src/utils/win/SkIStream.cpp b/src/utils/win/SkIStream.cpp
index 74d814c..6274e71 100644
--- a/src/utils/win/SkIStream.cpp
+++ b/src/utils/win/SkIStream.cpp
@@ -113,7 +113,7 @@
 }
 
 SkIStream::~SkIStream() {
-    if (NULL != this->fSkStream && fUnrefOnRelease) {
+    if (this->fSkStream && fUnrefOnRelease) {
         this->fSkStream->unref();
     }
 }
@@ -196,7 +196,7 @@
         break;
     }
 
-    if (NULL != lpNewFilePointer) {
+    if (lpNewFilePointer) {
         lpNewFilePointer->QuadPart = this->fLocation.QuadPart;
     }
     return hr;
@@ -228,7 +228,7 @@
 { }
 
 SkWIStream::~SkWIStream() {
-    if (NULL != this->fSkWStream) {
+    if (this->fSkWStream) {
         this->fSkWStream->flush();
     }
 }
diff --git a/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp
index 9c0c2d4..5c46138 100644
--- a/src/utils/win/SkWGL_win.cpp
+++ b/src/utils/win/SkWGL_win.cpp
@@ -367,7 +367,7 @@
                 coreProfileAttribs[1] = kCoreGLVersions[2 * v];
                 coreProfileAttribs[3] = kCoreGLVersions[2 * v + 1];
                 glrc = extensions.createContextAttribs(dc, NULL, coreProfileAttribs);
-                if (NULL != glrc) {
+                if (glrc) {
                     break;
                 }
             }
@@ -429,9 +429,9 @@
             HPBUFFER pbuf = extensions.createPbuffer(parentDC, pixelFormatsToTry[f], 1, 1, NULL);
             if (0 != pbuf) {
                 HDC dc = extensions.getPbufferDC(pbuf);
-                if (NULL != dc) {
+                if (dc) {
                     HGLRC glrc = create_gl_context(dc, extensions, contextType);
-                    if (NULL != glrc) {
+                    if (glrc) {
                         return SkNEW_ARGS(SkWGLPbufferContext, (pbuf, dc, glrc));
                     }
                     extensions.releasePbufferDC(pbuf, dc);
diff --git a/src/views/SkOSMenu.cpp b/src/views/SkOSMenu.cpp
index 3de0a9e..ad0c73f 100644
--- a/src/views/SkOSMenu.cpp
+++ b/src/views/SkOSMenu.cpp
@@ -32,7 +32,7 @@
 }
 
 void SkOSMenu::getItems(const SkOSMenu::Item* items[]) const {
-    if (NULL != items) {
+    if (items) {
         for (int i = 0; i < fItems.count(); ++i) {
             items[i] = fItems[i];
         }
@@ -204,7 +204,7 @@
 }
 
 bool SkOSMenu::FindListItems(const SkEvent& evt, SkString items[]) {
-    if (evt.isType(gMenuEventType) && NULL != items) {
+    if (evt.isType(gMenuEventType) && items) {
         const char* text = evt.findString(gList_Items_Str);
         if (text != NULL) {
             SkString temp(text);
diff --git a/src/views/SkView.cpp b/src/views/SkView.cpp
index f211ad9..0070201 100644
--- a/src/views/SkView.cpp
+++ b/src/views/SkView.cpp
@@ -637,7 +637,7 @@
 {
     SkASSERT(this);
 
-    if (NULL != local) {
+    if (local) {
         SkMatrix m;
         this->localToGlobal(&m);
         if (!m.invert(&m)) {
diff --git a/src/views/mac/SkNSView.mm b/src/views/mac/SkNSView.mm
index 80bfd67..6347d46 100644
--- a/src/views/mac/SkNSView.mm
+++ b/src/views/mac/SkNSView.mm
@@ -50,7 +50,7 @@
                                           selector:@selector(backingPropertiesChanged:)
                                           name:@"NSWindowDidChangeBackingPropertiesNotification"
                                           object:[self window]];
-    if (NULL != fWind) {
+    if (fWind) {
         fWind->setVisibleP(true);
         NSSize size = self.frame.size;
 #if RETINA_API_AVAILABLE
@@ -103,12 +103,9 @@
 #if RETINA_API_AVAILABLE
     newSize = [self convertSizeToBacking:newSize];
 #endif
-    if (NULL != fWind &&
-            (fWind->width()  != newSize.width ||
-             fWind->height() != newSize.height))
-    {
+    if (fWind && (fWind->width()  != newSize.width || fWind->height() != newSize.height)) {
         fWind->resize((int) newSize.width, (int) newSize.height);
-        if (NULL != fGLContext) {
+        if (fGLContext) {
             glClear(GL_STENCIL_BUFFER_BIT);
             [fGLContext update];
         }
@@ -131,7 +128,7 @@
 
 - (void)drawSkia {
     fRedrawRequestPending = false;
-    if (NULL != fWind) {
+    if (fWind) {
         SkAutoTUnref<SkCanvas> canvas(fWind->createCanvas());
         fWind->draw(canvas);
 #ifdef FORCE_REDRAW
@@ -268,7 +265,7 @@
     NSPoint p = [event locationInWindow];
     unsigned modi = convertNSModifiersToSk([event modifierFlags]);
 
-    if ([self mouse:p inRect:[self bounds]] && NULL != fWind) {
+    if ([self mouse:p inRect:[self bounds]] && fWind) {
         NSPoint loc = [self convertPoint:p fromView:nil];
 #if RETINA_API_AVAILABLE
         loc = [self convertPointToBacking:loc]; //y-up
@@ -283,7 +280,7 @@
     NSPoint p = [event locationInWindow];
     unsigned modi = convertNSModifiersToSk([event modifierFlags]);
 
-    if ([self mouse:p inRect:[self bounds]] && NULL != fWind) {
+    if ([self mouse:p inRect:[self bounds]] && fWind) {
         NSPoint loc = [self convertPoint:p fromView:nil];
 #if RETINA_API_AVAILABLE
         loc = [self convertPointToBacking:loc]; //y-up
@@ -298,7 +295,7 @@
     NSPoint p = [event locationInWindow];
     unsigned modi = convertNSModifiersToSk([event modifierFlags]);
     
-    if ([self mouse:p inRect:[self bounds]] && NULL != fWind) {
+    if ([self mouse:p inRect:[self bounds]] && fWind) {
         NSPoint loc = [self convertPoint:p fromView:nil];
 #if RETINA_API_AVAILABLE
         loc = [self convertPointToBacking:loc]; //y-up
@@ -313,7 +310,7 @@
     NSPoint p = [event locationInWindow];
     unsigned modi = convertNSModifiersToSk([event modifierFlags]);
     
-    if ([self mouse:p inRect:[self bounds]] && NULL != fWind) {
+    if ([self mouse:p inRect:[self bounds]] && fWind) {
         NSPoint loc = [self convertPoint:p fromView:nil];
 #if RETINA_API_AVAILABLE
         loc = [self convertPointToBacking:loc]; //y-up
diff --git a/src/views/unix/SkOSWindow_Unix.cpp b/src/views/unix/SkOSWindow_Unix.cpp
index fad5922..e22377a 100644
--- a/src/views/unix/SkOSWindow_Unix.cpp
+++ b/src/views/unix/SkOSWindow_Unix.cpp
@@ -46,9 +46,9 @@
 }
 
 void SkOSWindow::closeWindow() {
-    if (NULL != fUnixWindow.fDisplay) {
+    if (fUnixWindow.fDisplay) {
         this->detach();
-        SkASSERT(NULL != fUnixWindow.fGc);
+        SkASSERT(fUnixWindow.fGc);
         XFreeGC(fUnixWindow.fDisplay, fUnixWindow.fGc);
         fUnixWindow.fGc = NULL;
         XDestroyWindow(fUnixWindow.fDisplay, fUnixWindow.fWin);
@@ -64,9 +64,9 @@
         this->closeWindow();
     }
     // presence of fDisplay means we already have a window
-    if (NULL != fUnixWindow.fDisplay) {
-        if (NULL != info) {
-            if (NULL != fVi) {
+    if (fUnixWindow.fDisplay) {
+        if (info) {
+            if (fVi) {
                 glXGetConfig(fUnixWindow.fDisplay, fVi, GLX_SAMPLES_ARB, &info->fSampleCount);
                 glXGetConfig(fUnixWindow.fDisplay, fVi, GLX_STENCIL_SIZE, &info->fStencilBits);
             } else {
@@ -110,7 +110,7 @@
     }
 
     if (fVi) {
-        if (NULL != info) {
+        if (info) {
             glXGetConfig(dsp, fVi, GLX_SAMPLES_ARB, &info->fSampleCount);
             glXGetConfig(dsp, fVi, GLX_STENCIL_SIZE, &info->fStencilBits);
         }
@@ -132,7 +132,7 @@
                                          CWEventMask | CWColormap,
                                          &swa);
     } else {
-        if (NULL != info) {
+        if (info) {
             info->fSampleCount = 0;
             info->fStencilBits = 0;
         }
@@ -310,7 +310,7 @@
 }
 
 void SkOSWindow::mapWindowAndWait() {
-    SkASSERT(NULL != fUnixWindow.fDisplay);
+    SkASSERT(fUnixWindow.fDisplay);
     Display* dsp = fUnixWindow.fDisplay;
     Window win = fUnixWindow.fWin;
     XMapWindow(dsp, win);
@@ -333,7 +333,7 @@
         return false;
     }
     if (NULL == fUnixWindow.fGLContext) {
-        SkASSERT(NULL != fVi);
+        SkASSERT(fVi);
 
         fUnixWindow.fGLContext = glXCreateContext(fUnixWindow.fDisplay,
                                                   fVi,
@@ -365,7 +365,7 @@
 }
 
 void SkOSWindow::present() {
-    if (NULL != fUnixWindow.fDisplay && NULL != fUnixWindow.fGLContext) {
+    if (fUnixWindow.fDisplay && fUnixWindow.fGLContext) {
         glXSwapBuffers(fUnixWindow.fDisplay, fUnixWindow.fWin);
     }
 }
@@ -405,7 +405,7 @@
         return;
     }
     // If we are drawing with GL, we don't need XPutImage.
-    if (NULL != fUnixWindow.fGLContext) {
+    if (fUnixWindow.fGLContext) {
         return;
     }
     // Draw the bitmap to the screen.
diff --git a/src/views/win/SkOSWindow_win.cpp b/src/views/win/SkOSWindow_win.cpp
index 1b47dea..447a5af 100644
--- a/src/views/win/SkOSWindow_win.cpp
+++ b/src/views/win/SkOSWindow_win.cpp
@@ -60,7 +60,7 @@
 
 SkOSWindow::~SkOSWindow() {
 #if SK_SUPPORT_GPU
-    if (NULL != fHGLRC) {
+    if (fHGLRC) {
         wglDeleteContext((HGLRC)fHGLRC);
     }
 #if SK_ANGLE
diff --git a/tests/BBoxHierarchyTest.cpp b/tests/BBoxHierarchyTest.cpp
index b9cbbc4..71b9699 100644
--- a/tests/BBoxHierarchyTest.cpp
+++ b/tests/BBoxHierarchyTest.cpp
@@ -86,7 +86,7 @@
                            skiatest::Reporter* reporter) {
     DataRect rects[NUM_RECTS];
     SkRandom rand;
-    REPORTER_ASSERT(reporter, NULL != tree);
+    REPORTER_ASSERT(reporter, tree);
 
     int expectedDepthMin = -1;
     int expectedDepthMax = -1;
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp
index 82789a1..92e9d78 100644
--- a/tests/CachedDecodingPixelRefTest.cpp
+++ b/tests/CachedDecodingPixelRefTest.cpp
@@ -63,8 +63,8 @@
     if (b1.isNull() || b1.empty()) {
         return;
     }
-    REPORTER_ASSERT(reporter, NULL != b1.getPixels());
-    REPORTER_ASSERT(reporter, NULL != b2.getPixels());
+    REPORTER_ASSERT(reporter, b1.getPixels());
+    REPORTER_ASSERT(reporter, b2.getPixels());
     if ((!(b1.getPixels())) || (!(b2.getPixels()))) {
         return;
     }
@@ -122,7 +122,7 @@
         REPORTER_ASSERT(reporter, NULL == lazy.getPixels());
         {
             SkAutoLockPixels autoLockPixels(lazy);  // now pixels are good.
-            REPORTER_ASSERT(reporter, NULL != lazy.getPixels());
+            REPORTER_ASSERT(reporter, lazy.getPixels());
             if (NULL == lazy.getPixels()) {
                 continue;
             }
@@ -131,7 +131,7 @@
         REPORTER_ASSERT(reporter, NULL == lazy.getPixels());
         {
             SkAutoLockPixels autoLockPixels(lazy);  // now pixels are good.
-            REPORTER_ASSERT(reporter, NULL != lazy.getPixels());
+            REPORTER_ASSERT(reporter, lazy.getPixels());
             if (NULL == lazy.getPixels()) {
                 continue;
             }
@@ -184,7 +184,7 @@
 
 protected:
     virtual bool onGetInfo(SkImageInfo* info) SK_OVERRIDE {
-        REPORTER_ASSERT(fReporter, NULL != info);
+        REPORTER_ASSERT(fReporter, info);
         if ((NULL == info) || (kFailGetInfo_TestType == fType)) {
             return false;
         }
@@ -223,7 +223,7 @@
     REPORTER_ASSERT(reporter, TestImageGenerator::Width() == bm.width());
     REPORTER_ASSERT(reporter, TestImageGenerator::Height() == bm.height());
     SkAutoLockPixels autoLockPixels(bm);
-    REPORTER_ASSERT(reporter, NULL != bm.getPixels());
+    REPORTER_ASSERT(reporter, bm.getPixels());
     if (NULL == bm.getPixels()) {
         return;
     }
diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp
index 787f9af..8364a4b 100644
--- a/tests/CanvasStateTest.cpp
+++ b/tests/CanvasStateTest.cpp
@@ -270,7 +270,7 @@
     SkCanvas* tmpCanvas = SkCanvasStateUtils::CreateFromCanvasState(state);
     REPORTER_ASSERT(reporter, tmpCanvas);
 
-    REPORTER_ASSERT(reporter, NULL != canvas.getDrawFilter());
+    REPORTER_ASSERT(reporter, canvas.getDrawFilter());
     REPORTER_ASSERT(reporter, NULL == tmpCanvas->getDrawFilter());
 
     tmpCanvas->unref();
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index 0620df9..662e680 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -980,12 +980,12 @@
             // whether the result is bounded or not, the whole plane should start outside the clip.
             reducedStack.clipEmpty();
         }
-        for (ElementList::Iter iter = reducedClips.headIter(); NULL != iter.get(); iter.next()) {
+        for (ElementList::Iter iter = reducedClips.headIter(); iter.get(); iter.next()) {
             add_elem_to_stack(*iter.get(), &reducedStack);
         }
 
         // GrReducedClipStack assumes that the final result is clipped to the returned bounds
-        if (NULL != tightBounds) {
+        if (tightBounds) {
             reducedStack.clipDevRect(*tightBounds, SkRegion::kIntersect_Op);
         }
 
@@ -1191,7 +1191,7 @@
     SkRect answer;
     answer.iset(25, 25, 75, 75);
 
-    REPORTER_ASSERT(reporter, NULL != element);
+    REPORTER_ASSERT(reporter, element);
     REPORTER_ASSERT(reporter, SkClipStack::Element::kRect_Type == element->getType());
     REPORTER_ASSERT(reporter, SkRegion::kIntersect_Op == element->getOp());
     REPORTER_ASSERT(reporter, element->getRect() == answer);
diff --git a/tests/DeferredCanvasTest.cpp b/tests/DeferredCanvasTest.cpp
index b8b82b2..61af550 100644
--- a/tests/DeferredCanvasTest.cpp
+++ b/tests/DeferredCanvasTest.cpp
@@ -681,7 +681,7 @@
 
 static void TestDeferredCanvasSurface(skiatest::Reporter* reporter, GrContextFactory* factory) {
     SkImageInfo imageSpec = SkImageInfo::MakeN32Premul(10, 10);
-    bool useGpu = NULL != factory;
+    bool useGpu = SkToBool(factory);
     int cnt;
 #if SK_SUPPORT_GPU
     if (useGpu) {
@@ -712,7 +712,7 @@
         {
            surface = SkSurface::NewRaster(imageSpec);
         }
-        SkASSERT(NULL != surface);
+        SkASSERT(surface);
         SkAutoTUnref<SkSurface> aur(surface);
         SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(surface));
 
@@ -764,7 +764,7 @@
     SkImageInfo imageSpec = SkImageInfo::MakeN32Premul(10, 10);
     SkSurface* surface;
     SkSurface* alternateSurface;
-    bool useGpu = NULL != factory;
+    bool useGpu = SkToBool(factory);
     int cnt;
 #if SK_SUPPORT_GPU
     if (useGpu) {
@@ -796,8 +796,8 @@
             surface = SkSurface::NewRaster(imageSpec);
             alternateSurface = SkSurface::NewRaster(imageSpec);
         }
-        SkASSERT(NULL != surface);
-        SkASSERT(NULL != alternateSurface);
+        SkASSERT(surface);
+        SkASSERT(alternateSurface);
         SkAutoTUnref<SkSurface> aur1(surface);
         SkAutoTUnref<SkSurface> aur2(alternateSurface);
         PixelPtr pixels1 = get_surface_ptr(surface, useGpu);
diff --git a/tests/DequeTest.cpp b/tests/DequeTest.cpp
index 5d5dc09..04b1f40 100644
--- a/tests/DequeTest.cpp
+++ b/tests/DequeTest.cpp
@@ -19,8 +19,8 @@
         REPORTER_ASSERT(reporter, !deq.empty());
         REPORTER_ASSERT(reporter, count == deq.count());
         REPORTER_ASSERT(reporter, sizeof(int) == deq.elemSize());
-        REPORTER_ASSERT(reporter, NULL != deq.front());
-        REPORTER_ASSERT(reporter, NULL != deq.back());
+        REPORTER_ASSERT(reporter, deq.front());
+        REPORTER_ASSERT(reporter, deq.back());
         if (1 == count) {
             REPORTER_ASSERT(reporter, deq.back() == deq.front());
         } else {
@@ -36,7 +36,7 @@
     void* ptr;
 
     int value = max;
-    while (NULL != (ptr = iter.next())) {
+    while ((ptr = iter.next())) {
         REPORTER_ASSERT(reporter, value == *(int*)ptr);
         value -= 1;
     }
@@ -46,7 +46,7 @@
     iter.reset(deq, SkDeque::Iter::kBack_IterStart);
 
     value = min;
-    while (NULL != (ptr = iter.prev())) {
+    while ((ptr = iter.prev())) {
         REPORTER_ASSERT(reporter, value == *(int*)ptr);
         value += 1;
     }
@@ -57,12 +57,12 @@
 
     value = max;
     // forward iteration half-way
-    for (int i = 0; i < deq.count()/2 && NULL != (ptr = iter.next()); i++) {
+    for (int i = 0; i < deq.count()/2 && (ptr = iter.next()); i++) {
         REPORTER_ASSERT(reporter, value == *(int*)ptr);
         value -= 1;
     }
     // then back down w/ reverse iteration
-    while (NULL != (ptr = iter.prev())) {
+    while ((ptr = iter.prev())) {
         REPORTER_ASSERT(reporter, value == *(int*)ptr);
         value += 1;
     }
diff --git a/tests/FontMgrTest.cpp b/tests/FontMgrTest.cpp
index c9aa778..a1dc9dc 100644
--- a/tests/FontMgrTest.cpp
+++ b/tests/FontMgrTest.cpp
@@ -16,7 +16,7 @@
     uint32_t flags = 0;
     SkAutoTUnref<SkFont> font(SkFont::Create(NULL, 24, SkFont::kA8_MaskType, flags));
 
-    REPORTER_ASSERT(reporter, NULL != font->getTypeface());
+    REPORTER_ASSERT(reporter, font->getTypeface());
     REPORTER_ASSERT(reporter, 24 == font->getSize());
     REPORTER_ASSERT(reporter, 1 == font->getScaleX());
     REPORTER_ASSERT(reporter, 0 == font->getSkewX());
diff --git a/tests/GLInterfaceValidationTest.cpp b/tests/GLInterfaceValidationTest.cpp
index 541af8f..797ba72 100755
--- a/tests/GLInterfaceValidationTest.cpp
+++ b/tests/GLInterfaceValidationTest.cpp
@@ -22,14 +22,14 @@
         // We're supposed to fail the NVPR context type when we the native context that does not
         // support the NVPR extension.
         if (GrContextFactory::kNVPR_GLContextType == glCtxType &&
-            NULL != factory->getGLContext(GrContextFactory::kNative_GLContextType) &&
+            factory->getGLContext(GrContextFactory::kNative_GLContextType) &&
             !factory->getGLContext(GrContextFactory::kNative_GLContextType)->hasExtension("GL_NV_path_rendering")) {
             REPORTER_ASSERT(reporter, NULL == glCtxHelper);
             continue;
         }
 
-        REPORTER_ASSERT(reporter, NULL != glCtxHelper);
-        if (NULL != glCtxHelper) {
+        REPORTER_ASSERT(reporter, glCtxHelper);
+        if (glCtxHelper) {
             const GrGLInterface* interface = glCtxHelper->gl();
             REPORTER_ASSERT(reporter, interface->validate());
         }
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 6efd7d5..a641fe2 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -44,9 +44,9 @@
 
     bool dstRead = false;
     bool fragPos = false;
-    bool vertexShader = (NULL != geometryProcessor);
+    bool vertexShader = SkToBool(geometryProcessor);
     int offset = 0;
-    if (NULL != geometryProcessor) {
+    if (geometryProcessor) {
         const GrEffectStage* stage = geometryProcessor;
         uint16_t* offsetAndSize = reinterpret_cast<uint16_t*>(fKey.begin() +
                                                               kEffectKeyOffsetsAndLengthOffset +
@@ -295,7 +295,7 @@
 DEF_GPUTEST(GLPrograms, reporter, factory) {
     for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
         GrContext* context = factory->get(static_cast<GrContextFactory::GLContextType>(type));
-        if (NULL != context) {
+        if (context) {
             GrGpuGL* gpu = static_cast<GrGpuGL*>(context->getGpu());
             int maxStages = 6;
 #if SK_ANGLE
diff --git a/tests/GpuLayerCacheTest.cpp b/tests/GpuLayerCacheTest.cpp
index 5e18197..83f31f5 100644
--- a/tests/GpuLayerCacheTest.cpp
+++ b/tests/GpuLayerCacheTest.cpp
@@ -34,7 +34,7 @@
         GrCachedLayer* layer = cache->findLayerOrCreate(picture.uniqueID(), 
                                                         idOffset+i+1, idOffset+i+2, 
                                                         SkMatrix::I());
-        REPORTER_ASSERT(reporter, NULL != layer);
+        REPORTER_ASSERT(reporter, layer);
         GrCachedLayer* temp = cache->findLayer(picture.uniqueID(), idOffset+i+1, idOffset+i+2, SkMatrix::I());
         REPORTER_ASSERT(reporter, temp == layer);
 
@@ -66,7 +66,7 @@
     needsRerendering = cache->lock(layer, desc, false);
     REPORTER_ASSERT(reporter, !needsRerendering);
 
-    REPORTER_ASSERT(reporter, NULL != layer->texture());
+    REPORTER_ASSERT(reporter, layer->texture());
     REPORTER_ASSERT(reporter, layer->locked());
 }
 
@@ -100,7 +100,7 @@
 
         for (int i = 0; i < kInitialNumLayers; ++i) {
             GrCachedLayer* layer = cache.findLayer(picture->uniqueID(), i+1, i+2, SkMatrix::I());
-            REPORTER_ASSERT(reporter, NULL != layer);
+            REPORTER_ASSERT(reporter, layer);
 
             lock_layer(reporter, &cache, layer);
 
@@ -117,19 +117,19 @@
         // Unlock the textures
         for (int i = 0; i < kInitialNumLayers; ++i) {
             GrCachedLayer* layer = cache.findLayer(picture->uniqueID(), i+1, i+2, SkMatrix::I());
-            REPORTER_ASSERT(reporter, NULL != layer);
+            REPORTER_ASSERT(reporter, layer);
 
             cache.unlock(layer);
         }
 
         for (int i = 0; i < kInitialNumLayers; ++i) {
             GrCachedLayer* layer = cache.findLayer(picture->uniqueID(), i+1, i+2, SkMatrix::I());
-            REPORTER_ASSERT(reporter, NULL != layer);
+            REPORTER_ASSERT(reporter, layer);
 
             REPORTER_ASSERT(reporter, !layer->locked());
             // The first 4 layers should still be in the atlas.
             if (i < 4) {
-                REPORTER_ASSERT(reporter, NULL != layer->texture());
+                REPORTER_ASSERT(reporter, layer->texture());
                 REPORTER_ASSERT(reporter, layer->isAtlased());
             } else {
                 // The final layer should be unlocked.
@@ -145,7 +145,7 @@
             GrCachedLayer* layer = cache.findLayer(picture->uniqueID(), 
                                                    kInitialNumLayers+1, kInitialNumLayers+2, 
                                                    SkMatrix::I());
-            REPORTER_ASSERT(reporter, NULL != layer);
+            REPORTER_ASSERT(reporter, layer);
 
             lock_layer(reporter, &cache, layer);
             cache.unlock(layer);
@@ -155,13 +155,13 @@
             GrCachedLayer* layer = cache.findLayer(picture->uniqueID(), i+1, i+2, SkMatrix::I());
             // 3 old layers plus the new one should be in the atlas.
             if (1 == i || 2 == i || 3 == i || 5 == i) {
-                REPORTER_ASSERT(reporter, NULL != layer);
+                REPORTER_ASSERT(reporter, layer);
                 REPORTER_ASSERT(reporter, !layer->locked());
-                REPORTER_ASSERT(reporter, NULL != layer->texture());
+                REPORTER_ASSERT(reporter, layer->texture());
                 REPORTER_ASSERT(reporter, layer->isAtlased());
             } else if (4 == i) {
                 // The one that was never atlased should still be around
-                REPORTER_ASSERT(reporter, NULL != layer);
+                REPORTER_ASSERT(reporter, layer);
 
                 REPORTER_ASSERT(reporter, NULL == layer->texture());
                 REPORTER_ASSERT(reporter, !layer->isAtlased());
diff --git a/tests/GrAllocatorTest.cpp b/tests/GrAllocatorTest.cpp
index a05da8f..c02a7ca 100644
--- a/tests/GrAllocatorTest.cpp
+++ b/tests/GrAllocatorTest.cpp
@@ -30,7 +30,7 @@
 // again. Finally it resets the allocator and checks again.
 static void check_allocator(GrTAllocator<C>* allocator, int cnt, int popCnt,
                             skiatest::Reporter* reporter) {
-    SkASSERT(NULL != allocator);
+    SkASSERT(allocator);
     SkASSERT(allocator->empty());
     for (int i = 0; i < cnt; ++i) {
         // Try both variations of push_back().
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index ff67b1b..a2ed629 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -16,7 +16,7 @@
 
 DEF_GPUTEST(GrSurface, reporter, factory) {
     GrContext* context = factory->get(GrContextFactory::kNull_GLContextType);
-    if (NULL != context) {
+    if (context) {
         GrTextureDesc desc;
         desc.fConfig = kSkia8888_GrPixelConfig;
         desc.fFlags = kRenderTarget_GrTextureFlagBit;
diff --git a/tests/ImageCacheTest.cpp b/tests/ImageCacheTest.cpp
index bda10a0..317ed6d 100644
--- a/tests/ImageCacheTest.cpp
+++ b/tests/ImageCacheTest.cpp
@@ -45,7 +45,7 @@
 
         TestingRec* newRec = SkNEW_ARGS(TestingRec, (key, i));
         const TestingRec* addedRec = (const TestingRec*)cache.addAndLock(newRec);
-        REPORTER_ASSERT(reporter, NULL != addedRec);
+        REPORTER_ASSERT(reporter, addedRec);
 
         const TestingRec* foundRec = (const TestingRec*)cache.findAndLock(key);
         REPORTER_ASSERT(reporter, foundRec == addedRec);
@@ -59,7 +59,7 @@
         for (size_t i = 0; i < COUNT * 100; ++i) {
             TestingKey key(i);
             SkResourceCache::ID id = cache.addAndLock(SkNEW_ARGS(TestingRec, (key, i)));
-            REPORTER_ASSERT(reporter, NULL != id);
+            REPORTER_ASSERT(reporter, id);
             cache.unlock(id);
         }
     }
@@ -117,7 +117,7 @@
 
     // Lookup can return either value.
     const TestingRec* rec = (const TestingRec*)cache.findAndLock(key);
-    REPORTER_ASSERT(r, NULL != rec);
+    REPORTER_ASSERT(r, rec);
     REPORTER_ASSERT(r, 2 == rec->fValue || 3 == rec->fValue);
     cache.unlock(rec);
 }
diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp
index 4d26167..30665a6 100644
--- a/tests/ImageDecodingTest.cpp
+++ b/tests/ImageDecodingTest.cpp
@@ -278,7 +278,7 @@
 
         // This should never fail since we know the images we're decoding.
         SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(&stream));
-        REPORTER_ASSERT(reporter, NULL != decoder.get());
+        REPORTER_ASSERT(reporter, decoder.get());
         if (NULL == decoder.get()) {
             continue;
         }
@@ -510,9 +510,9 @@
         SkBitmap bm;
         SkAssertResult(bm.setInfo(SkImageInfo::MakeN32Premul(1, 1)));
         REPORTER_ASSERT(reporter,
-            NULL != install_pixel_ref(&bm, stream.detach(), 1, true));
+            install_pixel_ref(&bm, stream.detach(), 1, true));
         SkAutoLockPixels alp(bm);
-        REPORTER_ASSERT(reporter, NULL != bm.getPixels());
+        REPORTER_ASSERT(reporter, bm.getPixels());
     }
 }
 
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index a8cd5d0..ebe9c4d 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -152,7 +152,7 @@
         // Check that a clipping color matrix followed by a grayscale does not concatenate into a single filter.
         SkAutoTUnref<SkImageFilter> doubleBrightness(make_scale(2.0f));
         SkAutoTUnref<SkImageFilter> halfBrightness(make_scale(0.5f, doubleBrightness));
-        REPORTER_ASSERT(reporter, NULL != halfBrightness->getInput(0));
+        REPORTER_ASSERT(reporter, halfBrightness->getInput(0));
     }
 
     {
diff --git a/tests/KtxTest.cpp b/tests/KtxTest.cpp
index 32dacd5..1a61f3a 100644
--- a/tests/KtxTest.cpp
+++ b/tests/KtxTest.cpp
@@ -31,7 +31,7 @@
     bm8888.allocN32Pixels(128, 128);
 
     uint8_t *pixels = reinterpret_cast<uint8_t*>(bm8888.getPixels());
-    REPORTER_ASSERT(reporter, NULL != pixels);
+    REPORTER_ASSERT(reporter, pixels);
 
     if (NULL == pixels) {
         return;
@@ -53,10 +53,10 @@
     REPORTER_ASSERT(reporter, !(bm8888.empty()));
 
     SkAutoDataUnref encodedData(SkImageEncoder::EncodeData(bm8888, SkImageEncoder::kKTX_Type, 0));
-    REPORTER_ASSERT(reporter, NULL != encodedData);
+    REPORTER_ASSERT(reporter, encodedData);
 
     SkAutoTUnref<SkMemoryStream> stream(SkNEW_ARGS(SkMemoryStream, (encodedData)));
-    REPORTER_ASSERT(reporter, NULL != stream);
+    REPORTER_ASSERT(reporter, stream);
 
     SkBitmap decodedBitmap;
     bool imageDecodeSuccess = SkImageDecoder::DecodeStream(stream, &decodedBitmap);
@@ -69,7 +69,7 @@
     REPORTER_ASSERT(reporter, !(decodedBitmap.empty()));
 
     uint8_t *decodedPixels = reinterpret_cast<uint8_t*>(decodedBitmap.getPixels());
-    REPORTER_ASSERT(reporter, NULL != decodedPixels);
+    REPORTER_ASSERT(reporter, decodedPixels);
     REPORTER_ASSERT(reporter, decodedBitmap.getSize() == bm8888.getSize());
 
     if (NULL == decodedPixels) {
@@ -109,7 +109,7 @@
 
     SkAutoTUnref<SkMemoryStream> stream(
         SkNEW_ARGS(SkMemoryStream, (kHalfWhiteKTX, sizeof(kHalfWhiteKTX))));
-    REPORTER_ASSERT(reporter, NULL != stream);
+    REPORTER_ASSERT(reporter, stream);
 
     SkBitmap decodedBitmap;
     bool imageDecodeSuccess = SkImageDecoder::DecodeStream(stream, &decodedBitmap);
@@ -122,7 +122,7 @@
     REPORTER_ASSERT(reporter, !(decodedBitmap.empty()));
 
     uint8_t *decodedPixels = reinterpret_cast<uint8_t*>(decodedBitmap.getPixels());
-    REPORTER_ASSERT(reporter, NULL != decodedPixels);
+    REPORTER_ASSERT(reporter, decodedPixels);
 
     uint8_t *row = decodedPixels;
     for (int j = 0; j < decodedBitmap.height(); ++j) {
@@ -145,7 +145,7 @@
     // Load PKM file into a bitmap
     SkBitmap etcBitmap;
     SkAutoTUnref<SkData> fileData(SkData::NewFromFileName(pkmFilename.c_str()));
-    REPORTER_ASSERT(reporter, NULL != fileData);
+    REPORTER_ASSERT(reporter, fileData);
     if (NULL == fileData) {
         return;
     }
@@ -159,7 +159,7 @@
     // Write the bitmap out to a KTX file.
     SkData *ktxDataPtr = SkImageEncoder::EncodeData(etcBitmap, SkImageEncoder::kKTX_Type, 0);
     SkAutoDataUnref newKtxData(ktxDataPtr);
-    REPORTER_ASSERT(reporter, NULL != ktxDataPtr);
+    REPORTER_ASSERT(reporter, ktxDataPtr);
 
     // See is this data is identical to data in existing ktx file.
     SkString ktxFilename = GetResourcePath("mandrill_128.ktx");
diff --git a/tests/LListTest.cpp b/tests/LListTest.cpp
index 20151c3..8fb0117 100644
--- a/tests/LListTest.cpp
+++ b/tests/LListTest.cpp
@@ -73,12 +73,12 @@
     Iter iter;
 
     ListElement* cur = iter.init(list, Iter::kHead_IterStart);
-    for (int i = 0; NULL != cur; ++i, cur = iter.next()) {
+    for (int i = 0; cur; ++i, cur = iter.next()) {
         REPORTER_ASSERT(reporter, cur->fID == 3-i);
     }
 
     cur = iter.init(list, Iter::kTail_IterStart);
-    for (int i = 0; NULL != cur; ++i, cur = iter.prev()) {
+    for (int i = 0; cur; ++i, cur = iter.prev()) {
         REPORTER_ASSERT(reporter, cur->fID == i);
     }
 
@@ -114,7 +114,7 @@
     check_list(list, reporter, false, 4, true, true, true, true, elements);
 
     cur = iter.init(list, Iter::kHead_IterStart);
-    for (int i = 0; NULL != cur; ++i, cur = iter.next()) {
+    for (int i = 0; cur; ++i, cur = iter.next()) {
         REPORTER_ASSERT(reporter, cur->fID == i);
     }
 }
@@ -228,7 +228,7 @@
                         next.next();
                         prev.prev();
 
-                        SkASSERT(NULL != iter.get());
+                        SkASSERT(iter.get());
                         // insert either before or after the iterator, then check that the
                         // surrounding sequence is correct.
                         if (2 == insertionMethod) {
@@ -237,10 +237,10 @@
                             newItem.prev();
                             REPORTER_ASSERT(reporter, newItem.get()->fID == id);
 
-                            if (NULL != next.get()) {
+                            if (next.get()) {
                                 REPORTER_ASSERT(reporter, next.prev()->fID == iter.get()->fID);
                             }
-                            if (NULL != prev.get()) {
+                            if (prev.get()) {
                                 REPORTER_ASSERT(reporter, prev.next()->fID == id);
                             }
                         } else {
@@ -249,10 +249,10 @@
                             newItem.next();
                             REPORTER_ASSERT(reporter, newItem.get()->fID == id);
 
-                            if (NULL != next.get()) {
+                            if (next.get()) {
                                 REPORTER_ASSERT(reporter, next.prev()->fID == id);
                             }
-                            if (NULL != prev.get()) {
+                            if (prev.get()) {
                                 REPORTER_ASSERT(reporter, prev.next()->fID == iter.get()->fID);
                             }
                         }
@@ -276,10 +276,10 @@
                 // find the element
                 Iter iter(list1, start);
                 while (n--) {
-                    REPORTER_ASSERT(reporter, NULL != iter.get());
+                    REPORTER_ASSERT(reporter, iter.get());
                     (iter.*incrFunc)();
                 }
-                REPORTER_ASSERT(reporter, NULL != iter.get());
+                REPORTER_ASSERT(reporter, iter.get());
 
                 // remember the prev and next elements from the element to be removed
                 Iter prev = iter;
diff --git a/tests/MallocPixelRefTest.cpp b/tests/MallocPixelRefTest.cpp
index cf5e054..c20c883 100644
--- a/tests/MallocPixelRefTest.cpp
+++ b/tests/MallocPixelRefTest.cpp
@@ -64,7 +64,7 @@
         SkAutoTUnref<SkMallocPixelRef> pr(
             SkMallocPixelRef::NewAllocate(info, rowBytes, NULL));
         REPORTER_ASSERT(reporter, pr.get() != NULL);
-        REPORTER_ASSERT(reporter, NULL != pr->pixels());
+        REPORTER_ASSERT(reporter, pr->pixels());
     }
     {
         void* addr = static_cast<void*>(new uint8_t[size]);
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 57587c4..35fbf2f 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -3377,7 +3377,7 @@
             REPORTER_ASSERT(reporter, 2*kRepeatCnt == pathRef->countPoints());
             REPORTER_ASSERT(reporter, kRepeatCnt == pathRef->countWeights());
             REPORTER_ASSERT(reporter, SkPath::kConic_SegmentMask == pathRef->getSegmentMasks());
-            REPORTER_ASSERT(reporter, NULL != weights);
+            REPORTER_ASSERT(reporter, weights);
             for (int i = 0; i < kRepeatCnt; ++i) {
                 REPORTER_ASSERT(reporter, SkPath::kConic_Verb == pathRef->atVerb(i));
             }
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index eb85c94..b1cdf7e 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -770,7 +770,7 @@
 
     const char *reason = NULL;
     REPORTER_ASSERT(reporter, !picture->suitableForGpuRasterization(NULL, &reason));
-    REPORTER_ASSERT(reporter, NULL != reason);
+    REPORTER_ASSERT(reporter, reason);
 
     canvas = GENERATE_CANVAS(recorder, useNewPath);
     {
@@ -968,7 +968,7 @@
             SkPicture::AccelData::Key key = GrAccelData::ComputeAccelDataKey();
 
             const SkPicture::AccelData* data = pict->EXPERIMENTAL_getAccelData(key);
-            REPORTER_ASSERT(reporter, NULL != data);
+            REPORTER_ASSERT(reporter, data);
 
             const GrAccelData *gpuData = static_cast<const GrAccelData*>(data);
             REPORTER_ASSERT(reporter, 8 == gpuData->numSaveLayers());
@@ -1023,7 +1023,7 @@
                                       kHeight == info3.fSize.fHeight);
             REPORTER_ASSERT(reporter, info3.fOriginXform.isIdentity());
             REPORTER_ASSERT(reporter, 0 == info3.fOffset.fX && 0 == info3.fOffset.fY);
-            REPORTER_ASSERT(reporter, NULL != info3.fPaint);
+            REPORTER_ASSERT(reporter, info3.fPaint);
             REPORTER_ASSERT(reporter, !info3.fIsNested && !info3.fHasNestedLayers);
 
             REPORTER_ASSERT(reporter, info4.fValid);
diff --git a/tests/RTreeTest.cpp b/tests/RTreeTest.cpp
index 087f19a..40af5fe 100644
--- a/tests/RTreeTest.cpp
+++ b/tests/RTreeTest.cpp
@@ -84,7 +84,7 @@
 static void rtree_test_main(SkRTree* rtree, skiatest::Reporter* reporter) {
     DataRect rects[NUM_RECTS];
     SkRandom rand;
-    REPORTER_ASSERT(reporter, NULL != rtree);
+    REPORTER_ASSERT(reporter, rtree);
 
     int expectedDepthMin = -1;
     int expectedDepthMax = -1;
diff --git a/tests/RecordTestUtils.h b/tests/RecordTestUtils.h
index db3f02d..0575b83 100644
--- a/tests/RecordTestUtils.h
+++ b/tests/RecordTestUtils.h
@@ -24,7 +24,7 @@
     ReadAs<T> reader;
     record.visit<void>(index, reader);
     REPORTER_ASSERT(r, T::kType == reader.type);
-    REPORTER_ASSERT(r, NULL != reader.ptr);
+    REPORTER_ASSERT(r, SkToBool(reader.ptr));
     return reader.ptr;
 }
 
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index c08e75f..a66b036 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -74,7 +74,7 @@
 
     ~TestResource() {
         --fAlive;
-        if (NULL != fToDelete) {
+        if (fToDelete) {
             // Breaks our little 2-element cycle below.
             fToDelete->setDeleteWhenDestroyed(NULL, NULL);
             fCache->deleteResource(fToDelete->getCacheEntry());
@@ -274,7 +274,7 @@
 
         REPORTER_ASSERT(reporter, 300 == cache.getCachedResourceBytes());
         REPORTER_ASSERT(reporter, 2 == cache.getCachedResourceCount());
-        REPORTER_ASSERT(reporter, NULL != cache.find(key1));
+        REPORTER_ASSERT(reporter, cache.find(key1));
         // Internal resource cache validation will test the detached size (debug mode only).
     }
 }
diff --git a/tests/SListTest.cpp b/tests/SListTest.cpp
index 72a8281..78fcc65 100644
--- a/tests/SListTest.cpp
+++ b/tests/SListTest.cpp
@@ -27,7 +27,7 @@
         ERRORF(reporter, "%s - List count is not zero, %d instead", stage, list.getCount());
         return false;
     }
-    if (NULL != list.head()) {
+    if (list.head()) {
         ERRORF(reporter, "%s - List has elements when empty", stage);
         return false;
     }
@@ -55,7 +55,7 @@
         }
         next = next->next();
     }
-    if (NULL != next) {
+    if (next) {
         ERRORF(reporter, "%s - List too long, should be %d", stage, count);
         return false;
     }
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index b5582dc..23cc33d 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -198,7 +198,7 @@
         // This should have succeeded, since there are enough bytes to read this
         REPORTER_ASSERT(reporter, buffer2.isValid());
         REPORTER_ASSERT(reporter, static_cast<size_t>(peekAfter - peekBefore) == bytesWritten);
-        REPORTER_ASSERT(reporter, NULL != obj2);
+        REPORTER_ASSERT(reporter, obj2);
     } else {
         // If the deserialization was supposed to fail, make sure it did
         REPORTER_ASSERT(reporter, !buffer.isValid());
@@ -490,7 +490,7 @@
         SkValidatingReadBuffer reader(static_cast<void*>(data.get()), size);
         SkAutoTUnref<SkPicture> readPict(
             SkPicture::CreateFromBuffer(reader));
-        REPORTER_ASSERT(reporter, NULL != readPict.get());
+        REPORTER_ASSERT(reporter, readPict.get());
     }
 
     TestPictureTypefaceSerialization(reporter);
diff --git a/tests/SkResourceCacheTest.cpp b/tests/SkResourceCacheTest.cpp
index dbd327c..b660890 100644
--- a/tests/SkResourceCacheTest.cpp
+++ b/tests/SkResourceCacheTest.cpp
@@ -79,7 +79,7 @@
     SkBitmap cachedBitmap;
     cachedBitmap.setInfo(info);
     SkBitmap::Allocator* allocator = SkBitmapCache::GetAllocator();
-    if (NULL != allocator) {
+    if (allocator) {
         allocator->allocPixelRef(&cachedBitmap, 0);
     } else {
         cachedBitmap.allocPixels();
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index eca929e..a175f64 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -139,7 +139,7 @@
             continue;   // gpu may not be enabled
         }
         const void* addr = image->peekPixels(&info, &rowBytes);
-        bool success = (NULL != addr);
+        bool success = SkToBool(addr);
         REPORTER_ASSERT(reporter, gRec[i].fPeekShouldSucceed == success);
         if (success) {
             REPORTER_ASSERT(reporter, 10 == info.width());
@@ -199,7 +199,7 @@
             surface->getCanvas()->clear(color);
 
             const void* addr = surface->getCanvas()->peekPixels(&info, &rowBytes);
-            bool success = (NULL != addr);
+            bool success = SkToBool(addr);
             REPORTER_ASSERT(reporter, gRec[i].fPeekShouldSucceed == success);
 
             SkImageInfo info2;
@@ -389,7 +389,7 @@
     SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
     GrTexture* texture = image->getTexture();
     if (surfaceType == kGpu_SurfaceType || surfaceType == kGpuScratch_SurfaceType) {
-        REPORTER_ASSERT(reporter, NULL != texture);
+        REPORTER_ASSERT(reporter, texture);
         REPORTER_ASSERT(reporter, 0 != texture->getTextureHandle());
     } else {
         REPORTER_ASSERT(reporter, NULL == texture);
@@ -444,14 +444,14 @@
 
 #if SK_SUPPORT_GPU
     TestGetTexture(reporter, kRaster_SurfaceType, NULL);
-    if (NULL != factory) {
+    if (factory) {
         for (int i= 0; i < GrContextFactory::kGLContextTypeCnt; ++i) {
             GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContextType) i;
             if (!GrContextFactory::IsRenderingGLContext(glCtxType)) {
                 continue;
             }
             GrContext* context = factory->get(glCtxType);
-            if (NULL != context) {
+            if (context) {
                 TestSurfaceInCache(reporter, kGpu_SurfaceType, context);
                 TestSurfaceInCache(reporter, kGpuScratch_SurfaceType, context);
                 Test_crbug263329(reporter, kGpu_SurfaceType, context);
diff --git a/tests/TextBlobTest.cpp b/tests/TextBlobTest.cpp
index 7495ef3..70c9ddc 100644
--- a/tests/TextBlobTest.cpp
+++ b/tests/TextBlobTest.cpp
@@ -175,9 +175,9 @@
         }
 
         SkAutoTUnref<const SkTextBlob> blob(builder.build());
-        REPORTER_ASSERT(reporter, (NULL != blob->fGlyphBuffer) == (glyphCount > 0));
-        REPORTER_ASSERT(reporter, (NULL != blob->fPosBuffer) == (posCount > 0));
-        REPORTER_ASSERT(reporter, (NULL != blob->fRuns.get()) == (inCount > 0));
+        REPORTER_ASSERT(reporter, SkToBool(blob->fGlyphBuffer) == (glyphCount > 0));
+        REPORTER_ASSERT(reporter, SkToBool(blob->fPosBuffer) == (posCount > 0));
+        REPORTER_ASSERT(reporter, SkToBool(blob->fRuns.get()) == (inCount > 0));
 
         SkTextBlob::RunIterator it(blob);
         for (unsigned i = 0; i < outCount; ++i) {
diff --git a/tests/TextureCompressionTest.cpp b/tests/TextureCompressionTest.cpp
index b93cabb..7dd285d 100644
--- a/tests/TextureCompressionTest.cpp
+++ b/tests/TextureCompressionTest.cpp
@@ -134,7 +134,7 @@
         SkAutoLockPixels alp(bitmap);
 
         uint8_t* pixels = reinterpret_cast<uint8_t*>(bitmap.getPixels());
-        REPORTER_ASSERT(reporter, NULL != pixels);
+        REPORTER_ASSERT(reporter, pixels);
         if (NULL == pixels) {
             return;
         }
@@ -153,7 +153,7 @@
 
     SkAutoMalloc decompMemory(kWidth*kHeight);
     uint8_t* decompBuffer = reinterpret_cast<uint8_t*>(decompMemory.get());
-    REPORTER_ASSERT(reporter, NULL != decompBuffer);
+    REPORTER_ASSERT(reporter, decompBuffer);
     if (NULL == decompBuffer) {
         return;
     }
@@ -168,7 +168,7 @@
         }
 
         SkAutoDataUnref data(SkTextureCompressor::CompressBitmapToFormat(bitmap, fmt));
-        REPORTER_ASSERT(reporter, NULL != data);
+        REPORTER_ASSERT(reporter, data);
         if (NULL == data) {
             continue;
         }
@@ -182,7 +182,7 @@
 
         SkAutoLockPixels alp(bitmap);
         uint8_t* pixels = reinterpret_cast<uint8_t*>(bitmap.getPixels());
-        REPORTER_ASSERT(reporter, NULL != pixels);
+        REPORTER_ASSERT(reporter, pixels);
         if (NULL == pixels) {
             continue;
         }
@@ -228,7 +228,7 @@
     for (int lum = 0; lum < 256; ++lum) {
         bitmap.lockPixels();
         uint8_t* pixels = reinterpret_cast<uint8_t*>(bitmap.getPixels());
-        REPORTER_ASSERT(reporter, NULL != pixels);
+        REPORTER_ASSERT(reporter, pixels);
         if (NULL == pixels) {
             bitmap.unlockPixels();
             continue;
@@ -241,7 +241,7 @@
 
         SkAutoDataUnref latcData(
             SkTextureCompressor::CompressBitmapToFormat(bitmap, kLATCFormat));
-        REPORTER_ASSERT(reporter, NULL != latcData);
+        REPORTER_ASSERT(reporter, latcData);
         if (NULL == latcData) {
             continue;
         }
diff --git a/third_party/ktx/ktx.cpp b/third_party/ktx/ktx.cpp
index 2391baf..7cc2f28 100644
--- a/third_party/ktx/ktx.cpp
+++ b/third_party/ktx/ktx.cpp
@@ -135,7 +135,7 @@
 }
 
 uint32_t SkKTXFile::readInt(const uint8_t** buf, size_t* bytesLeft) const {
-    SkASSERT(NULL != buf && NULL != bytesLeft);
+    SkASSERT(buf && bytesLeft);
 
     uint32_t result;
 
diff --git a/tools/PictureBenchmark.cpp b/tools/PictureBenchmark.cpp
index 8a714ca..15b6173 100644
--- a/tools/PictureBenchmark.cpp
+++ b/tools/PictureBenchmark.cpp
@@ -73,7 +73,7 @@
     fRenderer->setup();
 
     if (fPreprocess) {
-        if (NULL != fRenderer->getCanvas()) {
+        if (fRenderer->getCanvas()) {
             fRenderer->getCanvas()->EXPERIMENTAL_optimize(fRenderer->getPicture());
         }
     }
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp
index b2bac00..8148a2b 100644
--- a/tools/PictureRenderer.cpp
+++ b/tools/PictureRenderer.cpp
@@ -60,7 +60,7 @@
 
     SkASSERT(NULL == fPicture);
     SkASSERT(NULL == fCanvas.get());
-    if (NULL != fPicture || NULL != fCanvas.get()) {
+    if (fPicture || fCanvas.get()) {
         return;
     }
 
@@ -74,7 +74,7 @@
 }
 
 void PictureRenderer::CopyString(SkString* dest, const SkString* src) {
-    if (NULL != src) {
+    if (src) {
         dest->set(*src);
     } else {
         dest->reset();
@@ -90,7 +90,7 @@
         paint->setFlags(paint->getFlags() & ~fFlags[t] & SkPaint::kAllFlags);
         if (PictureRenderer::kMaskFilter_DrawFilterFlag & fFlags[t]) {
             SkMaskFilter* maskFilter = paint->getMaskFilter();
-            if (NULL != maskFilter) {
+            if (maskFilter) {
                 paint->setMaskFilter(NULL);
             }
         }
@@ -212,8 +212,8 @@
  *  should call this method during init.
  */
 void PictureRenderer::buildBBoxHierarchy() {
-    SkASSERT(NULL != fPicture);
-    if (kNone_BBoxHierarchyType != fBBoxHierarchyType && NULL != fPicture) {
+    SkASSERT(fPicture);
+    if (kNone_BBoxHierarchyType != fBBoxHierarchyType && fPicture) {
         SkAutoTDelete<SkBBHFactory> factory(this->getFactory());
         SkPictureRecorder recorder;
         SkCanvas* canvas = recorder.beginRecording(fPicture->cullRect().width(), 
@@ -305,14 +305,14 @@
         outputFilename.appendU64(imageDigestPtr->getHashValue());
     } else {
         outputFilename.set(escapedInputFilename);
-        if (NULL != tileNumberPtr) {
+        if (tileNumberPtr) {
             outputFilename.append("-tile");
             outputFilename.appendS32(*tileNumberPtr);
         }
     }
     outputFilename.append(".png");
 
-    if (NULL != jsonSummaryPtr) {
+    if (jsonSummaryPtr) {
         ImageDigest *imageDigestPtr = bitmapAndDigest.getImageDigestPtr();
         SkString outputRelativePath;
         if (outputSubdirPtr) {
@@ -392,7 +392,7 @@
     pipeCanvas->drawPicture(fPicture);
     writer.endRecording();
     fCanvas->flush();
-    if (NULL != out) {
+    if (out) {
         *out = SkNEW(SkBitmap);
         setup_bitmap(*out, SkScalarCeilToInt(fPicture->cullRect().width()), 
                            SkScalarCeilToInt(fPicture->cullRect().height()));
@@ -421,14 +421,14 @@
 
 bool SimplePictureRenderer::render(SkBitmap** out) {
     SkASSERT(fCanvas.get() != NULL);
-    SkASSERT(NULL != fPicture);
+    SkASSERT(fPicture);
     if (NULL == fCanvas.get() || NULL == fPicture) {
         return false;
     }
 
     fCanvas->drawPicture(fPicture);
     fCanvas->flush();
-    if (NULL != out) {
+    if (out) {
         *out = SkNEW(SkBitmap);
         setup_bitmap(*out, SkScalarCeilToInt(fPicture->cullRect().width()), 
                            SkScalarCeilToInt(fPicture->cullRect().height()));
@@ -467,7 +467,7 @@
 void TiledPictureRenderer::init(const SkPicture* pict, const SkString* writePath,
                                 const SkString* mismatchPath, const SkString* inputFilename,
                                 bool useChecksumBasedFilenames) {
-    SkASSERT(NULL != pict);
+    SkASSERT(pict);
     SkASSERT(0 == fTileRects.count());
     if (NULL == pict || fTileRects.count() != 0) {
         return;
@@ -662,7 +662,7 @@
             success &= write(fCanvas, fWritePath, fMismatchPath, fInputFilename, fJsonSummaryPtr,
                              fUseChecksumBasedFilenames, &i);
         }
-        if (NULL != out) {
+        if (out) {
             if (fCanvas->readPixels(&bitmap, 0, 0)) {
                 // Add this tile to the entire bitmap.
                 bitmapCopyAtOffset(bitmap, *out, SkScalarFloorToInt(fTileRects[i].left()),
@@ -677,7 +677,7 @@
 
 SkCanvas* TiledPictureRenderer::setupCanvas(int width, int height) {
     SkCanvas* canvas = this->INHERITED::setupCanvas(width, height);
-    SkASSERT(NULL != fPicture);
+    SkASSERT(fPicture);
     // Clip the tile to an area that is completely inside both the SkPicture and the viewport. This
     // is mostly important for tiles on the right and bottom edges as they may go over this area and
     // the picture may have some commands that draw outside of this area and so should not actually
diff --git a/tools/filtermain.cpp b/tools/filtermain.cpp
index 00854d4..87d68ff 100644
--- a/tools/filtermain.cpp
+++ b/tools/filtermain.cpp
@@ -84,7 +84,7 @@
     const SkPaint* saveLayerPaint = saveLayer->paint();
 
     // if (NULL == saveLayerPaint) the dbmr's paint doesn't need to be changed
-    if (NULL != saveLayerPaint) {
+    if (saveLayerPaint) {
         SkDrawBitmapRectCommand* dbmr =
             (SkDrawBitmapRectCommand*) canvas->getDrawCommandAt(curCommand+1);
         SkPaint* dbmrPaint = dbmr->paint();
@@ -92,7 +92,7 @@
         if (NULL == dbmrPaint) {
             // if the DBMR doesn't have a paint just use the saveLayer's
             dbmr->setPaint(*saveLayerPaint);
-        } else if (NULL != saveLayerPaint) {
+        } else if (saveLayerPaint) {
             // Both paints are present so their alphas need to be combined
             SkColor color = saveLayerPaint->getColor();
             int a0 = SkColorGetA(color);
@@ -162,7 +162,7 @@
     const SkPaint* saveLayerPaint = saveLayer->paint();
 
     // if (NULL == saveLayerPaint) the dbmr's paint doesn't need to be changed
-    if (NULL != saveLayerPaint) {
+    if (saveLayerPaint) {
         SkDrawBitmapRectCommand* dbmr =
             (SkDrawBitmapRectCommand*) canvas->getDrawCommandAt(curCommand+3);
         SkPaint* dbmrPaint = dbmr->paint();
@@ -423,8 +423,8 @@
     const SkPaint* saveLayerPaint0 = saveLayer0->paint();
     const SkPaint* saveLayerPaint1 = saveLayer1->paint();
 
-    if ((NULL != saveLayerPaint0 && !is_simple(*saveLayerPaint0)) ||
-        (NULL != saveLayerPaint1 && !is_simple(*saveLayerPaint1))) {
+    if ((saveLayerPaint0 && !is_simple(*saveLayerPaint0)) ||
+        (saveLayerPaint1 && !is_simple(*saveLayerPaint1))) {
         return false;
     }
 
@@ -434,14 +434,14 @@
         return true;
     }
 
-    if (NULL != saveLayerPaint0) {
+    if (saveLayerPaint0) {
         SkColor layerColor0 = saveLayerPaint0->getColor() | 0xFF000000; // force opaque
         if (dbmrPaint->getColor() != layerColor0) {
             return false;
         }
     }
 
-    if (NULL != saveLayerPaint1) {
+    if (saveLayerPaint1) {
         SkColor layerColor1 = saveLayerPaint1->getColor() | 0xFF000000; // force opaque
         if (dbmrPaint->getColor() != layerColor1) {
             return false;
@@ -477,7 +477,7 @@
     int a0, a1;
 
     const SkPaint* saveLayerPaint0 = saveLayer0->paint();
-    if (NULL != saveLayerPaint0) {
+    if (saveLayerPaint0) {
         color = saveLayerPaint0->getColor();
         a0 = SkColorGetA(color);
     } else {
@@ -485,7 +485,7 @@
     }
 
     const SkPaint* saveLayerPaint1 = saveLayer1->paint();
-    if (NULL != saveLayerPaint1) {
+    if (saveLayerPaint1) {
         color = saveLayerPaint1->getColor();
         a1 = SkColorGetA(color);
     } else {
@@ -497,7 +497,7 @@
 
     SkPaint* dbmrPaint = dbmr->paint();
 
-    if (NULL != dbmrPaint) {
+    if (dbmrPaint) {
         SkColor newColor = SkColorSetA(dbmrPaint->getColor(), newA);
         dbmrPaint->setColor(newColor);
     } else {
@@ -579,7 +579,7 @@
 
     SkScalar newSrcLeft, newSrcTop;
 
-    if (NULL != dbmr->srcRect()) {
+    if (dbmr->srcRect()) {
         newSrcLeft = dbmr->srcRect()->fLeft + clip->rect().fLeft - dbmr->dstRect().fLeft;
         newSrcTop  = dbmr->srcRect()->fTop + clip->rect().fTop - dbmr->dstRect().fTop;
     } else {
diff --git a/tools/flags/SkCommandLineFlags.h b/tools/flags/SkCommandLineFlags.h
index c6a783d..0fb0233 100644
--- a/tools/flags/SkCommandLineFlags.h
+++ b/tools/flags/SkCommandLineFlags.h
@@ -416,7 +416,7 @@
         , fStrings(NULL) {
         fNext = SkCommandLineFlags::gHead;
         SkCommandLineFlags::gHead = this;
-        SkASSERT(NULL != name && strlen(name) > 1);
+        SkASSERT(name && strlen(name) > 1);
         SkASSERT(NULL == shortName || 1 == strlen(shortName));
     }
 
diff --git a/tools/picture_utils.cpp b/tools/picture_utils.cpp
index 6a35dd1..5c120b0 100644
--- a/tools/picture_utils.cpp
+++ b/tools/picture_utils.cpp
@@ -18,7 +18,7 @@
     void force_all_opaque(const SkBitmap& bitmap) {
         SkASSERT(NULL == bitmap.getTexture());
         SkASSERT(kN32_SkColorType == bitmap.colorType());
-        if (NULL != bitmap.getTexture() || kN32_SkColorType == bitmap.colorType()) {
+        if (bitmap.getTexture() || kN32_SkColorType == bitmap.colorType()) {
             return;
         }
 
diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp
index 9ec136c..4fb8352 100644
--- a/tools/render_pictures_main.cpp
+++ b/tools/render_pictures_main.cpp
@@ -145,11 +145,11 @@
                                     SkBitmap** out) {
     SkString inputFilename = SkOSPath::Basename(inputPath.c_str());
     SkString writePathString;
-    if (NULL != writePath && writePath->size() > 0 && !FLAGS_writeEncodedImages) {
+    if (writePath && writePath->size() > 0 && !FLAGS_writeEncodedImages) {
         writePathString.set(*writePath);
     }
     SkString mismatchPathString;
-    if (NULL != mismatchPath && mismatchPath->size() > 0) {
+    if (mismatchPath && mismatchPath->size() > 0) {
         mismatchPathString.set(*mismatchPath);
     }
 
@@ -207,7 +207,7 @@
                   FLAGS_writeChecksumBasedFilenames);
 
     if (FLAGS_preprocess) {
-        if (NULL != renderer.getCanvas()) {
+        if (renderer.getCanvas()) {
             renderer.getCanvas()->EXPERIMENTAL_optimize(renderer.getPicture());
         }
     }
@@ -250,7 +250,7 @@
     }
 
     ~AutoRestoreBbhType() {
-        if (NULL != fRenderer) {
+        if (fRenderer) {
             fRenderer->setBBoxHierarchyType(fSavedBbhType);
         }
     }
@@ -369,17 +369,17 @@
         sk_tools::replace_char(&outputFilename, '.', '_');
         outputFilename.append(".png");
 
-        if (NULL != jsonSummaryPtr) {
+        if (jsonSummaryPtr) {
             sk_tools::ImageDigest imageDigest(*bitmap);
             jsonSummaryPtr->add(inputFilename.c_str(), outputFilename.c_str(), imageDigest);
-            if ((NULL != mismatchPath) && !mismatchPath->isEmpty() &&
+            if ((mismatchPath) && !mismatchPath->isEmpty() &&
                 !jsonSummaryPtr->getExpectation(inputFilename.c_str()).matches(imageDigest)) {
                 success &= sk_tools::write_bitmap_to_disk(*bitmap, *mismatchPath, NULL,
                                                           outputFilename);
             }
         }
 
-        if ((NULL != writePath) && !writePath->isEmpty()) {
+        if ((writePath) && !writePath->isEmpty()) {
             success &= sk_tools::write_bitmap_to_disk(*bitmap, *writePath, NULL, outputFilename);
         }
     }
diff --git a/tools/skdiff_image.cpp b/tools/skdiff_image.cpp
index 172f62b..89f7381 100644
--- a/tools/skdiff_image.cpp
+++ b/tools/skdiff_image.cpp
@@ -37,11 +37,11 @@
     drp->fComparison.fStatus = DiffResource::kSpecified_Status;
 
     SkAutoDataUnref baseFileBits(read_file(drp->fBase.fFullPath.c_str()));
-    if (NULL != baseFileBits) {
+    if (baseFileBits) {
         drp->fBase.fStatus = DiffResource::kRead_Status;
     }
     SkAutoDataUnref comparisonFileBits(read_file(drp->fComparison.fFullPath.c_str()));
-    if (NULL != comparisonFileBits) {
+    if (comparisonFileBits) {
         drp->fComparison.fStatus = DiffResource::kRead_Status;
     }
     if (NULL == baseFileBits || NULL == comparisonFileBits) {
diff --git a/tools/skdiff_main.cpp b/tools/skdiff_main.cpp
index ba32216..df07844 100644
--- a/tools/skdiff_main.cpp
+++ b/tools/skdiff_main.cpp
@@ -422,11 +422,11 @@
             drp->fComparison.fStatus = DiffResource::kExists_Status;
 
             SkAutoDataUnref baseFileBits(read_file(drp->fBase.fFullPath.c_str()));
-            if (NULL != baseFileBits) {
+            if (baseFileBits) {
                 drp->fBase.fStatus = DiffResource::kRead_Status;
             }
             SkAutoDataUnref comparisonFileBits(read_file(drp->fComparison.fFullPath.c_str()));
-            if (NULL != comparisonFileBits) {
+            if (comparisonFileBits) {
                 drp->fComparison.fStatus = DiffResource::kRead_Status;
             }
             if (NULL == baseFileBits || NULL == comparisonFileBits) {
diff --git a/tools/skdiff_utils.cpp b/tools/skdiff_utils.cpp
index 9157ac6..14a9fec 100644
--- a/tools/skdiff_utils.cpp
+++ b/tools/skdiff_utils.cpp
@@ -103,7 +103,7 @@
     const char *first_char = input_cstr;
     const char *match_char;
     size_t oldSubstringLen = strlen(oldSubstring);
-    while (NULL != (match_char = strstr(first_char, oldSubstring))) {
+    while ((match_char = strstr(first_char, oldSubstring))) {
         output.append(first_char, (match_char - first_char));
         output.append(newSubstring);
         first_char = match_char + oldSubstringLen;
diff --git a/tools/skimage_main.cpp b/tools/skimage_main.cpp
index 60bdd05..a2d353c 100644
--- a/tools/skimage_main.cpp
+++ b/tools/skimage_main.cpp
@@ -511,7 +511,7 @@
     const char* filename = basename.c_str();
 
     if (!codec->decode(&stream, &bitmap, gPrefColorType, SkImageDecoder::kDecodePixels_Mode)) {
-        if (NULL != gJsonExpectations.get()) {
+        if (gJsonExpectations.get()) {
             const SkString name_config = create_json_key(filename);
             skiagm::Expectations jsExpectations = gJsonExpectations->get(name_config.c_str());
             if (jsExpectations.ignoreFailure()) {
@@ -637,7 +637,7 @@
             }
             if (SkImageDecoder::kUnknown_Format == format) {
                 const char* dot = strrchr(srcPath, '.');
-                if (NULL != dot) {
+                if (dot) {
                     format = guess_format_from_suffix(dot);
                 }
                 if (SkImageDecoder::kUnknown_Format == format) {
diff --git a/tools/skpdiff/SkDiffContext.cpp b/tools/skpdiff/SkDiffContext.cpp
index 4248ca3..32688f5 100644
--- a/tools/skpdiff/SkDiffContext.cpp
+++ b/tools/skpdiff/SkDiffContext.cpp
@@ -27,7 +27,7 @@
 }
 
 SkDiffContext::~SkDiffContext() {
-    if (NULL != fDiffers) {
+    if (fDiffers) {
         SkDELETE_ARRAY(fDiffers);
     }
 }
@@ -56,7 +56,7 @@
 
 void SkDiffContext::setDiffers(const SkTDArray<SkImageDiffer*>& differs) {
     // Delete whatever the last array of differs was
-    if (NULL != fDiffers) {
+    if (fDiffers) {
         SkDELETE_ARRAY(fDiffers);
         fDiffers = NULL;
         fDifferCount = 0;
@@ -307,7 +307,7 @@
     // See http://skbug.com/2713 ('make skpdiff use jsoncpp library to write out
     // JSON output, instead of manual writeText() calls?')
     stream.writeText("    \"records\": [\n");
-    while (NULL != currentRecord) {
+    while (currentRecord) {
         stream.writeText("        {\n");
 
             SkString baselineAbsPath = get_absolute_path(currentRecord->fBaselinePath);
@@ -386,7 +386,7 @@
         currentRecord = iter.next();
 
         // JSON does not allow trailing commas
-        if (NULL != currentRecord) {
+        if (currentRecord) {
             stream.writeText(",");
         }
         stream.writeText("\n");
@@ -409,7 +409,7 @@
     DiffRecord* currentRecord = iter.get();
 
     // Write CSV header and create a dictionary of all columns.
-    while (NULL != currentRecord) {
+    while (currentRecord) {
         for (int diffIndex = 0; diffIndex < currentRecord->fDiffs.count(); diffIndex++) {
             DiffData& data = currentRecord->fDiffs[diffIndex];
             if (!columns.find(data.fDiffName)) {
@@ -428,7 +428,7 @@
 
     SkTLList<DiffRecord>::Iter iter2(fRecords, SkTLList<DiffRecord>::Iter::kHead_IterStart);
     currentRecord = iter2.get();
-    while (NULL != currentRecord) {
+    while (currentRecord) {
         for (int i = 0; i < cntColumns; i++) {
             values[i] = -1;
         }
diff --git a/tools/skpdiff/skpdiff_main.cpp b/tools/skpdiff/skpdiff_main.cpp
index 9c1f37f..c01767e 100644
--- a/tools/skpdiff/skpdiff_main.cpp
+++ b/tools/skpdiff/skpdiff_main.cpp
@@ -134,7 +134,7 @@
 
     // Figure which differs the user chose, and optionally print them if the user requests it
     SkTDArray<SkImageDiffer*> chosenDiffers;
-    for (int differIndex = 0; NULL != gDiffers[differIndex]; differIndex++) {
+    for (int differIndex = 0; gDiffers[differIndex]; differIndex++) {
         SkImageDiffer* differ = gDiffers[differIndex];
         if (FLAGS_list) {
             SkDebugf("    %s", differ->getName());
diff --git a/tools/skpdiff/skpdiff_util.cpp b/tools/skpdiff/skpdiff_util.cpp
index 4a92f5e..498f657 100644
--- a/tools/skpdiff/skpdiff_util.cpp
+++ b/tools/skpdiff/skpdiff_util.cpp
@@ -174,7 +174,7 @@
     // Note these paths are in sorted order by default according to http://linux.die.net/man/3/glob
     // Check under the flag GLOB_NOSORT
     char** paths = globBuffer.gl_pathv;
-    while(NULL != *paths) {
+    while(*paths) {
         entries->push_back(SkString(*paths));
         paths++;
     }