OOPS.. Sorry. Changelog should have been:
[WIN32SS/NTGDI]
- Associate NULL surface for newly created memory DCs.
jgardou(a)svn.reactos.org a écrit :
Author: jgardou
Date: Mon Jul 23 10:12:53 2012
New Revision: 56947
URL:
http://svn.reactos.org/svn/reactos?rev=56947&view=rev
Log:
[WIN32SS/GDI]
Modified:
trunk/reactos/win32ss/gdi/eng/engbrush.c
trunk/reactos/win32ss/gdi/ntgdi/bitblt.c
trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c
trunk/reactos/win32ss/gdi/ntgdi/dclife.c
trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c
Modified: trunk/reactos/win32ss/gdi/eng/engbrush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/engbrush.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/engbrush.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/engbrush.c [iso-8859-1] Mon Jul 23 10:12:53 2012
@@ -67,6 +67,9 @@
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);
Modified: trunk/reactos/win32ss/gdi/ntgdi/bitblt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/bitblt.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/bitblt.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/bitblt.c [iso-8859-1] Mon Jul 23 10:12:53 2012
@@ -807,9 +807,11 @@
SURFACE *psurf;
POINTL BrushOrigin;
BOOL ret;
- PBRUSH pbrush = pebo->pbrush;
+ PBRUSH pbrush;
ASSERT(pebo);
+ pbrush = pebo->pbrush;
+ ASSERT(pbrush);
FIXUP_ROP(dwRop);
Modified: trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/bitmaps.…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c [iso-8859-1] Mon Jul 23 10:12:53 2012
@@ -259,6 +259,7 @@
DIBSECTION dibs;
INT Count;
PSURFACE psurf = Dc->dclevel.pSurface;
+ if(!psurf) psurf = psurfDefaultBitmap;
Count = BITMAP_GetObject(psurf, sizeof(dibs), &dibs);
if (Count == sizeof(BITMAP))
Modified: trunk/reactos/win32ss/gdi/ntgdi/dclife.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dclife.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dclife.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dclife.c [iso-8859-1] Mon Jul 23 10:12:53 2012
@@ -180,7 +180,7 @@
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 @@
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 @@
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 @@
DC_bAllocDcAttr(pdcNew);
// HACK!
- DC_vSelectSurface(pdcNew, psurfDefaultBitmap);
+ //DC_vSelectSurface(pdcNew, psurfDefaultBitmap);
DC_UnlockDc(pdcNew);
Modified: trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] Mon Jul 23 10:12:53 2012
@@ -230,9 +230,10 @@
}
/* 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 @@
pdc->dclevel.sizl.cy = 1;
// HACK
- psurfNew = SURFACE_ShareLockSurface(hbmp);
+ //psurfNew = SURFACE_ShareLockSurface(hbmp);
}
else
{