mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1031576 (Part 3) - Remove nsLayoutUtils::DrawPixelSnapped, since it's dead code now. r=dbaron
This commit is contained in:
parent
2bb67119a4
commit
4be1be30cb
@ -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,
|
||||
|
@ -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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user