Author: jgardou Date: Mon Apr 12 20:44:36 2010 New Revision: 46848
URL: http://svn.reactos.org/svn/reactos?rev=46848&view=rev Log: [WIN32K] - get rid of ROS_DC::BitsPerPixel. 1 - It was a hack. 2 - Its use was inconsistent.
Modified: branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c
Modified: branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h [iso-8859-1] Mon Apr 12 20:44:36 2010 @@ -53,8 +53,6 @@ { HRGN hClipRgn; /* Clip region (may be 0) */ HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */ - - BYTE bitsPerPixel;
CLIPOBJ *CombinedClip;
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Mon Apr 12 20:44:36 2010 @@ -106,8 +106,6 @@ GdiSelectVisRgn(pdc->BaseObject.hHmgr, hVisRgn); GreDeleteObject(hVisRgn); ASSERT(pdc->prgnVis); - pdc->rosdc.bitsPerPixel = pdc->ppdev->gdiinfo.cBitsPixel * - pdc->ppdev->gdiinfo.cPlanes; }
VOID
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] Mon Apr 12 20:44:36 2010 @@ -156,10 +156,10 @@ return NULL; }
- // FIXME: This looks wrong /* Is this a valid palette for this depth? */ - if ((pdc->rosdc.bitsPerPixel <= 8 && ppal->Mode == PAL_INDEXED) || - (pdc->rosdc.bitsPerPixel > 8)) + if ((BitsPerFormat(pdc->dclevel.pSurface->SurfObj.iBitmapFormat) <= 8 + && ppal->Mode == PAL_INDEXED) || + (BitsPerFormat(pdc->dclevel.pSurface->SurfObj.iBitmapFormat) > 8)) { /* Get old palette, set new one */ oldPal = pdc->dclevel.hpal; @@ -285,18 +285,6 @@ // If Info DC this is zero and pSurface is moved to DC->pSurfInfo. psurfBmp->hDC = hDC;
- // if we're working with a DIB, get the palette - // [fixme: only create if the selected palette is null] - if (psurfBmp->hSecure) - { -// pDC->rosdc.bitsPerPixel = psurfBmp->dib->dsBmih.biBitCount; ??? - pDC->rosdc.bitsPerPixel = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat); - } - else - { - pDC->rosdc.bitsPerPixel = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat); - } - /* FIXME; improve by using a region without a handle and selecting it */ hVisRgn = IntSysCreateRectRgn( 0, 0,
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] Mon Apr 12 20:44:36 2010 @@ -48,12 +48,6 @@ // FIXME: handle refs pdcDst->dclevel.plfnt = pdcSrc->dclevel.plfnt;
- /* ROS hacks */ - if (pdcDst->dctype != DC_TYPE_MEMORY) - { - pdcDst->rosdc.bitsPerPixel = pdcSrc->rosdc.bitsPerPixel; - } - /* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */ if (To) // Copy "To" SaveDC state. { @@ -80,11 +74,6 @@ if (!dc) return FALSE; // Clean the DC if (defaultDCstate) DC_vCopyState(defaultDCstate, dc, FALSE); - - if (dc->dctype != DC_TYPE_MEMORY) - { - dc->rosdc.bitsPerPixel = defaultDCstate->rosdc.bitsPerPixel; - }
DC_UnlockDc(dc);