- Apply a better fix for correctly report 16 bits alignment for DDBs, and keep them 32 bits aligned as it should be.
  - Reapply Pigglesworth patch, which was correct since mine was not.
Dedicated to tkreuzer, PigglesWorth and lassy, the three guys still on IRC to watch my commits at 3:30 AM.

svn path=/branches/reactos-yarotows/; revision=48408
This commit is contained in:
Jérôme Gardou 2010-08-02 01:41:16 +00:00
parent 53fe62ce9c
commit 0bba315d06
3 changed files with 11 additions and 13 deletions

View file

@ -202,17 +202,13 @@ SURFACE_bSetBitmapBits(
/* Is a width in bytes given? */
if (!ulWidth)
{
/* Align the width (windows compatibility) */
if(psurf->flags & DDB_SURFACE)
{
/* DDB are 16 bits aligned */
ulWidth = BITMAP_GetWidthBytes(pso->sizlBitmap.cx, cBitsPixel);
}
else
{
/* Others are 32 bits aligned */
ulWidth = DIB_GetDIBWidthBytes(pso->sizlBitmap.cx, cBitsPixel);
}
/* Calculate width from the bitmap width in pixels */
ulWidth = DIB_GetDIBWidthBytes(psurf->SurfObj.sizlBitmap.cx, cBitsPixel);
}
else
{
/* Align the width (windows compatibility, drivers expect that) */
((((ulWidth << 3) / cBitsPixel) * cBitsPixel + 31) & ~31) >> 3;
}

View file

@ -949,15 +949,17 @@ BITMAP_GetObject(SURFACE *psurf, INT Count, LPVOID buffer)
pBitmap->bmType = 0;
pBitmap->bmWidth = psurf->SurfObj.sizlBitmap.cx;
pBitmap->bmHeight = psurf->SurfObj.sizlBitmap.cy;
pBitmap->bmWidthBytes = abs(psurf->SurfObj.lDelta);
pBitmap->bmPlanes = 1;
pBitmap->bmBitsPixel = BitsPerFormat(psurf->SurfObj.iBitmapFormat);
pBitmap->bmWidthBytes = BITMAP_GetWidthBytes(pBitmap->bmWidth, pBitmap->bmBitsPixel);
/* Check for DIB section */
if (psurf->hSecure)
{
/* Set bmBits in this case */
pBitmap->bmBits = psurf->SurfObj.pvBits;
/* DIBs data are 32 bits aligned */
pBitmap->bmWidthBytes = DIB_GetDIBWidthBytes(pBitmap->bmWidth, pBitmap->bmBitsPixel);
if (Count >= sizeof(DIBSECTION))
{

View file

@ -25,7 +25,7 @@ typedef struct _GDI_OBJ_ATTR_ENTRY
RGN_ATTR Attr[GDIOBJATTRFREE];
} GDI_OBJ_ATTR_ENTRY, *PGDI_OBJ_ATTR_ENTRY;
static const USHORT HatchBrushes[NB_HATCH_STYLES][8] =
static const ULONG HatchBrushes[NB_HATCH_STYLES][8] =
{
{0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF}, /* HS_HORIZONTAL */
{0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7}, /* HS_VERTICAL */