author | Mounir Lamouri <mounir.lamouri@gmail.com> |
Wed, 31 Aug 2011 20:05:31 +0200 | |
changeset 76344 | 5d5f7f13f0ba9cf42024ca57108bd974aae37c34 |
parent 76342 | 891e5dbae3ec7f84ee003213e6377b2602066119 |
child 76345 | e5072a22fe9510ee98e46811374f23e6e37cd854 |
push id | 21097 |
push user | bmo@edmorley.co.uk |
push date | Thu, 01 Sep 2011 07:45:07 +0000 |
treeherder | mozilla-central@7d3d1c2c75f8 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 633627 |
milestone | 9.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
|
--- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -4194,77 +4194,47 @@ nsContextBoxBlur::Init(const nsRect& aRe const gfxRect* aSkipRect, PRUint32 aFlags) { if (aRect.IsEmpty()) { mContext = nsnull; return nsnull; } - // We convert our radii and our buffer to device space coordinates. When - // device space is smaller than our content space, we would otherwise be - // oversampling. gfxIntSize blurRadius = ComputeBlurRadius(aBlurRadius, aAppUnitsPerDevPixel); - aDestinationCtx->UserToDevice(blurRadius); - - PRInt32 spreadRadiusScalar = NS_MIN( - PRInt32(aSpreadRadius / aAppUnitsPerDevPixel), - PRInt32(MAX_SPREAD_RADIUS)); - gfxIntSize spreadRadius(spreadRadiusScalar, spreadRadiusScalar); - aDestinationCtx->UserToDevice(spreadRadius); - + PRInt32 spreadRadius = NS_MIN(PRInt32(aSpreadRadius / aAppUnitsPerDevPixel), + PRInt32(MAX_SPREAD_RADIUS)); mDestinationCtx = aDestinationCtx; // If not blurring, draw directly onto the destination device - if (blurRadius.width <= 0 && blurRadius.height <= 0 && spreadRadiusScalar <= 0 && + if (blurRadius.width <= 0 && blurRadius.height <= 0 && spreadRadius <= 0 && !(aFlags & FORCE_MASK)) { mContext = aDestinationCtx; return mContext; } // Convert from app units to device pixels gfxRect rect = nsLayoutUtils::RectToGfxRect(aRect, aAppUnitsPerDevPixel); - gfxRect deviceRect = mDestinationCtx->UserToDevice(rect); - gfxRect dirtyRect = nsLayoutUtils::RectToGfxRect(aDirtyRect, aAppUnitsPerDevPixel); dirtyRect.RoundOut(); - gfxRect deviceDirtyRect = mDestinationCtx->UserToDevice(dirtyRect); - - gfxRect deviceSkipRect; - gfxRect* deviceSkipRectPtr = NULL; - if (aSkipRect) { - deviceSkipRect = mDestinationCtx->UserToDevice(*aSkipRect); - deviceSkipRectPtr = &deviceSkipRect; - } - // Create the temporary surface for blurring - mContext = blur.Init(deviceRect, spreadRadius, blurRadius, - &deviceDirtyRect, deviceSkipRectPtr); - - gfxMatrix matrix = aDestinationCtx->CurrentMatrix(); - if (mContext) { - mContext->Scale(matrix.xx, matrix.yy); - } + mContext = blur.Init(rect, gfxIntSize(spreadRadius, spreadRadius), + blurRadius, &dirtyRect, aSkipRect); return mContext; } void nsContextBoxBlur::DoPaint() { if (mContext == mDestinationCtx) return; - // Since blurred mask is in device coordinates, the scales for painting the - // mask should be identity. - gfxContextMatrixAutoSaveRestore save(mDestinationCtx); - gfxMatrix matrix = mDestinationCtx->CurrentMatrix(); - mDestinationCtx->Scale(1 / matrix.xx, 1 / matrix.yy); blur.Paint(mDestinationCtx); } gfxContext* nsContextBoxBlur::GetContext() { return mContext; }