Make the SURFACE structure a bit more like the half documented windows version.
svn path=/branches/reactos-yarotows/; revision=47603
}
/* 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,
}
/* 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);
}
/* Is the source surface device managed? */
- else if (psoSrc && psurfSrc->flHooks & HOOK_BITBLT)
+ else if (psoSrc && psurfSrc->flags & HOOK_BITBLT)
{
pfnBitBlt = GDIDEVFUNCS(psoSrc).BitBlt;
}
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);
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);
{
/* 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;
}
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)
{
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,
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(
}
#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 */
}
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(
/* 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,
/* 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)
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;
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;
pso->iType = STYPE_DEVICE;
pso->iUniq = 0;
- psurf->flHooks = 0;
+ psurf->flags = 0;
SURFACE_UnlockSurface(psurf);
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);
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);
OutputRect = InputClippedRect;
}
- if(psurfDest->flHooks & HOOK_TRANSPARENTBLT)
+ if(psurfDest->flags & HOOK_TRANSPARENTBLT)
{
Ret = GDIDEVFUNCS(psoDest).TransparentBlt(
psoDest, psoSource, Clip, ColorTranslation, &OutputRect,
/* GDI surface object */
typedef struct _SURFACE
{
- BASEOBJECT BaseObject;
-
- SURFOBJ SurfObj;
- FLONG flHooks;
- FLONG flFlags;
- struct _PALETTE *ppal;
-
- 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
+ BASEOBJECT BaseObject;
+
+ 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
+ };
+
+ 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 */
return NULL;
}
- psurfBmp->flFlags = BITMAPOBJ_IS_APIBITMAP;
- psurfBmp->hDC = NULL; // Fixme
+ psurfBmp->flags = API_BITMAP;
+ psurfBmp->hdc = NULL; // Fixme
if (NULL != pBits)
{
/* 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
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
_SEH2_TRY
{
ProbeForWrite(Dimension, sizeof(SIZE), 1);
- *Dimension = psurfBmp->dimension;
+ *Dimension = psurfBmp->sizlDim;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
_SEH2_TRY
{
ProbeForWrite(Size, sizeof(SIZE), 1);
- *Size = psurf->dimension;
+ *Size = psurf->sizlDim;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
}
/* 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);
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)
{
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 */
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,
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;
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];