зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1481385 - Calculate bitmap mask size with stride. r=lsalzman
--HG-- extra : amend_source : 950b8705896cbe861366f1ea80f657d5debd097a
This commit is contained in:
Родитель
d26c328974
Коммит
4854321662
|
@ -174,11 +174,13 @@ UpdateMaskBits(gchar* aMaskBits, int32_t aMaskWidth, int32_t aMaskHeight,
|
|||
void
|
||||
WindowSurfaceX11Image::ResizeTransparencyBitmap(int aWidth, int aHeight)
|
||||
{
|
||||
if (mTransparencyBitmapWidth*mTransparencyBitmapHeight < aWidth*aHeight) {
|
||||
delete[] mTransparencyBitmap;
|
||||
int32_t actualSize =
|
||||
GetBitmapStride(mTransparencyBitmapWidth)*mTransparencyBitmapHeight;
|
||||
int32_t newSize = GetBitmapStride(aWidth)*aHeight;
|
||||
|
||||
int32_t byteSize = GetBitmapStride(aWidth)*aHeight;
|
||||
mTransparencyBitmap = new gchar[byteSize];
|
||||
if (actualSize < newSize) {
|
||||
delete[] mTransparencyBitmap;
|
||||
mTransparencyBitmap = new gchar[newSize];
|
||||
}
|
||||
|
||||
mTransparencyBitmapWidth = aWidth;
|
||||
|
|
Загрузка…
Ссылка в новой задаче