From 5248a4a5f788a1e73c452f34191509b2e3860c0b Mon Sep 17 00:00:00 2001 From: "paper%animecity.nu" Date: Fri, 17 Jan 2003 23:28:19 +0000 Subject: [PATCH] Regression of Bug 186103. r=ere, sr=tor. Don't draw beyond tile area. git-svn-id: svn://10.0.0.236/trunk@136546 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/windows/nsImageWin.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/mozilla/gfx/src/windows/nsImageWin.cpp b/mozilla/gfx/src/windows/nsImageWin.cpp index 0dace552b33..21d94d95a76 100644 --- a/mozilla/gfx/src/windows/nsImageWin.cpp +++ b/mozilla/gfx/src/windows/nsImageWin.cpp @@ -1056,13 +1056,14 @@ nsImageWin::ProgressiveDoubleBlit(nsDrawingSurface aSurface, // now duplicate our tile into the background + PRInt32 w, h; if (mAlphaDepth == 1) { for (PRInt32 y = aY0; y < aY1; y += srcRect.height) { + h = PR_MIN(srcRect.height, aY1 - y); for (PRInt32 x = aX0; x < aX1; x += srcRect.width) { - ::BitBlt(theHDC, x, y, srcRect.width, srcRect.height, - maskDC, 0, 0, SRCAND); - ::BitBlt(theHDC, x, y, srcRect.width, srcRect.height, - offDC, 0, 0, SRCPAINT); + w = PR_MIN(srcRect.width, aX1 - x); + ::BitBlt(theHDC, x, y, w, h, maskDC, 0, 0, SRCAND); + ::BitBlt(theHDC, x, y, w, h, offDC, 0, 0, SRCPAINT); } } // Destroy Alpha/Mask GDI Object @@ -1076,16 +1077,18 @@ nsImageWin::ProgressiveDoubleBlit(nsDrawingSurface aSurface, blendFunction.SourceConstantAlpha = 255; blendFunction.AlphaFormat = 1; for (PRInt32 y = aY0; y < aY1; y += srcRect.height) { + h = PR_MIN(srcRect.height, aY1 - y); for (PRInt32 x = aX0; x < aX1; x += srcRect.width) { - gAlphaBlend(theHDC, x, y, srcRect.width, srcRect.height, - offDC, 0, 0, srcRect.width, srcRect.height, blendFunction); + w = PR_MIN(srcRect.width, aX1 - x); + gAlphaBlend(theHDC, x, y, w, h, offDC, 0, 0, w, h, blendFunction); } } } else { for (PRInt32 y = aY0; y < aY1; y += srcRect.height) { + h = PR_MIN(srcRect.height, aY1 - y); for (PRInt32 x = aX0; x < aX1; x += srcRect.width) { - ::BitBlt(theHDC, x, y, srcRect.width, srcRect.height, - offDC, 0, 0, SRCCOPY); + w = PR_MIN(srcRect.width, aX1 - x); + ::BitBlt(theHDC, x, y, w, h, offDC, 0, 0, SRCCOPY); } } }