mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
fixing non-windows image copying
This commit is contained in:
parent
34f194d703
commit
eda254aff7
@ -221,9 +221,14 @@ NS_IMETHODIMP gfxImageFrame::SetImageData(const PRUint8 *aData, PRUint32 aLength
|
||||
if (((aOffset + (PRInt32)aLength) > imgLen) || !imgData)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRInt32 newOffset = ((mSize.height - 1) * row_stride) - aOffset;
|
||||
PRInt32 offset;
|
||||
#ifdef XP_PC
|
||||
PRInt32 offset = ((mSize.height - 1) * row_stride) - aOffset;
|
||||
#else
|
||||
offset = aOffset;
|
||||
#endif
|
||||
|
||||
memcpy(imgData + newOffset, aData, aLength);
|
||||
memcpy(imgData + offset, aData, aLength);
|
||||
|
||||
PRInt32 row = (aOffset / row_stride);
|
||||
mImage->SetDecodedRect(0, 0, mSize.width, row + 1);
|
||||
@ -305,4 +310,4 @@ NS_IMETHODIMP gfxImageFrame::GetInterface(const nsIID & aIID, void * *result)
|
||||
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -221,9 +221,14 @@ NS_IMETHODIMP gfxImageFrame::SetImageData(const PRUint8 *aData, PRUint32 aLength
|
||||
if (((aOffset + (PRInt32)aLength) > imgLen) || !imgData)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRInt32 newOffset = ((mSize.height - 1) * row_stride) - aOffset;
|
||||
PRInt32 offset;
|
||||
#ifdef XP_PC
|
||||
PRInt32 offset = ((mSize.height - 1) * row_stride) - aOffset;
|
||||
#else
|
||||
offset = aOffset;
|
||||
#endif
|
||||
|
||||
memcpy(imgData + newOffset, aData, aLength);
|
||||
memcpy(imgData + offset, aData, aLength);
|
||||
|
||||
PRInt32 row = (aOffset / row_stride);
|
||||
mImage->SetDecodedRect(0, 0, mSize.width, row + 1);
|
||||
@ -305,4 +310,4 @@ NS_IMETHODIMP gfxImageFrame::GetInterface(const nsIID & aIID, void * *result)
|
||||
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user