From cf9b7505f22aedde30612655e16f330f19ba2470 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Mon, 1 Aug 2011 13:26:01 +0000 Subject: [PATCH] Fix bug in SkMatrix::invert where typemask is not set on inverse when a matrix is inverted into itself. Review URL: http://codereview.appspot.com/4819050/ git-svn-id: http://skia.googlecode.com/svn/trunk@2002 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkMatrix.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp index a1b3fd6f11..ba8f596254 100644 --- a/src/core/SkMatrix.cpp +++ b/src/core/SkMatrix.cpp @@ -795,8 +795,10 @@ bool SkMatrix::invert(SkMatrix* inv) const { if (inv) { SkMatrix tmp; - if (inv == this) + if (inv == this) { inv = &tmp; + } + inv->setTypeMask(kUnknown_Mask); if (isPersp) { shift = 61 - shift; @@ -880,7 +882,6 @@ bool SkMatrix::invert(SkMatrix* inv) const { if (inv == &tmp) { *(SkMatrix*)this = tmp; } - inv->setTypeMask(kUnknown_Mask); } return true; }