mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Use GDIINFO values instead of DEVMODE values
svn path=/trunk/; revision=13886
This commit is contained in:
parent
ac74a57d42
commit
1dca540f6b
3 changed files with 6 additions and 13 deletions
|
@ -79,7 +79,6 @@ typedef struct _DC
|
||||||
HDC hSelf;
|
HDC hSelf;
|
||||||
HDC hNext;
|
HDC hNext;
|
||||||
DHPDEV PDev;
|
DHPDEV PDev;
|
||||||
DEVMODEW DMW;
|
|
||||||
HSURF FillPatternSurfaces[HS_DDI_MAX];
|
HSURF FillPatternSurfaces[HS_DDI_MAX];
|
||||||
PGDIINFO GDIInfo;
|
PGDIINFO GDIInfo;
|
||||||
PDEVINFO DevInfo;
|
PDEVINFO DevInfo;
|
||||||
|
|
|
@ -167,8 +167,8 @@ NtUserGetSystemMetrics(ULONG Index)
|
||||||
ScreenDC = DC_LockDc(ScreenDCHandle);
|
ScreenDC = DC_LockDc(ScreenDCHandle);
|
||||||
if (NULL != ScreenDC)
|
if (NULL != ScreenDC)
|
||||||
{
|
{
|
||||||
Width = ScreenDC->DMW.dmPelsWidth;
|
Width = ScreenDC->GDIInfo->ulHorzRes;
|
||||||
Height = ScreenDC->DMW.dmPelsHeight;
|
Height = ScreenDC->GDIInfo->ulVertRes;
|
||||||
DC_UnlockDc(ScreenDCHandle);
|
DC_UnlockDc(ScreenDCHandle);
|
||||||
}
|
}
|
||||||
NtGdiDeleteDC(ScreenDCHandle);
|
NtGdiDeleteDC(ScreenDCHandle);
|
||||||
|
|
|
@ -172,7 +172,6 @@ NtGdiCreateCompatableDC(HDC hDC)
|
||||||
NewDC->IsIC = FALSE;
|
NewDC->IsIC = FALSE;
|
||||||
|
|
||||||
NewDC->PDev = OrigDC->PDev;
|
NewDC->PDev = OrigDC->PDev;
|
||||||
NewDC->DMW = OrigDC->DMW;
|
|
||||||
memcpy(NewDC->FillPatternSurfaces,
|
memcpy(NewDC->FillPatternSurfaces,
|
||||||
OrigDC->FillPatternSurfaces,
|
OrigDC->FillPatternSurfaces,
|
||||||
sizeof OrigDC->FillPatternSurfaces);
|
sizeof OrigDC->FillPatternSurfaces);
|
||||||
|
@ -779,7 +778,6 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
||||||
}
|
}
|
||||||
|
|
||||||
NewDC->IsIC = CreateAsIC;
|
NewDC->IsIC = CreateAsIC;
|
||||||
NewDC->DMW = PrimarySurface.DMW;
|
|
||||||
NewDC->DevInfo = &PrimarySurface.DevInfo;
|
NewDC->DevInfo = &PrimarySurface.DevInfo;
|
||||||
NewDC->GDIInfo = &PrimarySurface.GDIInfo;
|
NewDC->GDIInfo = &PrimarySurface.GDIInfo;
|
||||||
memcpy(NewDC->FillPatternSurfaces, PrimarySurface.FillPatterns,
|
memcpy(NewDC->FillPatternSurfaces, PrimarySurface.FillPatterns,
|
||||||
|
@ -789,11 +787,7 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
||||||
NewDC->DriverFunctions = PrimarySurface.DriverFunctions;
|
NewDC->DriverFunctions = PrimarySurface.DriverFunctions;
|
||||||
NewDC->w.hBitmap = PrimarySurface.Handle;
|
NewDC->w.hBitmap = PrimarySurface.Handle;
|
||||||
|
|
||||||
NewDC->DMW.dmSize = sizeof(NewDC->DMW);
|
NewDC->w.bitsPerPixel = NewDC->GDIInfo->cBitsPixel * NewDC->GDIInfo->cPlanes;
|
||||||
NewDC->DMW.dmFields = 0x000fc000;
|
|
||||||
|
|
||||||
NewDC->DMW.dmLogPixels = 96;
|
|
||||||
NewDC->w.bitsPerPixel = NewDC->DMW.dmBitsPerPel; // FIXME: set this here??
|
|
||||||
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
|
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
|
||||||
|
|
||||||
if (! CreateAsIC)
|
if (! CreateAsIC)
|
||||||
|
@ -805,9 +799,9 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
||||||
DC_FreeDC ( hNewDC) ;
|
DC_FreeDC ( hNewDC) ;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ASSERT(NewDC->DMW.dmBitsPerPel == BitsPerFormat(SurfObj->iBitmapFormat));
|
ASSERT(NewDC->GDIInfo->cBitsPixel * NewDC->GDIInfo->cPlanes == BitsPerFormat(SurfObj->iBitmapFormat));
|
||||||
ASSERT(NewDC->DMW.dmPelsWidth == SurfObj->sizlBitmap.cx);
|
ASSERT(NewDC->GDIInfo->ulHorzRes == SurfObj->sizlBitmap.cx);
|
||||||
ASSERT(NewDC->DMW.dmPelsHeight == SurfObj->sizlBitmap.cy);
|
ASSERT(NewDC->GDIInfo->ulVertRes == SurfObj->sizlBitmap.cy);
|
||||||
|
|
||||||
NewDC->w.hPalette = NewDC->DevInfo->hpalDefault;
|
NewDC->w.hPalette = NewDC->DevInfo->hpalDefault;
|
||||||
NewDC->w.ROPmode = R2_COPYPEN;
|
NewDC->w.ROPmode = R2_COPYPEN;
|
||||||
|
|
Loading…
Reference in a new issue