mirror of
https://github.com/reactos/reactos.git
synced 2024-10-04 16:36:11 +00:00
[WIN32K]
Use GreCreateBitmapEx instead of EngCreateBitmap in NtGdiSetDIBitsToDeviceInternal, so that the RLE hack works. Fix initialization of XLATEOBJ. svn path=/trunk/; revision=50989
This commit is contained in:
parent
4ed72ce5b7
commit
3491d67b48
|
@ -463,7 +463,7 @@ NtGdiSetDIBitsToDeviceInternal(
|
||||||
rcDest.top = YDest;
|
rcDest.top = YDest;
|
||||||
if (bTransformCoordinates)
|
if (bTransformCoordinates)
|
||||||
{
|
{
|
||||||
CoordLPtoDP(pDC, (LPPOINT)&rcDest);
|
IntLPtoDP(pDC, (LPPOINT)&rcDest, 2);
|
||||||
}
|
}
|
||||||
rcDest.left += pDC->ptlDCOrig.x;
|
rcDest.left += pDC->ptlDCOrig.x;
|
||||||
rcDest.top += pDC->ptlDCOrig.y;
|
rcDest.top += pDC->ptlDCOrig.y;
|
||||||
|
@ -479,12 +479,16 @@ NtGdiSetDIBitsToDeviceInternal(
|
||||||
|
|
||||||
DIBWidth = WIDTH_BYTES_ALIGN32(SourceSize.cx, bmi->bmiHeader.biBitCount);
|
DIBWidth = WIDTH_BYTES_ALIGN32(SourceSize.cx, bmi->bmiHeader.biBitCount);
|
||||||
|
|
||||||
hSourceBitmap = EngCreateBitmap(SourceSize,
|
hSourceBitmap = GreCreateBitmapEx(bmi->bmiHeader.biWidth,
|
||||||
DIBWidth,
|
ScanLines,
|
||||||
BitmapFormat(bmi->bmiHeader.biBitCount,
|
0,
|
||||||
bmi->bmiHeader.biCompression),
|
BitmapFormat(bmi->bmiHeader.biBitCount,
|
||||||
bmi->bmiHeader.biHeight < 0 ? BMF_TOPDOWN : 0,
|
bmi->bmiHeader.biCompression),
|
||||||
(PVOID) Bits);
|
bmi->bmiHeader.biHeight < 0 ? BMF_TOPDOWN : 0,
|
||||||
|
bmi->bmiHeader.biSizeImage,
|
||||||
|
Bits,
|
||||||
|
0);
|
||||||
|
|
||||||
if (!hSourceBitmap)
|
if (!hSourceBitmap)
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_NO_SYSTEM_RESOURCES);
|
EngSetLastError(ERROR_NO_SYSTEM_RESOURCES);
|
||||||
|
@ -520,7 +524,12 @@ NtGdiSetDIBitsToDeviceInternal(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize EXLATEOBJ */
|
/* Initialize EXLATEOBJ */
|
||||||
EXLATEOBJ_vInitialize(&exlo, ppalDIB, pSurf->ppal, 0, 0, 0);
|
EXLATEOBJ_vInitialize(&exlo,
|
||||||
|
ppalDIB,
|
||||||
|
pSurf->ppal,
|
||||||
|
RGB(0xff, 0xff, 0xff),
|
||||||
|
pDC->pdcattr->crBackgroundClr,
|
||||||
|
pDC->pdcattr->crForegroundClr);
|
||||||
|
|
||||||
/* Copy the bits */
|
/* Copy the bits */
|
||||||
DPRINT("BitsToDev with dstsurf=(%d|%d) (%d|%d), src=(%d|%d) w=%d h=%d\n",
|
DPRINT("BitsToDev with dstsurf=(%d|%d) (%d|%d), src=(%d|%d) w=%d h=%d\n",
|
||||||
|
@ -1433,6 +1442,7 @@ DIB_CreateDIBSection(
|
||||||
/* CreateDIBSection should fail for compressed formats */
|
/* CreateDIBSection should fail for compressed formats */
|
||||||
if (bi->biCompression == BI_RLE4 || bi->biCompression == BI_RLE8)
|
if (bi->biCompression == BI_RLE4 || bi->biCompression == BI_RLE8)
|
||||||
{
|
{
|
||||||
|
DPRINT1("no compressed format allowed\n");
|
||||||
return (HBITMAP)NULL;
|
return (HBITMAP)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1465,6 +1475,7 @@ DIB_CreateDIBSection(
|
||||||
0);
|
0);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
DPRINT1("ZwQuerySystemInformation failed (0x%lx)\n", Status);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1486,6 +1497,7 @@ DIB_CreateDIBSection(
|
||||||
PAGE_READWRITE);
|
PAGE_READWRITE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
DPRINT1("ZwMapViewOfSection failed (0x%lx)\n", Status);
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1498,7 +1510,11 @@ DIB_CreateDIBSection(
|
||||||
{
|
{
|
||||||
offset = 0;
|
offset = 0;
|
||||||
bm.bmBits = EngAllocUserMem(totalSize, 0);
|
bm.bmBits = EngAllocUserMem(totalSize, 0);
|
||||||
if(!bm.bmBits) goto cleanup;
|
if(!bm.bmBits)
|
||||||
|
{
|
||||||
|
DPRINT1("Failed to allocate memory\n");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// hSecure = MmSecureVirtualMemory(bm.bmBits, totalSize, PAGE_READWRITE);
|
// hSecure = MmSecureVirtualMemory(bm.bmBits, totalSize, PAGE_READWRITE);
|
||||||
|
@ -1546,12 +1562,14 @@ DIB_CreateDIBSection(
|
||||||
0);
|
0);
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
|
DPRINT1("GreCreateBitmapEx failed\n");
|
||||||
EngSetLastError(ERROR_NO_SYSTEM_RESOURCES);
|
EngSetLastError(ERROR_NO_SYSTEM_RESOURCES);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
bmp = SURFACE_LockSurface(res);
|
bmp = SURFACE_LockSurface(res);
|
||||||
if (NULL == bmp)
|
if (NULL == bmp)
|
||||||
{
|
{
|
||||||
|
DPRINT1("SURFACE_LockSurface failed\n");
|
||||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue