[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->crCurrentText = pdc->pdcattr->crForegroundClr;
pebo->psurfTrg = pdc->dclevel.pSurface; 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);
ASSERT(pebo->psurfTrg->ppal); ASSERT(pebo->psurfTrg->ppal);

View file

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

View file

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

View file

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

View file

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