Replace uses of GrAssert by SkASSERT.

R=bsalomon@google.com

Review URL: https://codereview.chromium.org/22850006

git-svn-id: http://skia.googlecode.com/svn/trunk@10789 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index d1c7fea..2290cb9 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -39,7 +39,7 @@
                                      coordsType);
         builder->fsCodeAppend(";\n");
         if (GrConfigConversionEffect::kNone_PMConversion == fPMConversion) {
-            GrAssert(fSwapRedAndBlue);
+            SkASSERT(fSwapRedAndBlue);
             builder->fsCodeAppendf("\t%s = %s.bgra;\n", outputColor, outputColor);
         } else {
             const char* swiz = fSwapRedAndBlue ? "bgr" : "rgb";
@@ -89,7 +89,7 @@
                                                         drawEffect,
                                                         conv.coordsType(),
                                                         conv.texture(0));
-        GrAssert(!(matrixKey & key));
+        SkASSERT(!(matrixKey & key));
         return matrixKey | key;
     }
 
@@ -111,10 +111,10 @@
     : GrSingleTextureEffect(texture, matrix)
     , fSwapRedAndBlue(swapRedAndBlue)
     , fPMConversion(pmConversion) {
-    GrAssert(kRGBA_8888_GrPixelConfig == texture->config() ||
+    SkASSERT(kRGBA_8888_GrPixelConfig == texture->config() ||
              kBGRA_8888_GrPixelConfig == texture->config());
     // Why did we pollute our texture cache instead of using a GrSingleTextureEffect?
-    GrAssert(swapRedAndBlue || kNone_PMConversion != pmConversion);
+    SkASSERT(swapRedAndBlue || kNone_PMConversion != pmConversion);
 }
 
 const GrBackendEffectFactory& GrConfigConversionEffect::getFactory() const {
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 65da811..aad7d49 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -109,7 +109,7 @@
     const GrConvolutionEffect& conv = drawEffect.castEffect<GrConvolutionEffect>();
     GrTexture& texture = *conv.texture(0);
     // the code we generated was for a specific kernel radius
-    GrAssert(conv.radius() == fRadius);
+    SkASSERT(conv.radius() == fRadius);
     float imageIncrement[2] = { 0 };
     float ySign = texture.origin() != kTopLeft_GrSurfaceOrigin ? 1.0f : -1.0f;
     switch (conv.direction()) {
@@ -162,8 +162,8 @@
                                          bool useBounds,
                                          float bounds[2])
     : Gr1DKernelEffect(texture, direction, radius), fUseBounds(useBounds) {
-    GrAssert(radius <= kMaxKernelRadius);
-    GrAssert(NULL != kernel);
+    SkASSERT(radius <= kMaxKernelRadius);
+    SkASSERT(NULL != kernel);
     int width = this->width();
     for (int i = 0; i < width; i++) {
         fKernel[i] = kernel[i];
@@ -178,7 +178,7 @@
                                          bool useBounds,
                                          float bounds[2])
     : Gr1DKernelEffect(texture, direction, radius), fUseBounds(useBounds) {
-    GrAssert(radius <= kMaxKernelRadius);
+    SkASSERT(radius <= kMaxKernelRadius);
     int width = this->width();
 
     float sum = 0.0f;
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index 06615d2..598c6ee 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -34,8 +34,8 @@
         const char* fsCoordName;
         GrSLType fsCoordSLType;
         if (GrEffect::kCustom_CoordsType == ste.coordsType()) {
-            GrAssert(ste.getMatrix().isIdentity());
-            GrAssert(1 == ste.numVertexAttribs());
+            SkASSERT(ste.getMatrix().isIdentity());
+            SkASSERT(1 == ste.numVertexAttribs());
             fsCoordSLType = kVec2f_GrSLType;
             const char* vsVaryingName;
             builder->addVarying(kVec2f_GrSLType, "textureCoords", &vsVaryingName, &fsCoordName);
@@ -70,7 +70,7 @@
                          const GrDrawEffect& drawEffect) SK_OVERRIDE {
         const GrSimpleTextureEffect& ste = drawEffect.castEffect<GrSimpleTextureEffect>();
         if (GrEffect::kCustom_CoordsType == ste.coordsType()) {
-            GrAssert(ste.getMatrix().isIdentity());
+            SkASSERT(ste.getMatrix().isIdentity());
         } else {
             fEffectMatrix.get()->setData(uman, ste.getMatrix(), drawEffect, ste.texture(0));
         }
diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h
index f80ff8d..bcce46b 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.h
+++ b/src/gpu/effects/GrSimpleTextureEffect.h
@@ -26,7 +26,7 @@
     static GrEffectRef* Create(GrTexture* tex,
                                const SkMatrix& matrix,
                                CoordsType coordsType = kLocal_CoordsType) {
-        GrAssert(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
+        SkASSERT(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
         AutoEffectUnref effect(SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, GrTextureParams::kNone_FilterMode, coordsType)));
         return CreateEffectRef(effect);
     }
@@ -36,7 +36,7 @@
                                const SkMatrix& matrix,
                                GrTextureParams::FilterMode filterMode,
                                CoordsType coordsType = kLocal_CoordsType) {
-        GrAssert(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
+        SkASSERT(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
         AutoEffectUnref effect(
             SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, filterMode, coordsType)));
         return CreateEffectRef(effect);
@@ -46,7 +46,7 @@
                                const SkMatrix& matrix,
                                const GrTextureParams& p,
                                CoordsType coordsType = kLocal_CoordsType) {
-        GrAssert(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
+        SkASSERT(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
         AutoEffectUnref effect(SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, p, coordsType)));
         return CreateEffectRef(effect);
     }
@@ -77,7 +77,7 @@
                           GrTextureParams::FilterMode filterMode,
                           CoordsType coordsType)
         : GrSingleTextureEffect(texture, matrix, filterMode, coordsType) {
-        GrAssert(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
+        SkASSERT(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
     }
 
     GrSimpleTextureEffect(GrTexture* texture,
@@ -86,7 +86,7 @@
                           CoordsType coordsType)
         : GrSingleTextureEffect(texture, matrix, params, coordsType) {
         if (kCustom_CoordsType == coordsType) {
-            GrAssert(matrix.isIdentity());
+            SkASSERT(matrix.isIdentity());
             this->addVertexAttrib(kVec2f_GrSLType);
         }
     }
diff --git a/src/gpu/effects/GrTextureDomainEffect.cpp b/src/gpu/effects/GrTextureDomainEffect.cpp
index 80fa770..cf100d7 100644
--- a/src/gpu/effects/GrTextureDomainEffect.cpp
+++ b/src/gpu/effects/GrTextureDomainEffect.cpp
@@ -67,7 +67,7 @@
                                                 "clampCoord");
         builder->fsCodeAppend(";\n");
     } else {
-        GrAssert(GrTextureDomainEffect::kDecal_WrapMode == texDom.wrapMode());
+        SkASSERT(GrTextureDomainEffect::kDecal_WrapMode == texDom.wrapMode());
 
         if (kImagination_GrGLVendor == builder->ctxInfo().vendor()) {
             // On the NexusS and GalaxyNexus, the other path (with the 'any'
@@ -162,14 +162,14 @@
         // We don't currently handle domains that are empty or don't intersect the texture.
         // It is OK if the domain rect is a line or point, but it should not be inverted. We do not
         // handle rects that do not intersect the [0..1]x[0..1] rect.
-        GrAssert(domain.fLeft <= domain.fRight);
-        GrAssert(domain.fTop <= domain.fBottom);
+        SkASSERT(domain.fLeft <= domain.fRight);
+        SkASSERT(domain.fTop <= domain.fBottom);
         clippedDomain.fLeft = SkMaxScalar(domain.fLeft, kFullRect.fLeft);
         clippedDomain.fRight = SkMinScalar(domain.fRight, kFullRect.fRight);
         clippedDomain.fTop = SkMaxScalar(domain.fTop, kFullRect.fTop);
         clippedDomain.fBottom = SkMinScalar(domain.fBottom, kFullRect.fBottom);
-        GrAssert(clippedDomain.fLeft <= clippedDomain.fRight);
-        GrAssert(clippedDomain.fTop <= clippedDomain.fBottom);
+        SkASSERT(clippedDomain.fLeft <= clippedDomain.fRight);
+        SkASSERT(clippedDomain.fTop <= clippedDomain.fBottom);
 
         AutoEffectUnref effect(SkNEW_ARGS(GrTextureDomainEffect, (texture,
                                                                   matrix,
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp
index e1cacec..877215e 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) {
-    GrAssert(NULL != info);
+    SkASSERT(NULL != info);
 
     AtlasEntry* entry = static_cast<AtlasEntry*>(info);
 
@@ -78,7 +78,7 @@
     , fRows(SkNEW_ARRAY(AtlasRow, fNumRows))
     , fLRUFront(NULL)
     , fLRUBack(NULL) {
-    GrAssert(fNumRows * fDesc.fRowHeight == fDesc.fHeight);
+    SkASSERT(fNumRows * fDesc.fRowHeight == fDesc.fHeight);
     this->initLRU();
     VALIDATE;
 }
@@ -164,7 +164,7 @@
                                            GrContext::kDontFlush_PixelOpsFlag);
     }
 
-    GrAssert(rowNumber >= 0);
+    SkASSERT(rowNumber >= 0);
     VALIDATE;
     return rowNumber;
 }
@@ -173,7 +173,7 @@
     VALIDATE;
     --fRows[row].fLocks;
     --fLockedRows;
-    GrAssert(fRows[row].fLocks >= 0 && fLockedRows >= 0);
+    SkASSERT(fRows[row].fLocks >= 0 && fLockedRows >= 0);
     if (0 == fRows[row].fLocks) {
         this->appendLRU(fRows + row);
     }
@@ -209,11 +209,11 @@
         this->initLRU();
         fKeyTable.rewind();
     }
-    GrAssert(NULL != fTexture);
+    SkASSERT(NULL != fTexture);
 }
 
 void GrTextureStripAtlas::unlockTexture() {
-    GrAssert(NULL != fTexture && 0 == fLockedRows);
+    SkASSERT(NULL != fTexture && 0 == fLockedRows);
     fTexture->unref();
     fTexture = NULL;
     fDesc.fContext->purgeCache();
@@ -229,12 +229,12 @@
         fRows[i].fPrev = NULL;
         this->appendLRU(fRows + i);
     }
-    GrAssert(NULL == fLRUFront || NULL == fLRUFront->fPrev);
-    GrAssert(NULL == fLRUBack || NULL == fLRUBack->fNext);
+    SkASSERT(NULL == fLRUFront || NULL == fLRUFront->fPrev);
+    SkASSERT(NULL == fLRUBack || NULL == fLRUBack->fNext);
 }
 
 void GrTextureStripAtlas::appendLRU(AtlasRow* row) {
-    GrAssert(NULL == row->fPrev && NULL == row->fNext);
+    SkASSERT(NULL == row->fPrev && NULL == row->fNext);
     if (NULL == fLRUFront && NULL == fLRUBack) {
         fLRUFront = row;
         fLRUBack = row;
@@ -246,20 +246,20 @@
 }
 
 void GrTextureStripAtlas::removeFromLRU(AtlasRow* row) {
-    GrAssert(NULL != row);
+    SkASSERT(NULL != row);
     if (NULL != row->fNext && NULL != row->fPrev) {
         row->fPrev->fNext = row->fNext;
         row->fNext->fPrev = row->fPrev;
     } else {
         if (NULL == row->fNext) {
-            GrAssert(row == fLRUBack);
+            SkASSERT(row == fLRUBack);
             fLRUBack = row->fPrev;
             if (fLRUBack) {
                 fLRUBack->fNext = NULL;
             }
         }
         if (NULL == row->fPrev) {
-            GrAssert(row == fLRUFront);
+            SkASSERT(row == fLRUFront);
             fLRUFront = row->fNext;
             if (fLRUFront) {
                 fLRUFront->fPrev = NULL;
@@ -286,20 +286,20 @@
     // Our key table should be sorted
     uint32_t prev = 1 > fKeyTable.count() ? 0 : fKeyTable[0]->fKey;
     for (int i = 1; i < fKeyTable.count(); ++i) {
-        GrAssert(prev < fKeyTable[i]->fKey);
-        GrAssert(fKeyTable[i]->fKey != kEmptyAtlasRowKey);
+        SkASSERT(prev < fKeyTable[i]->fKey);
+        SkASSERT(fKeyTable[i]->fKey != kEmptyAtlasRowKey);
         prev = fKeyTable[i]->fKey;
     }
 
     int lruCount = 0;
     // Validate LRU pointers, and count LRU entries
-    GrAssert(NULL == fLRUFront || NULL == fLRUFront->fPrev);
-    GrAssert(NULL == fLRUBack  || NULL == fLRUBack->fNext);
+    SkASSERT(NULL == fLRUFront || NULL == fLRUFront->fPrev);
+    SkASSERT(NULL == fLRUBack  || NULL == fLRUBack->fNext);
     for (AtlasRow* r = fLRUFront; r != NULL; r = r->fNext) {
         if (NULL == r->fNext) {
-            GrAssert(r == fLRUBack);
+            SkASSERT(r == fLRUBack);
         } else {
-            GrAssert(r->fNext->fPrev == r);
+            SkASSERT(r->fNext->fPrev == r);
         }
         ++lruCount;
     }
@@ -319,30 +319,30 @@
                     break;
                 }
             }
-            GrAssert(inLRU);
+            SkASSERT(inLRU);
         } else {
             // If we are locked, we should have a key
-            GrAssert(kEmptyAtlasRowKey != fRows[i].fKey);
+            SkASSERT(kEmptyAtlasRowKey != fRows[i].fKey);
         }
 
         // If we have a key != kEmptyAtlasRowKey, it should be in the key table
-        GrAssert(fRows[i].fKey == kEmptyAtlasRowKey || this->searchByKey(fRows[i].fKey) >= 0);
+        SkASSERT(fRows[i].fKey == kEmptyAtlasRowKey || this->searchByKey(fRows[i].fKey) >= 0);
     }
 
     // Our count of locks should equal the sum of row locks, unless we ran out of rows and flushed,
     // in which case we'll have one more lock than recorded in the rows (to represent the pending
     // lock of a row; which ensures we don't unlock the texture prematurely).
-    GrAssert(rowLocks == fLockedRows || rowLocks + 1 == fLockedRows);
+    SkASSERT(rowLocks == fLockedRows || rowLocks + 1 == fLockedRows);
 
     // We should have one lru entry for each free row
-    GrAssert(freeRows == lruCount);
+    SkASSERT(freeRows == lruCount);
 
     // If we have locked rows, we should have a locked texture, otherwise
     // it should be unlocked
     if (fLockedRows == 0) {
-        GrAssert(NULL == fTexture);
+        SkASSERT(NULL == fTexture);
     } else {
-        GrAssert(NULL != fTexture);
+        SkASSERT(NULL != fTexture);
     }
 }
 #endif