From 604728cdb123ca0cc0b39b1df29b279aa3ae8917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Mon, 14 Jul 2003 17:36:59 +0000 Subject: [PATCH] Set CombinedClip region for memory DCs svn path=/trunk/; revision=5118 --- reactos/subsys/win32k/objects/cliprgn.c | 7 ++++++- reactos/subsys/win32k/objects/dc.c | 25 +++++++++++++++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/reactos/subsys/win32k/objects/cliprgn.c b/reactos/subsys/win32k/objects/cliprgn.c index 55b933856a0..42d0d9f629d 100644 --- a/reactos/subsys/win32k/objects/cliprgn.c +++ b/reactos/subsys/win32k/objects/cliprgn.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * 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 #include @@ -121,6 +121,11 @@ W32kSelectVisRgn(HDC hdc, HRGN hrgn) 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); CLIPPING_UpdateGCRegion(dc); DC_ReleasePtr( hdc ); diff --git a/reactos/subsys/win32k/objects/dc.c b/reactos/subsys/win32k/objects/dc.c index 9d897639447..db9a40ced57 100644 --- a/reactos/subsys/win32k/objects/dc.c +++ b/reactos/subsys/win32k/objects/dc.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * 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 * @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -123,6 +124,7 @@ HDC STDCALL W32kCreateCompatableDC(HDC hDC) PDC NewDC, OrigDC = NULL; HBITMAP hBitmap; HDC hNewDC; + HRGN hVisRgn; OrigDC = DC_HandleToPtr(hDC); if (OrigDC == NULL) @@ -194,6 +196,11 @@ HDC STDCALL W32kCreateCompatableDC(HDC hDC) } DC_ReleasePtr( hDC ); DC_ReleasePtr( hNewDC ); + + hVisRgn = W32kCreateRectRgn(0, 0, 1, 1); + W32kSelectVisRgn(hNewDC, hVisRgn); + W32kDeleteObject(hVisRgn); + DC_InitDC(hNewDC); return hNewDC; @@ -387,6 +394,7 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver, PDC NewDC; HDC hDC = NULL; PSURFGDI SurfGDI; + HRGN hVisRgn; /* Check for existing DC object */ if ((hNewDC = DC_FindOpenDC(Driver)) != NULL) @@ -443,11 +451,14 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver, NewDC->w.hPalette = NewDC->DevInfo->hpalDefault; 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 ); + hVisRgn = W32kCreateRectRgn(0, 0, SurfGDI->SurfObj.sizlBitmap.cx, + SurfGDI->SurfObj.sizlBitmap.cy); + W32kSelectVisRgn(hNewDC, hVisRgn); + W32kDeleteObject(hVisRgn); + /* Initialize the DC state */ DC_InitDC(hNewDC); W32kSetTextColor(hNewDC, RGB(0, 0, 0)); @@ -1188,6 +1199,7 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj) WORD objectMagic; COLORREF *ColorMap; ULONG NumColors, Index; + HRGN hVisRgn; if(!hDC || !hGDIObj) return NULL; @@ -1282,6 +1294,11 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj) } else { dc->w.bitsPerPixel = pb->bitmap.bmBitsPixel; } + + hVisRgn = W32kCreateRectRgn(0, 0, pb->size.cx, pb->size.cy); + W32kSelectVisRgn(hDC, hVisRgn); + W32kDeleteObject(hVisRgn); + break; #if UPDATEREGIONS