mirror of
https://github.com/reactos/reactos.git
synced 2024-09-07 03:11:07 +00:00
[WIN32K]
Fix the RLE hack (partly) svn path=/trunk/; revision=50988
This commit is contained in:
parent
b84b85e485
commit
4ed72ce5b7
|
@ -82,8 +82,6 @@ GreCreateBitmapEx(
|
||||||
PSURFACE psurf;
|
PSURFACE psurf;
|
||||||
SURFOBJ *pso;
|
SURFOBJ *pso;
|
||||||
HBITMAP hbmp;
|
HBITMAP hbmp;
|
||||||
PVOID pvCompressedBits;
|
|
||||||
SIZEL sizl;
|
|
||||||
|
|
||||||
/* Verify format */
|
/* Verify format */
|
||||||
if (iFormat < BMF_1BPP || iFormat > BMF_PNG) return NULL;
|
if (iFormat < BMF_1BPP || iFormat > BMF_PNG) return NULL;
|
||||||
|
@ -103,18 +101,27 @@ GreCreateBitmapEx(
|
||||||
/* The infamous RLE hack */
|
/* The infamous RLE hack */
|
||||||
if (iFormat == BMF_4RLE || iFormat == BMF_8RLE)
|
if (iFormat == BMF_4RLE || iFormat == BMF_8RLE)
|
||||||
{
|
{
|
||||||
|
PVOID pvCompressedBits;
|
||||||
|
SIZEL sizl;
|
||||||
|
LONG lDelta;
|
||||||
|
|
||||||
sizl.cx = nWidth;
|
sizl.cx = nWidth;
|
||||||
sizl.cy = nHeight;
|
sizl.cy = nHeight;
|
||||||
|
lDelta = WIDTH_BYTES_ALIGN32(nWidth, gajBitsPerFormat[iFormat]);
|
||||||
|
|
||||||
pvCompressedBits = pvBits;
|
pvCompressedBits = pvBits;
|
||||||
pvBits = EngAllocMem(FL_ZERO_MEMORY, pso->cjBits, TAG_DIB);
|
pvBits = EngAllocMem(FL_ZERO_MEMORY, lDelta * nHeight, TAG_DIB);
|
||||||
if (!pvBits)
|
if (!pvBits)
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
SURFACE_FreeSurfaceByHandle(hbmp);
|
SURFACE_FreeSurfaceByHandle(hbmp);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
DecompressBitmap(sizl, pvCompressedBits, pvBits, pso->lDelta, iFormat);
|
DecompressBitmap(sizl, pvCompressedBits, pvBits, lDelta, iFormat);
|
||||||
fjBitmap |= BMF_RLE_HACK;
|
fjBitmap |= BMF_RLE_HACK;
|
||||||
|
|
||||||
|
iFormat = iFormat == BMF_4RLE ? BMF_4BPP : BMF_8BPP;
|
||||||
|
psurf->SurfObj.iBitmapFormat = iFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark as API bitmap */
|
/* Mark as API bitmap */
|
||||||
|
|
Loading…
Reference in a new issue