winex11.drv: Store if a bitmap is top-down in X_PHYSBITMAP.
GetObject() is supposed to return the absolute height, and there's no other way to retrieve this information after the bitmap is created.
This commit is contained in:
parent
4072edc111
commit
f331fe4c27
|
@ -1308,7 +1308,7 @@ static BOOL client_side_dib_copy( X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc
|
|||
|
||||
bytesToCopy = width * bytesPerPixel;
|
||||
|
||||
if (srcDib.dsBmih.biHeight < 0)
|
||||
if (physDevSrc->bitmap->topdown)
|
||||
{
|
||||
srcPtr = &physDevSrc->bitmap->base[ySrc*srcDib.dsBm.bmWidthBytes + xSrc*bytesPerPixel];
|
||||
srcRowOffset = srcDib.dsBm.bmWidthBytes;
|
||||
|
@ -1319,7 +1319,7 @@ static BOOL client_side_dib_copy( X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc
|
|||
+ xSrc*bytesPerPixel];
|
||||
srcRowOffset = -srcDib.dsBm.bmWidthBytes;
|
||||
}
|
||||
if (dstDib.dsBmih.biHeight < 0)
|
||||
if (physDevDst->bitmap->topdown)
|
||||
{
|
||||
dstPtr = &physDevDst->bitmap->base[yDst*dstDib.dsBm.bmWidthBytes + xDst*bytesPerPixel];
|
||||
dstRowOffset = dstDib.dsBm.bmWidthBytes;
|
||||
|
|
|
@ -4726,12 +4726,17 @@ HBITMAP CDECL X11DRV_CreateDIBSection( X11DRV_PDEVICE *physDev, HBITMAP hbitmap,
|
|||
{
|
||||
X_PHYSBITMAP *physBitmap;
|
||||
DIBSECTION dib;
|
||||
WORD bpp, compr;
|
||||
LONG w, h;
|
||||
#ifdef HAVE_LIBXXSHM
|
||||
int major, minor;
|
||||
Bool pixmaps;
|
||||
#endif
|
||||
|
||||
DIB_GetBitmapInfo( &bmi->bmiHeader, &w, &h, &bpp, &compr );
|
||||
|
||||
if (!(physBitmap = X11DRV_init_phys_bitmap( hbitmap ))) return 0;
|
||||
if (h < 0) physBitmap->topdown = TRUE;
|
||||
physBitmap->status = DIB_Status_None;
|
||||
|
||||
GetObjectW( hbitmap, sizeof(dib), &dib );
|
||||
|
|
|
@ -127,6 +127,7 @@ typedef struct
|
|||
int *colorMap; /* color map info */
|
||||
int nColorMap;
|
||||
BOOL trueColor;
|
||||
BOOL topdown;
|
||||
CRITICAL_SECTION lock; /* GDI access lock */
|
||||
enum x11drv_shm_mode shm_mode;
|
||||
#ifdef HAVE_LIBXXSHM
|
||||
|
|
Loading…
Reference in New Issue