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:
parent
c00d5c7902
commit
fc9a3be3d2
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user