case SkShader::kMirror_TileMode:
return "mirror";
default:
- SkASSERT(!"unknown tilemode");
+ SkDEBUGFAIL("unknown tilemode");
return "error";
}
}
case kOval_GeomType:
return "oval";
default:
- SkASSERT(!"unknown geometry type");
+ SkDEBUGFAIL("unknown geometry type");
return "error";
}
}
#endif
case kPDF_Backend:
default:
- SkASSERT(!"unsupported");
+ SkDEBUGFAIL("unsupported");
}
return device;
}
break;
case SkPath::kQuad_Verb:
case SkPath::kCubic_Verb:
- SkASSERT(!"Curves not supported!");
+ SkDEBUGFAIL("Curves not supported!");
default:
// Unhandled cases
SkASSERT(false);
lastPt [1] += dir;
break;
case SkPaint::kRound_Cap:
- SkASSERT(!"Round caps not supported!");
+ SkDEBUGFAIL("Round caps not supported!");
default: // No cap
break;
}
} else if (!strcmp(c_bitmapFilter, "box")) {
return SkNEW(SkBoxFilter);
} else {
- SkASSERT(!!!"Unknown filter type");
+ SkDEBUGFAIL("Unknown filter type");
}
return NULL;
public:
virtual int count() SK_OVERRIDE { return 0; }
virtual void getStyle(int, SkFontStyle*, SkString*) SK_OVERRIDE {
- SkASSERT(!"SkFontStyleSet::getStyle called on empty set");
+ SkDEBUGFAIL("SkFontStyleSet::getStyle called on empty set");
}
virtual SkTypeface* createTypeface(int index) SK_OVERRIDE {
- SkASSERT(!"SkFontStyleSet::createTypeface called on empty set");
+ SkDEBUGFAIL("SkFontStyleSet::createTypeface called on empty set");
return NULL;
}
virtual SkTypeface* matchStyle(const SkFontStyle&) SK_OVERRIDE {
return 0;
}
virtual void onGetFamilyName(int index, SkString* familyName) SK_OVERRIDE {
- SkASSERT(!"onGetFamilyName called with bad index");
+ SkDEBUGFAIL("onGetFamilyName called with bad index");
}
virtual SkFontStyleSet* onCreateStyleSet(int index) SK_OVERRIDE {
- SkASSERT(!"onCreateStyleSet called with bad index");
+ SkDEBUGFAIL("onCreateStyleSet called with bad index");
return NULL;
}
virtual SkFontStyleSet* onMatchFamily(const char[]) SK_OVERRIDE {
closedOrMoved = true;
break;
default:
- SkASSERT(!"unexpected verb");
+ SkDEBUGFAIL("unexpected verb");
break;
}
*currVerb += 1;
// don't add a close if it's the first verb or a repeat
break;
default:
- SkASSERT(!"unexpected verb");
+ SkDEBUGFAIL("unexpected verb");
break;
}
}
needClose = true;
break;
default:
- SkASSERT(!"unexpected verb");
+ SkDEBUGFAIL("unexpected verb");
}
}
}
subdivide_quad_to(&tmp, pts);
break;
case kConic_Verb:
- SkASSERT(!"TODO: compute new weight");
+ SkDEBUGFAIL("TODO: compute new weight");
tmp.conicTo(pts[1], pts[2], iter.conicWeight());
break;
case kCubic_Verb:
case SkPath::kClose_Verb:
break;
default:
- SkASSERT(!"unexpected verb");
+ SkDEBUGFAIL("unexpected verb");
break;
}
}
pCnt = 0;
break;
case SkPath::kDone_Verb:
- SkASSERT(!"growForVerb called for kDone");
+ SkDEBUGFAIL("growForVerb called for kDone");
// fall through
default:
- SkASSERT(!"default is not reached");
+ SkDEBUGFAIL("default is not reached");
pCnt = 0;
}
size_t space = sizeof(uint8_t) + pCnt * sizeof (SkPoint);
}
SkDevice* SkPictureRecord::setDevice(SkDevice* device) {
- SkASSERT(!"eeek, don't try to change the device on a recording canvas");
+ SkDEBUGFAIL("eeek, don't try to change the device on a recording canvas");
return this->INHERITED::setDevice(device);
}
}
break;
default:
- SkASSERT(!"unknown paint style");
+ SkDEBUGFAIL("unknown paint style");
// fall back on just fill
fWidth = kStrokeRec_FillStyleWidth;
fStrokeAndFill = false;
case SkShader::kMirror_TileMode:
return XPS_SPREAD_METHOD_REFLECT;
default:
- SkASSERT(!"Unknown tile mode.");
+ SkDEBUGFAIL("Unknown tile mode.");
}
return XPS_SPREAD_METHOD_PAD;
}
// the corresponding line/quad/cubic verbs
break;
default:
- SkASSERT(!"unexpected verb");
+ SkDEBUGFAIL("unexpected verb");
break;
}
}
break;
}
default:
- SkASSERT(!"Unknown SkPath::FillType.");
+ SkDEBUGFAIL("Unknown SkPath::FillType.");
}
HRVM(shadedGeometry->SetFillRule(xpsFillRule),
"Could not set fill rule for shaded path.");
"Could not set transform matrix.");
useCanvasForClip = true;
} else {
- SkASSERT(!"Attempt to add glyphs in perspective.");
+ SkDEBUGFAIL("Attempt to add glyphs in perspective.");
useCanvasForClip = false;
}
}
return NULL;
}
}
- SkASSERT(!"never get here");
+ SkDEBUGFAIL("never get here");
return NULL;
}
template<SkDisplacementMapEffect::ChannelSelectorType type>
uint32_t getValue(SkColor, const SkUnPreMultiply::Scale*) {
- SkASSERT(!"Unknown channel selector");
+ SkDEBUGFAIL("Unknown channel selector");
return 0;
}
break;
case SkDisplacementMapEffect::kUnknown_ChannelSelectorType:
default:
- SkASSERT(!"Unknown Y channel selector");
+ SkDEBUGFAIL("Unknown Y channel selector");
}
}
break;
case SkDisplacementMapEffect::kUnknown_ChannelSelectorType:
default:
- SkASSERT(!"Unknown X channel selector");
+ SkDEBUGFAIL("Unknown X channel selector");
}
}
break;
case SkDisplacementMapEffect::kUnknown_ChannelSelectorType:
default:
- SkASSERT(!"Unknown X channel selector");
+ SkDEBUGFAIL("Unknown X channel selector");
}
switch (fYChannelSelector) {
break;
case SkDisplacementMapEffect::kUnknown_ChannelSelectorType:
default:
- SkASSERT(!"Unknown Y channel selector");
+ SkDEBUGFAIL("Unknown Y channel selector");
}
builder->fsCodeAppend("-vec2(0.5));\t\t");
case kA888_GrMaskFormat:
return kSkia8888_GrPixelConfig;
default:
- SkASSERT(!"unknown maskformat");
+ SkDEBUGFAIL("unknown maskformat");
}
return kUnknown_GrPixelConfig;
}
}
break;
default:
- SkASSERT(!"Unknown path fFill!");
+ SkDEBUGFAIL("Unknown path fFill!");
return false;
}
}
case SkMask::kLCD32_Format:
return kA888_GrMaskFormat;
default:
- SkASSERT(!"unsupported SkMask::Format");
+ SkDEBUGFAIL("unsupported SkMask::Format");
return kA8_GrMaskFormat;
}
}
print_shader(stringCnt, strings, stringLengths);
GrPrintf("\n%s", log.get());
}
- SkASSERT(!"Shader compilation failed!");
+ SkDEBUGFAIL("Shader compilation failed!");
GR_GL_CALL(gli, DeleteShader(shader));
return 0;
}
(char*)log.get()));
GrPrintf((char*)log.get());
}
- SkASSERT(!"Error linking program");
+ SkDEBUGFAIL("Error linking program");
GL_CALL(DeleteProgram(fProgramID));
fProgramID = 0;
return false;
GrGLBinding GrGLGetBindingInUseFromString(const char* versionString) {
if (NULL == versionString) {
- SkASSERT(!"NULL GL version string.");
+ SkDEBUGFAIL("NULL GL version string.");
return kNone_GrGLBinding;
}
GrGLVersion GrGLGetVersionFromString(const char* versionString) {
if (NULL == versionString) {
- SkASSERT(!"NULL GL version string.");
+ SkDEBUGFAIL("NULL GL version string.");
return 0;
}
GrGLSLVersion GrGLGetGLSLVersionFromString(const char* versionString) {
if (NULL == versionString) {
- SkASSERT(!"NULL GLSL version string.");
+ SkDEBUGFAIL("NULL GLSL version string.");
return 0;
}
// good to set a break-point here to know when createTexture fails
static GrTexture* return_null_texture() {
-// SkASSERT(!"null texture");
+// SkDEBUGFAIL("null texture");
return NULL;
}
colorStages.begin(),
coverageStages.begin()));
if (NULL == fCurrentProgram.get()) {
- SkASSERT(!"Failed to create program!");
+ SkDEBUGFAIL("Failed to create program!");
return false;
}
fCurrentProgram.get()->ref();
}
break;
}
- SkASSERT(!"how did we get here");
+ SkDEBUGFAIL("how did we get here");
return SkBitmap::kNo_Config;
}
case kWEBP_Format:
return "WEBP";
default:
- SkASSERT(!"Invalid format type!");
+ SkDEBUGFAIL("Invalid format type!");
}
return "Unknown Format";
}
if (target->fRowBytes != SkToU32(bm.rowBytes())) {
if (target->fRowBytes < SkImageMinRowBytes(*info)) {
- SkASSERT(!"Desired row bytes is too small");
+ SkDEBUGFAIL("Desired row bytes is too small");
return false;
}
bm.setConfig(bm.config(), bm.width(), bm.height(), target->fRowBytes);
case 1: SkASSERT(SkPath::kLine_Verb == verb); break;
case 2: SkASSERT(SkPath::kQuad_Verb == verb); break;
case 3: SkASSERT(SkPath::kCubic_Verb == verb); break;
- default: SkASSERT(!"should not be here");
+ default: SkDEBUGFAIL("should not be here");
}
#endif
return (SkPath::Verb)verb;
case SkPath::kLine_Verb: SkASSERT(1 == points); break;
case SkPath::kQuad_Verb: SkASSERT(2 == points); break;
case SkPath::kCubic_Verb: SkASSERT(3 == points); break;
- default: SkASSERT(!"should not get here");
+ default: SkDEBUGFAIL("should not get here");
}
#endif
return points;
#define NOT_IMPLEMENTED(condition, assert) \
do { \
- if (condition) { \
+ if ((bool)(condition)) { \
PRINT_NOT_IMPL("NOT_IMPLEMENTED: " #condition "\n"); \
SkDEBUGCODE(SkASSERT(!assert);) \
} \
SkDebugf("%s", slot->fValue.fBool ? "true" : "false");
break;
default:
- SkASSERT(!"how did I get here");
+ SkDEBUGFAIL("how did I get here");
break;
}
if (slot->fNext) {
SkDebugf(" %s ", fArray.fInts[last] ? "true" : "false");
} break;
default:
- SkASSERT(!"unsupported array type");
+ SkDEBUGFAIL("unsupported array type");
break;
}
}
case SkRRect::kSimple_Type: return "simple";
case SkRRect::kComplex_Type: return "complex";
}
- SkASSERT(!"never get here");
+ SkDEBUGFAIL("never get here");
return "";
}
};
static void not_supported() {
- SkASSERT(!"this method should never be called");
+ SkDEBUGFAIL("this method should never be called");
}
static void nothing_to_do() {}
}
SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) {
- SkASSERT(!"SkFontHost::CreateTypeface unimplemented");
+ SkDEBUGFAIL("SkFontHost::CreateTypeface unimplemented");
return NULL;
}
SkTypeface* SkFontHost::CreateTypefaceFromFile(char const*) {
-// SkASSERT(!"SkFontHost::CreateTypefaceFromFile unimplemented");
+// SkDEBUGFAIL("SkFontHost::CreateTypefaceFromFile unimplemented");
return NULL;
}
///////////////////////////////////////////////////////////////////////////////
void SkFontHost::Serialize(const SkTypeface* face, SkWStream* stream) {
- SkASSERT(!"SkFontHost::Serialize unimplemented");
+ SkDEBUGFAIL("SkFontHost::Serialize unimplemented");
}
SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
uint32_t fontID,
SkAdvancedTypefaceMetrics::PerGlyphInfo perGlyphInfo) {
- SkASSERT(!"SkFontHost::GetAdvancedTypefaceMetrics unimplemented");
+ SkDEBUGFAIL("SkFontHost::GetAdvancedTypefaceMetrics unimplemented");
return NULL;
}
}
SkScalerContext* SkFontHost::CreateScalerContext(const SkDescriptor* desc) {
- SkASSERT(!"SkFontHost::CreateScalarContext unimplemented");
+ SkDEBUGFAIL("SkFontHost::CreateScalarContext unimplemented");
return NULL;
}
\ No newline at end of file
}
size_t sk_fwrite(const void* buffer, size_t byteCount, SkFILE* f) {
- SkASSERT(!"Not supported yet");
+ SkDEBUGFAIL("Not supported yet");
return 0;
}
void sk_fflush(SkFILE* f) {
- SkASSERT(!"Not supported yet");
+ SkDEBUGFAIL("Not supported yet");
}
void sk_fclose(SkFILE* rec) {
fPath->setFillType(SkPath::kWinding_FillType);
break;
default:
- SkASSERT(!"Unknown D2D1_FILL_MODE.");
+ SkDEBUGFAIL("Unknown D2D1_FILL_MODE.");
break;
}
}
void STDMETHODCALLTYPE SkDWriteGeometrySink::SetSegmentFlags(D2D1_PATH_SEGMENT vertexFlags) {
if (vertexFlags == D2D1_PATH_SEGMENT_NONE || vertexFlags == D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN) {
- SkASSERT(!"Invalid D2D1_PATH_SEGMENT value.");
+ SkDEBUGFAIL("Invalid D2D1_PATH_SEGMENT value.");
}
}
void STDMETHODCALLTYPE SkDWriteGeometrySink::BeginFigure(D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN figureBegin) {
fPath->moveTo(SkFloatToScalar(startPoint.x), SkFloatToScalar(startPoint.y));
if (figureBegin == D2D1_FIGURE_BEGIN_HOLLOW) {
- SkASSERT(!"Invalid D2D1_FIGURE_BEGIN value.");
+ SkDEBUGFAIL("Invalid D2D1_FIGURE_BEGIN value.");
}
}
wbytes <<= 2;
break;
default:
- SkASSERT(!"unknown mask format");
+ SkDEBUGFAIL("unknown mask format");
return false;
}
}
if (range.fCount1 > 0 && fx != range.fFx1) {
SkDebugf("%x %x\n", fx, range.fFx1);
- R_ASSERT(!"bad fFx1");
+ R_ASSERT(false); // bad fFx1
return;
}
for (i = 0; i < range.fCount1; i++) {
srcPts++;
break;
case SkPath::kQuad_Verb:
- REPORTER_ASSERT(reporter, !"unexpected quad verb");
+ REPORTER_ASSERT_MESSAGE(reporter, false, "unexpected quad verb");
break;
case SkPath::kConic_Verb:
- REPORTER_ASSERT(reporter, !"unexpected conic verb");
+ REPORTER_ASSERT_MESSAGE(reporter, false, "unexpected conic verb");
break;
case SkPath::kCubic_Verb:
- REPORTER_ASSERT(reporter, !"unexpected cubic verb");
+ REPORTER_ASSERT_MESSAGE(reporter, false, "unexpected cubic verb");
break;
case SkPath::kClose_Verb:
REPORTER_ASSERT(reporter, !firstTime);
lastWasClose = true;
break;
default:
- SkASSERT(!"unexpected verb");
+ SkDEBUGFAIL("unexpected verb");
}
expectedVerbs[numIterVerbs++] = nextVerb;
}
lastPt = lastMoveTo;
break;
default:
- SkASSERT(!"unexpected verb");
+ SkDEBUGFAIL("unexpected verb");
}
}
REPORTER_ASSERT(reporter, numIterPts == numPoints);
flag->setDouble(atof(argv[i]));
break;
default:
- SkASSERT(!"Invalid flag type");
+ SkDEBUGFAIL("Invalid flag type");
}
break;
}
if (kString_FlagType == fFlagType) {
fStrings->reset();
} else {
- SkASSERT(!"Can only call resetStrings on kString_FlagType");
+ SkDEBUGFAIL("Can only call resetStrings on kString_FlagType");
}
}
if (kString_FlagType == fFlagType) {
fStrings->append(string);
} else {
- SkASSERT(!"Can only append to kString_FlagType");
+ SkDEBUGFAIL("Can only append to kString_FlagType");
}
}
if (kInt_FlagType == fFlagType) {
*fIntValue = value;
} else {
- SkASSERT(!"Can only call setInt on kInt_FlagType");
+ SkDEBUGFAIL("Can only call setInt on kInt_FlagType");
}
}
if (kDouble_FlagType == fFlagType) {
*fDoubleValue = value;
} else {
- SkASSERT(!"Can only call setDouble on kDouble_FlagType");
+ SkDEBUGFAIL("Can only call setDouble on kDouble_FlagType");
}
}
if (kBool_FlagType == fFlagType) {
*fBoolValue = value;
} else {
- SkASSERT(!"Can only call setBool on kBool_FlagType");
+ SkDEBUGFAIL("Can only call setBool on kBool_FlagType");
}
}
result.printf("%2.2f", fDefaultDouble);
break;
default:
- SkASSERT(!"Invalid flag type");
+ SkDEBUGFAIL("Invalid flag type");
}
return result;
}
case SkFlagInfo::kDouble_FlagType:
return SkString("double");
default:
- SkASSERT(!"Invalid flag type");
+ SkDEBUGFAIL("Invalid flag type");
return SkString();
}
}