Stroked text should check inverse return.
authorbungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 9 Apr 2012 20:49:03 +0000 (20:49 +0000)
committerbungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 9 Apr 2012 20:49:03 +0000 (20:49 +0000)
http://codereview.appspot.com/5986067/

git-svn-id: http://skia.googlecode.com/svn/trunk@3633 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkScalerContext.cpp

index 2921b1e..1799b2c 100644 (file)
@@ -617,7 +617,10 @@ void SkScalerContext::internalGetPath(const SkGlyph& glyph, SkPath* fillPath,
         SkMatrix    matrix, inverse;
 
         fRec.getMatrixFrom2x2(&matrix);
-        matrix.invert(&inverse);
+        if (!matrix.invert(&inverse)) {
+            // assume fillPath and devPath are already empty.
+            return;
+        }
         path.transform(inverse, &localPath);
         // now localPath is only affected by the paint settings, and not the canvas matrix