mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-29 21:46:40 +00:00
Merge branch 'master' into XACE-SELINUX
Conflicts: afb/afbpntwin.c afb/afbscrinit.c afb/afbwindow.c cfb/cfb.h cfb/cfballpriv.c cfb/cfbscrinit.c cfb/cfbwindow.c configure.ac fb/wfbrename.h hw/xfree86/xf4bpp/ppcIO.c hw/xfree86/xf4bpp/ppcPntWin.c hw/xfree86/xf4bpp/ppcWindow.c hw/xfree86/xf8_32bpp/cfbscrinit.c mfb/mfb.h mfb/mfbpntwin.c mfb/mfbscrinit.c mfb/mfbwindow.c mi/miexpose.c Note: conflicts caused by devPrivates rework vs. paintwindow changes.
This commit is contained in:
commit
97c150b61b
205 changed files with 1899 additions and 8248 deletions
167
afb/afbwindow.c
167
afb/afbwindow.c
|
|
@ -63,41 +63,16 @@ SOFTWARE.
|
|||
#include "maskbits.h"
|
||||
|
||||
Bool
|
||||
afbCreateWindow(pWin)
|
||||
register WindowPtr pWin;
|
||||
afbCreateWindow(WindowPtr pWin)
|
||||
{
|
||||
register afbPrivWin *pPrivWin;
|
||||
|
||||
pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates,
|
||||
afbWindowPrivateKey);
|
||||
pPrivWin->pRotatedBorder = NullPixmap;
|
||||
pPrivWin->pRotatedBackground = NullPixmap;
|
||||
pPrivWin->fastBackground = FALSE;
|
||||
pPrivWin->fastBorder = FALSE;
|
||||
#ifdef PIXMAP_PER_WINDOW
|
||||
dixSetPrivate(&pWin->devPrivates, frameWindowPrivateKey,
|
||||
dixLookupPrivate(&pWin->pDrawable.pScreen->devPrivates,
|
||||
afbScreenPrivateKey));
|
||||
#endif
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
/* This always returns true, because Xfree can't fail. It might be possible
|
||||
* on some devices for Destroy to fail */
|
||||
Bool
|
||||
afbDestroyWindow(pWin)
|
||||
WindowPtr pWin;
|
||||
afbDestroyWindow(WindowPtr pWin)
|
||||
{
|
||||
register afbPrivWin *pPrivWin;
|
||||
|
||||
pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates,
|
||||
afbWindowPrivateKey);
|
||||
if (pPrivWin->pRotatedBorder)
|
||||
(*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder);
|
||||
if (pPrivWin->pRotatedBackground)
|
||||
(*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground);
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
|
@ -109,47 +84,10 @@ afbMapWindow(pWindow)
|
|||
return (TRUE);
|
||||
}
|
||||
|
||||
/* (x, y) is the upper left corner of the window on the screen
|
||||
do we really need to pass this? (is it a;ready in pWin->absCorner?)
|
||||
we only do the rotation for pixmaps that are 32 bits wide (padded
|
||||
or otherwise.)
|
||||
afbChangeWindowAttributes() has already put a copy of the pixmap
|
||||
in pPrivWin->pRotated*
|
||||
*/
|
||||
|
||||
/*ARGSUSED*/
|
||||
Bool
|
||||
afbPositionWindow(pWin, x, y)
|
||||
WindowPtr pWin;
|
||||
int x, y;
|
||||
afbPositionWindow(WindowPtr pWin, int x, int y)
|
||||
{
|
||||
register afbPrivWin *pPrivWin;
|
||||
int reset = 0;
|
||||
|
||||
pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates,
|
||||
afbWindowPrivateKey);
|
||||
if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) {
|
||||
afbXRotatePixmap(pPrivWin->pRotatedBackground,
|
||||
pWin->drawable.x - pPrivWin->oldRotate.x);
|
||||
afbYRotatePixmap(pPrivWin->pRotatedBackground,
|
||||
pWin->drawable.y - pPrivWin->oldRotate.y);
|
||||
reset = 1;
|
||||
}
|
||||
|
||||
if (!pWin->borderIsPixel && pPrivWin->fastBorder) {
|
||||
while (pWin->backgroundState == ParentRelative)
|
||||
pWin = pWin->parent;
|
||||
afbXRotatePixmap(pPrivWin->pRotatedBorder,
|
||||
pWin->drawable.x - pPrivWin->oldRotate.x);
|
||||
afbYRotatePixmap(pPrivWin->pRotatedBorder,
|
||||
pWin->drawable.y - pPrivWin->oldRotate.y);
|
||||
reset = 1;
|
||||
}
|
||||
if (reset) {
|
||||
pPrivWin->oldRotate.x = pWin->drawable.x;
|
||||
pPrivWin->oldRotate.y = pWin->drawable.y;
|
||||
}
|
||||
|
||||
/* This is the "wrong" fix to the right problem, but it doesn't really
|
||||
* cost very much. When the window is moved, we need to invalidate any
|
||||
* RotatedPixmap that exists in any GC currently validated against this
|
||||
|
|
@ -219,105 +157,8 @@ afbCopyWindow(pWin, ptOldOrg, prgnSrc)
|
|||
REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* swap in correct PaintWindow* routine. If we can use a fast output
|
||||
routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy
|
||||
of it in devPrivate.
|
||||
*/
|
||||
Bool
|
||||
afbChangeWindowAttributes(pWin, mask)
|
||||
register WindowPtr pWin;
|
||||
register unsigned long mask;
|
||||
afbChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
|
||||
{
|
||||
register unsigned long index;
|
||||
register afbPrivWin *pPrivWin;
|
||||
WindowPtr pBgWin;
|
||||
|
||||
pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates,
|
||||
afbWindowPrivateKey);
|
||||
/*
|
||||
* When background state changes from ParentRelative and
|
||||
* we had previously rotated the fast border pixmap to match
|
||||
* the parent relative origin, rerotate to match window
|
||||
*/
|
||||
if (mask & (CWBackPixmap | CWBackPixel) &&
|
||||
pWin->backgroundState != ParentRelative && pPrivWin->fastBorder &&
|
||||
(pPrivWin->oldRotate.x != pWin->drawable.x ||
|
||||
pPrivWin->oldRotate.y != pWin->drawable.y)) {
|
||||
afbXRotatePixmap(pPrivWin->pRotatedBorder,
|
||||
pWin->drawable.x - pPrivWin->oldRotate.x);
|
||||
afbYRotatePixmap(pPrivWin->pRotatedBorder,
|
||||
pWin->drawable.y - pPrivWin->oldRotate.y);
|
||||
pPrivWin->oldRotate.x = pWin->drawable.x;
|
||||
pPrivWin->oldRotate.y = pWin->drawable.y;
|
||||
}
|
||||
while(mask) {
|
||||
index = lowbit (mask);
|
||||
mask &= ~index;
|
||||
switch(index) {
|
||||
case CWBackPixmap:
|
||||
if (pWin->backgroundState == None)
|
||||
pPrivWin->fastBackground = FALSE;
|
||||
else if (pWin->backgroundState == ParentRelative) {
|
||||
pPrivWin->fastBackground = FALSE;
|
||||
/* Rotate border to match parent origin */
|
||||
if (pPrivWin->pRotatedBorder) {
|
||||
for (pBgWin = pWin->parent;
|
||||
pBgWin->backgroundState == ParentRelative;
|
||||
pBgWin = pBgWin->parent);
|
||||
afbXRotatePixmap(pPrivWin->pRotatedBorder,
|
||||
pBgWin->drawable.x - pPrivWin->oldRotate.x);
|
||||
afbYRotatePixmap(pPrivWin->pRotatedBorder,
|
||||
pBgWin->drawable.y - pPrivWin->oldRotate.y);
|
||||
pPrivWin->oldRotate.x = pBgWin->drawable.x;
|
||||
pPrivWin->oldRotate.y = pBgWin->drawable.y;
|
||||
}
|
||||
} else if ((pWin->background.pixmap->drawable.width <= PPW) &&
|
||||
!(pWin->background.pixmap->drawable.width &
|
||||
(pWin->background.pixmap->drawable.width - 1))) {
|
||||
afbCopyRotatePixmap(pWin->background.pixmap,
|
||||
&pPrivWin->pRotatedBackground,
|
||||
pWin->drawable.x, pWin->drawable.y);
|
||||
if (pPrivWin->pRotatedBackground) {
|
||||
pPrivWin->fastBackground = TRUE;
|
||||
pPrivWin->oldRotate.x = pWin->drawable.x;
|
||||
pPrivWin->oldRotate.y = pWin->drawable.y;
|
||||
} else
|
||||
pPrivWin->fastBackground = FALSE;
|
||||
} else
|
||||
pPrivWin->fastBackground = FALSE;
|
||||
break;
|
||||
|
||||
case CWBackPixel:
|
||||
pPrivWin->fastBackground = FALSE;
|
||||
break;
|
||||
|
||||
case CWBorderPixmap:
|
||||
if ((pWin->border.pixmap->drawable.width <= PPW) &&
|
||||
!(pWin->border.pixmap->drawable.width &
|
||||
(pWin->border.pixmap->drawable.width - 1))) {
|
||||
for (pBgWin = pWin;
|
||||
pBgWin->backgroundState == ParentRelative;
|
||||
pBgWin = pBgWin->parent);
|
||||
afbCopyRotatePixmap(pWin->border.pixmap,
|
||||
&pPrivWin->pRotatedBorder,
|
||||
pBgWin->drawable.x, pBgWin->drawable.y);
|
||||
if (pPrivWin->pRotatedBorder) {
|
||||
pPrivWin->fastBorder = TRUE;
|
||||
pPrivWin->oldRotate.x = pBgWin->drawable.x;
|
||||
pPrivWin->oldRotate.y = pBgWin->drawable.y;
|
||||
} else
|
||||
pPrivWin->fastBorder = FALSE;
|
||||
} else
|
||||
pPrivWin->fastBorder = FALSE;
|
||||
break;
|
||||
case CWBorderPixel:
|
||||
pPrivWin->fastBorder = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Again, we have no failure modes indicated by any of the routines
|
||||
* we've called, so we have to assume it worked */
|
||||
return (TRUE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue