mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Added color translation for solid color brushes.
svn path=/trunk/; revision=3369
This commit is contained in:
parent
5add7bd9d8
commit
6b30cb44dd
2 changed files with 20 additions and 7 deletions
|
@ -13,7 +13,6 @@ BOOL VGADDIFillSolid(SURFOBJ *Surface, RECTL Dimensions, ULONG iColor)
|
||||||
ULONG long leftpixs, midpixs, rightpixs, temp;
|
ULONG long leftpixs, midpixs, rightpixs, temp;
|
||||||
UCHAR a;
|
UCHAR a;
|
||||||
|
|
||||||
DPRINT("VGADDIFillSolid: x:%d, y:%d, w:%d, h:%d\n", x, y, w, h);
|
|
||||||
|
|
||||||
// Swap dimensions so that x, y are at topmost left
|
// Swap dimensions so that x, y are at topmost left
|
||||||
if(Dimensions.right < Dimensions.left) {
|
if(Dimensions.right < Dimensions.left) {
|
||||||
|
@ -34,6 +33,7 @@ BOOL VGADDIFillSolid(SURFOBJ *Surface, RECTL Dimensions, ULONG iColor)
|
||||||
// Calculate the width and height
|
// Calculate the width and height
|
||||||
w = x2 - x;
|
w = x2 - x;
|
||||||
h = y2 - y;
|
h = y2 - y;
|
||||||
|
DPRINT("VGADDIFillSolid: x:%d, y:%d, w:%d, h:%d, color: %d\n", x, y, w, h, iColor);
|
||||||
|
|
||||||
// Calculate the starting offset
|
// Calculate the starting offset
|
||||||
offset = xconv[x]+y80[y];
|
offset = xconv[x]+y80[y];
|
||||||
|
@ -87,6 +87,7 @@ BOOL VGADDIFillSolid(SURFOBJ *Surface, RECTL Dimensions, ULONG iColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Middle
|
// Middle
|
||||||
|
|
||||||
x=orgx+(8-leftpixs)+leftpixs;
|
x=orgx+(8-leftpixs)+leftpixs;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: dc.c,v 1.34 2002/08/18 07:02:57 ei Exp $
|
/* $Id: dc.c,v 1.35 2002/08/19 21:49:45 ei Exp $
|
||||||
*
|
*
|
||||||
* DC.C - Device context functions
|
* DC.C - Device context functions
|
||||||
*
|
*
|
||||||
|
@ -904,6 +904,7 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
PSURFGDI surfgdi;
|
PSURFGDI surfgdi;
|
||||||
PDC dc;
|
PDC dc;
|
||||||
PPENOBJ pen;
|
PPENOBJ pen;
|
||||||
|
PBRUSHOBJ brush;
|
||||||
PXLATEOBJ XlateObj;
|
PXLATEOBJ XlateObj;
|
||||||
PPALGDI PalGDI;
|
PPALGDI PalGDI;
|
||||||
WORD objectMagic;
|
WORD objectMagic;
|
||||||
|
@ -923,14 +924,25 @@ 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(dc->w.hPalette);
|
PalGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
|
||||||
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
if( PalGDI ){
|
||||||
pen = GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC);
|
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||||
pen->logpen.lopnColor = XLATEOBJ_iXlate(XlateObj, pen->logpen.lopnColor);
|
pen = GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC);
|
||||||
GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC);
|
pen->logpen.lopnColor = XLATEOBJ_iXlate(XlateObj, pen->logpen.lopnColor);
|
||||||
|
GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC);
|
||||||
|
}
|
||||||
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
|
||||||
|
PalGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
|
||||||
|
if( PalGDI ){
|
||||||
|
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||||
|
brush = GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||||
|
brush->iSolidColor = XLATEOBJ_iXlate(XlateObj, brush->iSolidColor);
|
||||||
|
GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GO_FONT_MAGIC:
|
case GO_FONT_MAGIC:
|
||||||
objOrg = (HGDIOBJ)dc->w.hFont;
|
objOrg = (HGDIOBJ)dc->w.hFont;
|
||||||
|
|
Loading…
Reference in a new issue