Author: jimtabor
Date: Sun Dec 14 23:25:31 2008
New Revision: 38101
URL:
http://svn.reactos.org/svn/reactos?rev=38101&view=rev
Log:
- Implement DIB section attribute flag support.
- Fix height negativity being passed to NtGdiCreateCompatibleBitmap. See bug 3947.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Sun Dec 14
23:25:31 2008
@@ -1018,8 +1018,9 @@
return 0;
}
- hBitmap = NtGdiCreateCompatibleBitmap(hDC, BitsInfo->bmiHeader.biWidth,
- BitsInfo->bmiHeader.biHeight);
+ hBitmap = NtGdiCreateCompatibleBitmap( hDC,
+ BitsInfo->bmiHeader.biWidth,
+ abs(BitsInfo->bmiHeader.biHeight));
if (hBitmap == NULL)
{
DPRINT1("NtGdiCreateCompatibleBitmap fail create bitmap\n");
@@ -1302,14 +1303,19 @@
HBITMAP APIENTRY
DIB_CreateDIBSection(
- PDC dc, BITMAPINFO *bmi, UINT usage,
- LPVOID *bits, HANDLE section,
- DWORD offset, DWORD ovr_pitch)
+ PDC dc,
+ BITMAPINFO *bmi,
+ UINT usage,
+ LPVOID *bits,
+ HANDLE section,
+ DWORD offset,
+ DWORD ovr_pitch)
{
HBITMAP res = 0;
BITMAPOBJ *bmp = NULL;
DIBSECTION *dib = NULL;
void *mapBits = NULL;
+ PDC_ATTR pDc_Attr;
// Fill BITMAP32 structure with DIB data
BITMAPINFOHEADER *bi = &bmi->bmiHeader;
@@ -1328,6 +1334,9 @@
{
return (HBITMAP)NULL;
}
+
+ pDc_Attr = dc->pDc_Attr;
+ if ( !pDc_Attr ) pDc_Attr = &dc->Dc_Attr;
effHeight = bi->biHeight >= 0 ? bi->biHeight : -bi->biHeight;
bm.bmType = 0;
@@ -1523,6 +1532,8 @@
*bits = bm.bmBits;
}
+ if (res) pDc_Attr->ulDirty_ |= DC_DIBSECTION;
+
return res;
}