Bug 759457. Don't fast path shadows with negative scale. r=roc,a=akeybl FIREFOX_BETA_14_BASE
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 31 May 2012 18:22:28 -0400
changeset 94478 57b91ddc54fcd4ebff0d8943604dc999d491336a
parent 94477 c53704c5e1e7b587b87a0ceef21fa11184662117
child 94479 478366aeebc354e26b188c77d907124054bd9822
push idunknown
push userunknown
push dateunknown
reviewersroc, akeybl
bugs759457
milestone14.0a2
Bug 759457. Don't fast path shadows with negative scale. r=roc,a=akeybl We don't support this yet, so don't bother trying.
layout/base/nsCSSRendering.cpp
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -4242,22 +4242,22 @@ nsContextBoxBlur::Init(const nsRect& aRe
   if (aRect.IsEmpty()) {
     mContext = nsnull;
     return nsnull;
   }
 
   gfxFloat scaleX = 1;
   gfxFloat scaleY = 1;
 
-  // Do blurs in device space when possible
-  // If the scale is not uniform we fall back to transforming on paint.
+  // Do blurs in device space when possible.
   // Chrome/Skia always does the blurs in device space
   // and will sometimes get incorrect results (e.g. rotated blurs)
   gfxMatrix transform = aDestinationCtx->CurrentMatrix();
-  if (transform.HasNonAxisAlignedTransform()) {
+  // XXX: we could probably handle negative scales but for now it's easier just to fallback
+  if (transform.HasNonAxisAlignedTransform() || transform.xx <= 0.0 || transform.yy <= 0.0) {
     transform = gfxMatrix();
   } else {
     scaleX = transform.xx;
     scaleY = transform.yy;
   }
 
   // compute a large or smaller blur radius
   gfxIntSize blurRadius = ComputeBlurRadius(aBlurRadius, aAppUnitsPerDevPixel, scaleX, scaleY);