Convert GrCrash->SkFAIL GrDebugCrash->SkDEBUGFAIL

R=robertphillips@google.com, reed@google.com, mtklein@google.com

Author: bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14460 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp
index 8eed0cd..e808cd7 100644
--- a/bench/GrResourceCacheBench.cpp
+++ b/bench/GrResourceCacheBench.cpp
@@ -116,11 +116,11 @@
         GrResourceKey key = TextureResource::ComputeKey(desc);
         GrResource* item = cache->find(key);
         if (NULL == item) {
-            GrCrash("cache add does not work as expected");
+            SkFAIL("cache add does not work as expected");
             return;
         }
         if (static_cast<TextureResource*>(item)->fID != k) {
-            GrCrash("cache add does not work as expected");
+            SkFAIL("cache add does not work as expected");
             return;
         }
     }
@@ -130,11 +130,11 @@
         GrResourceKey key = StencilResource::ComputeKey(w, h, s);
         GrResource* item = cache->find(key);
         if (NULL == item) {
-            GrCrash("cache add does not work as expected");
+            SkFAIL("cache add does not work as expected");
             return;
         }
         if (static_cast<TextureResource*>(item)->fID != k) {
-            GrCrash("cache add does not work as expected");
+            SkFAIL("cache add does not work as expected");
             return;
         }
     }
@@ -147,7 +147,7 @@
         GrResourceKey key = TextureResource::ComputeKey(desc);
         GrResource* item = cache->find(key);
         if (NULL != item) {
-            GrCrash("cache add does not work as expected");
+            SkFAIL("cache add does not work as expected");
             return;
         }
     }
@@ -158,7 +158,7 @@
         GrResourceKey key = StencilResource::ComputeKey(w, h, s);
         GrResource* item = cache->find(key);
         if (NULL != item) {
-            GrCrash("cache add does not work as expected");
+            SkFAIL("cache add does not work as expected");
             return;
         }
     }
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 13450cd..8863b07 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -113,6 +113,8 @@
     #define SkAssertResult(cond)        cond
 #endif
 
+#define SkFAIL(message)                 SK_DEBUGBREAK(false && message)
+
 #ifdef SK_DEVELOPER
     #define SkDEVCODE(code)             code
 #else
diff --git a/include/gpu/GrColor.h b/include/gpu/GrColor.h
index b0bce3f..183781a 100644
--- a/include/gpu/GrColor.h
+++ b/include/gpu/GrColor.h
@@ -117,7 +117,7 @@
         case kA_GrColorComponentFlag:
             return 'a';
         default:
-            GrCrash("Invalid color component flag.");
+            SkFAIL("Invalid color component flag.");
             return '\0';
     }
 }
diff --git a/include/gpu/GrConfig.h b/include/gpu/GrConfig.h
index fc464c5..cbdb350 100644
--- a/include/gpu/GrConfig.h
+++ b/include/gpu/GrConfig.h
@@ -178,15 +178,6 @@
 #define GrAlwaysAssert(COND) GR_ALWAYSASSERT(COND)
 
 /**
- * Crash from unrecoverable condition, optionally with a message. The debug variants only
- * crash in a debug build. The message versions print the message regardless of release vs debug.
- */
-inline void GrCrash() { GrAlwaysAssert(false); }
-inline void GrCrash(const char* msg) { GrPrintf(msg); GrAlwaysAssert(false); }
-inline void GrDebugCrash() { SkASSERT(false); }
-inline void GrDebugCrash(const char* msg) { GrPrintf(msg); SkASSERT(false); }
-
-/**
  *  GR_STATIC_ASSERT is a compile time assertion. Depending on the platform
  *  it may print the message in the compiler log. Obviously, the condition must
  *  be evaluatable at compile time.
diff --git a/include/gpu/GrContextFactory.h b/include/gpu/GrContextFactory.h
index 916d5df..f09bad9 100644
--- a/include/gpu/GrContextFactory.h
+++ b/include/gpu/GrContextFactory.h
@@ -84,7 +84,7 @@
             case kDebug_GLContextType:
                 return "debug";
             default:
-                GrCrash("Unknown GL Context type.");
+                SkFAIL("Unknown GL Context type.");
         }
     }
 
diff --git a/include/gpu/GrTypesPriv.h b/include/gpu/GrTypesPriv.h
index f09f95d..dfe4153 100644
--- a/include/gpu/GrTypesPriv.h
+++ b/include/gpu/GrTypesPriv.h
@@ -212,7 +212,7 @@
         case kInverseFillAA_GrEffectEdgeType:
             return kFillAA_GrEffectEdgeType;
         case kHairlineAA_GrEffectEdgeType:
-            GrCrash("Hairline fill isn't invertible.");
+            SkFAIL("Hairline fill isn't invertible.");
     }
     return kFillAA_GrEffectEdgeType; // suppress warning.
 }
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index 53c431b..73d0b01 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -1076,7 +1076,7 @@
                     break;
                 }
                 default:
-                    GrCrash("Unknown XferEffect mode.");
+                    SkFAIL("Unknown XferEffect mode.");
                     break;
             }
         }
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 65766c1..81d70a7 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -145,7 +145,7 @@
                                    const ColorExpr& value) {
     switch (coeff) {
     default:
-        GrCrash("Unexpected xfer coeff.");
+        SkFAIL("Unexpected xfer coeff.");
     case SkXfermode::kZero_Coeff:    /** 0 */
         return ColorExpr(0);
     case SkXfermode::kOne_Coeff:     /** 1 */
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index b485ae1..24fdd0e 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -1115,7 +1115,7 @@
                                             random->nextU()));
         }
         default:
-            GrCrash();
+            SkFAIL("Unexpected value.");
             return NULL;
     }
 }
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 2350e6c..8803f8a 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -369,7 +369,7 @@
             func = "max";
             break;
         default:
-            GrCrash("Unexpected type");
+            SkFAIL("Unexpected type");
             func = ""; // suppress warning
             break;
     }
@@ -410,7 +410,7 @@
             imageIncrement[1] = 1.0f / texture.height();
             break;
         default:
-            GrCrash("Unknown filter direction.");
+            SkFAIL("Unknown filter direction.");
     }
     uman.set2fv(fImageIncrementUni, 1, imageIncrement);
 }
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 2af5bb2..d0f6e0e 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -203,7 +203,7 @@
         case DegenerateTestData::kNonDegenerate:
             break;
         default:
-            GrCrash("Unexpected degenerate test stage.");
+            SkFAIL("Unexpected degenerate test stage.");
     }
 }
 
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp
index d23041f..eebda01 100644
--- a/src/gpu/GrAARectRenderer.cpp
+++ b/src/gpu/GrAARectRenderer.cpp
@@ -327,7 +327,7 @@
             }
             if (useTempData) {
                 if (!fAAFillRectIndexBuffer->updateData(data, kAAFillRectIndexBufferSize)) {
-                    GrCrash("Can't get AA Fill Rect indices into buffer!");
+                    SkFAIL("Can't get AA Fill Rect indices into buffer!");
                 }
                 SkDELETE_ARRAY(data);
             } else {
diff --git a/src/gpu/GrCacheID.cpp b/src/gpu/GrCacheID.cpp
index 87917ac..8d0be0d 100644
--- a/src/gpu/GrCacheID.cpp
+++ b/src/gpu/GrCacheID.cpp
@@ -27,7 +27,7 @@
 
     int32_t domain = sk_atomic_inc(&gNextDomain);
     if (domain >= 1 << (8 * sizeof(Domain))) {
-        GrCrash("Too many Cache Domains");
+        SkFAIL("Too many Cache Domains");
     }
 
     return static_cast<Domain>(domain);
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 12b3360..071b9d3 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -1000,7 +1000,7 @@
                         funcRef = clipBit;
                         break;
                     default:
-                        GrCrash("Unknown stencil func");
+                        SkFAIL("Unknown stencil func");
                 }
             } else {
                 funcMask &= userBits;
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 9cea214..5512f17 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -244,7 +244,7 @@
 #endif
             break;
         default:
-            GrCrash("Unknown Vertex Source Type.");
+            SkFAIL("Unknown Vertex Source Type.");
             break;
     }
 }
@@ -267,7 +267,7 @@
 #endif
             break;
         default:
-            GrCrash("Unknown Index Source Type.");
+            SkFAIL("Unknown Index Source Type.");
             break;
     }
 }
@@ -355,7 +355,7 @@
     int maxValidVertex;
     switch (geoSrc.fVertexSrc) {
         case kNone_GeometrySrcType:
-            GrCrash("Attempting to draw without vertex src.");
+            SkFAIL("Attempting to draw without vertex src.");
         case kReserved_GeometrySrcType: // fallthrough
         case kArray_GeometrySrcType:
             maxValidVertex = geoSrc.fVertexCount;
@@ -365,14 +365,14 @@
             break;
     }
     if (maxVertex > maxValidVertex) {
-        GrCrash("Drawing outside valid vertex range.");
+        SkFAIL("Drawing outside valid vertex range.");
     }
     if (indexCount > 0) {
         int maxIndex = startIndex + indexCount;
         int maxValidIndex;
         switch (geoSrc.fIndexSrc) {
             case kNone_GeometrySrcType:
-                GrCrash("Attempting to draw indexed geom without index src.");
+                SkFAIL("Attempting to draw indexed geom without index src.");
             case kReserved_GeometrySrcType: // fallthrough
             case kArray_GeometrySrcType:
                 maxValidIndex = geoSrc.fIndexCount;
@@ -382,7 +382,7 @@
                 break;
         }
         if (maxIndex > maxValidIndex) {
-            GrCrash("Index reads outside valid index range.");
+            SkFAIL("Index reads outside valid index range.");
         }
     }
 
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 732bad0..46dd9d0 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -744,7 +744,7 @@
             case kBuffer_GeometrySrcType:
                 return static_cast<int>(src.fIndexBuffer->sizeInBytes() / sizeof(uint16_t));
             default:
-                GrCrash("Unexpected Index Source.");
+                SkFAIL("Unexpected Index Source.");
                 return 0;
         }
     }
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index d8f65d5..82da8c2 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -265,7 +265,7 @@
 
     switch (fill) {
         default:
-            GrCrash("Unexpected path fill.");
+            SkFAIL("Unexpected path fill.");
             /* fallthrough */;
         case SkPath::kWinding_FillType:
         case SkPath::kInverseWinding_FillType:
@@ -313,7 +313,7 @@
                 if (!fQuadIndexBuffer->updateData(indices, SIZE)) {
                     fQuadIndexBuffer->unref();
                     fQuadIndexBuffer = NULL;
-                    GrCrash("Can't get indices into buffer!");
+                    SkFAIL("Can't get indices into buffer!");
                 }
                 sk_free(indices);
             }
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index c051f91..dd5b2c8 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -345,7 +345,7 @@
             case kLineStrip_GrPrimitiveType:
                 return kDrawLines_DrawType;
             default:
-                GrCrash("Unexpected primitive type");
+                SkFAIL("Unexpected primitive type");
                 return kDrawTriangles_DrawType;
         }
     }
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index 5b3bc3a..44d0b1a 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -386,7 +386,7 @@
             break;
         }
         default:
-            GrCrash("unknown geom src type");
+            SkFAIL("unknown geom src type");
     }
     draw->fVertexBuffer->ref();
 
@@ -404,7 +404,7 @@
                 break;
             }
             default:
-                GrCrash("unknown geom src type");
+                SkFAIL("unknown geom src type");
         }
         draw->fIndexBuffer->ref();
     } else {
diff --git a/src/gpu/GrPaint.cpp b/src/gpu/GrPaint.cpp
index 7499cd0..35912a9 100644
--- a/src/gpu/GrPaint.cpp
+++ b/src/gpu/GrPaint.cpp
@@ -104,7 +104,7 @@
                 case kDA_GrBlendCoeff:
                 case kIDA_GrBlendCoeff:
                 default:
-                    GrCrash("srcCoeff should not refer to src or dst.");
+                    SkFAIL("srcCoeff should not refer to src or dst.");
                     break;
 
                 // TODO: update this once GrPaint actually has a const color.
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index 938f016..ba8b962 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -18,7 +18,7 @@
 
     int32_t type = sk_atomic_inc(&gNextType);
     if (type >= (1 << 8 * sizeof(ResourceType))) {
-        GrCrash("Too many Resource Types");
+        SkFAIL("Too many Resource Types");
     }
 
     return static_cast<ResourceType>(type);
diff --git a/src/gpu/GrStencil.cpp b/src/gpu/GrStencil.cpp
index 7677260..f37aa31 100644
--- a/src/gpu/GrStencil.cpp
+++ b/src/gpu/GrStencil.cpp
@@ -389,7 +389,7 @@
             }
             break;
         default:
-            GrCrash("Unknown set op");
+            SkFAIL("Unknown set op");
     }
     return false;
 }
diff --git a/src/gpu/GrTextureAccess.cpp b/src/gpu/GrTextureAccess.cpp
index e4b0786..91db08b 100644
--- a/src/gpu/GrTextureAccess.cpp
+++ b/src/gpu/GrTextureAccess.cpp
@@ -100,7 +100,7 @@
                 fSwizzleMask |= kA_GrColorComponentFlag;
                 break;
             default:
-                GrCrash("Unexpected swizzle string character.");
+                SkFAIL("Unexpected swizzle string character.");
                 break;
         }
     }
diff --git a/src/gpu/SkGrFontScaler.cpp b/src/gpu/SkGrFontScaler.cpp
index c0be4ff..4485690 100644
--- a/src/gpu/SkGrFontScaler.cpp
+++ b/src/gpu/SkGrFontScaler.cpp
@@ -185,7 +185,7 @@
                 break;
             }
             default:
-                GrCrash("Invalid GrMaskFormat");
+                SkFAIL("Invalid GrMaskFormat");
         }
     } else if (srcRB == dstRB) {
         memcpy(dst, src, dstRB * height);
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index 78633e5..862c1d2 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -109,7 +109,7 @@
             break;
         }
         default:
-            GrCrash("Shouldn't get here");
+            SkFAIL("Shouldn't get here");
     }
 
     builder->fsCodeAppendf("\t%s = %s;\n", outputColor,
@@ -244,7 +244,7 @@
             break;
         }
         default:
-            GrCrash("Shouldn't get here");
+            SkFAIL("Shouldn't get here");
     }
 
     builder->fsCodeAppendf("\t%s = %s;\n", outputColor,
@@ -395,7 +395,7 @@
             break;
         }
         default:
-            GrCrash("Shouldn't get here");
+            SkFAIL("Shouldn't get here");
     }
 
     builder->fsCodeAppendf("\t%s = %s;\n", outputColor,
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 9b342fb..f33ad23 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -61,7 +61,7 @@
                         outputColor, outputColor, outputColor, swiz, outputColor, outputColor);
                     break;
                 default:
-                    GrCrash("Unknown conversion op.");
+                    SkFAIL("Unknown conversion op.");
                     break;
             }
         }
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 57cdece..aad7c87 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -118,7 +118,7 @@
             imageIncrement[1] = ySign / texture.height();
             break;
         default:
-            GrCrash("Unknown filter direction.");
+            SkFAIL("Unknown filter direction.");
     }
     uman.set2fv(fImageIncrementUni, 1, imageIncrement);
     if (conv.useBounds()) {
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index 40870e2..f2ee278 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -342,7 +342,7 @@
             builder->fsCodeAppend("\t\tfloat alpha = approx_dist > 0.0 ? 1.0 : 0.0;\n");
             break;
         case kHairlineAA_GrEffectEdgeType:
-            GrCrash("Hairline not expected here.");
+            SkFAIL("Hairline not expected here.");
     }
 
     builder->fsCodeAppendf("\t\t%s = %s;\n", outputColor,
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index bc79057..11d8a18 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -369,7 +369,7 @@
                 rect.fBottom -= radius;
                 break;
             default:
-                GrCrash("Should have been one of the above cases.");
+                SkFAIL("Should have been one of the above cases.");
         }
         uman.set4f(fInnerRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
         uman.set1f(fRadiusPlusHalfUniform, radius + 0.5f);
@@ -566,7 +566,7 @@
             break;
         }
         default:
-            GrCrash("RRect should always be simple or nine-patch.");
+            SkFAIL("RRect should always be simple or nine-patch.");
     }
     // implicit is the evaluation of (x/a)^2 + (y/b)^2 - 1.
     builder->fsCodeAppend("\t\tfloat implicit = dot(Z, dxy) - 1.0;\n");
@@ -623,7 +623,7 @@
                 break;
             }
         default:
-            GrCrash("RRect should always be simple or nine-patch.");
+            SkFAIL("RRect should always be simple or nine-patch.");
         }
         uman.set4f(fInnerRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
         fPrevRRect = rrect;
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 501411c..890b816 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -579,7 +579,7 @@
             return;
         }
     }
-    GrCrash("Why are we seeing a stencil format that "
+    SkFAIL("Why are we seeing a stencil format that "
             "GrGLCaps doesn't know about.");
 }
 
@@ -600,7 +600,7 @@
             return fStencilVerifiedColorConfigs[i].isVerified(config);
         }
     }
-    GrCrash("Why are we seeing a stencil format that "
+    SkFAIL("Why are we seeing a stencil format that "
             "GLCaps doesn't know about.");
     return false;
 }
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp
index 18a9d72..2ef7659 100644
--- a/src/gpu/gl/GrGLCreateNullInterface.cpp
+++ b/src/gpu/gl/GrGLCreateNullInterface.cpp
@@ -125,7 +125,7 @@
         id = gCurrElementArrayBuffer;
         break;
     default:
-        GrCrash("Unexpected target to nullGLBufferData");
+        SkFAIL("Unexpected target to nullGLBufferData");
         break;
     }
 
@@ -251,7 +251,7 @@
             }
             break; }
         default:
-            GrCrash("Unexpected pname to GetBufferParamateriv");
+            SkFAIL("Unexpected pname to GetBufferParamateriv");
             break;
     }
 };
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp
index 7efa067..5bf0efb 100644
--- a/src/gpu/gl/GrGLInterface.cpp
+++ b/src/gpu/gl/GrGLInterface.cpp
@@ -117,7 +117,7 @@
 }
 
 #define RETURN_FALSE_INTERFACE                             \
-    GrDebugCrash("GrGLInterface::validate() failed.");     \
+    SkDEBUGFAIL("GrGLInterface::validate() failed.");      \
     return false;                                          \
 
 bool GrGLInterface::validate() const {
diff --git a/src/gpu/gl/GrGLNoOpInterface.cpp b/src/gpu/gl/GrGLNoOpInterface.cpp
index 2b84b28..a433c0e 100644
--- a/src/gpu/gl/GrGLNoOpInterface.cpp
+++ b/src/gpu/gl/GrGLNoOpInterface.cpp
@@ -500,7 +500,7 @@
             *params = SK_ARRAY_COUNT(kExtensions);
             break;
         default:
-            GrCrash("Unexpected pname to GetIntegerv");
+            SkFAIL("Unexpected pname to GetIntegerv");
    }
 }
 
@@ -529,7 +529,7 @@
             break;
         // we don't expect any other pnames
         default:
-            GrCrash("Unexpected pname to GetProgramiv");
+            SkFAIL("Unexpected pname to GetProgramiv");
             break;
    }
 }
@@ -545,7 +545,7 @@
             *params = 0;
             break;
         default:
-            GrCrash("Unexpected pname passed to GetQueryObject.");
+            SkFAIL("Unexpected pname passed to GetQueryObject.");
             break;
    }
 }
@@ -562,7 +562,7 @@
             *params = 32;
             break;
         default:
-            GrCrash("Unexpected pname passed GetQueryiv.");
+            SkFAIL("Unexpected pname passed GetQueryiv.");
    }
 }
 
@@ -603,7 +603,7 @@
         case GR_GL_RENDERER:
             return (const GrGLubyte*)"The Debug (Non-)Renderer";
         default:
-            GrCrash("Unexpected name passed to GetString");
+            SkFAIL("Unexpected name passed to GetString");
             return NULL;
    }
 }
@@ -617,7 +617,7 @@
                 return NULL;
             }
         default:
-            GrCrash("Unexpected name passed to GetStringi");
+            SkFAIL("Unexpected name passed to GetStringi");
             return NULL;
     }
 }
@@ -628,7 +628,7 @@
                                                           GrGLint* params) {
     // we used to use this to query stuff about externally created textures,
     // now we just require clients to tell us everything about the texture.
-    GrCrash("Should never query texture parameters.");
+    SkFAIL("Should never query texture parameters.");
 }
 
 GrGLint GR_GL_FUNCTION_TYPE noOpGLGetUniformLocation(GrGLuint program, const char* name) {
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 9b997c8..aa46aed 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -89,7 +89,7 @@
             SkASSERT(kOne_GrBlendCoeff == *srcCoeff && kZero_GrBlendCoeff == *dstCoeff);
             break;
         default:
-            GrCrash("Unexpected coverage output");
+            SkFAIL("Unexpected coverage output");
             break;
     }
 }
@@ -270,7 +270,7 @@
                 sharedState->fConstAttribColorIndex = -1;
                 break;
             default:
-                GrCrash("Unknown color type.");
+                SkFAIL("Unknown color type.");
         }
     } else {
         sharedState->fConstAttribColorIndex = -1;
@@ -309,7 +309,7 @@
                 sharedState->fConstAttribCoverageIndex = -1;
                 break;
             default:
-                GrCrash("Unknown coverage type.");
+                SkFAIL("Unknown coverage type.");
         }
     } else {
         sharedState->fConstAttribCoverageIndex = -1;
diff --git a/src/gpu/gl/GrGLProgramEffects.cpp b/src/gpu/gl/GrGLProgramEffects.cpp
index 1695a8e..04cebf8 100644
--- a/src/gpu/gl/GrGLProgramEffects.cpp
+++ b/src/gpu/gl/GrGLProgramEffects.cpp
@@ -341,7 +341,7 @@
                 varyingType = kVec3f_GrSLType;
                 break;
             default:
-                GrCrash("Unexpected key.");
+                SkFAIL("Unexpected key.");
         }
         SkString suffixedUniName;
         if (kVoid_GrSLType != transforms[t].fType) {
@@ -393,7 +393,7 @@
                 break;
             }
             default:
-                GrCrash("Unexpected uniform type.");
+                SkFAIL("Unexpected uniform type.");
         }
         SkNEW_APPEND_TO_TARRAY(outCoords, TransformedCoords,
                                (SkString(fsVaryingName), varyingType));
@@ -446,7 +446,7 @@
                 break;
             }
             default:
-                GrCrash("Unexpected uniform type.");
+                SkFAIL("Unexpected uniform type.");
         }
     }
 }
@@ -572,7 +572,7 @@
                 break;
             }
             default:
-                GrCrash("Unexpected matrixs type.");
+                SkFAIL("Unexpected matrixs type.");
         }
     }
 }
diff --git a/src/gpu/gl/GrGLSL.cpp b/src/gpu/gl/GrGLSL.cpp
index 7587fe8..468b13b 100644
--- a/src/gpu/gl/GrGLSL.cpp
+++ b/src/gpu/gl/GrGLSL.cpp
@@ -34,7 +34,7 @@
             *generation = k110_GrGLSLGeneration;
             return true;
         default:
-            GrCrash("Unknown GL Standard");
+            SkFAIL("Unknown GL Standard");
             return false;
     }
 }
@@ -64,7 +64,7 @@
                 return "#version 150 compatibility\n";
             }
         default:
-            GrCrash("Unknown GL version.");
+            SkFAIL("Unknown GL version.");
             return ""; // suppress warning
     }
 }
diff --git a/src/gpu/gl/GrGLSL.h b/src/gpu/gl/GrGLSL.h
index 8234be9..ff39c2b 100644
--- a/src/gpu/gl/GrGLSL.h
+++ b/src/gpu/gl/GrGLSL.h
@@ -70,7 +70,7 @@
         case kSampler2D_GrSLType:
             return "sampler2D";
         default:
-            GrCrash("Unknown shader var type.");
+            SkFAIL("Unknown shader var type.");
             return ""; // suppress warning
     }
 }
diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp
index b72e23f..c5df4c8 100644
--- a/src/gpu/gl/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/GrGLShaderBuilder.cpp
@@ -187,7 +187,7 @@
             }
             return true;
         default:
-            GrCrash("Unexpected GLSLFeature requested.");
+            SkFAIL("Unexpected GLSLFeature requested.");
             return false;
     }
 }
@@ -218,7 +218,7 @@
                                "GL_NV_shader_framebuffer_fetch");
             return true;
         default:
-            GrCrash("Unexpected GLSLPrivateFeature requested.");
+            SkFAIL("Unexpected GLSLPrivateFeature requested.");
             return false;
     }
 }
@@ -249,7 +249,7 @@
     if (fCodeStage.inStageCode()) {
         const GrEffectRef& effect = *fCodeStage.effectStage()->getEffect();
         if (!effect->willReadDstColor()) {
-            GrDebugCrash("GrGLEffect asked for dst color but its generating GrEffect "
+            SkDEBUGFAIL("GrGLEffect asked for dst color but its generating GrEffect "
                          "did not request access.");
             return "";
         }
@@ -399,7 +399,7 @@
     if (fCodeStage.inStageCode()) {
         const GrEffectRef& effect = *fCodeStage.effectStage()->getEffect();
         if (!effect->willReadFragmentPosition()) {
-            GrDebugCrash("GrGLEffect asked for frag position but its generating GrEffect "
+            SkDEBUGFAIL("GrGLEffect asked for frag position but its generating GrEffect "
                          "did not request access.");
             return "";
         }
@@ -483,9 +483,9 @@
                 str->append("precision lowp float;\n");
                 break;
             case GrGLShaderVar::kDefault_Precision:
-                GrCrash("Default precision now allowed.");
+                SkFAIL("Default precision now allowed.");
             default:
-                GrCrash("Unknown precision value.");
+                SkFAIL("Unknown precision value.");
         }
     }
 }
diff --git a/src/gpu/gl/GrGLShaderVar.h b/src/gpu/gl/GrGLShaderVar.h
index 7862abd..68c4bbd 100644
--- a/src/gpu/gl/GrGLShaderVar.h
+++ b/src/gpu/gl/GrGLShaderVar.h
@@ -315,7 +315,7 @@
                 case kDefault_Precision:
                     return "";
                 default:
-                    GrCrash("Unexpected precision type.");
+                    SkFAIL("Unexpected precision type.");
             }
         }
         return "";
@@ -341,7 +341,7 @@
             case kVaryingOut_TypeModifier:
                 return k110_GrGLSLGeneration == gen ? "varying" : "out";
             default:
-                GrCrash("Unknown shader variable type modifier.");
+                SkFAIL("Unknown shader variable type modifier.");
                 return ""; // suppress warning
         }
     }
diff --git a/src/gpu/gl/GrGLVertexEffect.h b/src/gpu/gl/GrGLVertexEffect.h
index 1b4c744..40b4b34 100644
--- a/src/gpu/gl/GrGLVertexEffect.h
+++ b/src/gpu/gl/GrGLVertexEffect.h
@@ -42,7 +42,7 @@
                           const char* inputColor,
                           const TransformedCoordsArray& coords,
                           const TextureSamplerArray& samplers) SK_OVERRIDE {
-        GrCrash("GrGLVertexEffect requires GrGLFullShaderBuilder* overload for emitCode().");
+        SkFAIL("GrGLVertexEffect requires GrGLFullShaderBuilder* overload for emitCode().");
     }
 
 private:
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 4b39a16..9b92fe2 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -730,7 +730,7 @@
                                                                 width, height));
             break;
         case GrGLCaps::kNone_MSFBOType:
-            GrCrash("Shouldn't be here if we don't support multisampled renderbuffers.");
+            SkFAIL("Shouldn't be here if we don't support multisampled renderbuffers.");
             break;
     }
     return (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface()));;
@@ -1303,7 +1303,7 @@
     }
     switch (this->glCaps().invalidateFBType()) {
         case GrGLCaps::kNone_FBFetchType:
-            GrCrash("Should never get here.");
+            SkFAIL("Should never get here.");
             break;
         case GrGLCaps::kInvalidate_InvalidateFBType:
             if (0 == glRT->renderFBOID()) {
@@ -1463,7 +1463,7 @@
                                     tgt->textureFBOID()));
             break;
         default:
-            GrCrash("Unknown resolve type");
+            SkFAIL("Unknown resolve type");
     }
 
     const GrGLIRect& glvp = tgt->getViewport();
@@ -1656,7 +1656,7 @@
 static GrGLenum gr_stencil_op_to_gl_path_rendering_fill_mode(GrStencilOp op) {
     switch (op) {
         default:
-            GrCrash("Unexpected path fill.");
+            SkFAIL("Unexpected path fill.");
             /* fallthrough */;
         case kIncClamp_StencilOp:
             return GR_GL_COUNT_UP;
@@ -2357,7 +2357,7 @@
                 GL_CALL(Disable(GR_GL_CULL_FACE));
                 break;
             default:
-                GrCrash("Unknown draw face.");
+                SkFAIL("Unknown draw face.");
         }
         fHWDrawFace = drawState.getDrawFace();
     }
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 0a7bb0e..b9b0984 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -309,7 +309,7 @@
             break;
         default:
             vbuf = NULL; // suppress warning
-            GrCrash("Unknown geometry src type!");
+            SkFAIL("Unknown geometry src type!");
     }
 
     SkASSERT(NULL != vbuf);
@@ -333,7 +333,7 @@
             break;
         default:
             ibuf = NULL; // suppress warning
-            GrCrash("Unknown geometry src type!");
+            SkFAIL("Unknown geometry src type!");
         }
 
         SkASSERT(NULL != ibuf);
diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
index 0a8333b..087bd47 100644
--- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
+++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
@@ -93,7 +93,7 @@
             buffer = GrDebugGL::getInstance()->getElementArrayBuffer();
             break;
         default:
-            GrCrash("Unexpected target to glBufferData");
+            SkFAIL("Unexpected target to glBufferData");
             break;
     }
 
@@ -586,7 +586,7 @@
             GrDebugGL::getInstance()->setElementArrayBuffer(buffer);
             break;
         default:
-            GrCrash("Unexpected target to glBindBuffer");
+            SkFAIL("Unexpected target to glBindBuffer");
             break;
     }
 }
@@ -638,7 +638,7 @@
             buffer = GrDebugGL::getInstance()->getElementArrayBuffer();
             break;
         default:
-            GrCrash("Unexpected target to glMapBuffer");
+            SkFAIL("Unexpected target to glMapBuffer");
             break;
     }
 
@@ -668,7 +668,7 @@
             buffer = GrDebugGL::getInstance()->getElementArrayBuffer();
             break;
         default:
-            GrCrash("Unexpected target to glUnmapBuffer");
+            SkFAIL("Unexpected target to glUnmapBuffer");
             break;
     }
 
@@ -720,7 +720,7 @@
                 *params = buffer->getUsage();
             break;
         default:
-            GrCrash("Unexpected value to glGetBufferParamateriv");
+            SkFAIL("Unexpected value to glGetBufferParamateriv");
             break;
     }
 };