mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 20:36:26 +00:00
Set CombinedClip region for memory DCs
svn path=/trunk/; revision=5118
This commit is contained in:
parent
bf39992fa1
commit
604728cdb1
2 changed files with 27 additions and 5 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: cliprgn.c,v 1.17 2003/06/28 08:39:18 gvg Exp $ */
|
/* $Id: cliprgn.c,v 1.18 2003/07/14 17:36:59 gvg Exp $ */
|
||||||
|
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -121,6 +121,11 @@ W32kSelectVisRgn(HDC hdc, HRGN hrgn)
|
||||||
|
|
||||||
dc->w.flags &= ~DC_DIRTY;
|
dc->w.flags &= ~DC_DIRTY;
|
||||||
|
|
||||||
|
if (dc->w.hVisRgn == NULL)
|
||||||
|
{
|
||||||
|
dc->w.hVisRgn = W32kCreateRectRgn(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
retval = W32kCombineRgn(dc->w.hVisRgn, hrgn, 0, RGN_COPY);
|
retval = W32kCombineRgn(dc->w.hVisRgn, hrgn, 0, RGN_COPY);
|
||||||
CLIPPING_UpdateGCRegion(dc);
|
CLIPPING_UpdateGCRegion(dc);
|
||||||
DC_ReleasePtr( hdc );
|
DC_ReleasePtr( hdc );
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: dc.c,v 1.62 2003/06/28 08:39:18 gvg Exp $
|
/* $Id: dc.c,v 1.63 2003/07/14 17:36:59 gvg Exp $
|
||||||
*
|
*
|
||||||
* DC.C - Device context functions
|
* DC.C - Device context functions
|
||||||
*
|
*
|
||||||
|
@ -28,6 +28,7 @@
|
||||||
#include <ddk/ntddvid.h>
|
#include <ddk/ntddvid.h>
|
||||||
|
|
||||||
#include <win32k/bitmaps.h>
|
#include <win32k/bitmaps.h>
|
||||||
|
#include <win32k/cliprgn.h>
|
||||||
#include <win32k/coord.h>
|
#include <win32k/coord.h>
|
||||||
#include <win32k/driver.h>
|
#include <win32k/driver.h>
|
||||||
#include <win32k/dc.h>
|
#include <win32k/dc.h>
|
||||||
|
@ -123,6 +124,7 @@ HDC STDCALL W32kCreateCompatableDC(HDC hDC)
|
||||||
PDC NewDC, OrigDC = NULL;
|
PDC NewDC, OrigDC = NULL;
|
||||||
HBITMAP hBitmap;
|
HBITMAP hBitmap;
|
||||||
HDC hNewDC;
|
HDC hNewDC;
|
||||||
|
HRGN hVisRgn;
|
||||||
|
|
||||||
OrigDC = DC_HandleToPtr(hDC);
|
OrigDC = DC_HandleToPtr(hDC);
|
||||||
if (OrigDC == NULL)
|
if (OrigDC == NULL)
|
||||||
|
@ -194,6 +196,11 @@ HDC STDCALL W32kCreateCompatableDC(HDC hDC)
|
||||||
}
|
}
|
||||||
DC_ReleasePtr( hDC );
|
DC_ReleasePtr( hDC );
|
||||||
DC_ReleasePtr( hNewDC );
|
DC_ReleasePtr( hNewDC );
|
||||||
|
|
||||||
|
hVisRgn = W32kCreateRectRgn(0, 0, 1, 1);
|
||||||
|
W32kSelectVisRgn(hNewDC, hVisRgn);
|
||||||
|
W32kDeleteObject(hVisRgn);
|
||||||
|
|
||||||
DC_InitDC(hNewDC);
|
DC_InitDC(hNewDC);
|
||||||
|
|
||||||
return hNewDC;
|
return hNewDC;
|
||||||
|
@ -387,6 +394,7 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver,
|
||||||
PDC NewDC;
|
PDC NewDC;
|
||||||
HDC hDC = NULL;
|
HDC hDC = NULL;
|
||||||
PSURFGDI SurfGDI;
|
PSURFGDI SurfGDI;
|
||||||
|
HRGN hVisRgn;
|
||||||
|
|
||||||
/* Check for existing DC object */
|
/* Check for existing DC object */
|
||||||
if ((hNewDC = DC_FindOpenDC(Driver)) != NULL)
|
if ((hNewDC = DC_FindOpenDC(Driver)) != NULL)
|
||||||
|
@ -443,11 +451,14 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver,
|
||||||
NewDC->w.hPalette = NewDC->DevInfo->hpalDefault;
|
NewDC->w.hPalette = NewDC->DevInfo->hpalDefault;
|
||||||
|
|
||||||
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
|
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
|
||||||
|
|
||||||
NewDC->w.hVisRgn = W32kCreateRectRgn(0, 0, SurfGDI->SurfObj.sizlBitmap.cx,
|
|
||||||
SurfGDI->SurfObj.sizlBitmap.cy);
|
|
||||||
DC_ReleasePtr( hNewDC );
|
DC_ReleasePtr( hNewDC );
|
||||||
|
|
||||||
|
hVisRgn = W32kCreateRectRgn(0, 0, SurfGDI->SurfObj.sizlBitmap.cx,
|
||||||
|
SurfGDI->SurfObj.sizlBitmap.cy);
|
||||||
|
W32kSelectVisRgn(hNewDC, hVisRgn);
|
||||||
|
W32kDeleteObject(hVisRgn);
|
||||||
|
|
||||||
/* Initialize the DC state */
|
/* Initialize the DC state */
|
||||||
DC_InitDC(hNewDC);
|
DC_InitDC(hNewDC);
|
||||||
W32kSetTextColor(hNewDC, RGB(0, 0, 0));
|
W32kSetTextColor(hNewDC, RGB(0, 0, 0));
|
||||||
|
@ -1188,6 +1199,7 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
WORD objectMagic;
|
WORD objectMagic;
|
||||||
COLORREF *ColorMap;
|
COLORREF *ColorMap;
|
||||||
ULONG NumColors, Index;
|
ULONG NumColors, Index;
|
||||||
|
HRGN hVisRgn;
|
||||||
|
|
||||||
if(!hDC || !hGDIObj) return NULL;
|
if(!hDC || !hGDIObj) return NULL;
|
||||||
|
|
||||||
|
@ -1282,6 +1294,11 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
} else {
|
} else {
|
||||||
dc->w.bitsPerPixel = pb->bitmap.bmBitsPixel;
|
dc->w.bitsPerPixel = pb->bitmap.bmBitsPixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hVisRgn = W32kCreateRectRgn(0, 0, pb->size.cx, pb->size.cy);
|
||||||
|
W32kSelectVisRgn(hDC, hVisRgn);
|
||||||
|
W32kDeleteObject(hVisRgn);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if UPDATEREGIONS
|
#if UPDATEREGIONS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue