mirror of
https://github.com/reactos/reactos.git
synced 2024-08-05 11:00:55 +00:00
[WIN32K]
Introduce GreCreateBitmapEx, which has the extended functionality needed by some callers, GreCreateBitmap calls GreCreateBitmapEx to keep the simple syntax. Use it in DIB_CreateDIBSection to fix build. Also pass the size of the image (still ignored), which is needed for compressed bitmaps (we currently assume that RLEs take as much space as an uncompressed bitmap) svn path=/branches/reactos-yarotows/; revision=47663
This commit is contained in:
parent
a3214996fc
commit
f8a49f4c75
|
@ -11,7 +11,6 @@ HBITMAP FASTCALL BITMAP_CopyBitmap (HBITMAP hBitmap);
|
|||
UINT FASTCALL BITMAP_GetRealBitsPixel(UINT nBitsPixel);
|
||||
INT FASTCALL BITMAP_GetWidthBytes (INT bmWidth, INT bpp);
|
||||
|
||||
|
||||
HBITMAP
|
||||
APIENTRY
|
||||
GreCreateBitmap(
|
||||
|
@ -20,3 +19,15 @@ GreCreateBitmap(
|
|||
IN UINT cPlanes,
|
||||
IN UINT cBitsPixel,
|
||||
IN OPTIONAL PVOID pvBits);
|
||||
|
||||
HBITMAP
|
||||
APIENTRY
|
||||
GreCreateBitmapEx(
|
||||
IN INT nWidth,
|
||||
IN INT nHeight,
|
||||
IN ULONG cjWidthBytes,
|
||||
IN ULONG iFormat,
|
||||
IN USHORT fjBitmap,
|
||||
IN ULONG cjBits,
|
||||
IN OPTIONAL PVOID pvBits);
|
||||
|
||||
|
|
|
@ -69,11 +69,13 @@ UnsafeSetBitmapBits(
|
|||
|
||||
HBITMAP
|
||||
APIENTRY
|
||||
GreCreateBitmap(
|
||||
GreCreateBitmapEx(
|
||||
IN INT nWidth,
|
||||
IN INT nHeight,
|
||||
IN UINT cPlanes,
|
||||
IN UINT cBitsPixel,
|
||||
IN ULONG cjWidthBytes,
|
||||
IN ULONG iFormat,
|
||||
IN USHORT fjBitmap,
|
||||
IN ULONG cjSizeImage,
|
||||
IN OPTIONAL PVOID pvBits)
|
||||
{
|
||||
PSURFACE psurf;
|
||||
|
@ -82,10 +84,6 @@ GreCreateBitmap(
|
|||
PVOID pvCompressedBits;
|
||||
SIZEL sizl;
|
||||
FLONG fl = 0;
|
||||
ULONG iFormat;
|
||||
|
||||
/* Calculate bitmap format */
|
||||
iFormat = BitmapFormat(cBitsPixel * cPlanes, BI_RGB);
|
||||
|
||||
/* Verify format */
|
||||
if (iFormat < BMF_1BPP || iFormat > BMF_PNG) return NULL;
|
||||
|
@ -121,7 +119,7 @@ GreCreateBitmap(
|
|||
}
|
||||
|
||||
/* Set the bitmap bits */
|
||||
if (!SURFACE_bSetBitmapBits(psurf, fl, 0, pvBits))
|
||||
if (!SURFACE_bSetBitmapBits(psurf, fjBitmap, cjWidthBytes, pvBits))
|
||||
{
|
||||
/* Bail out if that failed */
|
||||
DPRINT1("SURFACE_bSetBitmapBits failed.\n");
|
||||
|
@ -137,6 +135,25 @@ GreCreateBitmap(
|
|||
return hbmp;
|
||||
}
|
||||
|
||||
HBITMAP
|
||||
APIENTRY
|
||||
GreCreateBitmap(
|
||||
IN INT nWidth,
|
||||
IN INT nHeight,
|
||||
IN UINT cPlanes,
|
||||
IN UINT cBitsPixel,
|
||||
IN OPTIONAL PVOID pvBits)
|
||||
{
|
||||
/* Call the extended function */
|
||||
return GreCreateBitmapEx(nWidth,
|
||||
nHeight,
|
||||
0, /* auto width */
|
||||
BitmapFormat(cBitsPixel * cPlanes, BI_RGB),
|
||||
0, /* no bitmap flags */
|
||||
0, /* auto size */
|
||||
pvBits);
|
||||
}
|
||||
|
||||
HBITMAP
|
||||
APIENTRY
|
||||
NtGdiCreateBitmap(
|
||||
|
|
|
@ -1492,11 +1492,13 @@ DIB_CreateDIBSection(
|
|||
// Create Device Dependent Bitmap and add DIB pointer
|
||||
Size.cx = bm.bmWidth;
|
||||
Size.cy = abs(bm.bmHeight);
|
||||
res = IntCreateBitmap(Size,
|
||||
res = GreCreateBitmapEx(bm.bmWidth,
|
||||
abs(bm.bmHeight),
|
||||
bm.bmWidthBytes,
|
||||
BitmapFormat(bi->biBitCount * bi->biPlanes, bi->biCompression),
|
||||
BMF_DONTCACHE | BMF_USERMEM | BMF_NOZEROINIT |
|
||||
(bi->biHeight < 0 ? BMF_TOPDOWN : 0),
|
||||
bi->biSizeImage,
|
||||
bm.bmBits);
|
||||
if (!res)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue