From 1a601ba9e55dd4913890d8fd94f9ab1bed14b47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Wed, 16 Jun 2010 16:59:29 +0000 Subject: [PATCH] [WIN32K] - Set DC_DIBSECTION dirty flag when a DIB section is selected, not when one is created. svn path=/trunk/; revision=47787 --- reactos/subsystems/win32/win32k/objects/dcobjs.c | 4 ++++ reactos/subsystems/win32/win32k/objects/dibobj.c | 9 ++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/dcobjs.c b/reactos/subsystems/win32/win32k/objects/dcobjs.c index 0bafaadd159..6e5e2c42fbb 100644 --- a/reactos/subsystems/win32/win32k/objects/dcobjs.c +++ b/reactos/subsystems/win32/win32k/objects/dcobjs.c @@ -297,10 +297,14 @@ NtGdiSelectBitmap( { // pDC->rosdc.bitsPerPixel = psurfBmp->dib->dsBmih.biBitCount; ??? pDC->rosdc.bitsPerPixel = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat); + /* Set DIBSECTION attribute */ + pdcattr->ulDirty_ |= DC_DIBSECTION; } else { pDC->rosdc.bitsPerPixel = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat); + /* Restore DIBSECTION attribute */ + pdcattr->ulDirty_ &= ~DC_DIBSECTION; } /* FIXME; improve by using a region without a handle and selecting it */ diff --git a/reactos/subsystems/win32/win32k/objects/dibobj.c b/reactos/subsystems/win32/win32k/objects/dibobj.c index 2ec35e6ee4a..f8ce6460278 100644 --- a/reactos/subsystems/win32/win32k/objects/dibobj.c +++ b/reactos/subsystems/win32/win32k/objects/dibobj.c @@ -558,7 +558,7 @@ NtGdiSetDIBitsToDeviceInternal( EXLATEOBJ_vInitialize(&exlo, ppalDIB, ppalDDB, 0, 0, 0); /* 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", rcDest.left, rcDest.top, rcDest.right, rcDest.bottom, ptSource.x, ptSource.y, SourceSize.cx, SourceSize.cy); Status = IntEngBitBlt(pDestSurf, @@ -636,7 +636,7 @@ NtGdiGetDIBitsInternal( _SEH2_TRY { ProbeForRead(&Info->bmiHeader.biSize, sizeof(DWORD), 1); - + ProbeForWrite(Info, Info->bmiHeader.biSize, 1); // Comp for Core. if (ChkBits) ProbeForWrite(ChkBits, MaxBits, 1); } @@ -1347,7 +1347,6 @@ DIB_CreateDIBSection( HBITMAP res = 0; SURFACE *bmp = NULL; void *mapBits = NULL; - PDC_ATTR pdcattr; // Fill BITMAP32 structure with DIB data BITMAPINFOHEADER *bi = &bmi->bmiHeader; @@ -1370,8 +1369,6 @@ DIB_CreateDIBSection( return (HBITMAP)NULL; } - pdcattr = dc->pdcattr; - effHeight = bi->biHeight >= 0 ? bi->biHeight : -bi->biHeight; bm.bmType = 0; bm.bmWidth = bi->biWidth; @@ -1593,8 +1590,6 @@ DIB_CreateDIBSection( *bits = bm.bmBits; } - if (res) pdcattr->ulDirty_ |= DC_DIBSECTION; - return res; }