mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-14 00:01:20 +00:00
Use negative strides in Xgl if pixel data have bottom-top scanline order
This commit is contained in:
parent
2dd76d646c
commit
1d994e1d14
4 changed files with 20 additions and 22 deletions
|
|
@ -423,18 +423,30 @@ xglMapPixmapBits (PixmapPtr pPixmap)
|
|||
{
|
||||
if (!pPixmap->devPrivate.ptr)
|
||||
{
|
||||
CARD8 *bits;
|
||||
|
||||
XGL_PIXMAP_PRIV (pPixmap);
|
||||
|
||||
if (!pPixmapPriv->buffer)
|
||||
if (!xglAllocatePixmapBits (pPixmap))
|
||||
return FALSE;
|
||||
|
||||
pPixmap->devKind = pPixmapPriv->stride;
|
||||
pPixmap->devPrivate.ptr =
|
||||
glitz_buffer_map (pPixmapPriv->buffer,
|
||||
GLITZ_BUFFER_ACCESS_READ_WRITE);
|
||||
if (!pPixmap->devPrivate.ptr)
|
||||
bits = glitz_buffer_map (pPixmapPriv->buffer,
|
||||
GLITZ_BUFFER_ACCESS_READ_WRITE);
|
||||
if (!bits)
|
||||
return FALSE;
|
||||
|
||||
if (XGL_INTERNAL_SCANLINE_ORDER_UPSIDE_DOWN && pPixmapPriv->format)
|
||||
{
|
||||
pPixmap->devKind = -pPixmapPriv->stride;
|
||||
pPixmap->devPrivate.ptr =
|
||||
bits + (pPixmap->drawable.height - 1) * pPixmapPriv->stride;
|
||||
}
|
||||
else
|
||||
{
|
||||
pPixmap->devKind = pPixmapPriv->stride;
|
||||
pPixmap->devPrivate.ptr = bits;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Reference in a new issue