exa: simplify exaPixmapIsOffscreen
- This includes properly handling the framebuffer.
This commit is contained in:
parent
57bed76e21
commit
10334cf7e6
26
exa/exa.c
26
exa/exa.c
@ -73,8 +73,9 @@ unsigned long
|
|||||||
exaGetPixmapOffset(PixmapPtr pPix)
|
exaGetPixmapOffset(PixmapPtr pPix)
|
||||||
{
|
{
|
||||||
ExaScreenPriv (pPix->drawable.pScreen);
|
ExaScreenPriv (pPix->drawable.pScreen);
|
||||||
|
ExaPixmapPriv (pPix);
|
||||||
|
|
||||||
return (CARD8 *)ExaGetPixmapAddress(pPix) - pExaScr->info->memoryBase;
|
return (CARD8 *)pExaPixmap->fb_ptr - pExaScr->info->memoryBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
@ -424,6 +425,13 @@ exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
|
|||||||
if (devKind > 0)
|
if (devKind > 0)
|
||||||
pExaPixmap->sys_pitch = devKind;
|
pExaPixmap->sys_pitch = devKind;
|
||||||
|
|
||||||
|
/* Is this the framebuffer (for classic exa)? */
|
||||||
|
if (pPixData && pPixData == pExaScr->info->memoryBase) {
|
||||||
|
pExaPixmap->fb_ptr = pPixData;
|
||||||
|
pExaPixmap->fb_pitch = devKind;
|
||||||
|
pExaPixmap->offscreen = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (width > 0 && height > 0 && bitsPerPixel > 0) {
|
if (width > 0 && height > 0 && bitsPerPixel > 0) {
|
||||||
exaSetFbPitch(pExaScr, pExaPixmap,
|
exaSetFbPitch(pExaScr, pExaPixmap,
|
||||||
width, height, bitsPerPixel);
|
width, height, bitsPerPixel);
|
||||||
@ -471,22 +479,14 @@ exaPixmapIsOffscreen(PixmapPtr p)
|
|||||||
ScreenPtr pScreen = p->drawable.pScreen;
|
ScreenPtr pScreen = p->drawable.pScreen;
|
||||||
ExaScreenPriv(pScreen);
|
ExaScreenPriv(pScreen);
|
||||||
ExaPixmapPriv(p);
|
ExaPixmapPriv(p);
|
||||||
void *save_ptr;
|
|
||||||
Bool ret;
|
Bool ret;
|
||||||
|
|
||||||
save_ptr = p->devPrivate.ptr;
|
if (pExaScr->info->PixmapIsOffscreen) {
|
||||||
|
|
||||||
if (!save_ptr && pExaPixmap && !(pExaScr->info->flags & EXA_HANDLES_PIXMAPS))
|
|
||||||
p->devPrivate.ptr = ExaGetPixmapAddress(p);
|
p->devPrivate.ptr = ExaGetPixmapAddress(p);
|
||||||
|
|
||||||
if (pExaScr->info->PixmapIsOffscreen)
|
|
||||||
ret = pExaScr->info->PixmapIsOffscreen(p);
|
ret = pExaScr->info->PixmapIsOffscreen(p);
|
||||||
else
|
p->devPrivate.ptr = NULL;
|
||||||
ret = ((unsigned long) ((CARD8 *) p->devPrivate.ptr -
|
} else
|
||||||
(CARD8 *) pExaScr->info->memoryBase) <
|
ret = (pExaPixmap->offscreen && pExaPixmap->fb_ptr);
|
||||||
pExaScr->info->memorySize);
|
|
||||||
|
|
||||||
p->devPrivate.ptr = save_ptr;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user