Bug 1031576 (Part 3) - Remove nsLayoutUtils::DrawPixelSnapped, since it's dead code now. r=dbaron

This commit is contained in:
Seth Fowler 2014-07-21 17:59:23 -07:00
parent 2bb67119a4
commit 4be1be30cb
2 changed files with 0 additions and 67 deletions

View File

@ -5070,49 +5070,6 @@ DrawImageInternal(nsRenderingContext* aRenderingContext,
return NS_OK;
}
/* static */ void
nsLayoutUtils::DrawPixelSnapped(nsRenderingContext* aRenderingContext,
nsPresContext* aPresContext,
gfxDrawable* aDrawable,
GraphicsFilter aFilter,
const nsRect& aDest,
const nsRect& aFill,
const nsPoint& aAnchor,
const nsRect& aDirty)
{
int32_t appUnitsPerDevPixel =
aPresContext->AppUnitsPerDevPixel();
gfxContext* ctx = aRenderingContext->ThebesContext();
gfxIntSize drawableSize = aDrawable->Size();
nsIntSize imageSize(drawableSize.width, drawableSize.height);
SnappedImageDrawingParameters drawingParams =
ComputeSnappedImageDrawingParameters(ctx, appUnitsPerDevPixel, aDest, aFill,
aAnchor, aDirty, imageSize);
if (!drawingParams.mShouldDraw)
return;
gfxContextMatrixAutoSaveRestore saveMatrix(ctx);
if (drawingParams.mResetCTM) {
ctx->IdentityMatrix();
}
gfxRect sourceRect =
drawingParams.mUserSpaceToImageSpace.Transform(drawingParams.mFillRect);
gfxRect imageRect(0, 0, imageSize.width, imageSize.height);
gfxRect subimage(drawingParams.mSubimage.x, drawingParams.mSubimage.y,
drawingParams.mSubimage.width, drawingParams.mSubimage.height);
NS_ASSERTION(!sourceRect.Intersect(subimage).IsEmpty(),
"We must be allowed to sample *some* source pixels!");
gfxUtils::DrawPixelSnapped(ctx, aDrawable,
drawingParams.mUserSpaceToImageSpace, subimage,
sourceRect, imageRect, drawingParams.mFillRect,
gfx::SurfaceFormat::B8G8R8A8, aFilter);
}
/* static */ nsresult
nsLayoutUtils::DrawSingleUnscaledImage(nsRenderingContext* aRenderingContext,
nsPresContext* aPresContext,

View File

@ -1494,30 +1494,6 @@ public:
static gfxRect RectToGfxRect(const nsRect& aRect,
int32_t aAppUnitsPerDevPixel);
/**
* Draw a drawable using the pixel snapping algorithm.
* See https://wiki.mozilla.org/Gecko:Image_Snapping_and_Rendering
* @param aRenderingContext Where to draw the image, set up with an
* appropriate scale and transform for drawing in
* app units.
* @param aDrawable The drawable we want to draw.
* @param aFilter The graphics filter we should draw with.
* @param aDest Where one copy of the image should mapped to.
* @param aFill The area to be filled with copies of the
* image.
* @param aAnchor A point in aFill which we will ensure is
* pixel-aligned in the output.
* @param aDirty Pixels outside this area may be skipped.
*/
static void DrawPixelSnapped(nsRenderingContext* aRenderingContext,
nsPresContext* aPresContext,
gfxDrawable* aDrawable,
GraphicsFilter aFilter,
const nsRect& aDest,
const nsRect& aFill,
const nsPoint& aAnchor,
const nsRect& aDirty);
/**
* Draw a whole image without scaling or tiling.
*