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);
|
UINT FASTCALL BITMAP_GetRealBitsPixel(UINT nBitsPixel);
|
||||||
INT FASTCALL BITMAP_GetWidthBytes (INT bmWidth, INT bpp);
|
INT FASTCALL BITMAP_GetWidthBytes (INT bmWidth, INT bpp);
|
||||||
|
|
||||||
|
|
||||||
HBITMAP
|
HBITMAP
|
||||||
APIENTRY
|
APIENTRY
|
||||||
GreCreateBitmap(
|
GreCreateBitmap(
|
||||||
|
@ -20,3 +19,15 @@ GreCreateBitmap(
|
||||||
IN UINT cPlanes,
|
IN UINT cPlanes,
|
||||||
IN UINT cBitsPixel,
|
IN UINT cBitsPixel,
|
||||||
IN OPTIONAL PVOID pvBits);
|
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
|
HBITMAP
|
||||||
APIENTRY
|
APIENTRY
|
||||||
GreCreateBitmap(
|
GreCreateBitmapEx(
|
||||||
IN INT nWidth,
|
IN INT nWidth,
|
||||||
IN INT nHeight,
|
IN INT nHeight,
|
||||||
IN UINT cPlanes,
|
IN ULONG cjWidthBytes,
|
||||||
IN UINT cBitsPixel,
|
IN ULONG iFormat,
|
||||||
|
IN USHORT fjBitmap,
|
||||||
|
IN ULONG cjSizeImage,
|
||||||
IN OPTIONAL PVOID pvBits)
|
IN OPTIONAL PVOID pvBits)
|
||||||
{
|
{
|
||||||
PSURFACE psurf;
|
PSURFACE psurf;
|
||||||
|
@ -82,10 +84,6 @@ GreCreateBitmap(
|
||||||
PVOID pvCompressedBits;
|
PVOID pvCompressedBits;
|
||||||
SIZEL sizl;
|
SIZEL sizl;
|
||||||
FLONG fl = 0;
|
FLONG fl = 0;
|
||||||
ULONG iFormat;
|
|
||||||
|
|
||||||
/* Calculate bitmap format */
|
|
||||||
iFormat = BitmapFormat(cBitsPixel * cPlanes, BI_RGB);
|
|
||||||
|
|
||||||
/* Verify format */
|
/* Verify format */
|
||||||
if (iFormat < BMF_1BPP || iFormat > BMF_PNG) return NULL;
|
if (iFormat < BMF_1BPP || iFormat > BMF_PNG) return NULL;
|
||||||
|
@ -121,7 +119,7 @@ GreCreateBitmap(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the bitmap bits */
|
/* Set the bitmap bits */
|
||||||
if (!SURFACE_bSetBitmapBits(psurf, fl, 0, pvBits))
|
if (!SURFACE_bSetBitmapBits(psurf, fjBitmap, cjWidthBytes, pvBits))
|
||||||
{
|
{
|
||||||
/* Bail out if that failed */
|
/* Bail out if that failed */
|
||||||
DPRINT1("SURFACE_bSetBitmapBits failed.\n");
|
DPRINT1("SURFACE_bSetBitmapBits failed.\n");
|
||||||
|
@ -137,6 +135,25 @@ GreCreateBitmap(
|
||||||
return hbmp;
|
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
|
HBITMAP
|
||||||
APIENTRY
|
APIENTRY
|
||||||
NtGdiCreateBitmap(
|
NtGdiCreateBitmap(
|
||||||
|
|
|
@ -1492,12 +1492,14 @@ DIB_CreateDIBSection(
|
||||||
// Create Device Dependent Bitmap and add DIB pointer
|
// Create Device Dependent Bitmap and add DIB pointer
|
||||||
Size.cx = bm.bmWidth;
|
Size.cx = bm.bmWidth;
|
||||||
Size.cy = abs(bm.bmHeight);
|
Size.cy = abs(bm.bmHeight);
|
||||||
res = IntCreateBitmap(Size,
|
res = GreCreateBitmapEx(bm.bmWidth,
|
||||||
bm.bmWidthBytes,
|
abs(bm.bmHeight),
|
||||||
BitmapFormat(bi->biBitCount * bi->biPlanes, bi->biCompression),
|
bm.bmWidthBytes,
|
||||||
BMF_DONTCACHE | BMF_USERMEM | BMF_NOZEROINIT |
|
BitmapFormat(bi->biBitCount * bi->biPlanes, bi->biCompression),
|
||||||
(bi->biHeight < 0 ? BMF_TOPDOWN : 0),
|
BMF_DONTCACHE | BMF_USERMEM | BMF_NOZEROINIT |
|
||||||
bm.bmBits);
|
(bi->biHeight < 0 ? BMF_TOPDOWN : 0),
|
||||||
|
bi->biSizeImage,
|
||||||
|
bm.bmBits);
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
if (lpRGB != bmi->bmiColors)
|
if (lpRGB != bmi->bmiColors)
|
||||||
|
|
Loading…
Reference in a new issue