Bug 759457. Don't fast path shadows with negative scale. r=roc
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 31 May 2012 18:22:28 -0400
changeset 95396 6b480a66acbc394cf4ef01565a26f74a0d0ff2ab
parent 95395 b2d6b702eaa54415ade56a040caa5ee3adc60c39
child 95397 2caac347f96331a4f42ecfbc599beece8fc8f84b
push id10104
push userjmuizelaar@mozilla.com
push dateThu, 31 May 2012 22:22:43 +0000
treeherdermozilla-inbound@6b480a66acbc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs759457
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 759457. Don't fast path shadows with negative scale. r=roc 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
@@ -4136,22 +4136,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);