[WIN32SS/GDI]

svn path=/trunk/; revision=56947
This commit is contained in:
Jérôme Gardou 2012-07-23 10:12:53 +00:00
parent 23c9176d87
commit 239edc1a73
5 changed files with 18 additions and 15 deletions

View file

@ -67,6 +67,9 @@ EBRUSHOBJ_vInit(EBRUSHOBJ *pebo, PBRUSH pbrush, PDC pdc)
pebo->crCurrentText = pdc->pdcattr->crForegroundClr;
pebo->psurfTrg = pdc->dclevel.pSurface;
/* We are initializing for a new memory DC */
if(!pebo->psurfTrg)
pebo->psurfTrg = psurfDefaultBitmap;
ASSERT(pebo->psurfTrg);
ASSERT(pebo->psurfTrg->ppal);

View file

@ -807,9 +807,11 @@ IntPatBlt(
SURFACE *psurf;
POINTL BrushOrigin;
BOOL ret;
PBRUSH pbrush = pebo->pbrush;
PBRUSH pbrush;
ASSERT(pebo);
pbrush = pebo->pbrush;
ASSERT(pbrush);
FIXUP_ROP(dwRop);

View file

@ -259,6 +259,7 @@ IntCreateCompatibleBitmap(
DIBSECTION dibs;
INT Count;
PSURFACE psurf = Dc->dclevel.pSurface;
if(!psurf) psurf = psurfDefaultBitmap;
Count = BITMAP_GetObject(psurf, sizeof(dibs), &dibs);
if (Count == sizeof(BITMAP))

View file

@ -180,7 +180,7 @@ DC_vInitDc(
pdc->dclevel.pSurface = NULL;
// FIXME: HACK, because our code expects a surface
pdc->dclevel.pSurface = SURFACE_ShareLockSurface(StockObjects[DEFAULT_BITMAP]);
// pdc->dclevel.pSurface = SURFACE_ShareLockSurface(StockObjects[DEFAULT_BITMAP]);
pdc->erclBounds.left = 0;
pdc->erclBounds.top = 0;
@ -271,12 +271,9 @@ DC_vInitDc(
pdc->dclevel.ptlBrushOrigin.x = 0;
pdc->dclevel.ptlBrushOrigin.y = 0;
pdc->dcattr.ptlBrushOrigin = pdc->dclevel.ptlBrushOrigin;
/* Initialize EBRUSHOBJs */
EBRUSHOBJ_vInit(&pdc->eboFill, pdc->dclevel.pbrFill, pdc);
EBRUSHOBJ_vInit(&pdc->eboLine, pdc->dclevel.pbrLine, pdc);
/* Init text brush */
EBRUSHOBJ_vInit(&pdc->eboText, pbrDefaultBrush, pdc);
EBRUSHOBJ_vInit(&pdc->eboBackground, pbrDefaultBrush, pdc);
/* Setup fill data */
pdc->dcattr.jROP2 = R2_COPYPEN;
@ -424,9 +421,8 @@ DC_vSetOwner(PDC pdc, ULONG ulOwner)
pdc->dclevel.pbrFill = BRUSH_ShareLockBrush(pdc->pdcattr->hbrush);
pdc->dclevel.pbrLine = PEN_ShareLockPen(pdc->pdcattr->hpen);
/* Update the EBRUSHOBJs */
EBRUSHOBJ_vUpdate(&pdc->eboFill, pdc->dclevel.pbrFill, pdc);
EBRUSHOBJ_vUpdate(&pdc->eboLine, pdc->dclevel.pbrLine, pdc);
/* Mark them as dirty */
pdc->pdcattr->ulDirty_ |= DIRTY_FILL|DIRTY_LINE;
/* Allocate or free DC attribute */
if (ulOwner == GDI_OBJ_HMGR_PUBLIC || ulOwner == GDI_OBJ_HMGR_NONE)
@ -796,7 +792,7 @@ NtGdiCreateCompatibleDC(HDC hdc)
DC_bAllocDcAttr(pdcNew);
// HACK!
DC_vSelectSurface(pdcNew, psurfDefaultBitmap);
//DC_vSelectSurface(pdcNew, psurfDefaultBitmap);
DC_UnlockDc(pdcNew);

View file

@ -230,9 +230,10 @@ GdiSelectPalette(
}
/* Is this a valid palette for this depth? */
if ((BitsPerFormat(pdc->dclevel.pSurface->SurfObj.iBitmapFormat) <= 8
&& (ppal->flFlags & PAL_INDEXED)) ||
(BitsPerFormat(pdc->dclevel.pSurface->SurfObj.iBitmapFormat) > 8))
if ((!pdc->dclevel.pSurface) ||
(BitsPerFormat(pdc->dclevel.pSurface->SurfObj.iBitmapFormat) <= 8
&& (ppal->flFlags & PAL_INDEXED)) ||
(BitsPerFormat(pdc->dclevel.pSurface->SurfObj.iBitmapFormat) > 8))
{
/* Get old palette, set new one */
oldPal = pdc->dclevel.hpal;
@ -383,7 +384,7 @@ NtGdiSelectBitmap(
pdc->dclevel.sizl.cy = 1;
// HACK
psurfNew = SURFACE_ShareLockSurface(hbmp);
//psurfNew = SURFACE_ShareLockSurface(hbmp);
}
else
{