detect all masks, and don't use masksuperblitter with those
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 12 Mar 2012 16:09:06 +0000 (16:09 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 12 Mar 2012 16:09:06 +0000 (16:09 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@3364 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkScan_AntiPath.cpp

index e80ad3e..e224ea1 100644 (file)
@@ -392,10 +392,12 @@ public:
         return false;
 #endif
         int width = bounds.width();
-        int rb = SkAlign4(width);
+        int64_t rb = SkAlign4(width);
+        // use 64bits to detect overflow
+        int64_t storage = rb * bounds.height();
 
         return (width <= MaskSuperBlitter::kMAX_WIDTH) &&
-        (rb * bounds.height() <= MaskSuperBlitter::kMAX_STORAGE);
+               (storage <= MaskSuperBlitter::kMAX_STORAGE);
     }
 
 private:
@@ -425,7 +427,7 @@ MaskSuperBlitter::MaskSuperBlitter(SkBlitter* realBlitter, const SkIRect& ir,
     fMask.fBounds   = ir;
     fMask.fRowBytes = ir.width();
     fMask.fFormat   = SkMask::kA8_Format;
-
+            
     fClipRect = ir;
     fClipRect.intersect(clip.getBounds());