зеркало из https://github.com/mozilla/gecko-dev.git
use memcpy for the data
This commit is contained in:
Родитель
0992dc7dae
Коммит
0a981f36f2
|
@ -208,9 +208,6 @@ NS_IMETHODIMP nsImage::GetFormat(gfx_format *aFormat)
|
|||
HWND bg = GetDesktopWindow();
|
||||
HDC memDC = GetDC(NULL);
|
||||
|
||||
// HBITMAP memBM = CreateCompatibleBitmap(memDC, GFXCoordToIntCeil(mSize.width), GFXCoordToIntCeil(mSize.height));
|
||||
|
||||
|
||||
LPBITMAPINFOHEADER mBHead = (LPBITMAPINFOHEADER)new char[sizeof(BITMAPINFO)];
|
||||
|
||||
mBHead->biSize = sizeof(BITMAPINFOHEADER);
|
||||
|
@ -283,11 +280,7 @@ NS_IMETHODIMP nsImage::SetBits(const PRUint8 *data, PRUint32 length, PRInt32 off
|
|||
if (!mBits)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
PRUint32 i;
|
||||
PRInt32 off;
|
||||
// XXX i could unroll this loop a bit :-)
|
||||
for (i=0, off = offset; i <= length; ++i, ++off) {
|
||||
mBits[off] = data[i];
|
||||
}
|
||||
memcpy(mBits + offset, data, length);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -155,11 +155,7 @@ NS_IMETHODIMP nsImage::SetBits(const PRUint8 *data, PRUint32 length, PRInt32 off
|
|||
if (!mBits)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
PRUint32 i;
|
||||
PRInt32 off;
|
||||
// XXX i could unroll this loop a bit :-)
|
||||
for (i=0, off = offset; i <= length; ++i, ++offset) {
|
||||
mBits[off] = data[i];
|
||||
}
|
||||
memcpy(mBits + offset, data, length);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче