mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 20:36:35 +00:00
Release XLATEOBJs after use
svn path=/trunk/; revision=4403
This commit is contained in:
parent
1e8cc39810
commit
8b0fa2ce3d
1 changed files with 20 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: dc.c,v 1.50 2003/03/08 13:16:51 gvg Exp $
|
/* $Id: dc.c,v 1.51 2003/03/22 23:57:32 gvg Exp $
|
||||||
*
|
*
|
||||||
* DC.C - Device context functions
|
* DC.C - Device context functions
|
||||||
*
|
*
|
||||||
|
@ -1043,34 +1043,39 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
|
|
||||||
// Convert the color of the pen to the format of the DC
|
// Convert the color of the pen to the format of the DC
|
||||||
PalGDI = (PPALGDI)AccessInternalObject((ULONG) dc->w.hPalette);
|
PalGDI = (PPALGDI)AccessInternalObject((ULONG) dc->w.hPalette);
|
||||||
if( PalGDI ){
|
if( PalGDI ){
|
||||||
XlateObj = (PXLATEOBJ)IntEngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
XlateObj = (PXLATEOBJ)IntEngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||||
pen = GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC);
|
pen = GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC);
|
||||||
if( pen ){
|
if( pen ){
|
||||||
pen->logpen.lopnColor = XLATEOBJ_iXlate(XlateObj, pen->logpen.lopnColor);
|
pen->logpen.lopnColor = XLATEOBJ_iXlate(XlateObj, pen->logpen.lopnColor);
|
||||||
}
|
}
|
||||||
GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC);
|
GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC);
|
||||||
}
|
EngDeleteXlate(XlateObj);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GO_BRUSH_MAGIC:
|
case GO_BRUSH_MAGIC:
|
||||||
objOrg = (HGDIOBJ)dc->w.hBrush;
|
objOrg = (HGDIOBJ)dc->w.hBrush;
|
||||||
dc->w.hBrush = (HBRUSH) hGDIObj;
|
dc->w.hBrush = (HBRUSH) hGDIObj;
|
||||||
|
|
||||||
// Convert the color of the brush to the format of the DC
|
// Convert the color of the brush to the format of the DC
|
||||||
PalGDI = (PPALGDI)AccessInternalObject((ULONG) dc->w.hPalette);
|
PalGDI = (PPALGDI)AccessInternalObject((ULONG) dc->w.hPalette);
|
||||||
if( PalGDI ){
|
if( PalGDI ){
|
||||||
XlateObj = (PXLATEOBJ)IntEngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
XlateObj = (PXLATEOBJ)IntEngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||||
brush = GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
|
brush = GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||||
if( brush ){
|
if( brush ){
|
||||||
brush->iSolidColor = XLATEOBJ_iXlate(XlateObj, brush->logbrush.lbColor);
|
brush->iSolidColor = XLATEOBJ_iXlate(XlateObj, brush->logbrush.lbColor);
|
||||||
}
|
}
|
||||||
GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC);
|
GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||||
}
|
EngDeleteXlate(XlateObj);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GO_FONT_MAGIC:
|
|
||||||
|
case GO_FONT_MAGIC:
|
||||||
objOrg = (HGDIOBJ)dc->w.hFont;
|
objOrg = (HGDIOBJ)dc->w.hFont;
|
||||||
dc->w.hFont = (HFONT) hGDIObj;
|
dc->w.hFont = (HFONT) hGDIObj;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GO_BITMAP_MAGIC:
|
case GO_BITMAP_MAGIC:
|
||||||
// must be memory dc to select bitmap
|
// must be memory dc to select bitmap
|
||||||
if (!(dc->w.flags & DC_MEMORY)) return NULL;
|
if (!(dc->w.flags & DC_MEMORY)) return NULL;
|
||||||
|
@ -1115,6 +1120,7 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
dc->w.bitsPerPixel = pb->bitmap.bmBitsPixel;
|
dc->w.bitsPerPixel = pb->bitmap.bmBitsPixel;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if UPDATEREGIONS
|
#if UPDATEREGIONS
|
||||||
case GO_REGION_MAGIC:
|
case GO_REGION_MAGIC:
|
||||||
/* objOrg = (HGDIOBJ)hDC->region; */
|
/* objOrg = (HGDIOBJ)hDC->region; */
|
||||||
|
|
Loading…
Reference in a new issue