always check the result of SkMatrix::invert

git-svn-id: http://skia.googlecode.com/svn/trunk@3657 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2012-04-12 13:52:14 +00:00
parent c00d5c7902
commit fc9a3be3d2
2 changed files with 9 additions and 3 deletions

View File

@ -1357,7 +1357,9 @@ void SkCanvas::setExternalMatrix(const SkMatrix* matrix) {
fDeviceCMDirty = true; // |= (fExternalMatrix != *matrix)
fExternalMatrix = *matrix;
matrix->invert(&fExternalInverse);
if (!matrix->invert(&fExternalInverse)) {
fExternalInverse.reset();
}
}
}

View File

@ -28,7 +28,9 @@ private:
///////////////////////////////////////////////////////////////////////////////
Sk2DPathEffect::Sk2DPathEffect(const SkMatrix& mat) : fMatrix(mat) {
mat.invert(&fInverse);
if (!mat.invert(&fInverse)) {
fInverse.reset();
}
}
bool Sk2DPathEffect::filterPath(SkPath* dst, const SkPath& src, SkScalar* width) {
@ -78,7 +80,9 @@ Sk2DPathEffect::Sk2DPathEffect(SkFlattenableReadBuffer& buffer) {
SkASSERT(size <= sizeof(storage));
buffer.read(storage, size);
fMatrix.unflatten(storage);
fMatrix.invert(&fInverse);
if (!fMatrix.invert(&fInverse)) {
fInverse.reset();
}
}
///////////////////////////////////////////////////////////////////////////////