Bug 598798 patch 4: Remove hard-coded GraphicsFilter from nsLayoutUtils::DrawSingleUnscaledImage, and make its dirty-rect argument optional. r=roc a=blocking-betaN

This commit is contained in:
Daniel Holbert 2010-10-11 13:08:07 -07:00
parent 9a8be12f1c
commit 890fc2ed6c
3 changed files with 13 additions and 7 deletions

View File

@ -3117,8 +3117,9 @@ nsLayoutUtils::DrawPixelSnapped(nsIRenderingContext* aRenderingContext,
/* static */ nsresult
nsLayoutUtils::DrawSingleUnscaledImage(nsIRenderingContext* aRenderingContext,
imgIContainer* aImage,
GraphicsFilter aGraphicsFilter,
const nsPoint& aDest,
const nsRect& aDirty,
const nsRect* aDirty,
PRUint32 aImageFlags,
const nsRect* aSourceArea)
{
@ -3144,8 +3145,9 @@ nsLayoutUtils::DrawSingleUnscaledImage(nsIRenderingContext* aRenderingContext,
// outside the image bounds, we want to honor the aSourceArea-to-aDest
// translation but we don't want to actually tile the image.
fill.IntersectRect(fill, dest);
return DrawImageInternal(aRenderingContext, aImage, gfxPattern::FILTER_NEAREST,
dest, fill, aDest, aDirty, imageSize, aImageFlags);
return DrawImageInternal(aRenderingContext, aImage, aGraphicsFilter,
dest, fill, aDest, aDirty ? *aDirty : dest,
imageSize, aImageFlags);
}
/* static */ nsresult

View File

@ -996,7 +996,8 @@ public:
* app units.
* @param aImage The image.
* @param aDest The top-left where the image should be drawn
* @param aDirty Pixels outside this area may be skipped.
* @param aDirty If non-null, then pixels outside this area may
* be skipped.
* @param aImageFlags Image flags of the imgIContainer::FLAG_* variety
* @param aSourceArea If non-null, this area is extracted from
* the image and drawn at aDest. It's
@ -1005,8 +1006,9 @@ public:
*/
static nsresult DrawSingleUnscaledImage(nsIRenderingContext* aRenderingContext,
imgIContainer* aImage,
GraphicsFilter aGraphicsFilter,
const nsPoint& aDest,
const nsRect& aDirty,
const nsRect* aDirty,
PRUint32 aImageFlags,
const nsRect* aSourceArea = nsnull);

View File

@ -3385,7 +3385,8 @@ nsTreeBodyFrame::PaintTwisty(PRInt32 aRowIndex,
// Paint the image.
nsLayoutUtils::DrawSingleUnscaledImage(&aRenderingContext, image,
pt, aDirtyRect, imgIContainer::FLAG_NONE, &imageSize);
gfxPattern::FILTER_NEAREST, pt, &aDirtyRect,
imgIContainer::FLAG_NONE, &imageSize);
}
}
}
@ -3693,7 +3694,8 @@ nsTreeBodyFrame::PaintCheckbox(PRInt32 aRowIndex,
// Paint the image.
nsLayoutUtils::DrawSingleUnscaledImage(&aRenderingContext, image,
pt, aDirtyRect, imgIContainer::FLAG_NONE, &imageSize);
gfxPattern::FILTER_NEAREST, pt, &aDirtyRect,
imgIContainer::FLAG_NONE, &imageSize);
}
}