Bug 696579 - Round out mask, filter and pattern surfaces. r=roc

This commit is contained in:
Robert Longson 2011-10-26 09:52:11 +01:00
parent 5c182f0204
commit f0eafefb12
2 changed files with 4 additions and 5 deletions

View File

@ -169,8 +169,7 @@ nsSVGFE::SetupScalingFilter(nsSVGFilterInstance *aInstance,
return result;
gfxRect r(aDataRect.x, aDataRect.y, aDataRect.width, aDataRect.height);
r.Scale(gfxFloat(scaledSize.width)/aTarget->mImage->Width(),
gfxFloat(scaledSize.height)/aTarget->mImage->Height());
r.Scale(1 / kernelX, 1 / kernelY);
r.RoundOut();
if (!gfxUtils::GfxRectToIntRect(r, &result.mDataRect))
return result;

View File

@ -1143,10 +1143,10 @@ gfxIntSize
nsSVGUtils::ConvertToSurfaceSize(const gfxSize& aSize,
bool *aResultOverflows)
{
gfxIntSize surfaceSize(ClampToInt(aSize.width), ClampToInt(aSize.height));
gfxIntSize surfaceSize(ClampToInt(ceil(aSize.width)), ClampToInt(ceil(aSize.height)));
*aResultOverflows = surfaceSize.width != NS_round(aSize.width) ||
surfaceSize.height != NS_round(aSize.height);
*aResultOverflows = surfaceSize.width != ceil(aSize.width) ||
surfaceSize.height != ceil(aSize.height);
if (!gfxASurface::CheckSurfaceSize(surfaceSize)) {
surfaceSize.width = NS_MIN(NS_SVG_OFFSCREEN_MAX_DIMENSION,