2010-02-26 11:43:19 +00:00
|
|
|
#pragma once
|
2002-01-14 01:11:58 +00:00
|
|
|
|
2009-01-08 16:33:40 +00:00
|
|
|
#include "win32.h"
|
|
|
|
#include "gdiobj.h"
|
|
|
|
|
2010-04-02 11:53:14 +00:00
|
|
|
#define PDEV_SURFACE 0x80000000
|
|
|
|
|
2009-01-08 16:33:40 +00:00
|
|
|
/* GDI surface object */
|
|
|
|
typedef struct _SURFACE
|
|
|
|
{
|
2010-06-05 21:19:41 +00:00
|
|
|
BASEOBJECT BaseObject;
|
2009-01-08 16:33:40 +00:00
|
|
|
|
2010-06-05 21:19:41 +00:00
|
|
|
SURFOBJ SurfObj;
|
|
|
|
//XDCOBJ * pdcoAA;
|
|
|
|
FLONG flags;
|
|
|
|
struct _PALETTE *ppal;
|
|
|
|
//UINT unk_050;
|
2009-04-14 16:41:48 +00:00
|
|
|
|
2010-06-05 21:19:41 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
HANDLE hSecureUMPD; // if UMPD_SURFACE set
|
|
|
|
HANDLE hMirrorParent;// if MIRROR_SURFACE set
|
|
|
|
HANDLE hDDSurface; // if DIRECTDRAW_SURFACE set
|
|
|
|
};
|
2009-04-14 16:41:48 +00:00
|
|
|
|
2010-06-05 21:19:41 +00:00
|
|
|
SIZEL sizlDim; /* For SetBitmapDimension(), do NOT use
|
2009-01-08 16:33:40 +00:00
|
|
|
to get width/height of bitmap, use
|
|
|
|
bitmap.bmWidth/bitmap.bmHeight for
|
|
|
|
that */
|
2010-04-19 00:56:25 +00:00
|
|
|
|
2010-06-05 21:19:41 +00:00
|
|
|
HDC hdc; // Doc in "Undocumented Windows", page 546, seems to be supported with XP.
|
|
|
|
ULONG cRef;
|
|
|
|
HPALETTE hpalHint;
|
2009-01-08 16:33:40 +00:00
|
|
|
|
2010-06-05 21:19:41 +00:00
|
|
|
/* For device-independent bitmaps: */
|
|
|
|
HANDLE hDIBSection;
|
|
|
|
HANDLE hSecure;
|
|
|
|
DWORD dwOffset;
|
|
|
|
//UINT unk_078;
|
2009-01-09 02:06:39 +00:00
|
|
|
|
2009-04-14 16:41:48 +00:00
|
|
|
/* reactos specific */
|
2010-06-05 21:19:41 +00:00
|
|
|
DWORD dsBitfields[3]; // hack, should probably use palette instead
|
|
|
|
DWORD biClrUsed;
|
|
|
|
DWORD biClrImportant;
|
2009-01-08 16:33:40 +00:00
|
|
|
} SURFACE, *PSURFACE;
|
|
|
|
|
2010-06-05 21:19:41 +00:00
|
|
|
// 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
|
|
|
|
|
2009-01-08 16:33:40 +00:00
|
|
|
|
2010-06-06 03:12:56 +00:00
|
|
|
#define BMF_DONT_FREE 0x100
|
|
|
|
#define BMF_RLE_HACK 0x200
|
|
|
|
|
|
|
|
|
2009-01-08 16:33:40 +00:00
|
|
|
/* Internal interface */
|
|
|
|
|
|
|
|
#define SURFACE_AllocSurfaceWithHandle() ((PSURFACE) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BITMAP))
|
|
|
|
#define SURFACE_FreeSurface(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_SURF_TYPE)
|
|
|
|
#define SURFACE_FreeSurfaceByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP)
|
|
|
|
|
|
|
|
/* NOTE: Use shared locks! */
|
|
|
|
#define SURFACE_LockSurface(hBMObj) \
|
|
|
|
((PSURFACE) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP))
|
|
|
|
#define SURFACE_ShareLockSurface(hBMObj) \
|
|
|
|
((PSURFACE) GDIOBJ_ShareLockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP))
|
|
|
|
#define SURFACE_UnlockSurface(pBMObj) \
|
|
|
|
GDIOBJ_UnlockObjByPtr ((POBJ)pBMObj)
|
|
|
|
#define SURFACE_ShareUnlockSurface(pBMObj) \
|
|
|
|
GDIOBJ_ShareUnlockObjByPtr ((POBJ)pBMObj)
|
|
|
|
|
|
|
|
BOOL INTERNAL_CALL SURFACE_Cleanup(PVOID ObjectBody);
|
|
|
|
|
[WIN32K]
- Move RLE specific code to it's own file (rlecomp.c)
- Relace BitsPerFormat function with an array of UCHARs
- Rewrite surface creation. Surfaces are now allocated from one central function SURFACE_AllocSurface, which sets the size, iType, iUniq, the handle and the default palette.
- Implement SURFACE_vSetDefaultPalette, which sets the default RGB palette, based on bit depth.
- Implement SURFACE_bSetBitmapBits, wich sets cjBits, pvBits, pvScan0 and lDelta and allocates memory if neccessary.
- Use these functions for EngCreateBitmap, EngCreateDeviceBitmap, EngCreateDeviceSurface and IntCreateBitmap
svn path=/branches/reactos-yarotows/; revision=47612
2010-06-06 07:02:15 +00:00
|
|
|
PSURFACE
|
|
|
|
NTAPI
|
|
|
|
SURFACE_AllocSurface(
|
|
|
|
IN ULONG iType,
|
|
|
|
IN ULONG cx,
|
|
|
|
IN ULONG cy,
|
|
|
|
IN ULONG iFormat);
|
|
|
|
|
2009-03-20 18:02:55 +00:00
|
|
|
#define GDIDEV(SurfObj) ((PDEVOBJ *)((SurfObj)->hdev))
|
|
|
|
#define GDIDEVFUNCS(SurfObj) ((PDEVOBJ *)((SurfObj)->hdev))->DriverFunctions
|
2004-07-03 13:55:37 +00:00
|
|
|
|
2003-05-18 17:16:18 +00:00
|
|
|
ULONG FASTCALL BitmapFormat (WORD Bits, DWORD Compression);
|
[WIN32K]
- Move RLE specific code to it's own file (rlecomp.c)
- Relace BitsPerFormat function with an array of UCHARs
- Rewrite surface creation. Surfaces are now allocated from one central function SURFACE_AllocSurface, which sets the size, iType, iUniq, the handle and the default palette.
- Implement SURFACE_vSetDefaultPalette, which sets the default RGB palette, based on bit depth.
- Implement SURFACE_bSetBitmapBits, wich sets cjBits, pvBits, pvScan0 and lDelta and allocates memory if neccessary.
- Use these functions for EngCreateBitmap, EngCreateDeviceBitmap, EngCreateDeviceSurface and IntCreateBitmap
svn path=/branches/reactos-yarotows/; revision=47612
2010-06-06 07:02:15 +00:00
|
|
|
extern UCHAR gajBitsPerFormat[];
|
|
|
|
#define BitsPerFormat(Format) gajBitsPerFormat[Format]
|