fixing bug 148551. patch from paper@animecity.nu. r=pavlov sr=tor

This commit is contained in:
pavlov%netscape.com 2002-06-11 22:30:36 +00:00
parent d26a189738
commit b6ec7f6860
2 changed files with 16 additions and 4 deletions

View File

@ -254,7 +254,10 @@ NS_IMETHODIMP gfxImageFrame::SetImageData(const PRUint8 *aData, PRUint32 aLength
PRInt32 newOffset; PRInt32 newOffset;
#ifdef XP_PC #ifdef XP_PC
newOffset = ((mSize.height - 1) * row_stride) - aOffset; // Adjust: We need offset to be top-down rows & LTR within each row
// On XP_PC, it's passed in as bottom-up rows & LTR within each row
PRUint32 yOffset = ((PRUint32)(aOffset / row_stride)) * row_stride;
newOffset = ((mSize.height - 1) * row_stride) - yOffset + (aOffset % row_stride);
#else #else
newOffset = aOffset; newOffset = aOffset;
#endif #endif
@ -351,7 +354,10 @@ NS_IMETHODIMP gfxImageFrame::SetAlphaData(const PRUint8 *aData, PRUint32 aLength
PRInt32 offset; PRInt32 offset;
#ifdef XP_PC #ifdef XP_PC
offset = ((mSize.height - 1) * row_stride) - aOffset; // Adjust: We need offset to be top-down rows & LTR within each row
// On XP_PC, it's passed in as bottom-up rows & LTR within each row
PRUint32 yOffset = ((PRUint32)(aOffset / row_stride)) * row_stride;
offset = ((mSize.height - 1) * row_stride) - yOffset + (aOffset % row_stride);
#else #else
offset = aOffset; offset = aOffset;
#endif #endif

View File

@ -254,7 +254,10 @@ NS_IMETHODIMP gfxImageFrame::SetImageData(const PRUint8 *aData, PRUint32 aLength
PRInt32 newOffset; PRInt32 newOffset;
#ifdef XP_PC #ifdef XP_PC
newOffset = ((mSize.height - 1) * row_stride) - aOffset; // Adjust: We need offset to be top-down rows & LTR within each row
// On XP_PC, it's passed in as bottom-up rows & LTR within each row
PRUint32 yOffset = ((PRUint32)(aOffset / row_stride)) * row_stride;
newOffset = ((mSize.height - 1) * row_stride) - yOffset + (aOffset % row_stride);
#else #else
newOffset = aOffset; newOffset = aOffset;
#endif #endif
@ -351,7 +354,10 @@ NS_IMETHODIMP gfxImageFrame::SetAlphaData(const PRUint8 *aData, PRUint32 aLength
PRInt32 offset; PRInt32 offset;
#ifdef XP_PC #ifdef XP_PC
offset = ((mSize.height - 1) * row_stride) - aOffset; // Adjust: We need offset to be top-down rows & LTR within each row
// On XP_PC, it's passed in as bottom-up rows & LTR within each row
PRUint32 yOffset = ((PRUint32)(aOffset / row_stride)) * row_stride;
offset = ((mSize.height - 1) * row_stride) - yOffset + (aOffset % row_stride);
#else #else
offset = aOffset; offset = aOffset;
#endif #endif