Use GDIINFO values instead of DEVMODE values

svn path=/trunk/; revision=13886
This commit is contained in:
Gé van Geldorp 2005-03-08 20:23:40 +00:00
parent ac74a57d42
commit 1dca540f6b
3 changed files with 6 additions and 13 deletions

View file

@ -79,7 +79,6 @@ typedef struct _DC
HDC hSelf;
HDC hNext;
DHPDEV PDev;
DEVMODEW DMW;
HSURF FillPatternSurfaces[HS_DDI_MAX];
PGDIINFO GDIInfo;
PDEVINFO DevInfo;

View file

@ -167,8 +167,8 @@ NtUserGetSystemMetrics(ULONG Index)
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);

View file

@ -172,7 +172,6 @@ NtGdiCreateCompatableDC(HDC hDC)
NewDC->IsIC = FALSE;
NewDC->PDev = OrigDC->PDev;
NewDC->DMW = OrigDC->DMW;
memcpy(NewDC->FillPatternSurfaces,
OrigDC->FillPatternSurfaces,
sizeof OrigDC->FillPatternSurfaces);
@ -779,7 +778,6 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
}
NewDC->IsIC = CreateAsIC;
NewDC->DMW = PrimarySurface.DMW;
NewDC->DevInfo = &PrimarySurface.DevInfo;
NewDC->GDIInfo = &PrimarySurface.GDIInfo;
memcpy(NewDC->FillPatternSurfaces, PrimarySurface.FillPatterns,
@ -789,11 +787,7 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
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 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
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;