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
This commit is contained in:
commit-bot@chromium.org 2014-04-30 14:17:00 +00:00
parent d3571ed359
commit 88cb22b6b4
43 changed files with 89 additions and 96 deletions

View File

@ -116,11 +116,11 @@ static void check_cache_contents_or_die(GrResourceCache* cache, int k) {
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 @@ static void check_cache_contents_or_die(GrResourceCache* cache, int k) {
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 @@ static void check_cache_contents_or_die(GrResourceCache* cache, int k) {
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 @@ static void check_cache_contents_or_die(GrResourceCache* cache, int k) {
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;
}
}

View File

@ -113,6 +113,8 @@ inline void operator delete(void* p) {
#define SkAssertResult(cond) cond
#endif
#define SkFAIL(message) SK_DEBUGBREAK(false && message)
#ifdef SK_DEVELOPER
#define SkDEVCODE(code) code
#else

View File

@ -117,7 +117,7 @@ static inline char GrColorComponentFlagToChar(GrColorComponentFlags component) {
case kA_GrColorComponentFlag:
return 'a';
default:
GrCrash("Invalid color component flag.");
SkFAIL("Invalid color component flag.");
return '\0';
}
}

View File

@ -177,15 +177,6 @@ typedef unsigned __int64 uint64_t;
*/
#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

View File

@ -84,7 +84,7 @@ public:
case kDebug_GLContextType:
return "debug";
default:
GrCrash("Unknown GL Context type.");
SkFAIL("Unknown GL Context type.");
}
}

View File

@ -212,7 +212,7 @@ static inline GrEffectEdgeType GrInvertEffectEdgeType(const GrEffectEdgeType edg
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.
}

View File

@ -1076,7 +1076,7 @@ public:
break;
}
default:
GrCrash("Unknown XferEffect mode.");
SkFAIL("Unknown XferEffect mode.");
break;
}
}

View File

@ -145,7 +145,7 @@ static inline ColorExpr blend_term(SkXfermode::Coeff coeff,
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 */

View File

@ -1115,7 +1115,7 @@ SkLight* create_random_light(SkRandom* random) {
random->nextU()));
}
default:
GrCrash();
SkFAIL("Unexpected value.");
return NULL;
}
}

View File

@ -369,7 +369,7 @@ void GrGLMorphologyEffect::emitCode(GrGLShaderBuilder* builder,
func = "max";
break;
default:
GrCrash("Unexpected type");
SkFAIL("Unexpected type");
func = ""; // suppress warning
break;
}
@ -410,7 +410,7 @@ void GrGLMorphologyEffect::setData(const GrGLUniformManager& uman,
imageIncrement[1] = 1.0f / texture.height();
break;
default:
GrCrash("Unknown filter direction.");
SkFAIL("Unknown filter direction.");
}
uman.set2fv(fImageIncrementUni, 1, imageIncrement);
}

View File

@ -203,7 +203,7 @@ static void update_degenerate_test(DegenerateTestData* data, const SkPoint& pt)
case DegenerateTestData::kNonDegenerate:
break;
default:
GrCrash("Unexpected degenerate test stage.");
SkFAIL("Unexpected degenerate test stage.");
}
}

View File

@ -327,7 +327,7 @@ GrIndexBuffer* GrAARectRenderer::aaFillRectIndexBuffer(GrGpu* gpu) {
}
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 {

View File

@ -27,7 +27,7 @@ GrCacheID::Domain GrCacheID::GenerateDomain() {
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);

View File

@ -1000,7 +1000,7 @@ void GrClipMaskManager::adjustStencilParams(GrStencilSettings* settings,
funcRef = clipBit;
break;
default:
GrCrash("Unknown stencil func");
SkFAIL("Unknown stencil func");
}
} else {
funcMask &= userBits;

View File

@ -244,7 +244,7 @@ void GrDrawTarget::releasePreviousVertexSource() {
#endif
break;
default:
GrCrash("Unknown Vertex Source Type.");
SkFAIL("Unknown Vertex Source Type.");
break;
}
}
@ -267,7 +267,7 @@ void GrDrawTarget::releasePreviousIndexSource() {
#endif
break;
default:
GrCrash("Unknown Index Source Type.");
SkFAIL("Unknown Index Source Type.");
break;
}
}
@ -355,7 +355,7 @@ bool GrDrawTarget::checkDraw(GrPrimitiveType type, int startVertex,
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 @@ bool GrDrawTarget::checkDraw(GrPrimitiveType type, int startVertex,
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 @@ bool GrDrawTarget::checkDraw(GrPrimitiveType type, int startVertex,
break;
}
if (maxIndex > maxValidIndex) {
GrCrash("Index reads outside valid index range.");
SkFAIL("Index reads outside valid index range.");
}
}

View File

@ -744,7 +744,7 @@ protected:
case kBuffer_GeometrySrcType:
return static_cast<int>(src.fIndexBuffer->sizeInBytes() / sizeof(uint16_t));
default:
GrCrash("Unexpected Index Source.");
SkFAIL("Unexpected Index Source.");
return 0;
}
}

View File

@ -265,7 +265,7 @@ void GrGpu::getPathStencilSettingsForFillType(SkPath::FillType fill, GrStencilSe
switch (fill) {
default:
GrCrash("Unexpected path fill.");
SkFAIL("Unexpected path fill.");
/* fallthrough */;
case SkPath::kWinding_FillType:
case SkPath::kInverseWinding_FillType:
@ -313,7 +313,7 @@ const GrIndexBuffer* GrGpu::getQuadIndexBuffer() const {
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);
}

View File

@ -345,7 +345,7 @@ protected:
case kLineStrip_GrPrimitiveType:
return kDrawLines_DrawType;
default:
GrCrash("Unexpected primitive type");
SkFAIL("Unexpected primitive type");
return kDrawTriangles_DrawType;
}
}

View File

@ -386,7 +386,7 @@ void GrInOrderDrawBuffer::onDraw(const DrawInfo& info) {
break;
}
default:
GrCrash("unknown geom src type");
SkFAIL("unknown geom src type");
}
draw->fVertexBuffer->ref();
@ -404,7 +404,7 @@ void GrInOrderDrawBuffer::onDraw(const DrawInfo& info) {
break;
}
default:
GrCrash("unknown geom src type");
SkFAIL("unknown geom src type");
}
draw->fIndexBuffer->ref();
} else {

View File

@ -104,7 +104,7 @@ bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor,
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.

View File

@ -18,7 +18,7 @@ GrResourceKey::ResourceType GrResourceKey::GenerateResourceType() {
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);

View File

@ -389,7 +389,7 @@ bool GrStencilSettings::GetClipPasses(
}
break;
default:
GrCrash("Unknown set op");
SkFAIL("Unknown set op");
}
return false;
}

View File

@ -100,7 +100,7 @@ void GrTextureAccess::setSwizzle(const char* swizzle) {
fSwizzleMask |= kA_GrColorComponentFlag;
break;
default:
GrCrash("Unexpected swizzle string character.");
SkFAIL("Unexpected swizzle string character.");
break;
}
}

View File

@ -185,7 +185,7 @@ bool SkGrFontScaler::getPackedGlyphImage(GrGlyph::PackedID packed,
break;
}
default:
GrCrash("Invalid GrMaskFormat");
SkFAIL("Invalid GrMaskFormat");
}
} else if (srcRB == dstRB) {
memcpy(dst, src, dstRB * height);

View File

@ -109,7 +109,7 @@ void GrGLConicEffect::emitCode(GrGLFullShaderBuilder* builder,
break;
}
default:
GrCrash("Shouldn't get here");
SkFAIL("Shouldn't get here");
}
builder->fsCodeAppendf("\t%s = %s;\n", outputColor,
@ -244,7 +244,7 @@ void GrGLQuadEffect::emitCode(GrGLFullShaderBuilder* builder,
break;
}
default:
GrCrash("Shouldn't get here");
SkFAIL("Shouldn't get here");
}
builder->fsCodeAppendf("\t%s = %s;\n", outputColor,
@ -395,7 +395,7 @@ void GrGLCubicEffect::emitCode(GrGLFullShaderBuilder* builder,
break;
}
default:
GrCrash("Shouldn't get here");
SkFAIL("Shouldn't get here");
}
builder->fsCodeAppendf("\t%s = %s;\n", outputColor,

View File

@ -61,7 +61,7 @@ public:
outputColor, outputColor, outputColor, swiz, outputColor, outputColor);
break;
default:
GrCrash("Unknown conversion op.");
SkFAIL("Unknown conversion op.");
break;
}
}

View File

@ -118,7 +118,7 @@ void GrGLConvolutionEffect::setData(const GrGLUniformManager& uman,
imageIncrement[1] = ySign / texture.height();
break;
default:
GrCrash("Unknown filter direction.");
SkFAIL("Unknown filter direction.");
}
uman.set2fv(fImageIncrementUni, 1, imageIncrement);
if (conv.useBounds()) {

View File

@ -342,7 +342,7 @@ void GLEllipseEffect::emitCode(GrGLShaderBuilder* builder,
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,

View File

@ -369,7 +369,7 @@ void GLCircularRRectEffect::setData(const GrGLUniformManager& uman,
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 @@ void GLEllipticalRRectEffect::emitCode(GrGLShaderBuilder* builder,
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 @@ void GLEllipticalRRectEffect::setData(const GrGLUniformManager& uman,
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;

View File

@ -579,7 +579,7 @@ void GrGLCaps::markColorConfigAndStencilFormatAsVerified(
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 @@ bool GrGLCaps::isColorConfigAndStencilFormatVerified(
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;
}

View File

@ -125,7 +125,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLBufferData(GrGLenum target,
id = gCurrElementArrayBuffer;
break;
default:
GrCrash("Unexpected target to nullGLBufferData");
SkFAIL("Unexpected target to nullGLBufferData");
break;
}
@ -251,7 +251,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLGetBufferParameteriv(GrGLenum target, GrGLenu
}
break; }
default:
GrCrash("Unexpected pname to GetBufferParamateriv");
SkFAIL("Unexpected pname to GetBufferParamateriv");
break;
}
};

View File

@ -117,7 +117,7 @@ GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) {
}
#define RETURN_FALSE_INTERFACE \
GrDebugCrash("GrGLInterface::validate() failed."); \
SkDEBUGFAIL("GrGLInterface::validate() failed."); \
return false; \
bool GrGLInterface::validate() const {

View File

@ -500,7 +500,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetIntegerv(GrGLenum pname, GrGLint* params)
*params = SK_ARRAY_COUNT(kExtensions);
break;
default:
GrCrash("Unexpected pname to GetIntegerv");
SkFAIL("Unexpected pname to GetIntegerv");
}
}
@ -529,7 +529,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetShaderOrProgramiv(GrGLuint program,
break;
// we don't expect any other pnames
default:
GrCrash("Unexpected pname to GetProgramiv");
SkFAIL("Unexpected pname to GetProgramiv");
break;
}
}
@ -545,7 +545,7 @@ void query_result(GrGLenum GLtarget, GrGLenum pname, T *params) {
*params = 0;
break;
default:
GrCrash("Unexpected pname passed to GetQueryObject.");
SkFAIL("Unexpected pname passed to GetQueryObject.");
break;
}
}
@ -562,7 +562,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryiv(GrGLenum GLtarget,
*params = 32;
break;
default:
GrCrash("Unexpected pname passed GetQueryiv.");
SkFAIL("Unexpected pname passed GetQueryiv.");
}
}
@ -603,7 +603,7 @@ const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetString(GrGLenum name) {
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 @@ const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetStringi(GrGLenum name, GrGLuint i)
return NULL;
}
default:
GrCrash("Unexpected name passed to GetStringi");
SkFAIL("Unexpected name passed to GetStringi");
return NULL;
}
}
@ -628,7 +628,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetTexLevelParameteriv(GrGLenum target,
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) {

View File

@ -89,7 +89,7 @@ void GrGLProgram::overrideBlend(GrBlendCoeff* srcCoeff,
SkASSERT(kOne_GrBlendCoeff == *srcCoeff && kZero_GrBlendCoeff == *dstCoeff);
break;
default:
GrCrash("Unexpected coverage output");
SkFAIL("Unexpected coverage output");
break;
}
}
@ -270,7 +270,7 @@ void GrGLProgram::setColor(const GrDrawState& drawState,
sharedState->fConstAttribColorIndex = -1;
break;
default:
GrCrash("Unknown color type.");
SkFAIL("Unknown color type.");
}
} else {
sharedState->fConstAttribColorIndex = -1;
@ -309,7 +309,7 @@ void GrGLProgram::setCoverage(const GrDrawState& drawState,
sharedState->fConstAttribCoverageIndex = -1;
break;
default:
GrCrash("Unknown coverage type.");
SkFAIL("Unknown coverage type.");
}
} else {
sharedState->fConstAttribCoverageIndex = -1;

View File

@ -341,7 +341,7 @@ void GrGLVertexProgramEffects::emitTransforms(GrGLFullShaderBuilder* builder,
varyingType = kVec3f_GrSLType;
break;
default:
GrCrash("Unexpected key.");
SkFAIL("Unexpected key.");
}
SkString suffixedUniName;
if (kVoid_GrSLType != transforms[t].fType) {
@ -393,7 +393,7 @@ void GrGLVertexProgramEffects::emitTransforms(GrGLFullShaderBuilder* builder,
break;
}
default:
GrCrash("Unexpected uniform type.");
SkFAIL("Unexpected uniform type.");
}
SkNEW_APPEND_TO_TARRAY(outCoords, TransformedCoords,
(SkString(fsVaryingName), varyingType));
@ -446,7 +446,7 @@ void GrGLVertexProgramEffects::setTransformData(const GrGLUniformManager& unifor
break;
}
default:
GrCrash("Unexpected uniform type.");
SkFAIL("Unexpected uniform type.");
}
}
}
@ -572,7 +572,7 @@ void GrGLPathTexGenProgramEffects::setPathTexGenState(GrGpuGL* gpu,
break;
}
default:
GrCrash("Unexpected matrixs type.");
SkFAIL("Unexpected matrixs type.");
}
}
}

View File

@ -34,7 +34,7 @@ bool GrGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation)
*generation = k110_GrGLSLGeneration;
return true;
default:
GrCrash("Unknown GL Standard");
SkFAIL("Unknown GL Standard");
return false;
}
}
@ -64,7 +64,7 @@ const char* GrGetGLSLVersionDecl(const GrGLContextInfo& info) {
return "#version 150 compatibility\n";
}
default:
GrCrash("Unknown GL version.");
SkFAIL("Unknown GL version.");
return ""; // suppress warning
}
}

View File

@ -70,7 +70,7 @@ static inline const char* GrGLSLTypeString(GrSLType t) {
case kSampler2D_GrSLType:
return "sampler2D";
default:
GrCrash("Unknown shader var type.");
SkFAIL("Unknown shader var type.");
return ""; // suppress warning
}
}

View File

@ -187,7 +187,7 @@ bool GrGLShaderBuilder::enableFeature(GLSLFeature feature) {
}
return true;
default:
GrCrash("Unexpected GLSLFeature requested.");
SkFAIL("Unexpected GLSLFeature requested.");
return false;
}
}
@ -218,7 +218,7 @@ bool GrGLShaderBuilder::enablePrivateFeature(GLSLPrivateFeature feature) {
"GL_NV_shader_framebuffer_fetch");
return true;
default:
GrCrash("Unexpected GLSLPrivateFeature requested.");
SkFAIL("Unexpected GLSLPrivateFeature requested.");
return false;
}
}
@ -249,7 +249,7 @@ const char* GrGLShaderBuilder::dstColor() {
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 @@ const char* GrGLShaderBuilder::fragmentPosition() {
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 @@ inline void append_default_precision_qualifier(GrGLShaderVar::Precision p,
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.");
}
}
}

View File

@ -315,7 +315,7 @@ public:
case kDefault_Precision:
return "";
default:
GrCrash("Unexpected precision type.");
SkFAIL("Unexpected precision type.");
}
}
return "";
@ -341,7 +341,7 @@ private:
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
}
}

View File

@ -42,7 +42,7 @@ public:
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:

View File

@ -730,7 +730,7 @@ static bool renderbuffer_storage_msaa(GrGLContext& ctx,
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 @@ void GrGpuGL::discard(GrRenderTarget* renderTarget) {
}
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 @@ bool GrGpuGL::onReadPixels(GrRenderTarget* target,
tgt->textureFBOID()));
break;
default:
GrCrash("Unknown resolve type");
SkFAIL("Unknown resolve type");
}
const GrGLIRect& glvp = tgt->getViewport();
@ -1656,7 +1656,7 @@ void GrGpuGL::onGpuDraw(const DrawInfo& info) {
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 @@ void GrGpuGL::flushMiscFixedFunctionState() {
GL_CALL(Disable(GR_GL_CULL_FACE));
break;
default:
GrCrash("Unknown draw face.");
SkFAIL("Unknown draw face.");
}
fHWDrawFace = drawState.getDrawFace();
}

View File

@ -309,7 +309,7 @@ void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) {
break;
default:
vbuf = NULL; // suppress warning
GrCrash("Unknown geometry src type!");
SkFAIL("Unknown geometry src type!");
}
SkASSERT(NULL != vbuf);
@ -333,7 +333,7 @@ void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) {
break;
default:
ibuf = NULL; // suppress warning
GrCrash("Unknown geometry src type!");
SkFAIL("Unknown geometry src type!");
}
SkASSERT(NULL != ibuf);

View File

@ -93,7 +93,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLBufferData(GrGLenum target,
buffer = GrDebugGL::getInstance()->getElementArrayBuffer();
break;
default:
GrCrash("Unexpected target to glBufferData");
SkFAIL("Unexpected target to glBufferData");
break;
}
@ -586,7 +586,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindBuffer(GrGLenum target, GrGLuint bufferI
GrDebugGL::getInstance()->setElementArrayBuffer(buffer);
break;
default:
GrCrash("Unexpected target to glBindBuffer");
SkFAIL("Unexpected target to glBindBuffer");
break;
}
}
@ -638,7 +638,7 @@ GrGLvoid* GR_GL_FUNCTION_TYPE debugGLMapBuffer(GrGLenum target, GrGLenum access)
buffer = GrDebugGL::getInstance()->getElementArrayBuffer();
break;
default:
GrCrash("Unexpected target to glMapBuffer");
SkFAIL("Unexpected target to glMapBuffer");
break;
}
@ -668,7 +668,7 @@ GrGLboolean GR_GL_FUNCTION_TYPE debugGLUnmapBuffer(GrGLenum target) {
buffer = GrDebugGL::getInstance()->getElementArrayBuffer();
break;
default:
GrCrash("Unexpected target to glUnmapBuffer");
SkFAIL("Unexpected target to glUnmapBuffer");
break;
}
@ -720,7 +720,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetBufferParameteriv(GrGLenum target,
*params = buffer->getUsage();
break;
default:
GrCrash("Unexpected value to glGetBufferParamateriv");
SkFAIL("Unexpected value to glGetBufferParamateriv");
break;
}
};