Author: jgardou
Date: Mon Aug 2 14:45:51 2010
New Revision: 48415
URL:
http://svn.reactos.org/svn/reactos?rev=48415&view=rev
Log:
[WIN32K]
- Use correct offset in UserLoadImage, create the bitmap using display DC.
- BITMAP_GetObject : Report BI_BITFIELDS compression when we should.
- Use a 0 compatible DC when none is given in NtGdiCreateDIBitmapInternal.
This fixes some wine tests. Enjoy.
Modified:
branches/reactos-yarotows/subsystems/win32/win32k/misc/file.c
branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c
branches/reactos-yarotows/subsystems/win32/win32k/objects/dibobj.c
Modified: branches/reactos-yarotows/subsystems/win32/win32k/misc/file.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/misc/file.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/misc/file.c [iso-8859-1] Mon Aug 2
14:45:51 2010
@@ -149,10 +149,6 @@
return pvBase;
}
-// FIXME: this should go to dibobj.c
-
-
-
HBITMAP
NTAPI
UserLoadImage(PCWSTR pwszName)
@@ -213,8 +209,9 @@
{
/* Could be BITMAPCOREINFO */
BITMAPINFO* pConvertedInfo;
-
- pvBits = (PVOID)((PCHAR)pbmi + pbmfh->bfOffBits);
+ HDC hdc;
+
+ pvBits = (PVOID)((PCHAR)pbmfh + pbmfh->bfOffBits);
pConvertedInfo = DIB_ConvertBitmapInfo(pbmi, DIB_RGB_COLORS);
if(!pConvertedInfo)
@@ -223,19 +220,19 @@
goto leave;
}
- // FIXME: use Gre... so that the BITMAPINFO doesn't get probed
- hbmp = NtGdiCreateDIBitmapInternal(NULL,
- pConvertedInfo->bmiHeader.biWidth,
- pConvertedInfo->bmiHeader.biHeight,
- CBM_INIT,
- pvBits,
- pbmi,
- DIB_RGB_COLORS,
- pConvertedInfo->bmiHeader.biSize,
- pConvertedInfo->bmiHeader.biSizeImage,
- 0,
- 0);
-
+ hdc = IntGdiCreateDC(NULL, NULL, NULL, NULL,FALSE);
+
+ hbmp = GreCreateDIBitmapInternal(hdc,
+ pConvertedInfo->bmiHeader.biWidth,
+ pConvertedInfo->bmiHeader.biHeight,
+ CBM_INIT,
+ pvBits,
+ pConvertedInfo,
+ DIB_RGB_COLORS,
+ 0,
+ 0);
+
+ NtGdiDeleteObjectApp(hdc);
DIB_FreeConvertedBitmapInfo(pConvertedInfo, pbmi);
}
else
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Mon
Aug 2 14:45:51 2010
@@ -971,30 +971,36 @@
pds->dsBmih.biHeight = pds->dsBm.bmHeight;
pds->dsBmih.biPlanes = pds->dsBm.bmPlanes;
pds->dsBmih.biBitCount = pds->dsBm.bmBitsPixel;
- switch (psurf->SurfObj.iBitmapFormat)
- {
- /* FIXME: What about BI_BITFIELDS? */
- case BMF_1BPP:
- case BMF_4BPP:
- case BMF_8BPP:
- case BMF_16BPP:
- case BMF_24BPP:
- case BMF_32BPP:
- pds->dsBmih.biCompression = BI_RGB;
- break;
- case BMF_4RLE:
- pds->dsBmih.biCompression = BI_RLE4;
- break;
- case BMF_8RLE:
- pds->dsBmih.biCompression = BI_RLE8;
- break;
- case BMF_JPEG:
- pds->dsBmih.biCompression = BI_JPEG;
- break;
- case BMF_PNG:
- pds->dsBmih.biCompression = BI_PNG;
- break;
- }
+ if(psurf->ppal->Mode & PAL_BITFIELDS)
+ {
+ pds->dsBmih.biCompression = BI_BITFIELDS;
+ }
+ else
+ {
+ switch (psurf->SurfObj.iBitmapFormat)
+ {
+ case BMF_1BPP:
+ case BMF_4BPP:
+ case BMF_8BPP:
+ case BMF_16BPP:
+ case BMF_24BPP:
+ case BMF_32BPP:
+ pds->dsBmih.biCompression = BI_RGB;
+ break;
+ case BMF_4RLE:
+ pds->dsBmih.biCompression = BI_RLE4;
+ break;
+ case BMF_8RLE:
+ pds->dsBmih.biCompression = BI_RLE8;
+ break;
+ case BMF_JPEG:
+ pds->dsBmih.biCompression = BI_JPEG;
+ break;
+ case BMF_PNG:
+ pds->dsBmih.biCompression = BI_PNG;
+ break;
+ }
+ }
pds->dsBmih.biSizeImage = psurf->SurfObj.cjBits;
pds->dsBmih.biXPelsPerMeter = 0;
pds->dsBmih.biYPelsPerMeter = 0;
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Mon
Aug 2 14:45:51 2010
@@ -1258,7 +1258,7 @@
if (!hDc) /* 1bpp monochrome bitmap */
{ // Should use System Bitmap DC hSystemBM, with CreateCompatibleDC for this.
- hdcDest = IntGdiCreateDC(NULL, NULL, NULL, NULL,FALSE);
+ hdcDest = NtGdiCreateCompatibleDC(0);
if(!hdcDest)
{
return NULL;