Author: jgardou
Date: Sun Jun 20 13:11:23 2010
New Revision: 47809
URL:
http://svn.reactos.org/svn/reactos?rev=47809&view=rev
Log:
apply 46848 from yarotows
[WIN32K]
- get rid of ROS_DC::BitsPerPixel.
1 - It was a hack.
2 - Its use was inconsistent.
Modified:
trunk/reactos/ (props changed)
trunk/reactos/subsystems/win32/win32k/include/dc.h
trunk/reactos/subsystems/win32/win32k/objects/dclife.c
trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c
trunk/reactos/subsystems/win32/win32k/objects/dcstate.c
Propchange: trunk/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 20 13:11:23 2010
@@ -1,4 +1,4 @@
/branches/header-work:45691-47721
-/branches/reactos-yarotows:46966,47800
+/branches/reactos-yarotows:46848,46966,47800
/branches/ros-amd64-bringup:36852
/branches/ros-amd64-bringup/reactos:34711-34712,34741,34743,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36397,36445,36502-36503,36505,36570,36614,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36992,37323,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40927-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479,41484-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43857-43858,43860,43905-43907,43969,44002,44036-44037,44039-44040,44044-44045,44065,44095,44123,44144,44205,44238,44294,44338-44339,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44772,45124,45126-45127,46394,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805
Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] Sun Jun 20 13:11:23
2010
@@ -28,8 +28,6 @@
HRGN hClipRgn; /* Clip region (may be 0) */
HRGN hVisRgn; /* Visible region (must never be 0) */
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
-
- BYTE bitsPerPixel;
CLIPOBJ *CombinedClip; /* Use XCLIPOBJ in DC. */
Modified: trunk/reactos/subsystems/win32/win32k/objects/dclife.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Sun Jun 20
13:11:23 2010
@@ -310,10 +310,6 @@
// ATM we only have one display.
pdcattr->ulDirty_ |= DC_PRIMARY_DISPLAY;
- pdc->rosdc.bitsPerPixel = pdc->ppdev->gdiinfo.cBitsPixel *
- pdc->ppdev->gdiinfo.cPlanes;
- DPRINT("Bits per pel: %u\n", pdc->rosdc.bitsPerPixel);
-
pdc->flGraphicsCaps = PrimarySurface.devinfo.flGraphicsCaps;
pdc->flGraphicsCaps2 = PrimarySurface.devinfo.flGraphicsCaps2;
@@ -714,8 +710,6 @@
pdcNew->dhpdev = pdcOld->dhpdev;
- pdcNew->rosdc.bitsPerPixel = pdcOld->rosdc.bitsPerPixel;
-
/* DriverName is copied in the AllocDC routine */
pdcattrNew->ptlWindowOrg = pdcattrOld->ptlWindowOrg;
pdcattrNew->szlWindowExt = pdcattrOld->szlWindowExt;
Modified: trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] Sun Jun 20
13:11:23 2010
@@ -162,10 +162,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;
@@ -291,28 +291,22 @@
// 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);
- /* Set DIBSECTION attribute */
- pdcattr->ulDirty_ |= DC_DIBSECTION;
- }
- else
- {
- pDC->rosdc.bitsPerPixel = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat);
- /* Restore DIBSECTION attribute */
- pdcattr->ulDirty_ &= ~DC_DIBSECTION;
- }
-
/* FIXME; improve by using a region without a handle and selecting it */
hVisRgn = IntSysCreateRectRgn( 0,
0,
psurfBmp->SurfObj.sizlBitmap.cx,
psurfBmp->SurfObj.sizlBitmap.cy);
+ if(psurfBmp->hSecure)
+ {
+ /* Set DIBSECTION attribute */
+ pdcattr->ulDirty_ |= DC_DIBSECTION;
+ }
+ else
+ {
+ pdcattr->ulDirty_ &= ~DC_DIBSECTION;
+ }
+
/* Release the exclusive lock */
SURFACE_UnlockSurface(psurfBmp);
Modified: trunk/reactos/subsystems/win32/win32k/objects/dcstate.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] Sun Jun 20
13:11:23 2010
@@ -44,12 +44,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.
{
@@ -76,11 +70,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);