diff --git a/subsystems/win32/win32k/eng/alphablend.c b/subsystems/win32/win32k/eng/alphablend.c index 9a6c076e6ae..0841e565bf8 100644 --- a/subsystems/win32/win32k/eng/alphablend.c +++ b/subsystems/win32/win32k/eng/alphablend.c @@ -301,7 +301,7 @@ IntEngAlphaBlend(IN SURFOBJ *psoDest, } /* Call the driver's DrvAlphaBlend if available */ - if (psurfDest->flHooks & HOOK_ALPHABLEND) + if (psurfDest->flags & HOOK_ALPHABLEND) { ret = GDIDEVFUNCS(psoDest).AlphaBlend( psoDest, psoSource, ClipRegion, ColorTranslation, diff --git a/subsystems/win32/win32k/eng/bitblt.c b/subsystems/win32/win32k/eng/bitblt.c index aeb3a195227..92e90959dc4 100644 --- a/subsystems/win32/win32k/eng/bitblt.c +++ b/subsystems/win32/win32k/eng/bitblt.c @@ -585,10 +585,10 @@ IntEngBitBlt( } /* Is the target surface device managed? */ - if (psurfTrg->flHooks & HOOK_BITBLT) + if (psurfTrg->flags & HOOK_BITBLT) { /* Is the source a different device managed surface? */ - if (psoSrc && psoSrc->hdev != psoTrg->hdev && psurfSrc->flHooks & HOOK_BITBLT) + if (psoSrc && psoSrc->hdev != psoTrg->hdev && psurfSrc->flags & HOOK_BITBLT) { DPRINT1("Need to copy to standard bitmap format!\n"); ASSERT(FALSE); @@ -598,7 +598,7 @@ IntEngBitBlt( } /* Is the source surface device managed? */ - else if (psoSrc && psurfSrc->flHooks & HOOK_BITBLT) + else if (psoSrc && psurfSrc->flags & HOOK_BITBLT) { pfnBitBlt = GDIDEVFUNCS(psoSrc).BitBlt; } diff --git a/subsystems/win32/win32k/eng/copybits.c b/subsystems/win32/win32k/eng/copybits.c index 1f7206d872e..afb2f16cc99 100644 --- a/subsystems/win32/win32k/eng/copybits.c +++ b/subsystems/win32/win32k/eng/copybits.c @@ -67,7 +67,7 @@ EngCopyBits(SURFOBJ *psoDest, if (psoDest->iType!=STYPE_BITMAP) { /* FIXME: Eng* functions shouldn't call Drv* functions. ? */ - if (psurfDest->flHooks & HOOK_COPYBITS) + if (psurfDest->flags & HOOK_COPYBITS) { ret = GDIDEVFUNCS(psoDest).CopyBits( psoDest, psoSource, Clip, ColorTranslation, DestRect, SourcePoint); @@ -80,7 +80,7 @@ EngCopyBits(SURFOBJ *psoDest, if (psoSource->iType!=STYPE_BITMAP) { /* FIXME: Eng* functions shouldn't call Drv* functions. ? */ - if (psurfSource->flHooks & HOOK_COPYBITS) + if (psurfSource->flags & HOOK_COPYBITS) { ret = GDIDEVFUNCS(psoSource).CopyBits( psoDest, psoSource, Clip, ColorTranslation, DestRect, SourcePoint); diff --git a/subsystems/win32/win32k/eng/engmisc.c b/subsystems/win32/win32k/eng/engmisc.c index af544c95d55..d4c171347c5 100644 --- a/subsystems/win32/win32k/eng/engmisc.c +++ b/subsystems/win32/win32k/eng/engmisc.c @@ -56,7 +56,7 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave, { /* Driver needs to support DrvCopyBits, else we can't do anything */ SURFACE *psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj); - if (!(psurfDest->flHooks & HOOK_COPYBITS)) + if (!(psurfDest->flags & HOOK_COPYBITS)) { return FALSE; } @@ -149,7 +149,7 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave, if (NULL != *ppsoOutput) { SURFACE* psurfOutput = CONTAINING_RECORD(*ppsoOutput, SURFACE, SurfObj); - if (0 != (psurfOutput->flHooks & HOOK_SYNCHRONIZE)) + if (0 != (psurfOutput->flags & HOOK_SYNCHRONIZE)) { if (NULL != GDIDEVFUNCS(*ppsoOutput).SynchronizeSurface) { diff --git a/subsystems/win32/win32k/eng/gradient.c b/subsystems/win32/win32k/eng/gradient.c index 6b002c7a071..75faeae5c33 100644 --- a/subsystems/win32/win32k/eng/gradient.c +++ b/subsystems/win32/win32k/eng/gradient.c @@ -548,7 +548,7 @@ IntEngGradientFill( psurf = CONTAINING_RECORD(psoDest, SURFACE, SurfObj); ASSERT(psurf); - if(psurf->flHooks & HOOK_GRADIENTFILL) + if(psurf->flags & HOOK_GRADIENTFILL) { Ret = GDIDEVFUNCS(psoDest).GradientFill( psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh, diff --git a/subsystems/win32/win32k/eng/lineto.c b/subsystems/win32/win32k/eng/lineto.c index 9aba0a032f0..d5db687be0e 100644 --- a/subsystems/win32/win32k/eng/lineto.c +++ b/subsystems/win32/win32k/eng/lineto.c @@ -565,7 +565,7 @@ IntEngLineTo(SURFOBJ *psoDest, if (b.left == b.right) b.right++; if (b.top == b.bottom) b.bottom++; - if (psurfDest->flHooks & HOOK_LINETO) + if (psurfDest->flags & HOOK_LINETO) { /* Call the driver's DrvLineTo */ ret = GDIDEVFUNCS(psoDest).LineTo( @@ -573,7 +573,7 @@ IntEngLineTo(SURFOBJ *psoDest, } #if 0 - if (! ret && (psurfDest->flHooks & HOOK_STROKEPATH)) + if (! ret && (psurfDest->flags & HOOK_STROKEPATH)) { /* FIXME: Emulate LineTo using drivers DrvStrokePath and set ret on success */ } diff --git a/subsystems/win32/win32k/eng/paint.c b/subsystems/win32/win32k/eng/paint.c index d832238b127..31fd500492a 100644 --- a/subsystems/win32/win32k/eng/paint.c +++ b/subsystems/win32/win32k/eng/paint.c @@ -124,7 +124,7 @@ IntEngPaint(IN SURFOBJ *pso, DPRINT("pso->iType == %d\n", pso->iType); /* Is the surface's Paint function hooked? */ - if((pso->iType!=STYPE_BITMAP) && (psurf->flHooks & HOOK_PAINT)) + if((pso->iType!=STYPE_BITMAP) && (psurf->flags & HOOK_PAINT)) { // Call the driver's DrvPaint ret = GDIDEVFUNCS(pso).Paint( diff --git a/subsystems/win32/win32k/eng/stretchblt.c b/subsystems/win32/win32k/eng/stretchblt.c index b4f1d88e666..a6f3d4f4572 100644 --- a/subsystems/win32/win32k/eng/stretchblt.c +++ b/subsystems/win32/win32k/eng/stretchblt.c @@ -471,7 +471,7 @@ IntEngStretchBlt(SURFOBJ *psoDest, /* Prepare color adjustment */ /* Call the driver's DrvStretchBlt if available */ - if (psurfDest->flHooks & HOOK_STRETCHBLTROP) + if (psurfDest->flags & HOOK_STRETCHBLTROP) { /* Drv->StretchBltROP (look at http://www.osronline.com/ddkx/graphics/ddifncs_0z3b.htm ) */ ret = GDIDEVFUNCS(psoDest).StretchBltROP(psoDest, diff --git a/subsystems/win32/win32k/eng/surface.c b/subsystems/win32/win32k/eng/surface.c index 8068cad5de1..f981d15d630 100644 --- a/subsystems/win32/win32k/eng/surface.c +++ b/subsystems/win32/win32k/eng/surface.c @@ -98,7 +98,7 @@ SURFACE_Cleanup(PVOID ObjectBody) /* If this is an API bitmap, free the bits */ if (pvBits != NULL && - (psurf->flFlags & BITMAPOBJ_IS_APIBITMAP)) + (psurf->flags & API_BITMAP)) { /* Check if we have a DIB section */ if (psurf->hSecure) @@ -395,10 +395,9 @@ IntCreateBitmap(IN SIZEL Size, pso->fjBitmap = Flags & (BMF_TOPDOWN | BMF_NOZEROINIT); pso->iUniq = 0; - psurf->flHooks = 0; - psurf->flFlags = 0; - psurf->dimension.cx = 0; - psurf->dimension.cy = 0; + psurf->flags = 0; + psurf->sizlDim.cx = 0; + psurf->sizlDim.cy = 0; psurf->hSecure = NULL; psurf->hDIBSection = NULL; @@ -547,12 +546,11 @@ SURFMEM_bCreateDib(IN PDEVBITMAPINFO BitmapInfo, pso->dhsurf = 0; pso->dhpdev = NULL; pso->hdev = NULL; - psurf->flFlags = 0; - psurf->dimension.cx = 0; - psurf->dimension.cy = 0; + psurf->flags = 0; + psurf->sizlDim.cx = 0; + psurf->sizlDim.cy = 0; psurf->hSecure = NULL; psurf->hDIBSection = NULL; - psurf->flHooks = 0; /* Set bits */ pso->pvBits = Bits; @@ -695,7 +693,7 @@ EngCreateDeviceSurface(IN DHSURF dhsurf, pso->iType = STYPE_DEVICE; pso->iUniq = 0; - psurf->flHooks = 0; + psurf->flags = 0; SURFACE_UnlockSurface(psurf); @@ -731,7 +729,8 @@ EngAssociateSurface( pso->dhpdev = ppdev->dhpdev; /* Hook up specified functions */ - psurf->flHooks = flHooks; + psurf->flags &= ~HOOK_FLAGS; + psurf->flags |= (flHooks & HOOK_FLAGS); /* Get palette */ psurf->ppal = PALETTE_ShareLockPalette(ppdev->devinfo.hpalDefault); @@ -776,7 +775,8 @@ EngModifySurface( pso->dhpdev = ppdev->dhpdev; /* Hook up specified functions */ - psurf->flHooks = flHooks; + psurf->flags &= ~HOOK_FLAGS; + psurf->flags |= (flHooks & HOOK_FLAGS); /* Get palette */ psurf->ppal = PALETTE_ShareLockPalette(ppdev->devinfo.hpalDefault); diff --git a/subsystems/win32/win32k/eng/transblt.c b/subsystems/win32/win32k/eng/transblt.c index a0e4daf3fe5..0bfc145eb94 100644 --- a/subsystems/win32/win32k/eng/transblt.c +++ b/subsystems/win32/win32k/eng/transblt.c @@ -284,7 +284,7 @@ IntEngTransparentBlt(SURFOBJ *psoDest, OutputRect = InputClippedRect; } - if(psurfDest->flHooks & HOOK_TRANSPARENTBLT) + if(psurfDest->flags & HOOK_TRANSPARENTBLT) { Ret = GDIDEVFUNCS(psoDest).TransparentBlt( psoDest, psoSource, Clip, ColorTranslation, &OutputRect, diff --git a/subsystems/win32/win32k/include/surface.h b/subsystems/win32/win32k/include/surface.h index ab9381df776..e78dd5c1870 100644 --- a/subsystems/win32/win32k/include/surface.h +++ b/subsystems/win32/win32k/include/surface.h @@ -8,41 +8,83 @@ /* GDI surface object */ typedef struct _SURFACE { - BASEOBJECT BaseObject; + BASEOBJECT BaseObject; - SURFOBJ SurfObj; - FLONG flHooks; - FLONG flFlags; - struct _PALETTE *ppal; + SURFOBJ SurfObj; + //XDCOBJ * pdcoAA; + FLONG flags; + struct _PALETTE *ppal; + //UINT unk_050; - union - { - HANDLE hSecureUMPD; // if UMPD_SURFACE set - HANDLE hMirrorParent;// if MIRROR_SURFACE set - HANDLE hDDSurface; // if DIRECTDRAW_SURFACE set - }; + union + { + HANDLE hSecureUMPD; // if UMPD_SURFACE set + HANDLE hMirrorParent;// if MIRROR_SURFACE set + HANDLE hDDSurface; // if DIRECTDRAW_SURFACE set + }; - SIZEL dimension; /* For SetBitmapDimension(), do NOT use + SIZEL sizlDim; /* For SetBitmapDimension(), do NOT use to get width/height of bitmap, use bitmap.bmWidth/bitmap.bmHeight for that */ - HDC hDC; // Doc in "Undocumented Windows", page 546, seems to be supported with XP. - ULONG cRef; // 0x064 - HPALETTE hpalHint; + HDC hdc; // Doc in "Undocumented Windows", page 546, seems to be supported with XP. + ULONG cRef; + HPALETTE hpalHint; - /* For device-independent bitmaps: */ - HANDLE hDIBSection; - HANDLE hSecure; - DWORD dwOffset; + /* For device-independent bitmaps: */ + HANDLE hDIBSection; + HANDLE hSecure; + DWORD dwOffset; + //UINT unk_078; /* reactos specific */ - DWORD dsBitfields[3]; // hack, should probably use palette instead - DWORD biClrUsed; - DWORD biClrImportant; + DWORD dsBitfields[3]; // hack, should probably use palette instead + DWORD biClrUsed; + DWORD biClrImportant; } SURFACE, *PSURFACE; -#define BITMAPOBJ_IS_APIBITMAP 0x1 +// flags field: +//#define HOOK_BITBLT 0x00000001 +//#define HOOK_STRETCHBLT 0x00000002 +//#define HOOK_PLGBLT 0x00000004 +//#define HOOK_TEXTOUT 0x00000008 +//#define HOOK_PAINT 0x00000010 +//#define HOOK_STROKEPATH 0x00000020 +//#define HOOK_FILLPATH 0x00000040 +//#define HOOK_STROKEANDFILLPATH 0x00000080 +//#define HOOK_LINETO 0x00000100 +//#define SHAREACCESS_SURFACE 0x00000200 +//#define HOOK_COPYBITS 0x00000400 +//#define REDIRECTION_SURFACE 0x00000800 // ? +//#define HOOK_MOVEPANNING 0x00000800 +//#define HOOK_SYNCHRONIZE 0x00001000 +//#define HOOK_STRETCHBLTROP 0x00002000 +//#define HOOK_SYNCHRONIZEACCESS 0x00004000 +//#define USE_DEVLOCK_SURFACE 0x00004000 +//#define HOOK_TRANSPARENTBLT 0x00008000 +//#define HOOK_ALPHABLEND 0x00010000 +//#define HOOK_GRADIENTFILL 0x00020000 +//#if (NTDDI_VERSION < 0x06000000) +// #define HOOK_FLAGS 0x0003B5FF +//#else +// #define HOOK_FLAGS 0x0003B5EF +//#endif +#define UMPD_SURFACE 0x00040000 +#define MIRROR_SURFACE 0x00080000 +#define DIRECTDRAW_SURFACE 0x00100000 +#define DRIVER_CREATED_SURFACE 0x00200000 +#define ENG_CREATE_DEVICE_SURFACE 0x00400000 +#define DDB_SURFACE 0x00800000 +#define LAZY_DELETE_SURFACE 0x01000000 +#define BANDING_SURFACE 0x02000000 +#define API_BITMAP 0x04000000 +#define PALETTE_SELECT_SET 0x08000000 +#define UNREADABLE_SURFACE 0x10000000 +#define DYNAMIC_MODE_PALETTE 0x20000000 +#define ABORT_SURFACE 0x40000000 +#define PDEV_SURFACE 0x80000000 + /* Internal interface */ diff --git a/subsystems/win32/win32k/objects/bitmaps.c b/subsystems/win32/win32k/objects/bitmaps.c index 662b0e0010a..ed708f42dfe 100644 --- a/subsystems/win32/win32k/objects/bitmaps.c +++ b/subsystems/win32/win32k/objects/bitmaps.c @@ -79,8 +79,8 @@ IntGdiCreateBitmap( return NULL; } - psurfBmp->flFlags = BITMAPOBJ_IS_APIBITMAP; - psurfBmp->hDC = NULL; // Fixme + psurfBmp->flags = API_BITMAP; + psurfBmp->hdc = NULL; // Fixme if (NULL != pBits) { @@ -192,8 +192,8 @@ IntCreateCompatibleBitmap( /* Set palette */ psurf->ppal = PALETTE_ShareLockPalette(Dc->ppdev->devinfo.hpalDefault); /* Set flags */ - psurf->flFlags = BITMAPOBJ_IS_APIBITMAP; - psurf->hDC = NULL; // Fixme + psurf->flags = API_BITMAP; + psurf->hdc = NULL; // Fixme SURFACE_UnlockSurface(psurf); } else @@ -222,8 +222,8 @@ IntCreateCompatibleBitmap( psurfBmp->ppal = psurf->ppal; GDIOBJ_IncrementShareCount((POBJ)psurf->ppal); /* Set flags */ - psurfBmp->flFlags = BITMAPOBJ_IS_APIBITMAP; - psurfBmp->hDC = NULL; // Fixme + psurfBmp->flags = API_BITMAP; + psurfBmp->hdc = NULL; // Fixme SURFACE_UnlockSurface(psurfBmp); } else @@ -362,7 +362,7 @@ NtGdiGetBitmapDimension( _SEH2_TRY { ProbeForWrite(Dimension, sizeof(SIZE), 1); - *Dimension = psurfBmp->dimension; + *Dimension = psurfBmp->sizlDim; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -689,7 +689,7 @@ NtGdiSetBitmapDimension( _SEH2_TRY { ProbeForWrite(Size, sizeof(SIZE), 1); - *Size = psurf->dimension; + *Size = psurf->sizlDim; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -699,8 +699,8 @@ NtGdiSetBitmapDimension( } /* The dimension is changed even if writing the old value failed */ - psurf->dimension.cx = Width; - psurf->dimension.cy = Height; + psurf->sizlDim.cx = Width; + psurf->sizlDim.cy = Height; SURFACE_UnlockSurface(psurf); @@ -924,7 +924,7 @@ BITMAP_CopyBitmap(HBITMAP hBitmap) IntGetBitmapBits(Bitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf); IntSetBitmapBits(resBitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf); ExFreePoolWithTag(buf,TAG_BITMAP); - resBitmap->flFlags = Bitmap->flFlags; + resBitmap->flags = Bitmap->flags; /* Copy palette */ if (Bitmap->ppal) { @@ -1033,14 +1033,14 @@ APIENTRY NtGdiGetDCforBitmap( IN HBITMAP hsurf) { - HDC hDC = NULL; + HDC hdc = NULL; PSURFACE psurf = SURFACE_LockSurface(hsurf); if (psurf) { - hDC = psurf->hDC; + hdc = psurf->hdc; SURFACE_UnlockSurface(psurf); } - return hDC; + return hdc; } /* EOF */ diff --git a/subsystems/win32/win32k/objects/dcobjs.c b/subsystems/win32/win32k/objects/dcobjs.c index c6864225cd0..302503f8b9b 100644 --- a/subsystems/win32/win32k/objects/dcobjs.c +++ b/subsystems/win32/win32k/objects/dcobjs.c @@ -291,7 +291,7 @@ NtGdiSelectBitmap( DC_vSelectSurface(pDC, psurfBmp); // If Info DC this is zero and pSurface is moved to DC->pSurfInfo. - psurfBmp->hDC = hDC; + psurfBmp->hdc = hDC; /* FIXME; improve by using a region without a handle and selecting it */ hVisRgn = IntSysCreateRectRgn( 0, diff --git a/subsystems/win32/win32k/objects/dcutil.c b/subsystems/win32/win32k/objects/dcutil.c index f856ea19bda..0471c7dc9d2 100644 --- a/subsystems/win32/win32k/objects/dcutil.c +++ b/subsystems/win32/win32k/objects/dcutil.c @@ -145,7 +145,7 @@ IntSetDefaultRegion(PDC pdc) if (pdc->ppdev->flFlags & PDEV_META_DEVICE) { pSurface = pdc->dclevel.pSurface; - if (pSurface && pSurface->flFlags & PDEV_SURFACE) + if (pSurface && pSurface->flags & PDEV_SURFACE) { rclClip.left += pdc->ppdev->ptlOrigion.x; rclClip.top += pdc->ppdev->ptlOrigion.y; diff --git a/subsystems/win32/win32k/objects/dibobj.c b/subsystems/win32/win32k/objects/dibobj.c index 50707fd0936..44366cfe029 100644 --- a/subsystems/win32/win32k/objects/dibobj.c +++ b/subsystems/win32/win32k/objects/dibobj.c @@ -1535,7 +1535,7 @@ DIB_CreateDIBSection( bmp->hDIBSection = section; bmp->hSecure = hSecure; bmp->dwOffset = offset; - bmp->flFlags = BITMAPOBJ_IS_APIBITMAP; + bmp->flags = API_BITMAP; bmp->dsBitfields[0] = dsBitfields[0]; bmp->dsBitfields[1] = dsBitfields[1]; bmp->dsBitfields[2] = dsBitfields[2];