зеркало из https://github.com/mozilla/pjs.git
Don't bother with DrawTile when the destination rect is empty. b=237766 r+sr=roc
This commit is contained in:
Родитель
4e4e4386b6
Коммит
6266dfafbf
|
@ -348,12 +348,16 @@ nsRenderingContextImpl::DrawTile(imgIContainer *aImage,
|
|||
mTranMatrix->TransformCoord(&dr.x, &dr.y, &dr.width, &dr.height);
|
||||
mTranMatrix->TransformCoord(&aXImageStart, &aYImageStart);
|
||||
|
||||
// may have become empty due to transform shinking small number to 0
|
||||
if (dr.IsEmpty())
|
||||
return NS_OK;
|
||||
|
||||
nscoord width, height;
|
||||
aImage->GetWidth(&width);
|
||||
aImage->GetHeight(&height);
|
||||
|
||||
if (width == 0 || height == 0)
|
||||
return PR_FALSE;
|
||||
return NS_OK;
|
||||
|
||||
nscoord xOffset = (dr.x - aXImageStart) % width;
|
||||
nscoord yOffset = (dr.y - aYImageStart) % height;
|
||||
|
|
|
@ -803,6 +803,7 @@ NS_IMETHODIMP nsImageWin::DrawTile(nsIRenderingContext &aContext,
|
|||
PRInt32 aPadX, PRInt32 aPadY,
|
||||
const nsRect &aDestRect)
|
||||
{
|
||||
NS_ASSERTION(!aDestRect.IsEmpty(), "DrawTile doesn't work with empty rects");
|
||||
if (mDecodedX2 < mDecodedX1 || mDecodedY2 < mDecodedY1)
|
||||
return NS_OK;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче