Use GDIINFO values instead of DEVMODE values
Modified: trunk/reactos/include/win32k/dc.h
Modified: trunk/reactos/subsys/win32k/ntuser/metric.c
Modified: trunk/reactos/subsys/win32k/objects/dc.c
_____
Modified: trunk/reactos/include/win32k/dc.h
--- trunk/reactos/include/win32k/dc.h 2005-03-08 20:19:07 UTC (rev
13885)
+++ trunk/reactos/include/win32k/dc.h 2005-03-08 20:23:40 UTC (rev
13886)
@@ -79,7 +79,6 @@
HDC hSelf;
HDC hNext;
DHPDEV PDev;
- DEVMODEW DMW;
HSURF FillPatternSurfaces[HS_DDI_MAX];
PGDIINFO GDIInfo;
PDEVINFO DevInfo;
_____
Modified: trunk/reactos/subsys/win32k/ntuser/metric.c
--- trunk/reactos/subsys/win32k/ntuser/metric.c 2005-03-08 20:19:07 UTC
(rev 13885)
+++ trunk/reactos/subsys/win32k/ntuser/metric.c 2005-03-08 20:23:40 UTC
(rev 13886)
@@ -167,8 +167,8 @@
ScreenDC = DC_LockDc(ScreenDCHandle);
if (NULL != ScreenDC)
{
- Width = ScreenDC->DMW.dmPelsWidth;
- Height = ScreenDC->DMW.dmPelsHeight;
+ Width = ScreenDC->GDIInfo->ulHorzRes;
+ Height = ScreenDC->GDIInfo->ulVertRes;
DC_UnlockDc(ScreenDCHandle);
}
NtGdiDeleteDC(ScreenDCHandle);
_____
Modified: trunk/reactos/subsys/win32k/objects/dc.c
--- trunk/reactos/subsys/win32k/objects/dc.c 2005-03-08 20:19:07 UTC
(rev 13885)
+++ trunk/reactos/subsys/win32k/objects/dc.c 2005-03-08 20:23:40 UTC
(rev 13886)
@@ -172,7 +172,6 @@
NewDC->IsIC = FALSE;
NewDC->PDev = OrigDC->PDev;
- NewDC->DMW = OrigDC->DMW;
memcpy(NewDC->FillPatternSurfaces,
OrigDC->FillPatternSurfaces,
sizeof OrigDC->FillPatternSurfaces);
@@ -779,7 +778,6 @@
}
NewDC->IsIC = CreateAsIC;
- NewDC->DMW = PrimarySurface.DMW;
NewDC->DevInfo = &PrimarySurface.DevInfo;
NewDC->GDIInfo = &PrimarySurface.GDIInfo;
memcpy(NewDC->FillPatternSurfaces, PrimarySurface.FillPatterns,
@@ -789,11 +787,7 @@
NewDC->DriverFunctions = PrimarySurface.DriverFunctions;
NewDC->w.hBitmap = PrimarySurface.Handle;
- NewDC->DMW.dmSize = sizeof(NewDC->DMW);
- NewDC->DMW.dmFields = 0x000fc000;
-
- NewDC->DMW.dmLogPixels = 96;
- NewDC->w.bitsPerPixel = NewDC->DMW.dmBitsPerPel; // FIXME: set this
here??
+ NewDC->w.bitsPerPixel = NewDC->GDIInfo->cBitsPixel *
NewDC->GDIInfo->cPlanes;
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
if (! CreateAsIC)
@@ -805,9 +799,9 @@
DC_FreeDC ( hNewDC) ;
return NULL;
}
- ASSERT(NewDC->DMW.dmBitsPerPel ==
BitsPerFormat(SurfObj->iBitmapFormat));
- ASSERT(NewDC->DMW.dmPelsWidth == SurfObj->sizlBitmap.cx);
- ASSERT(NewDC->DMW.dmPelsHeight == SurfObj->sizlBitmap.cy);
+ ASSERT(NewDC->GDIInfo->cBitsPixel * NewDC->GDIInfo->cPlanes ==
BitsPerFormat(SurfObj->iBitmapFormat));
+ ASSERT(NewDC->GDIInfo->ulHorzRes == SurfObj->sizlBitmap.cx);
+ ASSERT(NewDC->GDIInfo->ulVertRes == SurfObj->sizlBitmap.cy);
NewDC->w.hPalette = NewDC->DevInfo->hpalDefault;
NewDC->w.ROPmode = R2_COPYPEN;
Show replies by date