Rootless: Imported changes made in xorg-server-1.2-apple branch
This commit is contained in:
parent
59c7ca6586
commit
a751bc12be
|
@ -482,6 +482,18 @@ RootlessComputeClips (pParent, pScreen, universe, kind, exposed)
|
||||||
universe, &pParent->clipList);
|
universe, &pParent->clipList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* One last thing: backing storage. We have to try to save what parts of
|
||||||
|
* the window are about to be obscured. We can just subtract the universe
|
||||||
|
* from the old clipList and get the areas that were in the old but aren't
|
||||||
|
* in the new and, hence, are about to be obscured.
|
||||||
|
*/
|
||||||
|
if (pParent->backStorage && !resized)
|
||||||
|
{
|
||||||
|
REGION_SUBTRACT( pScreen, exposed, &pParent->clipList, universe);
|
||||||
|
(* pScreen->SaveDoomedAreas)(pParent, exposed, dx, dy);
|
||||||
|
}
|
||||||
|
|
||||||
/* HACK ALERT - copying contents of regions, instead of regions */
|
/* HACK ALERT - copying contents of regions, instead of regions */
|
||||||
{
|
{
|
||||||
RegionRec tmp;
|
RegionRec tmp;
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include "fbpict.h"
|
#include "fbpict.h"
|
||||||
#include "safeAlpha.h"
|
#include "safeAlpha.h"
|
||||||
#include "rootlessCommon.h"
|
#include "rootlessCommon.h"
|
||||||
|
# define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
|
||||||
|
|
||||||
/* Optimized version of fbCompositeSolidMask_nx8x8888 */
|
/* Optimized version of fbCompositeSolidMask_nx8x8888 */
|
||||||
void
|
void
|
||||||
|
@ -133,68 +134,78 @@ SafeAlphaCompositeSolidMask_nx8x8888(
|
||||||
|
|
||||||
void
|
void
|
||||||
SafeAlphaComposite (CARD8 op,
|
SafeAlphaComposite (CARD8 op,
|
||||||
PicturePtr pSrc,
|
PicturePtr pSrc,
|
||||||
PicturePtr pMask,
|
PicturePtr pMask,
|
||||||
PicturePtr pDst,
|
PicturePtr pDst,
|
||||||
INT16 xSrc,
|
INT16 xSrc,
|
||||||
INT16 ySrc,
|
INT16 ySrc,
|
||||||
INT16 xMask,
|
INT16 xMask,
|
||||||
INT16 yMask,
|
INT16 yMask,
|
||||||
INT16 xDst,
|
INT16 xDst,
|
||||||
INT16 yDst,
|
INT16 yDst,
|
||||||
CARD16 width,
|
CARD16 width,
|
||||||
CARD16 height)
|
CARD16 height)
|
||||||
{
|
{
|
||||||
int oldDepth = pDst->pDrawable->depth;
|
if (!pSrc) {
|
||||||
int oldFormat = pDst->format;
|
ErrorF("SafeAlphaComposite: pSrc must not be null!\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!pDst) {
|
||||||
|
ErrorF("SafeAlphaComposite: pDst must not be null!\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int oldDepth = pDst->pDrawable->depth;
|
||||||
|
int oldFormat = pDst->format;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We can use the more optimized fbpict code, but it sets bits above
|
* We can use the more optimized fbpict code, but it sets bits above
|
||||||
* the depth to zero. Temporarily adjust destination depth if needed.
|
* the depth to zero. Temporarily adjust destination depth if needed.
|
||||||
*/
|
*/
|
||||||
if (pDst->pDrawable->type == DRAWABLE_WINDOW
|
if (pDst->pDrawable->type == DRAWABLE_WINDOW
|
||||||
&& pDst->pDrawable->depth == 24
|
&& pDst->pDrawable->depth == 24
|
||||||
&& pDst->pDrawable->bitsPerPixel == 32)
|
&& pDst->pDrawable->bitsPerPixel == 32)
|
||||||
{
|
{
|
||||||
pDst->pDrawable->depth = 32;
|
pDst->pDrawable->depth = 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For rootless preserve the alpha in x8r8g8b8 which really is
|
/* For rootless preserve the alpha in x8r8g8b8 which really is
|
||||||
* a8r8g8b8
|
* a8r8g8b8
|
||||||
*/
|
*/
|
||||||
if (oldFormat == PICT_x8r8g8b8)
|
if (oldFormat == PICT_x8r8g8b8)
|
||||||
{
|
{
|
||||||
pDst->format = PICT_a8r8g8b8;
|
pDst->format = PICT_a8r8g8b8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSrc && pMask && pSrc->pDrawable && pMask->pDrawable &&
|
if (pSrc->pDrawable && pMask && pMask->pDrawable &&
|
||||||
!pSrc->transform && !pMask->transform &&
|
!pSrc->transform && !pMask->transform &&
|
||||||
!pSrc->alphaMap && !pMask->alphaMap &&
|
!pSrc->alphaMap && !pMask->alphaMap &&
|
||||||
!pMask->repeat && !pMask->componentAlpha && !pDst->alphaMap &&
|
!pMask->repeat && !pMask->componentAlpha && !pDst->alphaMap &&
|
||||||
pMask->format == PICT_a8 &&
|
pMask->format == PICT_a8 &&
|
||||||
pSrc->repeatType == RepeatNormal &&
|
pSrc->repeatType == RepeatNormal &&
|
||||||
pSrc->pDrawable->width == 1 &&
|
pSrc->pDrawable->width == 1 &&
|
||||||
pSrc->pDrawable->height == 1 &&
|
pSrc->pDrawable->height == 1 &&
|
||||||
(pDst->format == PICT_a8r8g8b8 ||
|
(pDst->format == PICT_a8r8g8b8 ||
|
||||||
pDst->format == PICT_x8r8g8b8 ||
|
pDst->format == PICT_x8r8g8b8 ||
|
||||||
pDst->format == PICT_a8b8g8r8 ||
|
pDst->format == PICT_a8b8g8r8 ||
|
||||||
pDst->format == PICT_x8b8g8r8))
|
pDst->format == PICT_x8b8g8r8))
|
||||||
{
|
{
|
||||||
fbWalkCompositeRegion (op, pSrc, pMask, pDst,
|
fbWalkCompositeRegion (op, pSrc, pMask, pDst,
|
||||||
xSrc, ySrc, xMask, yMask, xDst, yDst,
|
xSrc, ySrc, xMask, yMask, xDst, yDst,
|
||||||
width, height,
|
width, height,
|
||||||
TRUE /* srcRepeat */,
|
TRUE /* srcRepeat */,
|
||||||
FALSE /* maskRepeat */,
|
FALSE /* maskRepeat */,
|
||||||
SafeAlphaCompositeSolidMask_nx8x8888);
|
SafeAlphaCompositeSolidMask_nx8x8888);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fbComposite (op, pSrc, pMask, pDst,
|
fbComposite (op, pSrc, pMask, pDst,
|
||||||
xSrc, ySrc, xMask, yMask, xDst, yDst, width, height);
|
xSrc, ySrc, xMask, yMask, xDst, yDst, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
pDst->pDrawable->depth = oldDepth;
|
pDst->pDrawable->depth = oldDepth;
|
||||||
pDst->format = oldFormat;
|
pDst->format = oldFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* RENDER */
|
#endif /* RENDER */
|
||||||
|
|
Loading…
Reference in New Issue